Commit bb5534ca authored by Lijiao's avatar Lijiao Committed by fishyds
Browse files

Fix bug of default metric for v0.3 (#304)

* Fix bug of Default Metric and modifiy trials detail style

* update
parent 80cebd84
import * as React from 'react'; import * as React from 'react';
import axios from 'axios'; import axios from 'axios';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import { MANAGER_IP, overviewItem } from '../static/const'; import { MANAGER_IP } from '../static/const';
import { import {
Experiment, TableObj, Experiment, TableObj,
Parameters, TrialNumber Parameters, TrialNumber
...@@ -25,7 +25,6 @@ interface SessionState { ...@@ -25,7 +25,6 @@ interface SessionState {
searchSpace: object; searchSpace: object;
status: string; status: string;
trialProfile: Experiment; trialProfile: Experiment;
selNum: number;
option: object; option: object;
noData: string; noData: string;
accuracyData: object; accuracyData: object;
...@@ -68,7 +67,6 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -68,7 +67,6 @@ class Overview extends React.Component<{}, SessionState> {
parameters: {} parameters: {}
} }
}], }],
selNum: overviewItem,
option: {}, option: {},
noData: '', noData: '',
// accuracy // accuracy
...@@ -169,7 +167,6 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -169,7 +167,6 @@ class Overview extends React.Component<{}, SessionState> {
}) })
.then(res => { .then(res => {
if (res.status === 200) { if (res.status === 200) {
const { selNum } = this.state;
const tableData = res.data; const tableData = res.data;
const topTableData: Array<TableObj> = []; const topTableData: Array<TableObj> = [];
const profile: TrialNumber = { const profile: TrialNumber = {
...@@ -252,7 +249,7 @@ class Overview extends React.Component<{}, SessionState> { ...@@ -252,7 +249,7 @@ class Overview extends React.Component<{}, SessionState> {
return NaN; return NaN;
} }
}); });
topTableData.length = Math.min(selNum, topTableData.length); topTableData.length = Math.min(10, topTableData.length);
if (this._isMounted) { if (this._isMounted) {
this.setState({ this.setState({
tableData: topTableData, tableData: topTableData,
......
...@@ -70,14 +70,25 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> { ...@@ -70,14 +70,25 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
dataIndex: 'acc', dataIndex: 'acc',
key: 'acc', key: 'acc',
render: (text: string, record: TableObj) => { render: (text: string, record: TableObj) => {
const accuracy = record.acc;
let wei = 0;
if (accuracy) {
if (accuracy.toString().indexOf('.') !== -1) {
wei = accuracy.toString().length - accuracy.toString().indexOf('.') - 1;
}
}
return ( return (
<div> <div>
{ {
record.acc record.acc
? ?
record.acc.toFixed(6) wei > 6
?
record.acc.toFixed(6)
:
record.acc
: :
record.acc 'NaN'
} }
</div> </div>
); );
......
...@@ -226,14 +226,25 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -226,14 +226,25 @@ class TableList extends React.Component<TableListProps, TableListState> {
width: 200, width: 200,
sorter: (a: TableObj, b: TableObj) => (a.acc as number) - (b.acc as number), sorter: (a: TableObj, b: TableObj) => (a.acc as number) - (b.acc as number),
render: (text: string, record: TableObj) => { render: (text: string, record: TableObj) => {
return( const accuracy = record.acc;
let wei = 0;
if (accuracy) {
if (accuracy.toString().indexOf('.') !== -1) {
wei = accuracy.toString().length - accuracy.toString().indexOf('.') - 1;
}
}
return (
<div> <div>
{ {
record.acc record.acc
? ?
record.acc.toFixed(6) wei > 6
?
record.acc.toFixed(6)
:
record.acc
: :
record.acc 'NaN'
} }
</div> </div>
); );
...@@ -308,7 +319,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -308,7 +319,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
} }
return ( return (
<pre id="allList" className="hyperpar"> <pre id="allList" className="hyperpar">
{ {
isHasParameters isHasParameters
? ?
< JSONTree < JSONTree
......
...@@ -13,4 +13,3 @@ export const CONTROLTYPE = [ ...@@ -13,4 +13,3 @@ export const CONTROLTYPE = [
'TRIAL_CONCURRENCY', 'TRIAL_CONCURRENCY',
'MAX_EXEC_DURATION' 'MAX_EXEC_DURATION'
]; ];
export const overviewItem = 10;
src/webui/src/static/img/icon/6.png

415 Bytes | W: | H:

src/webui/src/static/img/icon/6.png

326 Bytes | W: | H:

src/webui/src/static/img/icon/6.png
src/webui/src/static/img/icon/6.png
src/webui/src/static/img/icon/6.png
src/webui/src/static/img/icon/6.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -23,10 +23,13 @@ ...@@ -23,10 +23,13 @@
} }
} }
.panelTitle{ .panelTitle{
font-size: 18px; margin-right: 14px;
font-family: 'Segoe';
padding: 0 10px;
border-right: 2px solid #e8e8e8; border-right: 2px solid #e8e8e8;
span{
font-size: 18px;
font-family: 'Segoe';
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment