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
4bd5711d
Commit
4bd5711d
authored
1 year ago
by
pat-alt
Browse files
Options
Downloads
Patches
Plain Diff
more work on streamlining
parent
f2ab5fa4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!68
Post rebuttal
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
experiments/setup.jl
+16
-15
16 additions, 15 deletions
experiments/setup.jl
notebooks/setup.jl
+0
-1
0 additions, 1 deletion
notebooks/setup.jl
with
17 additions
and
17 deletions
.gitignore
+
1
−
1
View file @
4bd5711d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/artifacts/
/artifacts/
/.quarto/
/.quarto/
/Manifest.toml
/Manifest.toml
/re
plicated
/
/re
sults
/
**/.CondaPkg
**/.CondaPkg
/dev/rebuttal/www
/dev/rebuttal/www
...
...
This diff is collapsed.
Click to expand it.
experiments/setup.jl
+
16
−
15
View file @
4bd5711d
# General setup:
# General setup:
include
(
"
$
(pwd())/notebooks/setup.jl"
)
include
(
"
$
(pwd())/notebooks/setup.jl"
)
eval
(
setup_notebooks
)
eval
(
setup_notebooks
)
output_path
=
"
$
(pwd())/replicated"
isdir
(
output_path
)
||
mkdir
(
output_path
)
@info
"All results will be saved to
$
output_path."
params_path
=
"
$
(pwd())/replicated/params"
isdir
(
params_path
)
||
mkdir
(
params_path
)
@info
"All parameter choices will be saved to
$
params_path."
test_size
=
0.2
test_size
=
0.2
# Constants:
# Constants:
const
DEFAULT_OUTPUT_PATH
=
"
$
(pwd())/results"
const
RETRAIN
=
"retrain"
∈
ARGS
?
true
:
false
const
RETRAIN
=
"retrain"
∈
ARGS
?
true
:
false
#
Artifact
s:
#
Pre-trained model
s:
using
LazyArtifacts
function
pretrained_path
()
@warn
"Models were pre-trained on `julia-1.8.5` and may not work on other versions."
@info
"Models were pre-trained on `julia-1.8.5` and may not work on other versions."
artifact_path
=
joinpath
(
artifact
"results-paper-submission-1.8.5"
,
"results-paper-submission-1.8.5"
)
return
joinpath
(
artifact
"results-paper-submission-1.8.5"
,
"results-paper-submission-1.8.5"
)
pretrained_path
=
joinpath
(
artifact_path
,
"results"
)
end
# Scripts:
# Scripts:
include
(
"data/data.jl"
)
include
(
"data/data.jl"
)
...
@@ -28,8 +24,8 @@ Base.@kwdef struct Experiment
...
@@ -28,8 +24,8 @@ Base.@kwdef struct Experiment
counterfactual_data
::
CounterfactualData
counterfactual_data
::
CounterfactualData
test_data
::
CounterfactualData
test_data
::
CounterfactualData
dataname
::
String
=
"dataset"
dataname
::
String
=
"dataset"
output_path
::
String
=
output_path
output_path
::
String
=
DEFAULT_OUTPUT_PATH
p
retrained
_path
::
String
=
pretrained_path
p
arams
_path
::
String
=
joinpath
(
output_path
,
"params"
)
use_pretrained
::
Bool
=
true
use_pretrained
::
Bool
=
true
models
::
Union
{
Nothing
,
Dict
}
=
nothing
models
::
Union
{
Nothing
,
Dict
}
=
nothing
builder
::
Union
{
Nothing
,
MLJFlux
.
GenericBuilder
}
=
nothing
builder
::
Union
{
Nothing
,
MLJFlux
.
GenericBuilder
}
=
nothing
...
@@ -46,8 +42,13 @@ end
...
@@ -46,8 +42,13 @@ end
Run the experiment specified by `exp`.
Run the experiment specified by `exp`.
"""
"""
function
run_experiment
(
exp
::
Experiment
)
function
run_experiment
(
exp
::
Experiment
)
# SETUP ----------
# SETUP ----------
@info
"All results will be saved to
$
(exp.output_path)."
isdir
(
exp
.
output_path
)
||
mkdir
(
exp
.
output_path
)
@info
"All parameter choices will be saved to
$
(exp.params_path)."
isdir
(
exp
.
params_path
)
||
mkdir
(
exp
.
params_path
)
# Data
# Data
X
,
labels
,
n_obs
,
save_name
,
batch_size
,
sampler
=
prepare_data
(
X
,
labels
,
n_obs
,
save_name
,
batch_size
,
sampler
=
prepare_data
(
counterfactual_data
;
counterfactual_data
;
...
@@ -75,7 +76,7 @@ function run_experiment(exp::Experiment)
...
@@ -75,7 +76,7 @@ function run_experiment(exp::Experiment)
Serialization
.
serialize
(
joinpath
(
output_path
,
"
$(save_name)
_models.jls"
),
model_dict
)
Serialization
.
serialize
(
joinpath
(
output_path
,
"
$(save_name)
_models.jls"
),
model_dict
)
else
else
@info
"Loading pre-trained models."
@info
"Loading pre-trained models."
model_dict
=
Serialization
.
deserialize
(
joinpath
(
pretrained_path
,
"
$(save_name)
_models.jls"
))
model_dict
=
Serialization
.
deserialize
(
joinpath
(
pretrained_path
()
,
"
$(save_name)
_models.jls"
))
end
end
params
=
DataFrame
(
params
=
DataFrame
(
...
...
This diff is collapsed.
Click to expand it.
notebooks/setup.jl
+
0
−
1
View file @
4bd5711d
...
@@ -24,7 +24,6 @@ setup_notebooks = quote
...
@@ -24,7 +24,6 @@ setup_notebooks = quote
using
Flux
using
Flux
using
Images
using
Images
using
JointEnergyModels
using
JointEnergyModels
using
LaplaceRedux
:
LaplaceApproximation
using
LinearAlgebra
using
LinearAlgebra
using
Markdown
using
Markdown
using
MLDatasets
using
MLDatasets
...
...
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