forked from nashory/pggan-pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vt.py
69 lines (59 loc) · 1.31 KB
/
vt.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
61
62
63
64
65
66
67
68
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from visdom import Visdom
import numpy as np
import math
import os.path
import getpass
from sys import platform as _platform
from six.moves import urllib
import time
viz = Visdom()
time.sleep(1)
assert viz.check_connection(), 'Visdom server connection failed, start server with python -m visdom.server and default port = 8097'
Y = np.linspace(0, 4, 200)
Y = np.ones(1)
win = viz.line(
Y=np.sqrt(Y) + 2,
X=Y,
env='banana',
opts=dict(
fillarea=True,
showlegend=False,
width=800,
height=800,
xlabel='Time',
ylabel='Volume',
ytype='log',
title='Stacked area plot',
marginleft=30,
marginright=30,
marginbottom=80,
margintop=30,
),
)
# for i in range(100):
# time.sleep(0.1)
# print('awaken')
# Y = Y + 1
# viz.line(
# Y = np.sqrt(Y) + 2,
# X = Y,
# win=win,
# update='append'
# )
win = viz.line(
X=np.zeros(1),
Y=np.ones(1)*10,
opts=dict(title='banana')
)
for i in range(100000):
viz.line(
X=np.ones(1)*i,
Y=np.ones(1)*i**2,
win=win,
update='append'
)
time.sleep(0.1)