Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

deal with all type metrics #2782

Merged
merged 6 commits into from
Aug 12, 2020
Merged

Conversation

Lijiaoa
Copy link
Contributor

@Lijiaoa Lijiaoa commented Aug 12, 2020

No description provided.

@ultmaster ultmaster mentioned this pull request Aug 12, 2020
66 tasks
@Lijiaoa Lijiaoa closed this Aug 12, 2020
@Lijiaoa Lijiaoa reopened this Aug 12, 2020
@Lijiaoa Lijiaoa mentioned this pull request Aug 12, 2020
2 tasks
@@ -99,14 +102,22 @@ class App extends React.Component<{}, AppState> {
this.setState({ bestTrialEntries: entries });
}

shouldComponentUpdate(nextProps: any, nextState: AppState): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this...

Copy link
Contributor Author

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();
Copy link
Contributor

@liuzhe-lz liuzhe-lz Aug 12, 2020

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

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}

Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why throw a Map

@ultmaster ultmaster merged commit e2a8689 into microsoft:master Aug 12, 2020
LovPe pushed a commit to LovPe/nni that referenced this pull request Aug 17, 2020
* 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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants