Commit 4c12435d authored by Lijiao's avatar Lijiao Committed by fishyds
Browse files

webui logpath and document (#135)

* Add webui document and logpath as a href

* fix tslint

* fix comments by Chengmin
parent 36b583b7
# WebUI
## View summary page
Click the tab "Overview".
* See the experiment parameters.
* See search_space json.
* See good performance trial.
![](./img/overview.jpg)
## View job accuracy
Click the tab "Optimization Progress" to see the point graph of all trials. Hover every point to see its specific accuracy.
![](./img/accuracy.jpg)
## View hyper parameter
Click the tab "Hyper Parameter" to see the parallel graph.
* You can select the percentage to see top trials.
* Choose two axis to swap its positions
![](./img/searchspace.jpg)
## View trial status
Click the tab "Trial Status" to see the status of the all trials. Specifically:
* Trial duration: trial's duration in the bar graph.
* Trial detail: trial's id, trial's duration, start time, end time, status, accuracy and search space file.
![](./img/openRow.jpg)
* Kill: you can kill a job that status is running.
* Tensor: you can see a job in the tensorflow graph, it will link to the Tensorboard page.
![](./img/trialStatus.jpg)
* Intermediate Result Graph.
![](./img/intermediate.jpg)
## Control
Click the tab "Control" to add a new trial or update the search_space file and some experiment parameters.
![](./img/control.jpg)
## Feedback
[Known Issues](https://github.com/Microsoft/nni/issues).
\ No newline at end of file
# webui # WebUI
NNI is a research platform for metalearning. It provides easy-to-use interface so that you could perform neural architecture search, hyperparameter optimization and optimizer design for your own problems and models. ## View summary page
Web UI allows user to monitor the status of the NNI system using a graphical interface.
## Deployment
### To start the webui
> $ yarn
> $ yarn start
## Usage
### View summary page
Click the tab "Overview". Click the tab "Overview".
* See the experiment parameters.
* See good performance trial. * See good performance trial.
* See search_space json. * See search_space json.
### View job accuracy ## View job accuracy
Click the tab "Optimization Progress" to see the point graph of all trials. Hover every point to see its specific accuracy. Click the tab "Optimization Progress" to see the point graph of all trials. Hover every point to see its specific accuracy.
### View hyper parameter ## View hyper parameter
Click the tab "Hyper Parameter" to see the parallel graph. Click the tab "Hyper Parameter" to see the parallel graph.
* You can select the percentage to cut down some lines. * You can select the percentage to see top trials.
* Choose two axis to swap its positions * Choose two axis to swap its positions
### View trial status ## View trial status
Click the tab "Trial Status" to see the status of the all trials. Specifically: Click the tab "Trial Status" to see the status of the all trials. Specifically:
* Running trial: running trial's duration in the bar graph. * Trial duration: trial's duration in the bar graph.
* Trial detail: trial's id, trial's duration, start time, end time, status and accuracy. * Trial detail: trial's id, trial's duration, start time, end time, status, accuracy and search space file.
* Kill: you can kill a job that status is running. * Kill: you can kill a job that status is running.
* Tensor: you can see a job in the tensorflow graph, it will link to the Tensorboard page. * Tensor: you can see a job in the tensorflow graph, it will link to the Tensorboard page.
### Control ## Control
Click the tab "Control" to add a new trial or update the search_space file and some experiment parameters. Click the tab "Control" to add a new trial or update the search_space file and some experiment parameters.
### View Tensorboard Graph ## Feedback
Click the tab "Tensorboard" to see a job in the tensorflow graph. [Known Issues](https://github.com/Microsoft/nni/issues).
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"antd": "^3.8.1", "antd": "^3.9.3",
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"echarts": "^4.1.0", "echarts": "^4.1.0",
......
...@@ -5,6 +5,7 @@ import { MANAGER_IP, overviewItem } from '../const'; ...@@ -5,6 +5,7 @@ import { MANAGER_IP, overviewItem } from '../const';
const Option = Select.Option; const Option = Select.Option;
import JSONTree from 'react-json-tree'; import JSONTree from 'react-json-tree';
require('../style/sessionpro.css'); require('../style/sessionpro.css');
require('../style/logPath.css');
interface TableObj { interface TableObj {
key: number; key: number;
...@@ -14,12 +15,13 @@ interface TableObj { ...@@ -14,12 +15,13 @@ interface TableObj {
end: string; end: string;
status: string; status: string;
acc?: number; acc?: number;
description: object; description: Parameters;
} }
interface Parameters { interface Parameters {
parameters: object; parameters: object;
logPath?: string; logPath?: string;
isLink?: boolean;
} }
interface Experiment { interface Experiment {
...@@ -76,7 +78,9 @@ class Sessionpro extends React.Component<{}, SessionState> { ...@@ -76,7 +78,9 @@ class Sessionpro extends React.Component<{}, SessionState> {
end: '', end: '',
status: '', status: '',
acc: 0, acc: 0,
description: {} description: {
parameters: {}
}
}], }],
selNum: overviewItem, selNum: overviewItem,
option: {}, option: {},
...@@ -162,6 +166,10 @@ class Sessionpro extends React.Component<{}, SessionState> { ...@@ -162,6 +166,10 @@ class Sessionpro extends React.Component<{}, SessionState> {
desJobDetail.parameters = JSON.parse(tableData[item].hyperParameters).parameters; desJobDetail.parameters = JSON.parse(tableData[item].hyperParameters).parameters;
if (tableData[item].logPath !== undefined) { if (tableData[item].logPath !== undefined) {
desJobDetail.logPath = tableData[item].logPath; desJobDetail.logPath = tableData[item].logPath;
const isSessionLink = /^http/gi.test(tableData[item].logPath);
if (isSessionLink) {
desJobDetail.isLink = true;
}
} }
topTableData.push({ topTableData.push({
key: topTableData.length, key: topTableData.length,
...@@ -261,14 +269,35 @@ class Sessionpro extends React.Component<{}, SessionState> { ...@@ -261,14 +269,35 @@ class Sessionpro extends React.Component<{}, SessionState> {
}]; }];
const openRow = (record: TableObj) => { const openRow = (record: TableObj) => {
const openRowDataSource = {
parameters: record.description.parameters
};
let isLogLink: boolean = false;
const logPathRow = record.description.logPath;
if (record.description.isLink !== undefined) {
isLogLink = true;
}
return ( return (
<pre id="description" className="jsontree"> <pre id="description" className="jsontree">
<JSONTree <JSONTree
hideRoot={true} hideRoot={true}
shouldExpandNode={() => true} // default expandNode shouldExpandNode={() => true} // default expandNode
getItemString={() => (<span />)} // remove the {} items getItemString={() => (<span />)} // remove the {} items
data={record.description} data={openRowDataSource}
/> />
{
isLogLink
?
<div className="logpath">
<span className="logName">logPath: </span>
<a className="logContent logHref" href={logPathRow} target="_blank">{logPathRow}</a>
</div>
:
<div className="logpath">
<span className="logName">logPath: </span>
<span className="logContent">{logPathRow}</span>
</div>
}
</pre> </pre>
); );
}; };
......
...@@ -11,13 +11,13 @@ class SlideBar extends React.Component<{}, {}> { ...@@ -11,13 +11,13 @@ class SlideBar extends React.Component<{}, {}> {
<ul className="nav"> <ul className="nav">
<li> <li>
<IndexLink to={'/oview'} activeClassName="high"> <IndexLink to={'/oview'} activeClassName="high">
<Icon className="icon" type="dot-chart" />Overview <Icon className="icon" type="experiment" theme="outlined" />Overview
<Icon className="floicon" type="right" /> <Icon className="floicon" type="right" />
</IndexLink> </IndexLink>
</li> </li>
<li> <li>
<Link to={'/all'} activeClassName="high"> <Link to={'/all'} activeClassName="high">
<Icon className="icon" type="message" />Optimization Progress <Icon className="icon" type="dot-chart" />Optimization Progress
<Icon className="floicon" type="right" /> <Icon className="floicon" type="right" />
</Link> </Link>
</li> </li>
...@@ -39,6 +39,11 @@ class SlideBar extends React.Component<{}, {}> { ...@@ -39,6 +39,11 @@ class SlideBar extends React.Component<{}, {}> {
<Icon className="floicon" type="right" /> <Icon className="floicon" type="right" />
</Link> </Link>
</li> </li>
<li>
<a href="https://github.com/Microsoft/nni/issues" target="_blank">
<Icon className="icon" type="smile" theme="outlined" />Feedback
</a>
</li>
</ul> </ul>
</div> </div>
); );
......
...@@ -12,6 +12,7 @@ require('echarts/lib/chart/scatter'); ...@@ -12,6 +12,7 @@ require('echarts/lib/chart/scatter');
require('echarts/lib/component/tooltip'); require('echarts/lib/component/tooltip');
require('echarts/lib/component/title'); require('echarts/lib/component/title');
require('../style/trialStatus.css'); require('../style/trialStatus.css');
require('../style/logPath.css');
echarts.registerTheme('my_theme', { echarts.registerTheme('my_theme', {
color: '#3c8dbc' color: '#3c8dbc'
}); });
...@@ -19,6 +20,7 @@ echarts.registerTheme('my_theme', { ...@@ -19,6 +20,7 @@ echarts.registerTheme('my_theme', {
interface DescObj { interface DescObj {
parameters: Object; parameters: Object;
logPath?: string; logPath?: string;
isLink?: boolean;
} }
interface TableObj { interface TableObj {
...@@ -238,6 +240,10 @@ class TrialStatus extends React.Component<{}, TabState> { ...@@ -238,6 +240,10 @@ class TrialStatus extends React.Component<{}, TabState> {
} }
if (trialJobs[item].logPath !== undefined) { if (trialJobs[item].logPath !== undefined) {
desc.logPath = trialJobs[item].logPath; desc.logPath = trialJobs[item].logPath;
const isHyperLink = /^http/gi.test(trialJobs[item].logPath);
if (isHyperLink) {
desc.isLink = true;
}
} }
if (trialJobs[item].finalMetricData !== undefined) { if (trialJobs[item].finalMetricData !== undefined) {
acc = parseFloat(trialJobs[item].finalMetricData.data); acc = parseFloat(trialJobs[item].finalMetricData.data);
...@@ -472,14 +478,35 @@ class TrialStatus extends React.Component<{}, TabState> { ...@@ -472,14 +478,35 @@ class TrialStatus extends React.Component<{}, TabState> {
]; ];
const openRow = (record: TableObj) => { const openRow = (record: TableObj) => {
const parametersRow = {
parameters: record.description.parameters
};
let isLogLink: boolean = false;
const logPathRow = record.description.logPath;
if (record.description.isLink !== undefined) {
isLogLink = true;
}
return ( return (
<pre className="hyperpar"> <pre className="hyperpar">
<JSONTree <JSONTree
hideRoot={true} hideRoot={true}
shouldExpandNode={() => true} // default expandNode shouldExpandNode={() => true} // default expandNode
getItemString={() => (<span />)} // remove the {} items getItemString={() => (<span />)} // remove the {} items
data={record.description} data={parametersRow}
/> />
{
isLogLink
?
<div className="logpath">
<span className="logName">logPath: </span>
<a className="logContent logHref" href={logPathRow} target="_blank">{logPathRow}</a>
</div>
:
<div className="logpath">
<span className="logName">logPath: </span>
<span className="logContent">{logPathRow}</span>
</div>
}
<Button <Button
type="primary" type="primary"
className="tableButton" className="tableButton"
......
.logpath{
margin-bottom: 10px;
margin-left: 10px;
}
.logName{
color: #268BD2;
}
.logContent{
color: #333;
}
.logHref:hover{
color: blue;
text-decoration: underline;
}
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
.nav .icon{ .nav .icon{
padding-left: 13px; padding-left: 13px;
padding-right: 13px; padding-right: 13px;
font-size: 18px;
} }
.nav .floicon { .nav .floicon {
font-size: 16px; font-size: 16px;
......
...@@ -32,23 +32,6 @@ pre.hyperpar{ ...@@ -32,23 +32,6 @@ pre.hyperpar{
float: right; float: right;
margin-right: 30px; margin-right: 30px;
} }
/* the pagination of next and prev */
.ant-pagination-prev .ant-pagination-item-link:after{
content: "Previous";
display: block;
font-size: 14px;
color: #333;
padding-left: 5px;
padding-right: 5px;
}
.ant-pagination-next .ant-pagination-item-link:after {
content: "NEXT";
display: block;
font-size: 14px;
color: #333;
padding-left: 5px;
padding-right: 5px;
}
Button.tableButton{ Button.tableButton{
background: #3c8dbc; background: #3c8dbc;
border-color: #3c8dbc; border-color: #3c8dbc;
......
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