forked from wandb/wandb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_plots.py
More file actions
27 lines (24 loc) · 927 Bytes
/
basic_plots.py
File metadata and controls
27 lines (24 loc) · 927 Bytes
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
import wandb
import random
import math
wandb.init(entity='wandb', project='new-plots-test-5')
data = [[i, random.random() + math.sin(i / 10)] for i in range(100)]
table = wandb.Table(data=data, columns=["step", "height"])
line_plot = wandb.plot.line(table, x='step', y='height', title='what a great line plot')
histogram = wandb.plot.histogram(table, value='height', title='my-histo')
scatter = wandb.plot.scatter(table, x='step', y='height', title='scatter!')
bar_table = wandb.Table(data=[
['car', random.random()],
['bus', random.random()],
['road', random.random()],
['person', random.random()],
['cyclist', random.random()],
['tree', random.random()],
['sky', random.random()]
], columns=["class", "acc"])
bar = wandb.plot.bar(bar_table, label='class', value='acc', title='bar')
wandb.log({
'line1': line_plot,
'histogram1': histogram,
'scatter1': scatter,
'bar1': bar})