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 axios from 'axios';
import { Row, Col } from 'antd';
import { MANAGER_IP, overviewItem } from '../static/const';
import { MANAGER_IP } from '../static/const';
import {
Experiment, TableObj,
Parameters, TrialNumber
......@@ -25,7 +25,6 @@ interface SessionState {
searchSpace: object;
status: string;
trialProfile: Experiment;
selNum: number;
option: object;
noData: string;
accuracyData: object;
......@@ -68,7 +67,6 @@ class Overview extends React.Component<{}, SessionState> {
parameters: {}
}
}],
selNum: overviewItem,
option: {},
noData: '',
// accuracy
......@@ -169,7 +167,6 @@ class Overview extends React.Component<{}, SessionState> {
})
.then(res => {
if (res.status === 200) {
const { selNum } = this.state;
const tableData = res.data;
const topTableData: Array<TableObj> = [];
const profile: TrialNumber = {
......@@ -252,7 +249,7 @@ class Overview extends React.Component<{}, SessionState> {
return NaN;
}
});
topTableData.length = Math.min(selNum, topTableData.length);
topTableData.length = Math.min(10, topTableData.length);
if (this._isMounted) {
this.setState({
tableData: topTableData,
......
......@@ -70,14 +70,25 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
dataIndex: 'acc',
key: 'acc',
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 (
<div>
{
record.acc
?
record.acc.toFixed(6)
wei > 6
?
record.acc.toFixed(6)
:
record.acc
:
record.acc
'NaN'
}
</div>
);
......
......@@ -226,14 +226,25 @@ class TableList extends React.Component<TableListProps, TableListState> {
width: 200,
sorter: (a: TableObj, b: TableObj) => (a.acc as number) - (b.acc as number),
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>
{
record.acc
?
record.acc.toFixed(6)
wei > 6
?
record.acc.toFixed(6)
:
record.acc
:
record.acc
'NaN'
}
</div>
);
......@@ -308,7 +319,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
}
return (
<pre id="allList" className="hyperpar">
{
{
isHasParameters
?
< JSONTree
......
......@@ -13,4 +13,3 @@ export const CONTROLTYPE = [
'TRIAL_CONCURRENCY',
'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 @@
}
}
.panelTitle{
font-size: 18px;
font-family: 'Segoe';
padding: 0 10px;
margin-right: 14px;
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