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
723f6ccc
Commit
723f6ccc
authored
1 year ago
by
Pat Alt
Browse files
Options
Downloads
Patches
Plain Diff
minor things
parent
453d5ae7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!76
69 initial run including fmnist lenet and new method
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
experiments/models/train_models.jl
+3
-2
3 additions, 2 deletions
experiments/models/train_models.jl
experiments/setup_env.jl
+3
-1
3 additions, 1 deletion
experiments/setup_env.jl
experiments/synthetic.sh
+1
-1
1 addition, 1 deletion
experiments/synthetic.sh
with
7 additions
and
4 deletions
experiments/models/train_models.jl
+
3
−
2
View file @
723f6ccc
...
@@ -6,6 +6,7 @@ using CounterfactualExplanations: AbstractParallelizer
...
@@ -6,6 +6,7 @@ using CounterfactualExplanations: AbstractParallelizer
Trains all models in a dictionary and returns a dictionary of `ConformalModel` objects.
Trains all models in a dictionary and returns a dictionary of `ConformalModel` objects.
"""
"""
function
train_models
(
models
::
Dict
,
X
,
y
;
parallelizer
::
Union
{
Nothing
,
AbstractParallelizer
}
=
nothing
,
train_parallel
::
Bool
=
false
,
kwargs
...
)
function
train_models
(
models
::
Dict
,
X
,
y
;
parallelizer
::
Union
{
Nothing
,
AbstractParallelizer
}
=
nothing
,
train_parallel
::
Bool
=
false
,
kwargs
...
)
verbose
=
is_multi_processed
(
parallelizer
)
?
false
:
true
if
is_multi_processed
(
parallelizer
)
&&
train_parallel
if
is_multi_processed
(
parallelizer
)
&&
train_parallel
# Split models into groups of approximately equal size:
# Split models into groups of approximately equal size:
model_list
=
[(
key
,
value
)
for
(
key
,
value
)
in
models
]
model_list
=
[(
key
,
value
)
for
(
key
,
value
)
in
models
]
...
@@ -14,7 +15,7 @@ function train_models(models::Dict, X, y; parallelizer::Union{Nothing,AbstractPa
...
@@ -14,7 +15,7 @@ function train_models(models::Dict, X, y; parallelizer::Union{Nothing,AbstractPa
# Train models:
# Train models:
model_dict
=
Dict
()
model_dict
=
Dict
()
for
(
mod_name
,
model
)
in
x
for
(
mod_name
,
model
)
in
x
model_dict
[
mod_name
]
=
_train
(
model
,
X
,
y
;
mod_name
=
mod_name
,
verbose
=
fal
se
,
kwargs
...
)
model_dict
[
mod_name
]
=
_train
(
model
,
X
,
y
;
mod_name
=
mod_name
,
verbose
=
verbo
se
,
kwargs
...
)
end
end
MPI
.
Barrier
(
parallelizer
.
comm
)
MPI
.
Barrier
(
parallelizer
.
comm
)
output
=
MPI
.
gather
(
output
,
parallelizer
.
comm
)
output
=
MPI
.
gather
(
output
,
parallelizer
.
comm
)
...
@@ -28,7 +29,7 @@ function train_models(models::Dict, X, y; parallelizer::Union{Nothing,AbstractPa
...
@@ -28,7 +29,7 @@ function train_models(models::Dict, X, y; parallelizer::Union{Nothing,AbstractPa
model_dict
=
MPI
.
bcast
(
output
,
parallelizer
.
comm
;
root
=
0
)
model_dict
=
MPI
.
bcast
(
output
,
parallelizer
.
comm
;
root
=
0
)
MPI
.
Barrier
(
parallelizer
.
comm
)
MPI
.
Barrier
(
parallelizer
.
comm
)
else
else
model_dict
=
Dict
(
mod_name
=>
_train
(
model
,
X
,
y
;
mod_name
=
mod_name
,
kwargs
...
)
for
(
mod_name
,
model
)
in
models
)
model_dict
=
Dict
(
mod_name
=>
_train
(
model
,
X
,
y
;
mod_name
=
mod_name
,
verbose
=
verbose
,
kwargs
...
)
for
(
mod_name
,
model
)
in
models
)
end
end
return
model_dict
return
model_dict
end
end
...
...
This diff is collapsed.
Click to expand it.
experiments/setup_env.jl
+
3
−
1
View file @
723f6ccc
...
@@ -27,6 +27,8 @@ using TidierData
...
@@ -27,6 +27,8 @@ using TidierData
Random
.
seed!
(
2023
)
Random
.
seed!
(
2023
)
ENV
[
"DATADEPS_ALWAYS_ACCEPT"
]
=
"true"
# avoid command prompt and just download data
# Scripts:
# Scripts:
include
(
"experiment.jl"
)
include
(
"experiment.jl"
)
include
(
"data/data.jl"
)
include
(
"data/data.jl"
)
...
@@ -124,7 +126,7 @@ if any(contains.(ARGS, "n_individuals="))
...
@@ -124,7 +126,7 @@ if any(contains.(ARGS, "n_individuals="))
n_ind_specified
=
true
n_ind_specified
=
true
n_individuals
=
ARGS
[
findall
(
contains
.
(
ARGS
,
"n_individuals="
))][
1
]
|>
x
->
replace
(
x
,
"n_individuals="
=>
""
)
n_individuals
=
ARGS
[
findall
(
contains
.
(
ARGS
,
"n_individuals="
))][
1
]
|>
x
->
replace
(
x
,
"n_individuals="
=>
""
)
else
else
n_individuals
=
25
n_individuals
=
100
end
end
"Number of individuals to use in benchmarking."
"Number of individuals to use in benchmarking."
...
...
This diff is collapsed.
Click to expand it.
experiments/synthetic.sh
+
1
−
1
View file @
723f6ccc
...
@@ -11,4 +11,4 @@
...
@@ -11,4 +11,4 @@
module load 2023r1 openmpi
module load 2023r1 openmpi
srun julia
--project
=
experiments experiments/run_experiments.jl
--
data
=
linearly_separable,moons,c
r
icles
output_path
=
results retrain threaded mpi
>
experiments/synthetic.log
srun julia
--project
=
experiments experiments/run_experiments.jl
--
data
=
linearly_separable,moons,ci
r
cles
output_path
=
results retrain threaded mpi
>
experiments/synthetic.log
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