Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
journal_eiv
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
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jörg Martin
journal_eiv
Commits
03c02b18
Commit
03c02b18
authored
3 years ago
by
Jörg Martin
Browse files
Options
Downloads
Patches
Plain Diff
Argument loading in training scripts
parent
ba40b69e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Experiments/train_eiv.py
+11
-1
11 additions, 1 deletion
Experiments/train_eiv.py
Experiments/train_noneiv.py
+9
-1
9 additions, 1 deletion
Experiments/train_noneiv.py
with
20 additions
and
2 deletions
Experiments/train_eiv.py
+
11
−
1
View file @
03c02b18
...
...
@@ -4,6 +4,7 @@ Train EiV model using different seeds
import
random
import
importlib
import
os
import
argparse
import
json
import
numpy
as
np
...
...
@@ -15,7 +16,14 @@ from torch.utils.tensorboard.writer import SummaryWriter
from
EIVArchitectures
import
Networks
,
initialize_weights
from
EIVTrainingRoutines
import
train_and_store
,
loss_functions
data
=
'
california
'
# read in data via --data option
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
--data
"
,
help
=
"
Loads data
"
,
default
=
'
california
'
)
parser
.
add_argument
(
"
--no-autoindent
"
,
help
=
""
,
action
=
"
store_true
"
)
# to avoid conflics in IPython
args
=
parser
.
parse_args
()
data
=
args
.
data
# load hyperparameters from JSON file
with
open
(
os
.
path
.
join
(
'
configurations
'
,
f
'
eiv_
{
data
}
.json
'
),
'
r
'
)
as
conf_file
:
...
...
@@ -42,6 +50,8 @@ gamma = conf_dict["gamma"]
hidden_layers
=
conf_dict
[
"
hidden_layers
"
]
seed_range
=
conf_dict
[
'
seed_range
'
]
print
(
f
"
Training on
{
long_dataname
}
data
"
)
try
:
gpu_number
=
conf_dict
[
"
gpu_number
"
]
device
=
torch
.
device
(
f
'
cuda:
{
gpu_number
}
'
if
torch
.
cuda
.
is_available
()
else
'
cpu
'
)
...
...
This diff is collapsed.
Click to expand it.
Experiments/train_noneiv.py
+
9
−
1
View file @
03c02b18
...
...
@@ -4,6 +4,7 @@ Train non-EiV model using different seeds
import
random
import
importlib
import
os
import
argparse
import
json
import
numpy
as
np
...
...
@@ -15,7 +16,14 @@ from torch.utils.tensorboard.writer import SummaryWriter
from
EIVArchitectures
import
Networks
,
initialize_weights
from
EIVTrainingRoutines
import
train_and_store
,
loss_functions
data
=
'
california
'
# read in data via --data option
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
--data
"
,
help
=
"
Loads data
"
,
default
=
'
california
'
)
parser
.
add_argument
(
"
--no-autoindent
"
,
help
=
""
,
action
=
"
store_true
"
)
# to avoid conflics in IPython
args
=
parser
.
parse_args
()
data
=
args
.
data
# load hyperparameters from JSON file
with
open
(
os
.
path
.
join
(
'
configurations
'
,
f
'
noneiv_
{
data
}
.json
'
),
'
r
'
)
as
conf_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