Unverified Commit e9040c9b authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Merge pull request #23 from microsoft/master

pull code
parents 256f27af ed63175c
...@@ -23,6 +23,7 @@ import random ...@@ -23,6 +23,7 @@ import random
from .env_vars import trial_env_vars from .env_vars import trial_env_vars
from . import trial from . import trial
from .nas_utils import classic_mode, enas_mode, oneshot_mode
__all__ = [ __all__ = [
...@@ -124,7 +125,9 @@ else: ...@@ -124,7 +125,9 @@ else:
funcs_args, funcs_args,
fixed_inputs, fixed_inputs,
optional_inputs, optional_inputs,
optional_input_size): optional_input_size,
mode='classic_mode',
tf=None):
'''execute the chosen function and inputs. '''execute the chosen function and inputs.
Below is an example of chosen function and inputs: Below is an example of chosen function and inputs:
{ {
...@@ -144,14 +147,38 @@ else: ...@@ -144,14 +147,38 @@ else:
fixed_inputs: fixed_inputs:
optional_inputs: dict of optional inputs optional_inputs: dict of optional inputs
optional_input_size: number of candidate inputs to be chosen optional_input_size: number of candidate inputs to be chosen
tf: tensorflow module
''' '''
mutable_block = _get_param(mutable_id) if mode == 'classic_mode':
chosen_layer = mutable_block[mutable_layer_id]["chosen_layer"] return classic_mode(mutable_id,
chosen_inputs = mutable_block[mutable_layer_id]["chosen_inputs"] mutable_layer_id,
real_chosen_inputs = [optional_inputs[input_name] for input_name in chosen_inputs] funcs,
layer_out = funcs[chosen_layer]([fixed_inputs, real_chosen_inputs], **funcs_args[chosen_layer]) funcs_args,
fixed_inputs,
return layer_out optional_inputs,
optional_input_size)
elif mode == 'enas_mode':
assert tf is not None, 'Internal Error: Tensorflow should not be None in enas_mode'
return enas_mode(mutable_id,
mutable_layer_id,
funcs,
funcs_args,
fixed_inputs,
optional_inputs,
optional_input_size,
tf)
elif mode == 'oneshot_mode':
assert tf is not None, 'Internal Error: Tensorflow should not be None in oneshot_mode'
return oneshot_mode(mutable_id,
mutable_layer_id,
funcs,
funcs_args,
fixed_inputs,
optional_inputs,
optional_input_size,
tf)
else:
raise RuntimeError('Unrecognized mode: %s' % mode)
def _get_param(key): def _get_param(key):
if trial._params is None: if trial._params is None:
......
...@@ -38,7 +38,13 @@ class SmartParamTestCase(TestCase): ...@@ -38,7 +38,13 @@ class SmartParamTestCase(TestCase):
'test_smartparam/choice3/choice': '[1, 2]', 'test_smartparam/choice3/choice': '[1, 2]',
'test_smartparam/choice4/choice': '{"a", 2}', 'test_smartparam/choice4/choice': '{"a", 2}',
'test_smartparam/func/function_choice': 'bar', 'test_smartparam/func/function_choice': 'bar',
'test_smartparam/lambda_func/function_choice': "lambda: 2*3" 'test_smartparam/lambda_func/function_choice': "lambda: 2*3",
'mutable_block_66':{
'mutable_layer_0':{
'chosen_layer': 'conv2D(size=5)',
'chosen_inputs': ['y']
}
}
} }
nni.trial._params = { 'parameter_id': 'test_trial', 'parameters': params } nni.trial._params = { 'parameter_id': 'test_trial', 'parameters': params }
...@@ -61,6 +67,13 @@ class SmartParamTestCase(TestCase): ...@@ -61,6 +67,13 @@ class SmartParamTestCase(TestCase):
val = nni.function_choice({"lambda: 2*3": lambda: 2*3, "lambda: 3*4": lambda: 3*4}, name = 'lambda_func', key='test_smartparam/lambda_func/function_choice') val = nni.function_choice({"lambda: 2*3": lambda: 2*3, "lambda: 3*4": lambda: 3*4}, name = 'lambda_func', key='test_smartparam/lambda_func/function_choice')
self.assertEqual(val, 6) self.assertEqual(val, 6)
def test_mutable_layer(self):
layer_out = nni.mutable_layer('mutable_block_66',
'mutable_layer_0', {'conv2D(size=3)': conv2D, 'conv2D(size=5)': conv2D}, {'conv2D(size=3)':
{'size':3}, 'conv2D(size=5)': {'size':5}}, [100], {'x':1,'y':2}, 1, 'classic_mode')
self.assertEqual(layer_out, [100, 2, 5])
def foo(): def foo():
return 'foo' return 'foo'
...@@ -68,6 +81,8 @@ def foo(): ...@@ -68,6 +81,8 @@ def foo():
def bar(): def bar():
return 'bar' return 'bar'
def conv2D(inputs, size=3):
return inputs[0] + inputs[1] + [size]
if __name__ == '__main__': if __name__ == '__main__':
main() main()
...@@ -127,7 +127,7 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -127,7 +127,7 @@ class Compare extends React.Component<CompareProps, {}> {
<td /> <td />
{Object.keys(idList).map(key => { {Object.keys(idList).map(key => {
return ( return (
<td className="value" key={key}>{idList[key]}</td> <td className="value idList" key={key}>{idList[key]}</td>
); );
})} })}
</tr> </tr>
...@@ -193,6 +193,7 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -193,6 +193,7 @@ class Compare extends React.Component<CompareProps, {}> {
destroyOnClose={true} destroyOnClose={true}
maskClosable={false} maskClosable={false}
width="90%" width="90%"
// centered={true}
> >
<Row>{this.intermediate()}</Row> <Row>{this.intermediate()}</Row>
<Row>{this.initColumn()}</Row> <Row>{this.initColumn()}</Row>
......
...@@ -353,8 +353,10 @@ class Overview extends React.Component<OverviewProps, OverviewState> { ...@@ -353,8 +353,10 @@ class Overview extends React.Component<OverviewProps, OverviewState> {
const indexarr: Array<number> = []; const indexarr: Array<number> = [];
Object.keys(sourcePoint).map(item => { Object.keys(sourcePoint).map(item => {
const items = sourcePoint[item]; const items = sourcePoint[item];
accarr.push(items.acc.default); if (items.acc !== undefined) {
indexarr.push(items.sequenceId); accarr.push(items.acc.default);
indexarr.push(items.sequenceId);
}
}); });
const accOption = { const accOption = {
// support max show 0.0000000 // support max show 0.0000000
......
...@@ -4,7 +4,7 @@ import axios from 'axios'; ...@@ -4,7 +4,7 @@ import axios from 'axios';
import { MANAGER_IP } from '../static/const'; import { MANAGER_IP } from '../static/const';
import MediaQuery from 'react-responsive'; import MediaQuery from 'react-responsive';
import { DOWNLOAD_IP } from '../static/const'; import { DOWNLOAD_IP } from '../static/const';
import { Row, Col, Menu, Dropdown, Icon, Select } from 'antd'; import { Row, Col, Menu, Dropdown, Icon, Select, Button } from 'antd';
const { SubMenu } = Menu; const { SubMenu } = Menu;
const { Option } = Select; const { Option } = Select;
import '../static/style/slideBar.scss'; import '../static/style/slideBar.scss';
...@@ -14,6 +14,7 @@ interface SliderState { ...@@ -14,6 +14,7 @@ interface SliderState {
version: string; version: string;
menuVisible: boolean; menuVisible: boolean;
navBarVisible: boolean; navBarVisible: boolean;
isdisabledFresh: boolean;
} }
interface SliderProps { interface SliderProps {
...@@ -29,7 +30,6 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -29,7 +30,6 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
public _isMounted = false; public _isMounted = false;
public divMenu: HTMLDivElement | null; public divMenu: HTMLDivElement | null;
public countOfMenu: number = 0;
public selectHTML: Select | null; public selectHTML: Select | null;
constructor(props: SliderProps) { constructor(props: SliderProps) {
...@@ -38,6 +38,7 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -38,6 +38,7 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
version: '', version: '',
menuVisible: false, menuVisible: false,
navBarVisible: false, navBarVisible: false,
isdisabledFresh: false
}; };
} }
...@@ -208,7 +209,6 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -208,7 +209,6 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
} }
menu = () => { menu = () => {
this.countOfMenu = 0;
return ( return (
<Menu onClick={this.handleMenuClick}> <Menu onClick={this.handleMenuClick}>
<Menu.Item key="1">Experiment Parameters</Menu.Item> <Menu.Item key="1">Experiment Parameters</Menu.Item>
...@@ -223,12 +223,9 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -223,12 +223,9 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
const { version } = this.state; const { version } = this.state;
const feedBackLink = `https://github.com/Microsoft/nni/issues/new?labels=${version}`; const feedBackLink = `https://github.com/Microsoft/nni/issues/new?labels=${version}`;
return ( return (
<Menu onClick={this.handleMenuClick} mode="inline"> <Menu onClick={this.handleMenuClick} className="menuModal">
<Menu.Item key="overview"><Link to={'/oview'}>Overview</Link></Menu.Item> <Menu.Item key="overview"><Link to={'/oview'}>Overview</Link></Menu.Item>
<Menu.Item key="detail"><Link to={'/detail'}>Trials detail</Link></Menu.Item> <Menu.Item key="detail"><Link to={'/detail'}>Trials detail</Link></Menu.Item>
<Menu.Item key="fresh">
<span className="fresh" onClick={this.fresh}><span>Fresh</span></span>
</Menu.Item>
<Menu.Item key="feedback"> <Menu.Item key="feedback">
<a href={feedBackLink} target="_blank">Feedback</a> <a href={feedBackLink} target="_blank">Feedback</a>
</Menu.Item> </Menu.Item>
...@@ -250,38 +247,42 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -250,38 +247,42 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
); );
} }
// nav bar <1299
showMenu = () => {
if (this.divMenu !== null) {
this.countOfMenu = this.countOfMenu + 1;
if (this.countOfMenu % 2 === 0) {
this.divMenu.setAttribute('class', 'hide');
} else {
this.divMenu.setAttribute('class', 'show');
}
}
}
select = () => { select = () => {
const { isdisabledFresh } = this.state;
return ( return (
<Select <div className="interval">
onSelect={this.getInterval} <Button
defaultValue="Refresh every 10s" className="fresh"
className="interval" onClick={this.fresh}
> type="ghost"
<Option value="close">Disable Auto Refresh</Option> disabled={isdisabledFresh}
<Option value="10">Refresh every 10s</Option> >
<Option value="20">Refresh every 20s</Option> <Icon type="sync" /><span>Refresh</span>
<Option value="30">Refresh every 30s</Option> </Button>
<Option value="60">Refresh every 1min</Option> <Select
</Select> onSelect={this.getInterval}
defaultValue="Refresh every 10s"
>
<Option value="close">Disable Auto Refresh</Option>
<Option value="10">Refresh every 10s</Option>
<Option value="20">Refresh every 20s</Option>
<Option value="30">Refresh every 30s</Option>
<Option value="60">Refresh every 1min</Option>
</Select>
</div>
); );
} }
fresh = (event: React.SyntheticEvent<EventTarget>) => { fresh = (event: React.SyntheticEvent<EventTarget>) => {
event.preventDefault(); event.preventDefault();
const whichPage = window.location.pathname; event.stopPropagation();
this.props.changeFresh(whichPage); if (this._isMounted) {
this.setState({ isdisabledFresh: true }, () => {
const whichPage = window.location.pathname;
this.props.changeFresh(whichPage);
setTimeout(() => { this.setState(() => ({ isdisabledFresh: false })); }, 1000);
});
}
} }
componentDidMount() { componentDidMount() {
...@@ -298,73 +299,75 @@ class SlideBar extends React.Component<SliderProps, SliderState> { ...@@ -298,73 +299,75 @@ class SlideBar extends React.Component<SliderProps, SliderState> {
const feed = `https://github.com/Microsoft/nni/issues/new?labels=${version}`; const feed = `https://github.com/Microsoft/nni/issues/new?labels=${version}`;
return ( return (
<Row> <Row>
<MediaQuery query="(min-width: 1299px)"> <Col span={18}>
<Row className="nav"> <MediaQuery query="(min-width: 1299px)">
<ul className="link"> <Row className="nav">
<li className="logo"> <ul className="link">
<li className="logo">
<Link to={'/oview'}>
<img
src={require('../static/img/logo2.png')}
style={{ width: 88 }}
alt="NNI logo"
/>
</Link>
</li>
<li className="tab firstTab">
<Link to={'/oview'} activeClassName="high">
Overview
</Link>
</li>
<li className="tab">
<Link to={'/detail'} activeClassName="high">
Trials detail
</Link>
</li>
<li className="feedback">
<Dropdown
className="dropdown"
overlay={this.menu()}
onVisibleChange={this.handleVisibleChange}
visible={menuVisible}
trigger={['click']}
>
<a className="ant-dropdown-link" href="#">
Download <Icon type="down" />
</a>
</Dropdown>
<a href={feed} target="_blank">
<img
src={require('../static/img/icon/issue.png')}
alt="NNI github issue"
/>
Feedback
</a>
<span className="version">Version: {version}</span>
</li>
</ul>
</Row>
</MediaQuery>
</Col>
<Col span={18}>
<MediaQuery query="(max-width: 1299px)">
<Row className="little">
<Col span={1} className="menu">
<Dropdown overlay={this.navigationBar()} trigger={['click']}>
<Icon type="unordered-list" className="more" />
</Dropdown>
</Col>
<Col span={14} className="logo">
<Link to={'/oview'}> <Link to={'/oview'}>
<img <img
src={require('../static/img/logo2.png')} src={require('../static/img/logo2.png')}
style={{ width: 88 }} style={{ width: 80 }}
alt="NNI logo" alt="NNI logo"
/> />
</Link> </Link>
</li> </Col>
<li className="tab firstTab"> </Row>
<Link to={'/oview'} activeClassName="high"> </MediaQuery>
Overview </Col>
</Link> <Col span={3}> {this.select()} </Col>
</li>
<li className="tab">
<Link to={'/detail'} activeClassName="high">
Trials detail
</Link>
</li>
<li className="feedback">
<span className="fresh" onClick={this.fresh}>
<Icon type="sync"/><span>Fresh</span>
</span>
<Dropdown
className="dropdown"
overlay={this.menu()}
onVisibleChange={this.handleVisibleChange}
visible={menuVisible}
trigger={['click']}
>
<a className="ant-dropdown-link" href="#">
Download <Icon type="down" />
</a>
</Dropdown>
<a href={feed} target="_blank">
<img
src={require('../static/img/icon/issue.png')}
alt="NNI github issue"
/>
Feedback
</a>
<span className="version">Version: {version}</span>
</li>
</ul>
</Row>
</MediaQuery>
<MediaQuery query="(max-width: 1299px)">
<Row className="little">
<Col span={6} className="menu">
<Icon type="unordered-list" className="more" onClick={this.showMenu} />
<div ref={div => this.divMenu = div} className="hide">{this.navigationBar()}</div>
</Col>
<Col span={10} className="logo">
<Link to={'/oview'}>
<img
src={require('../static/img/logo2.png')}
style={{ width: 88 }}
alt="NNI logo"
/>
</Link>
</Col>
</Row>
</MediaQuery>
{this.select()}
</Row> </Row>
); );
} }
......
...@@ -394,15 +394,13 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState> ...@@ -394,15 +394,13 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState>
</Col> </Col>
<Col span={14} className="right"> <Col span={14} className="right">
<Button <Button
type="primary" className="common"
className="tableButton editStyle"
onClick={this.tableList ? this.tableList.addColumn : this.test} onClick={this.tableList ? this.tableList.addColumn : this.test}
> >
Add column Add column
</Button> </Button>
<Button <Button
type="primary" className="mediateBtn common"
className="tableButton editStyle mediateBtn"
// use child-component tableList's function, the function is in child-component. // use child-component tableList's function, the function is in child-component.
onClick={this.tableList ? this.tableList.compareBtn : this.test} onClick={this.tableList ? this.tableList.compareBtn : this.test}
> >
......
...@@ -163,9 +163,9 @@ class Duration extends React.Component<DurationProps, DurationState> { ...@@ -163,9 +163,9 @@ class Duration extends React.Component<DurationProps, DurationState> {
} }
shouldComponentUpdate(nextProps: DurationProps, nextState: DurationState) { shouldComponentUpdate(nextProps: DurationProps, nextState: DurationState) {
const { whichGraph, source } = nextProps; const { whichGraph, source } = nextProps;
if (whichGraph === '3') { if (whichGraph === '3') {
const beforeSource = this.props.source; const beforeSource = this.props.source;
if (whichGraph !== this.props.whichGraph) { if (whichGraph !== this.props.whichGraph) {
return true; return true;
...@@ -174,13 +174,14 @@ class Duration extends React.Component<DurationProps, DurationState> { ...@@ -174,13 +174,14 @@ class Duration extends React.Component<DurationProps, DurationState> {
if (source.length !== beforeSource.length) { if (source.length !== beforeSource.length) {
return true; return true;
} }
if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) {
return true;
}
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) { if (beforeSource[beforeSource.length - 1] !== undefined) {
return true; if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) {
return true;
}
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) {
return true;
}
} }
} }
return false; return false;
......
...@@ -12,7 +12,7 @@ interface IntermediateState { ...@@ -12,7 +12,7 @@ interface IntermediateState {
eachIntermediateNum: number; // trial's intermediate number count eachIntermediateNum: number; // trial's intermediate number count
isLoadconfirmBtn: boolean; isLoadconfirmBtn: boolean;
isFilter: boolean; isFilter: boolean;
length: number; length: number;
clickCounts: number; // user filter intermediate click confirm btn's counts clickCounts: number; // user filter intermediate click confirm btn's counts
} }
...@@ -136,7 +136,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -136,7 +136,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name: 'Scape' name: 'metric'
} }
}; };
if (this._isMounted) { if (this._isMounted) {
...@@ -209,7 +209,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -209,7 +209,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
componentWillReceiveProps(nextProps: IntermediateProps, nextState: IntermediateState) { componentWillReceiveProps(nextProps: IntermediateProps, nextState: IntermediateState) {
const { isFilter, filterSource } = nextState; const { isFilter, filterSource } = nextState;
const { whichGraph, source } = nextProps; const { whichGraph, source } = nextProps;
if (whichGraph === '4') { if (whichGraph === '4') {
if (isFilter === true) { if (isFilter === true) {
const pointVal = this.pointInput !== null ? this.pointInput.value : ''; const pointVal = this.pointInput !== null ? this.pointInput.value : '';
...@@ -226,16 +226,14 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -226,16 +226,14 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
} }
shouldComponentUpdate(nextProps: IntermediateProps, nextState: IntermediateState) { shouldComponentUpdate(nextProps: IntermediateProps, nextState: IntermediateState) {
const { whichGraph } = nextProps; const { whichGraph, source } = nextProps;
const beforeGraph = this.props.whichGraph; const beforeGraph = this.props.whichGraph;
if (whichGraph === '4') { if (whichGraph === '4') {
const { source } = nextProps;
const { isFilter, length, clickCounts } = nextState; const { isFilter, length, clickCounts } = nextState;
const beforeLength = this.state.length; const beforeLength = this.state.length;
const beforeSource = this.state.detailSource; const beforeSource = this.props.source;
const beforeClickCounts = this.state.clickCounts; const beforeClickCounts = this.state.clickCounts;
if (isFilter !== this.state.isFilter) { if (isFilter !== this.state.isFilter) {
return true; return true;
} }
...@@ -243,7 +241,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -243,7 +241,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
if (clickCounts !== beforeClickCounts) { if (clickCounts !== beforeClickCounts) {
return true; return true;
} }
if (isFilter === false) { if (isFilter === false) {
if (whichGraph !== beforeGraph) { if (whichGraph !== beforeGraph) {
return true; return true;
...@@ -251,15 +249,20 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -251,15 +249,20 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
if (length !== beforeLength) { if (length !== beforeLength) {
return true; return true;
} }
if (source[source.length - 1].description.intermediate.length !== if (beforeSource.length !== source.length) {
beforeSource[beforeSource.length - 1].description.intermediate.length) {
return true; return true;
} }
if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) { if (beforeSource[beforeSource.length - 1] !== undefined) {
return true; if (source[source.length - 1].description.intermediate.length !==
} beforeSource[beforeSource.length - 1].description.intermediate.length) {
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) { return true;
return true; }
if (source[source.length - 1].duration !== beforeSource[beforeSource.length - 1].duration) {
return true;
}
if (source[source.length - 1].status !== beforeSource[beforeSource.length - 1].status) {
return true;
}
} }
} }
} }
...@@ -291,7 +294,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -291,7 +294,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
? ?
<div> <div>
<Col span={3}> <Col span={3}>
<span>Scape</span> <span>Step</span>
<input <input
placeholder="point" placeholder="point"
ref={input => this.pointInput = input} ref={input => this.pointInput = input}
......
.compare{ .compare{
width: 92%; width: 92%;
table-layout: fixed;
margin: 0 auto; margin: 0 auto;
color: #333; color: #333;
tr{ tr{
line-height: 30px; line-height: 30px;
border-bottom: 1px solid #ccc; }
tr:nth-of-type(even){
background-color: gainsboro;
} }
.column{ .column{
width: 124px; max-width: 124px;
padding-left: 18px; padding-left: 18px;
font-weight: 700; font-weight: 700;
} }
.value{ .value{
width: 152px; max-width: 152px;
padding-right: 18px; padding-right: 18px;
text-align: right; text-align: left;
}
.idList{
font-weight: 700;
} }
} }
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
margin: 0 auto; margin: 0 auto;
.right{ .right{
text-align: right; text-align: right;
.common{
border-radius: 0;
}
.common:hover{
color: #0071BC;
border-radius: 0;
}
} }
.entry{ .entry{
width: 120px; width: 120px;
...@@ -31,8 +38,9 @@ ...@@ -31,8 +38,9 @@
} }
} }
/* compare button style */
Button.mediateBtn{ Button.mediateBtn{
margin: 0 32px; margin: 0 2px 0 8px;
} }
/* each row's Intermediate btn -> Modal*/ /* each row's Intermediate btn -> Modal*/
......
...@@ -34,18 +34,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -34,18 +34,10 @@ $drowHoverBgColor: #e2e2e2;
.feedback{ .feedback{
position: fixed; position: fixed;
right: 19%; right: 26%;
line-height: $barHeight; line-height: $barHeight;
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
.fresh{
span{
margin: 0 10px 0 3px;
}
}
.fresh:hover{
cursor: pointer;
}
a{ a{
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
...@@ -60,6 +52,17 @@ $drowHoverBgColor: #e2e2e2; ...@@ -60,6 +52,17 @@ $drowHoverBgColor: #e2e2e2;
} }
} }
/* refresh button */
.fresh{
border: none;
color: #fff;
font-size: 16px;
padding: 0;
}
.fresh:hover{
color: #fff;
}
.link li{ .link li{
float: left; float: left;
} }
...@@ -70,8 +73,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -70,8 +73,10 @@ $drowHoverBgColor: #e2e2e2;
} }
.interval{ .interval{
position: fixed; position: fixed;
right: 7%; right: 6%;
top: 12px; top: 12px;
font-size: 16px;
color: #fff;
.ant-select-selection{ .ant-select-selection{
background-color: transparent; background-color: transparent;
border: none; border: none;
...@@ -82,6 +87,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -82,6 +87,10 @@ $drowHoverBgColor: #e2e2e2;
.ant-select-arrow{ .ant-select-arrow{
color: #fff; color: #fff;
} }
.ant-btn-ghost[disabled]{
background-color: transparent;
color: #fff;
}
} }
/* set select bgcolor */ /* set select bgcolor */
.ant-select-dropdown-menu{ .ant-select-dropdown-menu{
...@@ -99,22 +108,30 @@ $drowHoverBgColor: #e2e2e2; ...@@ -99,22 +108,30 @@ $drowHoverBgColor: #e2e2e2;
padding: 0; padding: 0;
background-color: $drowBgColor; background-color: $drowBgColor;
border-radius: 0; border-radius: 0;
.ant-dropdown-menu-item:hover{ .ant-dropdown-menu-item{
font-size: 16px;
}
.ant-dropdown-menu-item:hover, .ant-dropdown-menu-submenu:hover{
background-color: $drowHoverBgColor; background-color: $drowHoverBgColor;
} }
} }
} }
.ant-dropdown-menu-sub{
padding: 0;
background-color: $drowBgColor;
border-radius: 0;
.ant-dropdown-menu-item:hover{
background-color: $drowHoverBgColor;
}
}
/* nav style*/ /* nav style*/
.little{ .little{
width: 100%; width: 90%;
.menu{ .menu{
.show{ margin-left: 33px;
display: block;
}
.hide{
display: none;
}
.more{ .more{
color: #fff; color: #fff;
font-size: 24px; font-size: 24px;
...@@ -125,6 +142,10 @@ $drowHoverBgColor: #e2e2e2; ...@@ -125,6 +142,10 @@ $drowHoverBgColor: #e2e2e2;
} }
} }
.logo{ .logo{
text-align: center; text-align: right;
} }
} }
.menuModal{
width: 198px;
}
authorName: nni
experimentName: default_test
maxExecDuration: 5m
maxTrialNum: 2
trialConcurrency: 1
searchSpacePath: search_space.json
tuner:
builtinTunerName: GPTuner
classArgs:
optimize_mode: maximize
utility: 'ei'
kappa: 5.0
xi: 0.0
nu: 2.5
alpha: 1e-6
cold_start_num: 10
selection_num_warm_up: 100000
selection_num_starting_points: 250
assessor:
builtinAssessorName: Medianstop
classArgs:
optimize_mode: maximize
trial:
codeDir: ../../../examples/trials/mnist
command: python3 mnist.py --batch_num 100
gpuNum: 0
useAnnotation: false
multiPhase: false
multiThread: false
trainingServicePlatform: local
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
## 问题 ## 问题
* 使用了私有 API 来检测是否 Tuner 和 Assessor 成功结束。 * 使用了私有 API 来检测是否 Tuner 和 Assessor 成功结束。
* RESTful 服务的输出未测试。 * RESTful 服务的输出未测试。
* 远程计算机训练服务没有测试。 * 远程计算机训练服务没有测试。
\ No newline at end of file
...@@ -18,7 +18,7 @@ jobs: ...@@ -18,7 +18,7 @@ jobs:
displayName: 'generate config files' displayName: 'generate config files'
- script: | - script: |
cd test cd test
python config_test.py --ts local --local_gpu --exclude smac,bohb python config_test.py --ts local --local_gpu --exclude smac,bohb,multi_phase_batch,multi_phase_grid
displayName: 'Examples and advanced features tests on local machine' displayName: 'Examples and advanced features tests on local machine'
- script: | - script: |
cd test cd test
......
...@@ -31,7 +31,7 @@ jobs: ...@@ -31,7 +31,7 @@ jobs:
displayName: 'Built-in tuners / assessors tests' displayName: 'Built-in tuners / assessors tests'
- script: | - script: |
cd test cd test
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts local --local_gpu PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts local --local_gpu --exclude multi_phase_batch,multi_phase_grid
displayName: 'Examples and advanced features tests on local machine' displayName: 'Examples and advanced features tests on local machine'
- script: | - script: |
cd test cd test
......
...@@ -65,5 +65,5 @@ jobs: ...@@ -65,5 +65,5 @@ jobs:
python --version python --version
python generate_ts_config.py --ts pai --pai_host $(pai_host) --pai_user $(pai_user) --pai_pwd $(pai_pwd) --vc $(pai_virtual_cluster) --nni_docker_image $(docker_image) --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip) python generate_ts_config.py --ts pai --pai_host $(pai_host) --pai_user $(pai_user) --pai_pwd $(pai_pwd) --vc $(pai_virtual_cluster) --nni_docker_image $(docker_image) --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip)
python config_test.py --ts pai --exclude multi_phase,smac,bohb python config_test.py --ts pai --exclude multi_phase,smac,bohb,multi_phase_batch,multi_phase_grid
displayName: 'Examples and advanced features tests on pai' displayName: 'Examples and advanced features tests on pai'
\ No newline at end of file
...@@ -75,5 +75,5 @@ jobs: ...@@ -75,5 +75,5 @@ jobs:
python3 generate_ts_config.py --ts pai --pai_host $(pai_host) --pai_user $(pai_user) --pai_pwd $(pai_pwd) --vc $(pai_virtual_cluster) \ python3 generate_ts_config.py --ts pai --pai_host $(pai_host) --pai_user $(pai_user) --pai_pwd $(pai_pwd) --vc $(pai_virtual_cluster) \
--nni_docker_image $TEST_IMG --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip) --nni_docker_image $TEST_IMG --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip)
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts pai --exclude multi_phase PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts pai --exclude multi_phase_batch,multi_phase_grid
displayName: 'integration test' displayName: 'integration test'
...@@ -39,7 +39,7 @@ jobs: ...@@ -39,7 +39,7 @@ jobs:
cd test cd test
python generate_ts_config.py --ts remote --remote_user $(docker_user) --remote_host $(remote_host) --remote_port $(Get-Content port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip) python generate_ts_config.py --ts remote --remote_user $(docker_user) --remote_host $(remote_host) --remote_port $(Get-Content port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip)
Get-Content training_service.yml Get-Content training_service.yml
python config_test.py --ts remote --exclude cifar10,smac,bohb python config_test.py --ts remote --exclude cifar10,smac,bohb,multi_phase_batch,multi_phase_grid
displayName: 'integration test' displayName: 'integration test'
- task: SSH@0 - task: SSH@0
inputs: inputs:
......
...@@ -52,7 +52,7 @@ jobs: ...@@ -52,7 +52,7 @@ jobs:
python3 generate_ts_config.py --ts remote --remote_user $(docker_user) --remote_host $(remote_host) \ python3 generate_ts_config.py --ts remote --remote_user $(docker_user) --remote_host $(remote_host) \
--remote_port $(cat port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip) --remote_port $(cat port) --remote_pwd $(docker_pwd) --nni_manager_ip $(nni_manager_ip)
cat training_service.yml cat training_service.yml
PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts remote --exclude cifar10 PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts remote --exclude cifar10,multi_phase_batch,multi_phase_grid
displayName: 'integration test' displayName: 'integration test'
- task: SSH@0 - task: SSH@0
inputs: inputs:
......
...@@ -27,7 +27,7 @@ NNI 中,有 4 种类型的 Annotation; ...@@ -27,7 +27,7 @@ NNI 中,有 4 种类型的 Annotation;
**参数** **参数**
- **sampling_algo**: 指定搜索空间的采样算法。 可将其换成 NNI 支持的其它采样函数,函数要以 `nni.` 开头。例如,`choice``uniform`,详见 [SearchSpaceSpec](https://nni.readthedocs.io/zh/latest/SearchSpaceSpec.html) - **sampling_algo**: 指定搜索空间的采样算法。 可将其换成 NNI 支持的其它采样函数,函数要以 `nni.` 开头。例如,`choice``uniform`,详见 [SearchSpaceSpec](https://nni.readthedocs.io/zh/latest/SearchSpaceSpec.html)
- **name**: 将被赋值的变量名称。 注意,此参数应该与下面一行等号左边的值相同。 - **name**: 将被赋值的变量名称。 注意,此参数应该与下面一行等号左边的值相同。
NNI 支持如下 10 种类型来表示搜索空间: NNI 支持如下 10 种类型来表示搜索空间:
......
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