-
Notifications
You must be signed in to change notification settings - Fork 1
/
visualization.py
executable file
·60 lines (51 loc) · 1.67 KB
/
visualization.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#%%
from datetime import datetime
import visdom
class Visualizations:
def __init__(self, env_name=None):
if env_name is None:
env_name = str(datetime.now().strftime("%d-%m %Hh%M"))
self.env_name = env_name
self.vis = visdom.Visdom(env=self.env_name)
self.accuracy_epoch_win1 = None
self.accuracy_epoch_win2 = None
self.accuracy_epoch_win3 = None
def plot_accuracy1(self, accuracy, epoch):
self.accuracy_epoch_win1 = self.vis.line(
[accuracy],
[epoch],
win=self.accuracy_epoch_win1,
update='append' if self.accuracy_epoch_win1 else None,
opts=dict(
xlabel='Epoch',
ylabel='Accuracy',
title='2017 new Accuracy-Epoch',
)
)
# 2018
def plot_accuracy2(self, accuracy, epoch):
self.accuracy_epoch_win2 = self.vis.line(
[accuracy],
[epoch],
win=self.accuracy_epoch_win2,
update='append' if self.accuracy_epoch_win2 else None,
opts=dict(
xlabel='Epoch',
ylabel='Accuracy',
title='2018 new Accuracy-Epoch',
)
)
# train_3000
def plot_accuracy3(self, accuracy, epoch):
self.accuracy_epoch_win3 = self.vis.line(
[accuracy],
[epoch],
win=self.accuracy_epoch_win3,
update='append' if self.accuracy_epoch_win3 else None,
opts=dict(
xlabel='Epoch',
ylabel='Accuracy',
title='Train 3000 new Accuracy-Epoch',
)
)
#%%