Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
886b02d0
Commit
886b02d0
authored
5 years ago
by
lukas leufen
Browse files
Options
Downloads
Patches
Plain Diff
more parameters set in experiment setup, log all set params in debug mode
parent
7622fe10
No related branches found
No related tags found
3 merge requests
!12
Experiment Setup finished
,
!11
finish run script creation, /close #11
,
!10
finish class ExperimentSetup
Pipeline
#25934
passed
5 years ago
Stage: test
Stage: pages
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
run.py
+32
-12
32 additions, 12 deletions
run.py
src/helpers.py
+1
-1
1 addition, 1 deletion
src/helpers.py
with
34 additions
and
13 deletions
.gitignore
+
1
−
0
View file @
886b02d0
...
@@ -56,3 +56,4 @@ htmlcov/
...
@@ -56,3 +56,4 @@ htmlcov/
.pytest_cache
.pytest_cache
/test/data/
/test/data/
report.html
report.html
/TestExperiment/
This diff is collapsed.
Click to expand it.
run.py
+
32
−
12
View file @
886b02d0
...
@@ -38,25 +38,44 @@ class run(object):
...
@@ -38,25 +38,44 @@ class run(object):
class
ExperimentSetup
:
class
ExperimentSetup
:
"""
params:
trainable: Train new model if true, otherwise try to load existing model
"""
def
__init__
(
self
):
def
__init__
(
self
,
trainable
=
False
):
self
.
data_path
=
None
self
.
data_path
=
None
self
.
experiment_path
=
None
self
.
experiment_path
=
None
self
.
experiment_name
=
None
self
.
experiment_name
=
None
self
.
trainable
=
False
self
.
trainable
=
None
self
.
setup_experiment
()
self
.
fraction_of_train
=
None
self
.
use_all_stations_on_all_data_sets
=
None
self
.
setup_experiment
(
trainable
)
def
setup_experiment
(
self
):
def
_set_param
(
self
,
param
,
value
):
setattr
(
self
,
param
,
value
)
logging
.
debug
(
f
"
set attribute:
{
param
}
=
{
value
}
"
)
def
setup_experiment
(
self
,
trainable
):
# set data path of this experiment
# set data path of this experiment
self
.
data_path
=
helpers
.
prepare_host
()
self
.
_set_param
(
"
data_path
"
,
helpers
.
prepare_host
()
)
# set experiment name
# set experiment name
experiment_date
=
parser
.
parse_args
([
"
experiment_date
"
])
exp_date
=
args
.
experiment_date
self
.
experiment_name
,
self
.
experiment_path
=
helpers
.
set_experiment_name
(
experiment_date
=
experiment_date
)
exp_name
,
exp_path
=
helpers
.
set_experiment_name
(
experiment_date
=
exp_date
)
self
.
_set_param
(
"
experiment_name
"
,
exp_name
)
self
.
_set_param
(
"
experiment_path
"
,
exp_path
)
helpers
.
check_path_and_create
(
self
.
experiment_path
)
# set if model is trainable
self
.
_set_param
(
"
trainable
"
,
trainable
)
# set fraction of train
self
.
_set_param
(
"
fraction_of_train
"
,
0.8
)
# se
t if model shall be trained or not
#
u
se
all stations on all data sets (train, val, test)
self
.
trainable
=
True
self
.
_set_param
(
"
use_all_stations_on_all_data_sets
"
,
True
)
class
PreProcessing
(
run
):
class
PreProcessing
(
run
):
...
@@ -83,11 +102,12 @@ class PostProcessing(run):
...
@@ -83,11 +102,12 @@ class PostProcessing(run):
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
experiment date
'
,
metavar
=
'
exp_date
'
,
type
=
str
,
nargs
=
1
,
help
=
'
set experiment date as string
'
,
parser
.
add_argument
(
'
--experiment_date
'
,
metavar
=
'
--exp_date
'
,
type
=
str
,
nargs
=
1
,
default
=
None
,
default
=
None
)
help
=
"
set experiment date as string
"
)
args
=
parser
.
parse_args
()
with
run
():
with
run
():
exp_setup
=
ExperimentSetup
()
exp_setup
=
ExperimentSetup
(
trainable
=
True
)
PreProcessing
(
exp_setup
)
PreProcessing
(
exp_setup
)
...
...
This diff is collapsed.
Click to expand it.
src/helpers.py
+
1
−
1
View file @
886b02d0
...
@@ -161,7 +161,7 @@ def prepare_host():
...
@@ -161,7 +161,7 @@ def prepare_host():
def
set_experiment_name
(
experiment_date
=
None
,
experiment_path
=
None
):
def
set_experiment_name
(
experiment_date
=
None
,
experiment_path
=
None
):
if
experiment_date
is
None
:
if
experiment_date
is
None
:
experiment_name
=
""
experiment_name
=
"
TestExperiment
"
else
:
else
:
experiment_name
=
f
"
{
experiment_date
}
_network/
"
experiment_name
=
f
"
{
experiment_date
}
_network/
"
if
experiment_path
is
None
:
if
experiment_path
is
None
:
...
...
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