@@ -212,10 +212,20 @@ class MeasureChart extends React.Component {
212
212
} else if (
213
213
measure_hist &&
214
214
Object . keys ( measure_hist )
215
- . find ( k => k . startsWith ( attr ) )
215
+ . find ( k => {
216
+ return attr === "train_loss" ?
217
+ k . startsWith ( attr ) && k . indexOf ( "_test" ) === - 1
218
+ :
219
+ k . startsWith ( attr )
220
+ } )
216
221
) {
217
222
const attrKey = Object . keys ( measure_hist )
218
- . find ( k => k . startsWith ( attr ) )
223
+ . find ( k => {
224
+ return attr === "train_loss" ?
225
+ k . startsWith ( attr ) && k . indexOf ( "_test" ) === - 1
226
+ :
227
+ k . startsWith ( attr )
228
+ } )
219
229
value =
220
230
measure_hist [ attrKey ] [ measure_hist [ attrKey ] . length - 1 ] ;
221
231
}
@@ -241,10 +251,20 @@ class MeasureChart extends React.Component {
241
251
if (
242
252
measure_hist &&
243
253
Object . keys ( measure_hist )
244
- . find ( k => k . startsWith ( attr ) )
254
+ . find ( k => {
255
+ return attr === "train_loss" ?
256
+ k . startsWith ( attr ) && k . indexOf ( "_test" ) === - 1
257
+ :
258
+ k . startsWith ( attr )
259
+ } )
245
260
) {
246
261
const attrKey = Object . keys ( measure_hist )
247
- . find ( k => k . startsWith ( attr ) )
262
+ . find ( k => {
263
+ return attr === "train_loss" ?
264
+ k . startsWith ( attr ) && k . indexOf ( "_test" ) === - 1
265
+ :
266
+ k . startsWith ( attr )
267
+ } )
248
268
measures = toJS ( measure_hist [ attrKey ] ) ;
249
269
// Remove Infinity values from measure_hist
250
270
if ( measures . some ( x => x === Infinity ) ) {
@@ -302,10 +322,20 @@ class MeasureChart extends React.Component {
302
322
if (
303
323
measure_hist &&
304
324
Object . keys ( measure_hist )
305
- . find ( k => k . startsWith ( attr ) )
325
+ . find ( k => {
326
+ return attr === "train_loss" ?
327
+ k . startsWith ( attr ) && k . indexOf ( "_test" ) === - 1
328
+ :
329
+ k . startsWith ( attr )
330
+ } )
306
331
) {
307
332
const attrKey = Object . keys ( measure_hist )
308
- . find ( k => k . startsWith ( attr ) )
333
+ . find ( k => {
334
+ return attr === "train_loss" ?
335
+ k . startsWith ( attr ) && k . indexOf ( "_test" ) === - 1
336
+ :
337
+ k . startsWith ( attr )
338
+ } )
309
339
let labels = [ ] ,
310
340
measures = toJS ( measure_hist [ attrKey ] ) ,
311
341
datasets = services . map ( ( s , index ) => {
@@ -385,7 +415,10 @@ class MeasureChart extends React.Component {
385
415
if ( service ) {
386
416
displayedValue = this . getValue ( service , attribute ) ;
387
417
388
- if ( attribute . startsWith ( "train_loss" ) && displayedValue !== "--" ) {
418
+ if (
419
+ attribute . startsWith ( "train_loss" ) &&
420
+ displayedValue !== "--"
421
+ ) {
389
422
displayedValue = parseFloat ( displayedValue ) ;
390
423
391
424
if ( typeof displayedValue . toFixed === "function" ) {
0 commit comments