-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcarrotlayout.py
133 lines (119 loc) · 3.83 KB
/
carrotlayout.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import dash_html_components as html
import dash_core_components as dcc
import carrotmysql
def loss_display():
display = html.Div(children=[
html.Div(children=[
dcc.Graph(
id='loss-graph',
figure={
'data': [
{'x': carrotmysql.query.epoch, 'y': carrotmysql.query.training_loss, 'type': 'line',
'name': 'Train loss'},
{'x': carrotmysql.query.epoch, 'y': carrotmysql.query.test_loss, 'line': 'bar',
'name': 'Validation loss'}
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
]
)
]
)
return display
def accuracy_display():
display = html.Div(children=[
html.Div(children=[
dcc.Graph(
id='accuracy-graph',
figure={
'data': [
{'x': carrotmysql.query.epoch, 'y': carrotmysql.query.training_accuracy,
'type': 'bar',
'name': 'Train loss'},
{'x': carrotmysql.query.epoch, 'y': carrotmysql.query.test_accuracy,
'type': 'bar',
'name': 'Validation loss'}
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
]
)
])
return display
def parameters_display():
carrotmysql.query.search_layer(carrotmysql.query.current_layer, parameter=True)
arr = carrotmysql.query.batch_seq(0)
display = html.Div(children=[
html.Div(children=[
dcc.Graph(
id='parameters-graph',
figure={
'data': [
{'x': arr[0],
'y': arr[1],
'z': arr[2],
'type': 'scatter3d', 'name': carrotmysql.query.current_layer}
],
'layout': {
'title': carrotmysql.query.current_layer
}
}
),
dcc.Slider(
id='parameters-slider',
min=-0,
max=carrotmysql.query.batch_size,
step=1,
value=0
),
dcc.Dropdown(
id='parameters-dropdown',
options=carrotmysql.query.get_options(),
value=carrotmysql.query.current_layer
)
]
)
])
return display
def gradients_display():
carrotmysql.query.search_layer(carrotmysql.query.current_layer, parameter=False)
arr = carrotmysql.query.batch_seq(0)
display = html.Div(children=[
html.Div(children=[
dcc.Graph(
id='gradients-graph',
figure={
'data': [
{'x': arr[0],
'y': arr[1],
'z': arr[2],
'type': 'scatter3d', 'name': carrotmysql.query.current_layer}
],
'layout': {
'title': carrotmysql.query.current_layer
}
}
),
dcc.Slider(
id='gradients-slider',
min=-0,
max=carrotmysql.query.batch_size,
step=1,
value=0
),
dcc.Dropdown(
id='gradients-dropdown',
options=carrotmysql.query.get_options(),
value=carrotmysql.query.current_layer
)
]
)
])
return display
return display