Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
6e2c08db
Commit
6e2c08db
authored
Apr 19, 2019
by
Lijiao
Committed by
SparkSnail
Apr 19, 2019
Browse files
Support multiphase experiment (#998)
Support multiphase experiment
parent
e6b3828c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
22 deletions
+60
-22
src/webui/src/components/Overview.tsx
src/webui/src/components/Overview.tsx
+13
-5
src/webui/src/components/TrialsDetail.tsx
src/webui/src/components/TrialsDetail.tsx
+12
-5
src/webui/src/components/overview/SuccessTable.tsx
src/webui/src/components/overview/SuccessTable.tsx
+3
-1
src/webui/src/components/public-child/OpenRow.tsx
src/webui/src/components/public-child/OpenRow.tsx
+21
-6
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+3
-1
src/webui/src/static/function.ts
src/webui/src/static/function.ts
+4
-4
src/webui/src/static/style/overview.scss
src/webui/src/static/style/overview.scss
+4
-0
No files found.
src/webui/src/components/Overview.tsx
View file @
6e2c08db
...
@@ -36,6 +36,7 @@ interface OverviewState {
...
@@ -36,6 +36,7 @@ interface OverviewState {
titleMinbgcolor
?:
string
;
titleMinbgcolor
?:
string
;
// trial stdout is content(false) or link(true)
// trial stdout is content(false) or link(true)
isLogCollection
:
boolean
;
isLogCollection
:
boolean
;
isMultiPhase
:
boolean
;
}
}
class
Overview
extends
React
.
Component
<
{},
OverviewState
>
{
class
Overview
extends
React
.
Component
<
{},
OverviewState
>
{
...
@@ -80,7 +81,8 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -80,7 +81,8 @@ class Overview extends React.Component<{}, OverviewState> {
totalCurrentTrial
:
0
totalCurrentTrial
:
0
},
},
isTop10
:
true
,
isTop10
:
true
,
isLogCollection
:
false
isLogCollection
:
false
,
isMultiPhase
:
false
};
};
}
}
...
@@ -102,6 +104,8 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -102,6 +104,8 @@ class Overview extends React.Component<{}, OverviewState> {
// default logCollection is true
// default logCollection is true
const
logCollection
=
res
.
data
.
params
.
logCollection
;
const
logCollection
=
res
.
data
.
params
.
logCollection
;
let
expLogCollection
:
boolean
=
false
;
let
expLogCollection
:
boolean
=
false
;
const
isMultiy
:
boolean
=
res
.
data
.
params
.
multiPhase
!==
undefined
?
res
.
data
.
params
.
multiPhase
:
false
;
const
optimizeMode
=
res
.
data
.
params
.
tuner
.
classArgs
.
optimize_mode
;
const
optimizeMode
=
res
.
data
.
params
.
tuner
.
classArgs
.
optimize_mode
;
if
(
optimizeMode
!==
undefined
)
{
if
(
optimizeMode
!==
undefined
)
{
if
(
optimizeMode
===
'
minimize
'
)
{
if
(
optimizeMode
===
'
minimize
'
)
{
...
@@ -165,7 +169,8 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -165,7 +169,8 @@ class Overview extends React.Component<{}, OverviewState> {
experimentAPI
:
res
.
data
,
experimentAPI
:
res
.
data
,
trialProfile
:
trialPro
[
0
],
trialProfile
:
trialPro
[
0
],
searchSpace
:
searchSpace
,
searchSpace
:
searchSpace
,
isLogCollection
:
expLogCollection
isLogCollection
:
expLogCollection
,
isMultiPhase
:
isMultiy
});
});
}
}
}
}
...
@@ -246,8 +251,10 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -246,8 +251,10 @@ class Overview extends React.Component<{}, OverviewState> {
const
duration
=
(
tableData
[
item
].
endTime
-
tableData
[
item
].
startTime
)
/
1000
;
const
duration
=
(
tableData
[
item
].
endTime
-
tableData
[
item
].
startTime
)
/
1000
;
const
acc
=
getFinal
(
tableData
[
item
].
finalMetricData
);
const
acc
=
getFinal
(
tableData
[
item
].
finalMetricData
);
// if hyperparameters is undefine, show error message, else, show parameters value
// if hyperparameters is undefine, show error message, else, show parameters value
if
(
tableData
[
item
].
hyperParameters
)
{
const
tempara
=
tableData
[
item
].
hyperParameters
;
const
parameters
=
JSON
.
parse
(
tableData
[
item
].
hyperParameters
[
0
]).
parameters
;
if
(
tempara
!==
undefined
)
{
const
tempLength
=
tempara
.
length
;
const
parameters
=
JSON
.
parse
(
tempara
[
tempLength
-
1
]).
parameters
;
if
(
typeof
parameters
===
'
string
'
)
{
if
(
typeof
parameters
===
'
string
'
)
{
desJobDetail
.
parameters
=
JSON
.
parse
(
parameters
);
desJobDetail
.
parameters
=
JSON
.
parse
(
parameters
);
}
else
{
}
else
{
...
@@ -414,7 +421,7 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -414,7 +421,7 @@ class Overview extends React.Component<{}, OverviewState> {
const
{
const
{
trialProfile
,
searchSpace
,
tableData
,
accuracyData
,
trialProfile
,
searchSpace
,
tableData
,
accuracyData
,
accNodata
,
status
,
errorStr
,
trialNumber
,
bestAccuracy
,
accNodata
,
status
,
errorStr
,
trialNumber
,
bestAccuracy
,
isMultiPhase
,
titleMaxbgcolor
,
titleMinbgcolor
,
isLogCollection
,
experimentAPI
titleMaxbgcolor
,
titleMinbgcolor
,
isLogCollection
,
experimentAPI
}
=
this
.
state
;
}
=
this
.
state
;
...
@@ -488,6 +495,7 @@ class Overview extends React.Component<{}, OverviewState> {
...
@@ -488,6 +495,7 @@ class Overview extends React.Component<{}, OverviewState> {
<
Col
span
=
{
16
}
id
=
"succeTable"
>
<
Col
span
=
{
16
}
id
=
"succeTable"
>
<
SuccessTable
<
SuccessTable
tableSource
=
{
tableData
}
tableSource
=
{
tableData
}
multiphase
=
{
isMultiPhase
}
logCollection
=
{
isLogCollection
}
logCollection
=
{
isLogCollection
}
trainingPlatform
=
{
trialProfile
.
trainingServicePlatform
}
trainingPlatform
=
{
trialProfile
.
trainingServicePlatform
}
/>
/>
...
...
src/webui/src/components/TrialsDetail.tsx
View file @
6e2c08db
...
@@ -25,6 +25,7 @@ interface TrialDetailState {
...
@@ -25,6 +25,7 @@ interface TrialDetailState {
experimentLogCollection
:
boolean
;
experimentLogCollection
:
boolean
;
entriesTable
:
number
;
entriesTable
:
number
;
searchSpace
:
string
;
searchSpace
:
string
;
isMultiPhase
:
boolean
;
}
}
class
TrialsDetail
extends
React
.
Component
<
{},
TrialDetailState
>
{
class
TrialsDetail
extends
React
.
Component
<
{},
TrialDetailState
>
{
...
@@ -68,7 +69,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -68,7 +69,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
experimentLogCollection
:
false
,
experimentLogCollection
:
false
,
entriesTable
:
20
,
entriesTable
:
20
,
isHasSearch
:
false
,
isHasSearch
:
false
,
searchSpace
:
''
searchSpace
:
''
,
isMultiPhase
:
false
};
};
}
}
...
@@ -105,8 +107,9 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -105,8 +107,9 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
duration
=
(
new
Date
().
getTime
()
-
begin
)
/
1000
;
duration
=
(
new
Date
().
getTime
()
-
begin
)
/
1000
;
}
}
}
}
if
(
trialJobs
[
item
].
hyperParameters
!==
undefined
)
{
const
tempHyper
=
trialJobs
[
item
].
hyperParameters
;
const
getPara
=
JSON
.
parse
(
trialJobs
[
item
].
hyperParameters
[
0
]).
parameters
;
if
(
tempHyper
!==
undefined
)
{
const
getPara
=
JSON
.
parse
(
tempHyper
[
tempHyper
.
length
-
1
]).
parameters
;
if
(
typeof
getPara
===
'
string
'
)
{
if
(
typeof
getPara
===
'
string
'
)
{
desc
.
parameters
=
JSON
.
parse
(
getPara
);
desc
.
parameters
=
JSON
.
parse
(
getPara
);
}
else
{
}
else
{
...
@@ -266,6 +269,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -266,6 +269,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
// default logCollection is true
// default logCollection is true
const
logCollection
=
res
.
data
.
params
.
logCollection
;
const
logCollection
=
res
.
data
.
params
.
logCollection
;
let
expLogCollection
:
boolean
=
false
;
let
expLogCollection
:
boolean
=
false
;
const
isMultiy
:
boolean
=
res
.
data
.
params
.
multiPhase
!==
undefined
?
res
.
data
.
params
.
multiPhase
:
false
;
if
(
logCollection
!==
undefined
&&
logCollection
!==
'
none
'
)
{
if
(
logCollection
!==
undefined
&&
logCollection
!==
'
none
'
)
{
expLogCollection
=
true
;
expLogCollection
=
true
;
}
}
...
@@ -273,7 +278,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -273,7 +278,8 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
this
.
setState
({
this
.
setState
({
experimentPlatform
:
trainingPlatform
,
experimentPlatform
:
trainingPlatform
,
searchSpace
:
res
.
data
.
params
.
searchSpace
,
searchSpace
:
res
.
data
.
params
.
searchSpace
,
experimentLogCollection
:
expLogCollection
experimentLogCollection
:
expLogCollection
,
isMultiPhase
:
isMultiy
});
});
}
}
}
}
...
@@ -296,7 +302,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -296,7 +302,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
render
()
{
render
()
{
const
{
const
{
tableListSource
,
searchResultSource
,
isHasSearch
,
tableListSource
,
searchResultSource
,
isHasSearch
,
isMultiPhase
,
entriesTable
,
experimentPlatform
,
searchSpace
,
experimentLogCollection
entriesTable
,
experimentPlatform
,
searchSpace
,
experimentLogCollection
}
=
this
.
state
;
}
=
this
.
state
;
const
source
=
isHasSearch
?
searchResultSource
:
tableListSource
;
const
source
=
isHasSearch
?
searchResultSource
:
tableListSource
;
...
@@ -370,6 +376,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
...
@@ -370,6 +376,7 @@ class TrialsDetail extends React.Component<{}, TrialDetailState> {
<
TableList
<
TableList
entries
=
{
entriesTable
}
entries
=
{
entriesTable
}
tableSource
=
{
source
}
tableSource
=
{
source
}
isMultiPhase
=
{
isMultiPhase
}
platform
=
{
experimentPlatform
}
platform
=
{
experimentPlatform
}
updateList
=
{
this
.
getDetailSource
}
updateList
=
{
this
.
getDetailSource
}
logCollection
=
{
experimentLogCollection
}
logCollection
=
{
experimentLogCollection
}
...
...
src/webui/src/components/overview/SuccessTable.tsx
View file @
6e2c08db
...
@@ -11,6 +11,7 @@ interface SuccessTableProps {
...
@@ -11,6 +11,7 @@ interface SuccessTableProps {
tableSource
:
Array
<
TableObj
>
;
tableSource
:
Array
<
TableObj
>
;
trainingPlatform
:
string
;
trainingPlatform
:
string
;
logCollection
:
boolean
;
logCollection
:
boolean
;
multiphase
:
boolean
;
}
}
class
SuccessTable
extends
React
.
Component
<
SuccessTableProps
,
{}
>
{
class
SuccessTable
extends
React
.
Component
<
SuccessTableProps
,
{}
>
{
...
@@ -23,12 +24,13 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
...
@@ -23,12 +24,13 @@ class SuccessTable extends React.Component<SuccessTableProps, {}> {
}
}
openRow
=
(
record
:
TableObj
)
=>
{
openRow
=
(
record
:
TableObj
)
=>
{
const
{
trainingPlatform
,
logCollection
}
=
this
.
props
;
const
{
trainingPlatform
,
logCollection
,
multiphase
}
=
this
.
props
;
return
(
return
(
<
OpenRow
<
OpenRow
trainingPlatform
=
{
trainingPlatform
}
trainingPlatform
=
{
trainingPlatform
}
record
=
{
record
}
record
=
{
record
}
logCollection
=
{
logCollection
}
logCollection
=
{
logCollection
}
multiphase
=
{
multiphase
}
/>
/>
);
);
}
}
...
...
src/webui/src/components/public-child/OpenRow.tsx
View file @
6e2c08db
...
@@ -4,6 +4,8 @@ import PaiTrialLog from '../public-child/PaiTrialLog';
...
@@ -4,6 +4,8 @@ import PaiTrialLog from '../public-child/PaiTrialLog';
import
TrialLog
from
'
../public-child/TrialLog
'
;
import
TrialLog
from
'
../public-child/TrialLog
'
;
import
{
TableObj
}
from
'
../../static/interface
'
;
import
{
TableObj
}
from
'
../../static/interface
'
;
import
{
Row
,
Tabs
,
Button
,
message
}
from
'
antd
'
;
import
{
Row
,
Tabs
,
Button
,
message
}
from
'
antd
'
;
import
{
MANAGER_IP
}
from
'
../../static/const
'
;
import
'
../../static/style/overview.scss
'
;
import
JSONTree
from
'
react-json-tree
'
;
import
JSONTree
from
'
react-json-tree
'
;
const
TabPane
=
Tabs
.
TabPane
;
const
TabPane
=
Tabs
.
TabPane
;
...
@@ -11,6 +13,7 @@ interface OpenRowProps {
...
@@ -11,6 +13,7 @@ interface OpenRowProps {
trainingPlatform
:
string
;
trainingPlatform
:
string
;
record
:
TableObj
;
record
:
TableObj
;
logCollection
:
boolean
;
logCollection
:
boolean
;
multiphase
:
boolean
;
}
}
interface
OpenRowState
{
interface
OpenRowState
{
...
@@ -46,7 +49,7 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
...
@@ -46,7 +49,7 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
}
}
render
()
{
render
()
{
const
{
trainingPlatform
,
record
,
logCollection
}
=
this
.
props
;
const
{
trainingPlatform
,
record
,
logCollection
,
multiphase
}
=
this
.
props
;
const
{
idList
}
=
this
.
state
;
const
{
idList
}
=
this
.
state
;
let
isClick
=
false
;
let
isClick
=
false
;
let
isHasParameters
=
true
;
let
isHasParameters
=
true
;
...
@@ -54,9 +57,8 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
...
@@ -54,9 +57,8 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
if
(
record
.
description
.
parameters
.
error
)
{
if
(
record
.
description
.
parameters
.
error
)
{
isHasParameters
=
false
;
isHasParameters
=
false
;
}
}
const
openRowDataSource
=
{
const
openRowDataSource
=
record
.
description
.
parameters
;
parameters
:
record
.
description
.
parameters
const
trialink
:
string
=
`
${
MANAGER_IP
}
/trial-jobs/
${
record
.
id
}
`
;
};
const
logPathRow
=
record
.
description
.
logPath
!==
undefined
const
logPathRow
=
record
.
description
.
logPath
!==
undefined
?
?
record
.
description
.
logPath
record
.
description
.
logPath
...
@@ -66,6 +68,19 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
...
@@ -66,6 +68,19 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
<
Row
className
=
"openRowContent hyperpar"
>
<
Row
className
=
"openRowContent hyperpar"
>
<
Tabs
tabPosition
=
"left"
className
=
"card"
>
<
Tabs
tabPosition
=
"left"
className
=
"card"
>
<
TabPane
tab
=
"Parameters"
key
=
"1"
>
<
TabPane
tab
=
"Parameters"
key
=
"1"
>
{
multiphase
?
<
Row
className
=
"link"
>
Trails for multiphase experiment will return a set of parameters,
we are listing the latest parameter in webportal.
<
br
/>
For the entire parameter set, please refer to the following "
<
a
href
=
{
trialink
}
target
=
"_blank"
>
{
trialink
}
</
a
>
".
</
Row
>
:
<
div
/>
}
{
{
isHasParameters
isHasParameters
?
?
...
@@ -74,13 +89,13 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
...
@@ -74,13 +89,13 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
{
{
isClick
isClick
?
?
<
pre
>
{
JSON
.
stringify
(
openRowDataSource
.
parameters
,
null
,
4
)
}
</
pre
>
<
pre
>
{
JSON
.
stringify
(
openRowDataSource
,
null
,
4
)
}
</
pre
>
:
:
<
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
=
{
openRowDataSource
.
parameters
}
data
=
{
openRowDataSource
}
/>
/>
}
}
</
Row
>
</
Row
>
...
...
src/webui/src/components/trial-detail/TableList.tsx
View file @
6e2c08db
...
@@ -32,6 +32,7 @@ interface TableListProps {
...
@@ -32,6 +32,7 @@ interface TableListProps {
updateList
:
Function
;
updateList
:
Function
;
platform
:
string
;
platform
:
string
;
logCollection
:
boolean
;
logCollection
:
boolean
;
isMultiPhase
:
boolean
;
}
}
interface
TableListState
{
interface
TableListState
{
...
@@ -175,12 +176,13 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -175,12 +176,13 @@ class TableList extends React.Component<TableListProps, TableListState> {
}
}
openRow
=
(
record
:
TableObj
)
=>
{
openRow
=
(
record
:
TableObj
)
=>
{
const
{
platform
,
logCollection
}
=
this
.
props
;
const
{
platform
,
logCollection
,
isMultiPhase
}
=
this
.
props
;
return
(
return
(
<
OpenRow
<
OpenRow
trainingPlatform
=
{
platform
}
trainingPlatform
=
{
platform
}
record
=
{
record
}
record
=
{
record
}
logCollection
=
{
logCollection
}
logCollection
=
{
logCollection
}
multiphase
=
{
isMultiPhase
}
/>
/>
);
);
}
}
...
...
src/webui/src/static/function.ts
View file @
6e2c08db
...
@@ -34,11 +34,11 @@ const convertDuration = (num: number) => {
...
@@ -34,11 +34,11 @@ const convertDuration = (num: number) => {
// get final result value
// get final result value
// draw Accuracy point graph
// draw Accuracy point graph
const
getFinalResult
=
(
final
:
FinalResult
)
=>
{
const
getFinalResult
=
(
final
:
Array
<
FinalResult
>
)
=>
{
let
acc
;
let
acc
;
let
showDefault
=
0
;
let
showDefault
=
0
;
if
(
final
)
{
if
(
final
)
{
acc
=
JSON
.
parse
(
final
[
0
].
data
);
acc
=
JSON
.
parse
(
final
[
final
.
length
-
1
].
data
);
if
(
typeof
(
acc
)
===
'
object
'
)
{
if
(
typeof
(
acc
)
===
'
object
'
)
{
if
(
acc
.
default
)
{
if
(
acc
.
default
)
{
showDefault
=
acc
.
default
;
showDefault
=
acc
.
default
;
...
@@ -53,10 +53,10 @@ const getFinalResult = (final: FinalResult) => {
...
@@ -53,10 +53,10 @@ const getFinalResult = (final: FinalResult) => {
};
};
// get final result value // acc obj
// get final result value // acc obj
const
getFinal
=
(
final
:
FinalResult
)
=>
{
const
getFinal
=
(
final
:
Array
<
FinalResult
>
)
=>
{
let
showDefault
:
FinalType
;
let
showDefault
:
FinalType
;
if
(
final
)
{
if
(
final
)
{
showDefault
=
JSON
.
parse
(
final
[
0
].
data
);
showDefault
=
JSON
.
parse
(
final
[
final
.
length
-
1
].
data
);
if
(
typeof
showDefault
===
'
number
'
)
{
if
(
typeof
showDefault
===
'
number
'
)
{
showDefault
=
{
default
:
showDefault
};
showDefault
=
{
default
:
showDefault
};
}
}
...
...
src/webui/src/static/style/overview.scss
View file @
6e2c08db
...
@@ -49,3 +49,7 @@
...
@@ -49,3 +49,7 @@
}
}
}
}
.link
{
margin-bottom
:
10px
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment