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
daa8d2ce
Commit
daa8d2ce
authored
2 years ago
by
Jörg Martin
Browse files
Options
Downloads
Patches
Plain Diff
renamed file
parent
2298b661
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Experiments/plot_real_diagonal.py
+4
-9
4 additions, 9 deletions
Experiments/plot_real_diagonal.py
with
4 additions
and
9 deletions
Experiments/plot_real_
intersection
.py
→
Experiments/plot_real_
diagonal
.py
+
4
−
9
View file @
daa8d2ce
...
@@ -152,7 +152,7 @@ def create_diagonal(train, number_of_steps=100):
...
@@ -152,7 +152,7 @@ def create_diagonal(train, number_of_steps=100):
input_shape
=
train
[
0
][
0
].
shape
input_shape
=
train
[
0
][
0
].
shape
assert
len
(
input_shape
)
==
1
assert
len
(
input_shape
)
==
1
input_dim
=
input_shape
[
0
]
input_dim
=
input_shape
[
0
]
ones
=
torch
.
ones
((
1
,
input_dim
))
ones
=
0.75
*
torch
.
ones
((
1
,
input_dim
))
t
=
torch
.
linspace
(
start
=
0
,
end
=
1
,
steps
=
number_of_steps
)[...,
None
]
t
=
torch
.
linspace
(
start
=
0
,
end
=
1
,
steps
=
number_of_steps
)[...,
None
]
return
(
1
-
t
)
*
ones
-
t
*
ones
return
(
1
-
t
)
*
ones
-
t
*
ones
...
@@ -161,9 +161,7 @@ def create_diagonal(train, number_of_steps=100):
...
@@ -161,9 +161,7 @@ def create_diagonal(train, number_of_steps=100):
assert
noneiv_conf_dict
[
"
seed_range
"
]
==
eiv_conf_dict
[
"
seed_range
"
]
assert
noneiv_conf_dict
[
"
seed_range
"
]
==
eiv_conf_dict
[
"
seed_range
"
]
seed_list
=
range
(
noneiv_conf_dict
[
"
seed_range
"
][
0
],
seed_list
=
range
(
noneiv_conf_dict
[
"
seed_range
"
][
0
],
noneiv_conf_dict
[
"
seed_range
"
][
1
])
noneiv_conf_dict
[
"
seed_range
"
][
1
])
noneiv_predictions
=
0
noneiv_uncertainties
=
0
noneiv_uncertainties
=
0
eiv_predictions
=
0
eiv_uncertainties
=
0
eiv_uncertainties
=
0
number_of_seeds
=
len
(
seed_list
)
number_of_seeds
=
len
(
seed_list
)
out_dim
=
0
out_dim
=
0
...
@@ -172,16 +170,13 @@ for seed in tqdm(seed_list):
...
@@ -172,16 +170,13 @@ for seed in tqdm(seed_list):
x_diagonal
=
create_diagonal
(
train
=
train_data
,
number_of_steps
=
number_of_steps
)
x_diagonal
=
create_diagonal
(
train
=
train_data
,
number_of_steps
=
number_of_steps
)
results
=
collect_predictions
(
x_diagonal
,
results
=
collect_predictions
(
x_diagonal
,
seed
=
seed
)
seed
=
seed
)
noneiv_predictions
+=
1
/
number_of_seeds
*
results
[
'
noneiv
'
][
'
predictions
'
][...,
out_dim
]
noneiv_uncertainties
+=
1
/
number_of_seeds
*
results
[
'
noneiv
'
][
'
uncertainties
'
][...,
out_dim
]
noneiv_uncertainties
+=
1
/
number_of_seeds
*
results
[
'
noneiv
'
][
'
uncertainties
'
][...,
out_dim
]
eiv_predictions
+=
1
/
number_of_seeds
*
results
[
'
eiv
'
][
'
predictions
'
][...,
out_dim
]
eiv_uncertainties
+=
1
/
number_of_seeds
*
results
[
'
eiv
'
][
'
uncertainties
'
][...,
out_dim
]
eiv_uncertainties
+=
1
/
number_of_seeds
*
results
[
'
eiv
'
][
'
uncertainties
'
][...,
out_dim
]
plt
.
figure
(
1
)
plt
.
figure
(
1
)
plt
.
clf
()
plt
.
clf
()
plot_x
=
torch
.
linspace
(
0
,
1
,
steps
=
number_of_steps
)
plot_x
=
torch
.
linspace
(
0
,
1
,
steps
=
number_of_steps
)
plt
.
plot
(
plot_x
,
noneiv_predictions
,
color
=
'
b
'
)
plt
.
fill_between
(
plot_x
,
noneiv_uncertainties
,
color
=
'
b
'
,
alpha
=
0.5
)
plt
.
fill_between
(
plot_x
,
noneiv_predictions
-
noneiv_uncertainties
,
noneiv_predictions
+
noneiv_uncertainties
,
color
=
'
b
'
,
alpha
=
0.5
)
plt
.
fill_between
(
plot_x
,
eiv_uncertainties
,
color
=
'
r
'
,
alpha
=
0.5
)
plt
.
plot
(
plot_x
,
eiv_predictions
,
color
=
'
r
'
)
plt
.
savefig
(
'
results/figures/intersection
'
)
plt
.
fill_between
(
plot_x
,
eiv_predictions
-
eiv_uncertainties
,
eiv_predictions
+
eiv_uncertainties
,
color
=
'
r
'
,
alpha
=
0.5
)
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