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

Commit

Permalink
Fix bug of default metric for v0.3 (#304)
Browse files Browse the repository at this point in the history
* Fix bug of Default Metric and modifiy trials detail style

* update
  • Loading branch information
lvybriage authored and yds05 committed Nov 2, 2018
1 parent 80cebd8 commit bb5534c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
7 changes: 2 additions & 5 deletions src/webui/src/components/Overview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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
Expand All @@ -25,7 +25,6 @@ interface SessionState {
searchSpace: object;
status: string;
trialProfile: Experiment;
selNum: number;
option: object;
noData: string;
accuracyData: object;
Expand Down Expand Up @@ -68,7 +67,6 @@ class Overview extends React.Component<{}, SessionState> {
parameters: {}
}
}],
selNum: overviewItem,
option: {},
noData: '',
// accuracy
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down
15 changes: 13 additions & 2 deletions src/webui/src/components/overview/SuccessTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
19 changes: 15 additions & 4 deletions src/webui/src/components/trial-detail/TableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down Expand Up @@ -308,7 +319,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
}
return (
<pre id="allList" className="hyperpar">
{
{
isHasParameters
?
< JSONTree
Expand Down
1 change: 0 additions & 1 deletion src/webui/src/static/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ export const CONTROLTYPE = [
'TRIAL_CONCURRENCY',
'MAX_EXEC_DURATION'
];
export const overviewItem = 10;
Binary file modified src/webui/src/static/img/icon/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/webui/src/static/style/trialsDetail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
}

Expand Down

0 comments on commit bb5534c

Please sign in to comment.