Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NN Projekt SS22
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
kreuzer
NN Projekt SS22
Commits
8ac5bdf0
Commit
8ac5bdf0
authored
2 years ago
by
wu
Browse files
Options
Downloads
Patches
Plain Diff
Update plot_training_curves.py
parent
c2fae59f
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plot_training_curves.py
+6
-14
6 additions, 14 deletions
plot_training_curves.py
with
6 additions
and
14 deletions
plot_training_curves.py
+
6
−
14
View file @
8ac5bdf0
...
...
@@ -4,27 +4,19 @@ import matplotlib.pyplot as plt
import
pathlib
hist_path
=
pathlib
.
Path
(
'
hist
'
)
actor_only_hist
=
torch
.
load
(
hist_path
/
'
model_actor_only_val_rouge_hist.pt
'
)
CE_hist
=
torch
.
load
(
hist_path
/
'
model_CE_val_rouge_hist.pt
'
)
ahist
=
torch
.
Tensor
(
actor_only_hist
)
chist
=
torch
.
Tensor
(
CE_hist
)
# list of loss, loss of type float in training and in validation / test
actor_only_hist
=
torch
.
load
(
hist_path
/
'
model_actor_only_val_rouge_hist.pt
'
,
map_location
=
"
cpu
"
)
CE_hist
=
torch
.
load
(
hist_path
/
'
model_CE_val_rouge_hist.pt
'
,
map_location
=
"
cpu
"
)
num_epochs
=
2
ohist
=
[]
shist
=
[]
ohist
=
[
h
.
cpu
().
numpy
()
for
h
in
ahist
]
shist
=
[
h
.
cpu
().
numpy
()
for
h
in
chist
]
plt
.
title
(
"
Validation Rouge vs. Number of Training Epochs
"
)
plt
.
xlabel
(
"
Training Epochs
"
)
plt
.
ylabel
(
"
Validation Rouge
"
)
plt
.
plot
(
range
(
1
,
num_epochs
+
1
),
o
hist
,
label
=
"
Actor Only
"
)
plt
.
plot
(
range
(
1
,
num_epochs
+
1
),
s
hist
,
label
=
"
Cross Entropy
"
)
plt
.
plot
(
range
(
1
,
num_epochs
+
1
),
actor_only_
hist
,
label
=
"
Actor Only
"
)
plt
.
plot
(
range
(
1
,
num_epochs
+
1
),
CE_
hist
,
label
=
"
Cross Entropy
"
)
plt
.
ylim
((
min
(
actor_only_hist
+
CE_hist
),
max
(
actor_only_hist
+
CE_hist
)))
plt
.
xticks
(
np
.
arange
(
1
,
num_epochs
+
1
,
1
.
0
))
plt
.
xticks
(
np
.
arange
(
0
,
num_epochs
,
1
00
0
))
#
plt
.
legend
()
plt
.
show
()
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