forked from facebookresearch/brainmagick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_hiplot.py
30 lines (26 loc) · 1.05 KB
/
_hiplot.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
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Hiplot explorers, see Dora documentations.
"""
from dora.hiplot import HiPlotExplorer
import hiplot
class MainHP(HiPlotExplorer):
def process_metrics(self, xp, metrics):
valid = metrics["valid"]
train = metrics["train"]
out = {
"train_loss": round(train["loss"], 5),
"valid_loss": round(valid["loss"], 5),
"best_loss": round(valid["best"], 5),
}
if 'test' in metrics:
test = metrics['test']
if 'wer_vocab' in test:
out.update({'wer_vocab': round(100 * test['wer_vocab'], 2)})
return out
def postprocess_exp(self, exp: hiplot.Experiment):
exp.display_data(hiplot.Displays.XY).update({"lines_thickness": 1.0, "lines_opacity": 1.0})
exp.display_data(hiplot.Displays.XY).update({"axis_x": "epoch", "axis_y": "valid_loss"})