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
32ada0a6
Commit
32ada0a6
authored
3 years ago
by
Jörg Martin
Browse files
Options
Downloads
Patches
Plain Diff
train_noneiv fixed
parent
e2c57f2d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Experiments/plot_prediction.py
+10
-3
10 additions, 3 deletions
Experiments/plot_prediction.py
Experiments/train_noneiv.py
+6
-1
6 additions, 1 deletion
Experiments/train_noneiv.py
with
16 additions
and
4 deletions
Experiments/plot_prediction.py
+
10
−
3
View file @
32ada0a6
...
@@ -69,6 +69,11 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws,
...
@@ -69,6 +69,11 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws,
# get datanames
# get datanames
long_dataname
=
conf_dict
[
"
long_dataname
"
]
long_dataname
=
conf_dict
[
"
long_dataname
"
]
short_dataname
=
conf_dict
[
"
short_dataname
"
]
short_dataname
=
conf_dict
[
"
short_dataname
"
]
try
:
normalize
=
conf_dict
[
'
normalize
'
]
except
KeyError
:
# normalize by default
normalize
=
True
# load hyperparameters
# load hyperparameters
...
@@ -98,8 +103,10 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws,
...
@@ -98,8 +103,10 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws,
# determine dimensions
# determine dimensions
_
,
test_data
,
normalized_func
=
load_data
(
seed
=
plotting_seed
,
return_ground_truth
=
False
,
_
,
test_data
,
normalized_func
=
load_data
(
seed
=
plotting_seed
,
return_normalized_func
=
True
)
return_ground_truth
=
False
,
return_normalized_func
=
True
,
normalize
=
normalize
)
input_dim
=
test_data
[
0
][
0
].
numel
()
input_dim
=
test_data
[
0
][
0
].
numel
()
output_dim
=
test_data
[
0
][
1
].
numel
()
output_dim
=
test_data
[
0
][
1
].
numel
()
assert
output_dim
==
1
assert
output_dim
==
1
...
@@ -209,7 +216,7 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws,
...
@@ -209,7 +216,7 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws,
return
plotting_dictionary
return
plotting_dictionary
data_list
=
[
'
sine
'
]
# short datanames
data_list
=
[
'
cubic
'
]
# short datanames
#TODO: Check which ranges are "correct"
#TODO: Check which ranges are "correct"
list_x_range
=
[
torch
.
linspace
(
-
2.5
,
2.5
,
50
)]
list_x_range
=
[
torch
.
linspace
(
-
2.5
,
2.5
,
50
)]
list_color
=
[(
'
red
'
,
'
blue
'
)]
list_color
=
[(
'
red
'
,
'
blue
'
)]
...
...
This diff is collapsed.
Click to expand it.
Experiments/train_noneiv.py
+
6
−
1
View file @
32ada0a6
...
@@ -49,6 +49,11 @@ init_std_y_list = conf_dict["init_std_y_list"]
...
@@ -49,6 +49,11 @@ init_std_y_list = conf_dict["init_std_y_list"]
gamma
=
conf_dict
[
"
gamma
"
]
gamma
=
conf_dict
[
"
gamma
"
]
hidden_layers
=
conf_dict
[
"
hidden_layers
"
]
hidden_layers
=
conf_dict
[
"
hidden_layers
"
]
seed_range
=
conf_dict
[
'
seed_range
'
]
seed_range
=
conf_dict
[
'
seed_range
'
]
try
:
normalize
=
conf_dict
[
'
normalize
'
]
except
KeyError
:
# normalize by default
normalize
=
True
print
(
f
"
Training on
{
long_dataname
}
data
"
)
print
(
f
"
Training on
{
long_dataname
}
data
"
)
...
@@ -190,7 +195,7 @@ def train_on_data(init_std_y, seed):
...
@@ -190,7 +195,7 @@ def train_on_data(init_std_y, seed):
set_seeds
(
seed
)
set_seeds
(
seed
)
# load Datasets
# load Datasets
train_data
,
test_data
=
load_data
(
seed
=
seed
,
splitting_part
=
0.8
,
train_data
,
test_data
=
load_data
(
seed
=
seed
,
splitting_part
=
0.8
,
normalize
=
Tru
e
)
normalize
=
normaliz
e
)
# make dataloaders
# make dataloaders
train_dataloader
=
DataLoader
(
train_data
,
batch_size
=
batch_size
,
train_dataloader
=
DataLoader
(
train_data
,
batch_size
=
batch_size
,
shuffle
=
True
)
shuffle
=
True
)
...
...
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