Skip to content

Commit

Permalink
fix: fetch measures best values with pytorch keys
Browse files Browse the repository at this point in the history
measure keys may include suffixes added by pytorch.
  • Loading branch information
alx committed Jan 13, 2022
1 parent 82cf2b0 commit ebe70b8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/stores/modelRepositories/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,18 @@ export default class Repository {

if (
measure_hist &&
measure_hist[`${metricKey}_hist`] &&
measure_hist[`${metricKey}_hist`].length > 0
typeof Object.keys(measure_hist)
.find(k => k.startsWith(metricKey)) !== 'undefined'
) {

const metricHistKey = Object.keys(measure_hist)
.find(k => k.startsWith(metricKey))

if(['acc', 'accp', 'meaniou', 'map', 'f1'].includes(metricKey)) {
value = Math.max.apply(Math, measure_hist[`${metricKey}_hist`])
value = Math.max.apply(Math, measure_hist[metricHistKey])
} else {
// train_loss, L1_mean_error, mcll, eucll
value = Math.min.apply(Math, measure_hist[`${metricKey}_hist`])
value = Math.min.apply(Math, measure_hist[metricHistKey])
}
}

Expand Down

0 comments on commit ebe70b8

Please sign in to comment.