Skip to content

Commit 52d41c0

Browse files
authored
Add files via upload
1 parent 9979f0d commit 52d41c0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Diff for: utils/visualize.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
import visdom
3+
4+
5+
def init_visdom_line(x, y, title, xlabel, ylabel, env="default"):
6+
env = visdom.Visdom(env=env)
7+
panel = env.line(
8+
X=np.array([x]),
9+
Y=np.array([y]),
10+
opts=dict(title=title, showlegend=True, xlabel=xlabel, ylabel=ylabel)
11+
)
12+
return env, panel
13+
14+
15+
def update_lines(env, panel, x, y, update_type='append'):
16+
env.line(
17+
X=np.array([x]),
18+
Y=np.array([y]),
19+
win=panel,
20+
update=update_type
21+
)

0 commit comments

Comments
 (0)