Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ECCCo-jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Altmeyer
ECCCo-jl
Commits
6fb38448
Commit
6fb38448
authored
1 year ago
by
Pat Alt
Browse files
Options
Downloads
Patches
Plain Diff
fuck em
parent
667f7a18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!83
73 aries comments
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
experiments/post_processing/plotting.jl
+13
-18
13 additions, 18 deletions
experiments/post_processing/plotting.jl
with
13 additions
and
18 deletions
experiments/post_processing/plotting.jl
+
13
−
18
View file @
6fb38448
...
...
@@ -62,21 +62,15 @@ function plot_random_eccco(outcome::ExperimentOutcome; generator="ECCCo-Δ", img
# Get output:
bmk
=
outcome
.
bmk
()
grouped_bmk
=
groupby
(
bmk
[
bmk
.
variable
.==
"distance"
.&&
bmk
.
generator
.==
generator
,
:
],
[
:
dataname
,
:
target
,
:
factual
])
random_choice
=
rand
(
1
:
length
(
grouped_bmk
))
models
=
unique
(
bmk
.
model
)
n_models
=
length
(
models
)
df
=
grouped_bmk
[
random_choice
]
while
nrow
(
df
)
>
n_models
random_choice
=
rand
(
1
:
length
(
grouped_bmk
))
df
=
grouped_bmk
[
random_choice
]
end
sort!
(
df
,
:
model
)
models
=
df
.
model
ce
=
rand
(
bmk
.
ce
)
gen
=
outcome
.
generator_dict
[
generator
]
models
=
outcome
.
model_dict
x
=
CounterfactualExplanations
.
counterfactual
(
ce
)
target
=
ce
.
target
data
=
ce
.
data
# Factual:
img
=
CounterfactualExplanations
.
factual
(
df
.
ce
[
1
]
)
|>
ECCCo
.
convert2mnist
img
=
CounterfactualExplanations
.
factual
(
ce
)
|>
ECCCo
.
convert2mnist
p1
=
Plots
.
plot
(
img
,
axis
=
([],
false
),
...
...
@@ -85,17 +79,18 @@ function plot_random_eccco(outcome::ExperimentOutcome; generator="ECCCo-Δ", img
)
plts
=
[
p1
]
# Counterfactua
ls
:
for
(
i
,
model
)
in
enumerate
(
model
s
)
img
=
CounterfactualExplanations
.
counterfactual
(
df
.
ce
[
i
]
)
|>
ECCCo
.
convert2mnist
for
(
model_name
,
M
)
in
mode
ls
ce
=
generate_counterfactual
(
x
,
target
,
data
,
M
,
gen
;
initialization
=:
identity
,
converge_when
=:
generator_condition
s
)
img
=
CounterfactualExplanations
.
counterfactual
(
ce
)
|>
ECCCo
.
convert2mnist
p
=
Plots
.
plot
(
img
,
axis
=
([],
false
),
size
=
(
img_height
,
img_height
),
title
=
"
$
model"
,
title
=
"
$
model
_name
"
,
)
push!
(
plts
,
p
)
end
n_models
=
length
(
models
)
plt
=
Plots
.
plot
(
plts
...
,
...
...
@@ -104,5 +99,5 @@ function plot_random_eccco(outcome::ExperimentOutcome; generator="ECCCo-Δ", img
)
display
(
plt
)
return
plt
,
df
.
target
[
1
]
,
seed
return
plt
,
target
,
seed
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment