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

Fix bug of default metric for v0.3 #304

Merged
merged 2 commits into from
Nov 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, AccurPoint, TrialNumber
Expand All @@ -28,7 +28,6 @@ interface SessionState {
searchSpace: object;
status: string;
trialProfile: Experiment;
selNum: number;
option: object;
noData: string;
accuracyData: object;
Expand Down Expand Up @@ -72,7 +71,6 @@ class Overview extends React.Component<{}, SessionState> {
parameters: {}
}
}],
selNum: overviewItem,
option: {},
noData: '',
// accuracy
Expand Down Expand Up @@ -173,7 +171,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 @@ -248,7 +245,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 @@ -227,14 +227,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 @@ -309,7 +320,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