Skip to content

Commit

Permalink
fix: do not use train_loss_test metrics on MeasureChart
Browse files Browse the repository at this point in the history
  • Loading branch information
alx committed Feb 7, 2022
1 parent b60e125 commit 0c54546
Showing 1 changed file with 40 additions and 7 deletions.
Expand Up @@ -212,10 +212,20 @@ class MeasureChart extends React.Component {
} else if (
measure_hist &&
Object.keys(measure_hist)
.find(k => k.startsWith(attr))
.find(k => {
return attr === "train_loss" ?
k.startsWith(attr) && k.indexOf("_test") === -1
:
k.startsWith(attr)
})
) {
const attrKey = Object.keys(measure_hist)
.find(k => k.startsWith(attr))
.find(k => {
return attr === "train_loss" ?
k.startsWith(attr) && k.indexOf("_test") === -1
:
k.startsWith(attr)
})
value =
measure_hist[attrKey][measure_hist[attrKey].length - 1];
}
Expand All @@ -241,10 +251,20 @@ class MeasureChart extends React.Component {
if (
measure_hist &&
Object.keys(measure_hist)
.find(k => k.startsWith(attr))
.find(k => {
return attr === "train_loss" ?
k.startsWith(attr) && k.indexOf("_test") === -1
:
k.startsWith(attr)
})
) {
const attrKey = Object.keys(measure_hist)
.find(k => k.startsWith(attr))
.find(k => {
return attr === "train_loss" ?
k.startsWith(attr) && k.indexOf("_test") === -1
:
k.startsWith(attr)
})
measures = toJS(measure_hist[attrKey]);
// Remove Infinity values from measure_hist
if (measures.some(x => x === Infinity)) {
Expand Down Expand Up @@ -302,10 +322,20 @@ class MeasureChart extends React.Component {
if (
measure_hist &&
Object.keys(measure_hist)
.find(k => k.startsWith(attr))
.find(k => {
return attr === "train_loss" ?
k.startsWith(attr) && k.indexOf("_test") === -1
:
k.startsWith(attr)
})
) {
const attrKey = Object.keys(measure_hist)
.find(k => k.startsWith(attr))
.find(k => {
return attr === "train_loss" ?
k.startsWith(attr) && k.indexOf("_test") === -1
:
k.startsWith(attr)
})
let labels = [],
measures = toJS(measure_hist[attrKey]),
datasets = services.map((s, index) => {
Expand Down Expand Up @@ -385,7 +415,10 @@ class MeasureChart extends React.Component {
if (service) {
displayedValue = this.getValue(service, attribute);

if (attribute.startsWith("train_loss") && displayedValue !== "--") {
if (
attribute.startsWith("train_loss") &&
displayedValue !== "--"
) {
displayedValue = parseFloat(displayedValue);

if (typeof displayedValue.toFixed === "function") {
Expand Down

0 comments on commit 0c54546

Please sign in to comment.