-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
@@ -99,14 +102,22 @@ class App extends React.Component<{}, AppState> { | |||
this.setState({ bestTrialEntries: entries }); | |||
} | |||
|
|||
shouldComponentUpdate(nextProps: any, nextState: AppState): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If don't use shouldComponentUpdate, parent App.tsx component will refresh three times when experiment done, and then child components will also refresh. And App.tsx's shouldComponentUdate only watch a boolean value.
@@ -177,8 +187,7 @@ class App extends React.Component<{}, AppState> { | |||
// experiment status and /trial-jobs api's status could decide website update | |||
if (['DONE', 'ERROR', 'STOPPED'].includes(EXPERIMENT.status) || TRIALS.jobListError()) { | |||
// experiment finished, refresh once more to ensure consistency | |||
this.setState({ interval: 0 }); | |||
this.lastRefresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote lastRefresh
because due to async nature when experiment status become DONE
, some state may have not updated to their final value yet. For example maybe the last trial is still running at previous /trial-jobs
REST call.
@@ -84,15 +84,18 @@ const getFinalResult = (final?: MetricDataRecord[]): number => { | |||
} | |||
}; | |||
|
|||
function isNaNorInfinity(val: number): boolean { | |||
return Object.is(val, NaN) || Object.is(val, Infinity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Number.isNaN
and Number.isFinite
is more clear for this purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
let accuracy; | ||
if(this.acc !== undefined && this.acc.default !== undefined){ | ||
if(typeof this.acc.default === 'number'){ | ||
accuracy = JSON5.parse(this.acc.default); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix this state: when user give final result as {tensor: xxx, data: xxx}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to parse a number?
if (tempHyper === undefined) { | ||
throw new Map([['error', 'This trial\'s parameters are not available.']]); | ||
if (this.info === undefined || this.info.hyperParameters === undefined) { | ||
throw new Map(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why throw a Map
?
* update * update * Fix metrics for type other than number * update * change master version TableList.tsx * revert unuseful change Co-authored-by: Lijiao <Lijiaoa@outlook.com> Co-authored-by: Lijiao <1425861283@qq.com> Co-authored-by: Yuge Zhang <scottyugochang@gmail.com> (cherry picked from commit e2a8689)
No description provided.