forked from mozilla/DeepSpeech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
273 lines (225 loc) · 10.2 KB
/
index.htm
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>DeepSpeech reports</title>
<link rel="stylesheet" href="resources/bootstrap.min.css" />
<link rel="stylesheet" href="resources/jquery-ui.min.css" />
<link rel="stylesheet" href="resources/rickshaw.min.css" />
<script src="resources/jquery-3.1.1.min.js"></script>
<script src="resources/jquery-ui.min.js"></script>
<script src="resources/d3.v3.min.js"></script>
<script src="resources/rickshaw.min.js"></script>
<script src="logs/hyper.js"></script>
<style type="text/css">
.rickshaw_legend {
color: black;
background: transparent;
}
.rickshaw_legend .line {
display: inline;
}
</style>
</head>
<body>
<!-- Static navbar -->
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">DeepSpeech</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#overall_wer">Overall WER</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Parameter WER <span class="caret"></span></a>
<ul id="parameter_menu" class="dropdown-menu">
</ul>
</li>
<!-- <li><a href="#contact">Runs</a></li> -->
</ul>
<!-- <ul class="nav navbar-nav navbar-right">
<li><a href="../navbar/">Default</a></li>
<li class="active"><a href="./">Static top <span class="sr-only">(current)</span></a></li>
<li><a href="../navbar-fixed-top/">Fixed top</a></li>
</ul> -->
</div>
</div>
</nav>
<div id="panels" class="container"></div>
<script src="resources/bootstrap.min.js"></script>
<script type="text/javascript">
const createChart = (id, title, fineprint, series, times) => {
var panelRoot = $('#panels');
var panel = $('<div/>').attr('id', id); panelRoot.append(panel);
panel.append('<h1>' + title + '</h1>');
panel.append('<p>' + fineprint + '</p>');
var cContainer = $('<div/>'); panel.append(cContainer);
var cChart = $('<div/>'); cContainer.append(cChart);
var cPreview = $('<div/>'); cContainer.append(cPreview);
var cTimeline = $('<div/>'); cContainer.append(cTimeline);
var cLegend = $('<div/>'); cContainer.append(cLegend);
var graph = new Rickshaw.Graph({
element: cChart[0],
height: 500,
renderer: 'area',
interpolation: 'linear',
unstack: 'true',
stroke: true,
preserve: true,
series: series
});
graph.render();
var preview = new Rickshaw.Graph.RangeSlider({
graph: graph,
element: cPreview[0]
});
var hoverDetail = new Rickshaw.Graph.HoverDetail({
graph: graph,
xFormatter: function(x) {
if (times)
return new Date(x * 1000.0).toString();
else
return x;
},
yFormatter: function(y) {
return (y * 100).toFixed(2) + '%';
}
});
var legend = new Rickshaw.Graph.Legend({
graph: graph,
element: cLegend[0]
});
var shelving = new Rickshaw.Graph.Behavior.Series.Toggle({
graph: graph,
legend: legend
});
var order = new Rickshaw.Graph.Behavior.Series.Order({
graph: graph,
legend: legend
});
var highlighter = new Rickshaw.Graph.Behavior.Series.Highlight({
graph: graph,
legend: legend
});
var ticksTreatment = 'glow';
if (times) {
var xAxis = new Rickshaw.Graph.Axis.Time({
graph: graph,
ticksTreatment: ticksTreatment,
timeFixture: new Rickshaw.Fixtures.Time.Local()
});
var annotator = new Rickshaw.Graph.Annotate({
graph: graph,
element: cTimeline[0]
});
times.forEach(time => annotator.add(time, new Date(time * 1000.0).toString()));
annotator.update();
xAxis.render();
}
var yAxis = new Rickshaw.Graph.Axis.Y({
graph: graph,
tickFormat: function(y) { return (y * 100).toFixed(0) + '%'; },
ticksTreatment: ticksTreatment
});
yAxis.render();
};
const groupBy = (array, getProperties) => {
var groups = {};
array.forEach(o => {
var group = JSON.stringify(getProperties(o));
(groups[group] = groups[group] || []).push(o);
});
return Object.keys(groups).map(group => groups[group]);
};
var ds = window.ALL_THE_DATA,
i,
reports = {},
overall_test_wer = [],
overall_validation_wer = [],
overall_train_wer = [],
times = [];
ds.forEach(item => {
var time = item.context.time_started =
new Date(item.context.time_started).getTime() / 1000.0;
item.context.time_finished =
new Date(item.context.time_finished).getTime() / 1000.0;
overall_test_wer .push({ x: time, y: item.results.test_wer });
overall_validation_wer .push({ x: time, y: item.results.last_validation_wer });
overall_train_wer .push({ x: time, y: item.results.last_train_wer });
times.push(time);
});
const stdtext =
'The Y axis plots the mean word error rate ' +
'<a href="https://en.wikipedia.org/wiki/Word_error_rate">WER</a> ' +
'(of the training\'s last epoch).' +
'<p>Lower is better: 0% WER equates to "all words were understood correctly", ' +
'while 100% WER equates to "every single word was wrong". ' +
'Percentages greater than 100% may occur, if the "understood" phrase got longer than the original one.</p><p>' +
'<strong>Train WER</strong>, <strong>Train WER</strong> and <strong>Train WER</strong> ' +
'refer to the WERs calculated on base of the corresponding ' +
'<a href="https://en.wikipedia.org/wiki/Test_set#Validation_set">data-sets.</a></p><p>' +
'Please use the legend for turning on/off data series.</p>';
createChart(
'overall_wer',
'DeepSpeech Word Error Rate over time',
'The X axis plots all trainings by their start times. ' + stdtext,
[
{ color: 'rgba(100,100,255,0.5)', data: overall_validation_wer, name: 'Validate WER' },
{ color: 'rgba(255,100,100,0.5)', data: overall_train_wer, name: 'Train WER' },
{ color: 'rgba(100,255,100,0.5)', data: overall_test_wer, name: 'Test WER' }
],
times
);
var params = Object.keys(keys = ds[0].parameters);
var parameterGroups = {};
params.forEach(param => {
// We group by the other parameters to find series of values that don't differ by other parameters
var others = params.filter(p => p !== param);
var groups = parameterGroups[param] = groupBy(ds, item => others.map(p => item.parameters[p]));
// Remove single values
groups = groups.filter(g => g.length > 1);
// Produce { x, y } objects with x being unique and y being the validation WER
groups = groups.map(group => {
var o = {};
group.forEach(item => o[item.parameters[param]] = item.results.last_validation_wer);
return {
values: Object.keys(o).map(k => ({ x: k * 1.0, y: o[k] })),
parameters: group[0].parameters,
context: group[0].context
};
});
// Exclude singular values
groups = groups.filter(g => g.values.length > 1);
// If there is more than one group, we produce a chart
if (groups.length > 0) {
var id = 'parameter_' + param;
var title = param.split('_').map(p => p[0].toUpperCase() + p.slice(1)).join(' ');
$('#parameter_menu').append('<li><a href="#' + id + '">' + title + '</a></li>');
var series = [],
cc1 = 150, cc2 = 50;
groups.forEach(group => {
// Color cycling
cc1 = (cc1 + 40) % 255; cc2 = (cc2 + 200) % 255;
series.push({
color: 'rgba(100,' + cc1 + ',' + cc2 + ',0.75)',
data: group.values,
name: 'WER from ' + new Date(group.context.time_finished * 1000.0).toString(),
meta: group.context
});
});
createChart(id, title, 'The X axis plots all trainings by the value of ' + title + '. ' + stdtext, series, false);
}
});
jQuery(document).ready(function ($) {
$('#tabs').tab();
});
</script>
</body>
</html>