Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
593a275c
Commit
593a275c
authored
Dec 14, 2020
by
Yuge Zhang
Browse files
Merge branch 'master' of
https://github.com/microsoft/nni
into dev-retiarii
parents
b3cdee85
683c458a
Changes
85
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
404 additions
and
124 deletions
+404
-124
ts/webui/src/components/managementExp/expFunction.ts
ts/webui/src/components/managementExp/expFunction.ts
+37
-0
ts/webui/src/components/managementExp/experimentConst.ts
ts/webui/src/components/managementExp/experimentConst.ts
+4
-0
ts/webui/src/components/modals/Compare.tsx
ts/webui/src/components/modals/Compare.tsx
+15
-13
ts/webui/src/components/overview/command/Command1.tsx
ts/webui/src/components/overview/command/Command1.tsx
+2
-2
ts/webui/src/components/overview/command/Command2.tsx
ts/webui/src/components/overview/command/Command2.tsx
+4
-4
ts/webui/src/components/overview/params/BasicInfo.tsx
ts/webui/src/components/overview/params/BasicInfo.tsx
+7
-7
ts/webui/src/components/overview/params/basicInfoStyles.ts
ts/webui/src/components/overview/params/basicInfoStyles.ts
+0
-0
ts/webui/src/components/overview/table/SuccessTable.tsx
ts/webui/src/components/overview/table/SuccessTable.tsx
+1
-1
ts/webui/src/components/trial-detail/DefaultMetricPoint.tsx
ts/webui/src/components/trial-detail/DefaultMetricPoint.tsx
+22
-16
ts/webui/src/components/trial-detail/Intermediate.tsx
ts/webui/src/components/trial-detail/Intermediate.tsx
+9
-3
ts/webui/src/index.tsx
ts/webui/src/index.tsx
+12
-10
ts/webui/src/static/const.ts
ts/webui/src/static/const.ts
+11
-0
ts/webui/src/static/function.ts
ts/webui/src/static/function.ts
+14
-0
ts/webui/src/static/interface.ts
ts/webui/src/static/interface.ts
+16
-1
ts/webui/src/static/model/experimentsManager.ts
ts/webui/src/static/model/experimentsManager.ts
+43
-0
ts/webui/src/static/style/common.scss
ts/webui/src/static/style/common.scss
+27
-5
ts/webui/src/static/style/experiment/experiment.scss
ts/webui/src/static/style/experiment/experiment.scss
+64
-0
ts/webui/src/static/style/nav/nav.scss
ts/webui/src/static/style/nav/nav.scss
+90
-61
ts/webui/src/static/style/overview/basic.scss
ts/webui/src/static/style/overview/basic.scss
+23
-0
ts/webui/src/static/style/overview/count.scss
ts/webui/src/static/style/overview/count.scss
+3
-1
No files found.
ts/webui/src/components/managementExp/expFunction.ts
0 → 100644
View file @
593a275c
import
{
AllExperimentList
,
SortInfo
}
from
'
../../static/interface
'
;
import
{
copyAndSort
}
from
'
../../static/function
'
;
function
compareDate
(
date1
:
Date
,
date2
:
Date
):
boolean
{
if
(
date1
!==
undefined
&&
date2
!==
undefined
)
{
if
(
date1
.
getFullYear
()
===
date2
.
getFullYear
())
{
if
(
date1
.
getMonth
()
===
date2
.
getMonth
())
{
if
(
date1
.
getDate
()
===
date2
.
getDate
())
{
return
true
;
}
}
}
}
return
false
;
}
const
filterByStatusOrPlatform
=
(
val
:
string
,
type
:
string
,
data
:
AllExperimentList
[]):
AllExperimentList
[]
=>
{
return
data
.
filter
(
temp
=>
temp
[
type
]
===
val
);
};
function
fillOptions
(
arr
:
string
[]):
any
{
const
list
:
Array
<
object
>
=
[];
arr
.
map
(
item
=>
{
list
.
push
({
key
:
item
,
text
:
item
});
});
return
list
;
}
function
getSortedSource
(
source
:
AllExperimentList
[],
sortInfo
:
SortInfo
):
AllExperimentList
[]
{
const
keepSortedSource
=
copyAndSort
(
source
,
sortInfo
.
field
,
sortInfo
.
isDescend
);
return
keepSortedSource
;
}
export
{
compareDate
,
filterByStatusOrPlatform
,
fillOptions
,
getSortedSource
};
ts/webui/src/components/managementExp/experimentConst.ts
0 → 100644
View file @
593a275c
const
MAXSCREENCOLUMNWIDHT
=
180
;
const
MINSCREENCOLUMNWIDHT
=
139
;
export
{
MAXSCREENCOLUMNWIDHT
,
MINSCREENCOLUMNWIDHT
};
ts/webui/src/components/modals/Compare.tsx
View file @
593a275c
...
@@ -58,16 +58,16 @@ class Compare extends React.Component<CompareProps, {}> {
...
@@ -58,16 +58,16 @@ class Compare extends React.Component<CompareProps, {}> {
super
(
props
);
super
(
props
);
}
}
private
_generateTooltipSummary
(
row
:
Item
,
metricKey
:
string
):
string
{
private
_generateTooltipSummary
=
(
row
:
Item
,
value
:
string
):
string
=>
return
renderToString
(
renderToString
(
<
div
className
=
'tooldetailAccuracy'
>
<
div
className
=
'tooldetailAccuracy'
>
<
div
>
Trial No.:
{
row
.
sequenceId
}
</
div
>
<
div
>
Trial ID:
{
row
.
id
}
</
div
>
<
div
>
Trial ID:
{
row
.
id
}
</
div
>
<
div
>
Default metric:
{
row
.
metrics
.
get
(
metricKey
)
||
'
N/A
'
}
</
div
>
<
div
>
Intermediate metric:
{
value
}
</
div
>
</
div
>
</
div
>
);
);
}
private
_intermediates
(
items
:
Item
[]
,
metricKey
:
string
):
React
.
ReactNode
{
private
_intermediates
(
items
:
Item
[]):
React
.
ReactNode
{
// Precondition: make sure `items` is not empty
// Precondition: make sure `items` is not empty
const
xAxisMax
=
Math
.
max
(...
items
.
map
(
item
=>
item
.
intermediates
.
length
));
const
xAxisMax
=
Math
.
max
(...
items
.
map
(
item
=>
item
.
intermediates
.
length
));
const
xAxis
=
Array
(
xAxisMax
)
const
xAxis
=
Array
(
xAxisMax
)
...
@@ -84,7 +84,7 @@ class Compare extends React.Component<CompareProps, {}> {
...
@@ -84,7 +84,7 @@ class Compare extends React.Component<CompareProps, {}> {
trigger
:
'
item
'
,
trigger
:
'
item
'
,
enterable
:
true
,
enterable
:
true
,
position
:
(
point
:
number
[],
data
:
TooltipForIntermediate
):
[
number
,
number
]
=>
{
position
:
(
point
:
number
[],
data
:
TooltipForIntermediate
):
[
number
,
number
]
=>
{
if
(
data
.
dataIndex
<
length
/
2
)
{
if
(
data
.
dataIndex
<
xAxisMax
/
2
)
{
return
[
point
[
0
],
80
];
return
[
point
[
0
],
80
];
}
else
{
}
else
{
return
[
point
[
0
]
-
300
,
80
];
return
[
point
[
0
]
-
300
,
80
];
...
@@ -92,7 +92,7 @@ class Compare extends React.Component<CompareProps, {}> {
...
@@ -92,7 +92,7 @@ class Compare extends React.Component<CompareProps, {}> {
},
},
formatter
:
(
data
:
TooltipForIntermediate
):
string
=>
{
formatter
:
(
data
:
TooltipForIntermediate
):
string
=>
{
const
item
=
items
.
find
(
k
=>
k
.
id
===
data
.
seriesName
)
as
Item
;
const
item
=
items
.
find
(
k
=>
k
.
id
===
data
.
seriesName
)
as
Item
;
return
this
.
_generateTooltipSummary
(
item
,
metricKey
);
return
this
.
_generateTooltipSummary
(
item
,
data
.
data
);
}
}
},
},
grid
:
{
grid
:
{
...
@@ -187,9 +187,13 @@ class Compare extends React.Component<CompareProps, {}> {
...
@@ -187,9 +187,13 @@ class Compare extends React.Component<CompareProps, {}> {
{
parameterKeys
.
map
(
k
=>
{
parameterKeys
.
map
(
k
=>
this
.
_renderRow
(
`space_
${
k
}
`
,
k
,
'
value
'
,
items
,
item
=>
item
.
parameters
.
get
(
k
))
this
.
_renderRow
(
`space_
${
k
}
`
,
k
,
'
value
'
,
items
,
item
=>
item
.
parameters
.
get
(
k
))
)
}
)
}
{
metricKeys
.
map
(
k
=>
{
metricKeys
!==
undefined
this
.
_renderRow
(
`metrics_
${
k
}
`
,
`Metric:
${
k
}
`
,
'
value
'
,
items
,
item
=>
item
.
metrics
.
get
(
k
))
?
metricKeys
.
map
(
k
=>
)
}
this
.
_renderRow
(
`metrics_
${
k
}
`
,
`Metric:
${
k
}
`
,
'
value
'
,
items
,
item
=>
item
.
metrics
.
get
(
k
)
)
)
:
null
}
</
tbody
>
</
tbody
>
</
table
>
</
table
>
);
);
...
@@ -209,8 +213,6 @@ class Compare extends React.Component<CompareProps, {}> {
...
@@ -209,8 +213,6 @@ class Compare extends React.Component<CompareProps, {}> {
metrics
:
flatten
(
trial
.
metrics
(
TRIALS
.
inferredMetricSpace
())),
metrics
:
flatten
(
trial
.
metrics
(
TRIALS
.
inferredMetricSpace
())),
intermediates
:
_parseIntermediates
(
trial
)
intermediates
:
_parseIntermediates
(
trial
)
}));
}));
const
metricKeys
=
this
.
_overlapKeys
(
items
.
map
(
item
=>
item
.
metrics
));
const
defaultMetricKey
=
!
metricKeys
||
metricKeys
.
includes
(
'
default
'
)
?
'
default
'
:
metricKeys
[
0
];
return
(
return
(
<
Modal
<
Modal
...
@@ -232,7 +234,7 @@ class Compare extends React.Component<CompareProps, {}> {
...
@@ -232,7 +234,7 @@ class Compare extends React.Component<CompareProps, {}> {
/>
/>
</
div
>
</
div
>
<
Stack
className
=
'compare-modal-intermediate'
>
<
Stack
className
=
'compare-modal-intermediate'
>
{
this
.
_intermediates
(
items
,
defaultMetricKey
)
}
{
this
.
_intermediates
(
items
)
}
<
Stack
className
=
'compare-yAxis'
>
# Intermediate result
</
Stack
>
<
Stack
className
=
'compare-yAxis'
>
# Intermediate result
</
Stack
>
</
Stack
>
</
Stack
>
{
showDetails
&&
<
Stack
>
{
this
.
_columns
(
items
)
}
</
Stack
>
}
{
showDetails
&&
<
Stack
>
{
this
.
_columns
(
items
)
}
</
Stack
>
}
...
...
ts/webui/src/components/overview/command/Command1.tsx
View file @
593a275c
...
@@ -37,9 +37,9 @@ export const Command1 = (): any => {
...
@@ -37,9 +37,9 @@ export const Command1 = (): any => {
<
div
className
=
'basic'
style
=
{
rightEidtParam
}
>
<
div
className
=
'basic'
style
=
{
rightEidtParam
}
>
<
div
>
<
div
>
<
p
className
=
'command'
>
Training platform
</
p
>
<
p
className
=
'command'
>
Training platform
</
p
>
<
div
className
=
'
nowrap
'
>
{
EXPERIMENT
.
profile
.
params
.
trainingServicePlatform
}
</
div
>
<
div
className
=
'
ellipsis
'
>
{
EXPERIMENT
.
profile
.
params
.
trainingServicePlatform
}
</
div
>
<
p
className
=
'lineMargin'
>
{
title
.
join
(
'
/
'
)
}
</
p
>
<
p
className
=
'lineMargin'
>
{
title
.
join
(
'
/
'
)
}
</
p
>
<
div
className
=
'
nowrap
'
>
{
builtinName
.
join
(
'
/
'
)
}
</
div
>
<
div
className
=
'
ellipsis
'
>
{
builtinName
.
join
(
'
/
'
)
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
ts/webui/src/components/overview/command/Command2.tsx
View file @
593a275c
...
@@ -24,10 +24,10 @@ export const Command2 = (): any => {
...
@@ -24,10 +24,10 @@ export const Command2 = (): any => {
return
(
return
(
<
div
className
=
'basic'
style
=
{
leftProgress
}
>
<
div
className
=
'basic'
style
=
{
leftProgress
}
>
<
p
className
=
'command'
>
Log directory
</
p
>
<
p
className
=
'command'
>
Log directory
</
p
>
<
div
className
=
'
nowrap
'
>
<
div
className
=
'
ellipsis
'
>
<
TooltipHost
<
TooltipHost
content
=
{
EXPERIMENT
.
profile
.
logDir
||
'
unknown
'
}
content
=
{
EXPERIMENT
.
profile
.
logDir
||
'
unknown
'
}
className
=
'
nowrap
'
className
=
'
ellipsis
'
directionalHint
=
{
DirectionalHint
.
bottomCenter
}
directionalHint
=
{
DirectionalHint
.
bottomCenter
}
tooltipProps
=
{
{
tooltipProps
=
{
{
calloutProps
:
{
calloutProps
:
{
...
@@ -43,10 +43,10 @@ export const Command2 = (): any => {
...
@@ -43,10 +43,10 @@ export const Command2 = (): any => {
</
TooltipHost
>
</
TooltipHost
>
</
div
>
</
div
>
<
p
className
=
'lineMargin'
>
Trial command
</
p
>
<
p
className
=
'lineMargin'
>
Trial command
</
p
>
<
div
className
=
'
nowrap
'
>
<
div
className
=
'
ellipsis
'
>
<
TooltipHost
<
TooltipHost
content
=
{
trialCommand
||
'
unknown
'
}
content
=
{
trialCommand
||
'
unknown
'
}
className
=
'
nowrap
'
className
=
'
ellipsis
'
directionalHint
=
{
DirectionalHint
.
bottomCenter
}
directionalHint
=
{
DirectionalHint
.
bottomCenter
}
tooltipProps
=
{
{
tooltipProps
=
{
{
calloutProps
:
{
calloutProps
:
{
...
...
ts/webui/src/components/overview/
experiment
/BasicInfo.tsx
→
ts/webui/src/components/overview/
params
/BasicInfo.tsx
View file @
593a275c
...
@@ -6,10 +6,10 @@ import { formatTimestamp } from '../../../static/function';
...
@@ -6,10 +6,10 @@ import { formatTimestamp } from '../../../static/function';
import
{
useId
}
from
'
@uifabric/react-hooks
'
;
import
{
useId
}
from
'
@uifabric/react-hooks
'
;
import
{
BestMetricContext
}
from
'
../../Overview
'
;
import
{
BestMetricContext
}
from
'
../../Overview
'
;
import
{
styles
}
from
'
./basicInfoStyles
'
;
import
{
styles
}
from
'
./basicInfoStyles
'
;
import
'
../../../static/style/
progress/progress
.scss
'
;
import
'
../../../static/style/
overview/probar
.scss
'
;
import
'
../../../static/style/
progress/probar
.scss
'
;
import
'
../../../static/style/
overview/basic
.scss
'
;
export
const
Re
BasicInfo
=
():
any
=>
{
export
const
BasicInfo
=
():
any
=>
{
const
labelId
:
string
=
useId
(
'
callout-label
'
);
const
labelId
:
string
=
useId
(
'
callout-label
'
);
const
descriptionId
:
string
=
useId
(
'
callout-description
'
);
const
descriptionId
:
string
=
useId
(
'
callout-description
'
);
const
ref
=
React
.
createRef
<
HTMLDivElement
>
();
const
ref
=
React
.
createRef
<
HTMLDivElement
>
();
...
@@ -26,9 +26,9 @@ export const ReBasicInfo = (): any => {
...
@@ -26,9 +26,9 @@ export const ReBasicInfo = (): any => {
<
Stack
horizontal
horizontalAlign
=
'space-between'
className
=
'marginTop'
>
<
Stack
horizontal
horizontalAlign
=
'space-between'
className
=
'marginTop'
>
<
div
className
=
'basic'
>
<
div
className
=
'basic'
>
<
p
>
Name
</
p
>
<
p
>
Name
</
p
>
<
div
className
=
'
nowrap
'
>
{
EXPERIMENT
.
profile
.
params
.
experimentName
}
</
div
>
<
div
className
=
'
ellipsis
'
>
{
EXPERIMENT
.
profile
.
params
.
experimentName
}
</
div
>
<
p
className
=
'marginTop'
>
ID
</
p
>
<
p
className
=
'marginTop'
>
ID
</
p
>
<
div
className
=
'
nowrap
'
>
{
EXPERIMENT
.
profile
.
id
}
</
div
>
<
div
className
=
'
ellipsis
'
>
{
EXPERIMENT
.
profile
.
id
}
</
div
>
</
div
>
</
div
>
<
div
className
=
'basic'
>
<
div
className
=
'basic'
>
<
p
>
Status
</
p
>
<
p
>
Status
</
p
>
...
@@ -86,9 +86,9 @@ export const ReBasicInfo = (): any => {
...
@@ -86,9 +86,9 @@ export const ReBasicInfo = (): any => {
</
div
>
</
div
>
<
div
className
=
'basic'
>
<
div
className
=
'basic'
>
<
p
>
Start time
</
p
>
<
p
>
Start time
</
p
>
<
div
className
=
'
nowrap
'
>
{
formatTimestamp
(
EXPERIMENT
.
profile
.
startTime
)
}
</
div
>
<
div
className
=
'
ellipsis
'
>
{
formatTimestamp
(
EXPERIMENT
.
profile
.
startTime
)
}
</
div
>
<
p
className
=
'marginTop'
>
End time
</
p
>
<
p
className
=
'marginTop'
>
End time
</
p
>
<
div
className
=
'
nowrap
'
>
{
formatTimestamp
(
EXPERIMENT
.
profile
.
endTime
)
}
</
div
>
<
div
className
=
'
ellipsis
'
>
{
formatTimestamp
(
EXPERIMENT
.
profile
.
endTime
)
}
</
div
>
</
div
>
</
div
>
</
Stack
>
</
Stack
>
{
/* learn about click -> default active key is dispatcher. */
}
{
/* learn about click -> default active key is dispatcher. */
}
...
...
ts/webui/src/components/overview/
experiment
/basicInfoStyles.ts
→
ts/webui/src/components/overview/
params
/basicInfoStyles.ts
View file @
593a275c
File moved
ts/webui/src/components/overview/table/SuccessTable.tsx
View file @
593a275c
...
@@ -106,7 +106,7 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>
...
@@ -106,7 +106,7 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>
</
React
.
Fragment
>
</
React
.
Fragment
>
);
);
private
columns
=
[
private
columns
:
IColumn
[]
=
[
{
{
key
:
'
_expand
'
,
key
:
'
_expand
'
,
name
:
''
,
name
:
''
,
...
...
ts/webui/src/components/trial-detail/DefaultMetricPoint.tsx
View file @
593a275c
...
@@ -73,18 +73,24 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
...
@@ -73,18 +73,24 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
data
.
data
[
0
]
<
maxSequenceId
?
point
[
0
]
:
point
[
0
]
-
300
,
data
.
data
[
0
]
<
maxSequenceId
?
point
[
0
]
:
point
[
0
]
-
300
,
80
80
],
],
formatter
:
(
data
:
TooltipForAccuracy
):
React
.
ReactNode
=>
formatter
:
(
data
:
TooltipForAccuracy
):
React
.
ReactNode
=>
{
'
<div class="tooldetailAccuracy">
'
+
return
(
'
<div>Trial No.:
'
+
'
<div class="tooldetailAccuracy">
'
+
data
.
data
[
0
]
+
'
<div>Trial No.:
'
+
'
</div>
'
+
data
.
data
[
0
]
+
'
<div>Default metric:
'
+
'
</div>
'
+
data
.
data
[
1
]
+
'
<div>Trial ID:
'
+
'
</div>
'
+
data
.
data
[
2
]
+
'
<div>Parameters: <pre>
'
+
'
</div>
'
+
JSON
.
stringify
(
data
.
data
[
2
],
null
,
4
)
+
'
<div>Default metric:
'
+
'
</pre></div>
'
+
data
.
data
[
1
]
+
'
</div>
'
'
</div>
'
+
'
<div>Parameters: <pre>
'
+
JSON
.
stringify
(
data
.
data
[
3
],
null
,
4
)
+
'
</pre></div>
'
+
'
</div>
'
);
}
},
},
dataZoom
:
[
dataZoom
:
[
{
{
...
@@ -110,7 +116,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
...
@@ -110,7 +116,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
}
}
generateScatterSeries
(
trials
:
Trial
[]):
any
{
generateScatterSeries
(
trials
:
Trial
[]):
any
{
const
data
=
trials
.
map
(
trial
=>
[
trial
.
sequenceId
,
trial
.
accuracy
,
trial
.
description
.
parameters
]);
const
data
=
trials
.
map
(
trial
=>
[
trial
.
sequenceId
,
trial
.
accuracy
,
trial
.
id
,
trial
.
description
.
parameters
]);
return
{
return
{
symbolSize
:
6
,
symbolSize
:
6
,
type
:
'
scatter
'
,
type
:
'
scatter
'
,
...
@@ -120,7 +126,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
...
@@ -120,7 +126,7 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
generateBestCurveSeries
(
trials
:
Trial
[]):
any
{
generateBestCurveSeries
(
trials
:
Trial
[]):
any
{
let
best
=
trials
[
0
];
let
best
=
trials
[
0
];
const
data
=
[[
best
.
sequenceId
,
best
.
accuracy
,
best
.
description
.
parameters
]];
const
data
=
[[
best
.
sequenceId
,
best
.
accuracy
,
best
.
id
,
best
.
description
.
parameters
]];
for
(
let
i
=
1
;
i
<
trials
.
length
;
i
++
)
{
for
(
let
i
=
1
;
i
<
trials
.
length
;
i
++
)
{
const
trial
=
trials
[
i
];
const
trial
=
trials
[
i
];
...
@@ -128,10 +134,10 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
...
@@ -128,10 +134,10 @@ class DefaultPoint extends React.Component<DefaultPointProps, DefaultPointState>
const
delta
=
trial
.
accuracy
!
-
best
.
accuracy
!
;
const
delta
=
trial
.
accuracy
!
-
best
.
accuracy
!
;
const
better
=
EXPERIMENT
.
optimizeMode
===
'
minimize
'
?
delta
<
0
:
delta
>
0
;
const
better
=
EXPERIMENT
.
optimizeMode
===
'
minimize
'
?
delta
<
0
:
delta
>
0
;
if
(
better
)
{
if
(
better
)
{
data
.
push
([
trial
.
sequenceId
,
trial
.
accuracy
,
trial
.
description
.
parameters
]);
data
.
push
([
trial
.
sequenceId
,
trial
.
accuracy
,
best
.
id
,
trial
.
description
.
parameters
]);
best
=
trial
;
best
=
trial
;
}
else
{
}
else
{
data
.
push
([
trial
.
sequenceId
,
best
.
accuracy
,
trial
.
description
.
parameters
]);
data
.
push
([
trial
.
sequenceId
,
best
.
accuracy
,
best
.
id
,
trial
.
description
.
parameters
]);
}
}
}
}
...
...
ts/webui/src/components/trial-detail/Intermediate.tsx
View file @
593a275c
...
@@ -61,6 +61,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
...
@@ -61,6 +61,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
const
temp
=
source
[
item
];
const
temp
=
source
[
item
];
trialIntermediate
.
push
({
trialIntermediate
.
push
({
name
:
temp
.
id
,
name
:
temp
.
id
,
trialNum
:
temp
.
sequenceId
,
data
:
temp
.
description
.
intermediate
,
data
:
temp
.
description
.
intermediate
,
type
:
'
line
'
,
type
:
'
line
'
,
hyperPara
:
temp
.
description
.
parameters
hyperPara
:
temp
.
description
.
parameters
...
@@ -94,13 +95,18 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
...
@@ -94,13 +95,18 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
},
},
formatter
:
function
(
data
:
TooltipForIntermediate
):
React
.
ReactNode
{
formatter
:
function
(
data
:
TooltipForIntermediate
):
React
.
ReactNode
{
const
trialId
=
data
.
seriesName
;
const
trialId
=
data
.
seriesName
;
let
obj
=
{};
let
parameters
=
{};
let
trialNum
=
0
;
const
temp
=
trialIntermediate
.
find
(
key
=>
key
.
name
===
trialId
);
const
temp
=
trialIntermediate
.
find
(
key
=>
key
.
name
===
trialId
);
if
(
temp
!==
undefined
)
{
if
(
temp
!==
undefined
)
{
obj
=
temp
.
hyperPara
;
parameters
=
temp
.
hyperPara
;
trialNum
=
temp
.
trialNum
;
}
}
return
(
return
(
'
<div class="tooldetailAccuracy">
'
+
'
<div class="tooldetailAccuracy">
'
+
'
<div>Trial No.:
'
+
trialNum
+
'
</div>
'
+
'
<div>Trial ID:
'
+
'
<div>Trial ID:
'
+
trialId
+
trialId
+
'
</div>
'
+
'
</div>
'
+
...
@@ -109,7 +115,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
...
@@ -109,7 +115,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
'
</div>
'
+
'
</div>
'
+
'
<div>Parameters:
'
+
'
<div>Parameters:
'
+
'
<pre>
'
+
'
<pre>
'
+
JSON
.
stringify
(
obj
,
null
,
4
)
+
JSON
.
stringify
(
parameters
,
null
,
4
)
+
'
</pre>
'
+
'
</pre>
'
+
'
</div>
'
+
'
</div>
'
+
'
</div>
'
'
</div>
'
...
...
ts/webui/src/index.tsx
View file @
593a275c
...
@@ -4,27 +4,29 @@ import App from './App';
...
@@ -4,27 +4,29 @@ import App from './App';
import
{
BrowserRouter
as
Router
,
Route
,
Switch
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
as
Router
,
Route
,
Switch
}
from
'
react-router-dom
'
;
const
Overview
=
lazy
(()
=>
import
(
'
./components/Overview
'
));
const
Overview
=
lazy
(()
=>
import
(
'
./components/Overview
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/TrialsDetail
'
));
const
TrialsDetail
=
lazy
(()
=>
import
(
'
./components/TrialsDetail
'
));
const
Experiment
=
lazy
(()
=>
import
(
'
./components/managementExp/ExperimentManager
'
));
import
'
./index.css
'
;
import
'
./index.css
'
;
import
'
./static/style/loading.scss
'
;
import
'
./static/style/loading.scss
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
ReactDOM
.
render
(
ReactDOM
.
render
(
<
Router
>
<
Router
>
<
App
>
<
Suspense
fallback
=
{
<
div
className
=
'loading'
>
<
img
src
=
{
require
(
'
./static/img/loading.gif
'
)
}
/>
</
div
>
}
>
<
Route
path
=
'/experiment'
component
=
{
Experiment
}
exact
/>
<
Switch
>
<
Switch
>
<
Suspense
<
App
>
fallback
=
{
<
div
className
=
'loading'
>
<
img
src
=
{
require
(
'
./static/img/loading.gif
'
)
}
/>
</
div
>
}
>
<
Route
path
=
'/'
component
=
{
Overview
}
exact
/>
<
Route
path
=
'/'
component
=
{
Overview
}
exact
/>
<
Route
path
=
'/oview'
component
=
{
Overview
}
/>
<
Route
path
=
'/oview'
component
=
{
Overview
}
/>
<
Route
path
=
'/detail'
component
=
{
TrialsDetail
}
/>
<
Route
path
=
'/detail'
component
=
{
TrialsDetail
}
/>
</
Suspense
>
</
App
>
</
Switch
>
</
Switch
>
</
App
>
</
Suspense
>
</
Router
>,
</
Router
>,
document
.
getElementById
(
'
root
'
)
document
.
getElementById
(
'
root
'
)
...
...
ts/webui/src/static/const.ts
View file @
593a275c
...
@@ -15,6 +15,16 @@ const trialJobStatus = [
...
@@ -15,6 +15,16 @@ const trialJobStatus = [
'
SYS_CANCELED
'
,
'
SYS_CANCELED
'
,
'
EARLY_STOPPED
'
'
EARLY_STOPPED
'
];
];
const
EXPERIMENTSTATUS
=
[
'
INITIALIZED
'
,
'
RUNNING
'
,
'
ERROR
'
,
'
STOPPING
'
,
'
STOPPED
'
,
'
DONE
'
,
'
NO_MORE_TRIAL
'
,
'
TUNER_NO_MORE_TRIAL
'
];
const
CONTROLTYPE
=
[
'
MAX_EXEC_DURATION
'
,
'
MAX_TRIAL_NUM
'
,
'
TRIAL_CONCURRENCY
'
,
'
SEARCH_SPACE
'
];
const
CONTROLTYPE
=
[
'
MAX_EXEC_DURATION
'
,
'
MAX_TRIAL_NUM
'
,
'
TRIAL_CONCURRENCY
'
,
'
SEARCH_SPACE
'
];
const
MONACO
=
{
const
MONACO
=
{
readOnly
:
true
,
readOnly
:
true
,
...
@@ -64,6 +74,7 @@ export {
...
@@ -64,6 +74,7 @@ export {
MANAGER_IP
,
MANAGER_IP
,
DOWNLOAD_IP
,
DOWNLOAD_IP
,
trialJobStatus
,
trialJobStatus
,
EXPERIMENTSTATUS
,
COLUMNPro
,
COLUMNPro
,
WEBUIDOC
,
WEBUIDOC
,
CONTROLTYPE
,
CONTROLTYPE
,
...
...
ts/webui/src/static/function.ts
View file @
593a275c
...
@@ -236,6 +236,14 @@ function formatTimestamp(timestamp?: number, placeholder?: string): string {
...
@@ -236,6 +236,14 @@ function formatTimestamp(timestamp?: number, placeholder?: string): string {
return
timestamp
?
new
Date
(
timestamp
).
toLocaleString
(
'
en-US
'
)
:
placeholder
;
return
timestamp
?
new
Date
(
timestamp
).
toLocaleString
(
'
en-US
'
)
:
placeholder
;
}
}
function
expformatTimestamp
(
timestamp
:
number
|
string
):
string
{
if
(
typeof
timestamp
===
'
number
'
)
{
return
new
Date
(
timestamp
).
toLocaleString
(
'
en-US
'
);
}
else
{
return
'
N/A
'
;
}
}
function
metricAccuracy
(
metric
:
MetricDataRecord
):
number
{
function
metricAccuracy
(
metric
:
MetricDataRecord
):
number
{
const
data
=
parseMetrics
(
metric
.
data
);
const
data
=
parseMetrics
(
metric
.
data
);
// return typeof data === 'number' ? data : NaN;
// return typeof data === 'number' ? data : NaN;
...
@@ -262,6 +270,10 @@ function formatComplexTypeValue(value: any): string | number {
...
@@ -262,6 +270,10 @@ function formatComplexTypeValue(value: any): string | number {
}
}
}
}
function
isManagerExperimentPage
():
boolean
{
return
location
.
pathname
.
indexOf
(
'
experiment
'
)
===
-
1
?
false
:
true
;
}
function
caclMonacoEditorHeight
(
height
):
number
{
function
caclMonacoEditorHeight
(
height
):
number
{
// [Search space 56px] + [marginBottom 18px] +
// [Search space 56px] + [marginBottom 18px] +
// button[height: 32px, marginTop: 45px, marginBottom: 7px]
// button[height: 32px, marginTop: 45px, marginBottom: 7px]
...
@@ -306,12 +318,14 @@ export {
...
@@ -306,12 +318,14 @@ export {
filterDuration
,
filterDuration
,
formatAccuracy
,
formatAccuracy
,
formatTimestamp
,
formatTimestamp
,
expformatTimestamp
,
metricAccuracy
,
metricAccuracy
,
parseMetrics
,
parseMetrics
,
isArrayType
,
isArrayType
,
requestAxios
,
requestAxios
,
isNaNorInfinity
,
isNaNorInfinity
,
formatComplexTypeValue
,
formatComplexTypeValue
,
isManagerExperimentPage
,
caclMonacoEditorHeight
,
caclMonacoEditorHeight
,
copyAndSort
copyAndSort
};
};
ts/webui/src/static/interface.ts
View file @
593a275c
...
@@ -120,6 +120,7 @@ interface Intermedia {
...
@@ -120,6 +120,7 @@ interface Intermedia {
type
:
string
;
type
:
string
;
data
:
Array
<
number
|
object
>
;
// intermediate data
data
:
Array
<
number
|
object
>
;
// intermediate data
hyperPara
:
object
;
// each trial hyperpara value
hyperPara
:
object
;
// each trial hyperpara value
trialNum
:
number
;
}
}
interface
MetricDataRecord
{
interface
MetricDataRecord
{
...
@@ -218,6 +219,19 @@ interface SortInfo {
...
@@ -218,6 +219,19 @@ interface SortInfo {
isDescend
?:
boolean
;
isDescend
?:
boolean
;
}
}
interface
AllExperimentList
{
id
:
string
;
experimentName
:
string
;
port
:
number
;
status
:
string
;
platform
:
string
;
startTime
:
number
;
endTime
:
number
;
tag
:
string
[];
pid
:
number
;
webuiUrl
:
string
[];
logDir
:
string
[];
}
export
{
export
{
TableObj
,
TableObj
,
TableRecord
,
TableRecord
,
...
@@ -240,5 +254,6 @@ export {
...
@@ -240,5 +254,6 @@ export {
EventMap
,
EventMap
,
SingleAxis
,
SingleAxis
,
MultipleAxes
,
MultipleAxes
,
SortInfo
SortInfo
,
AllExperimentList
};
};
ts/webui/src/static/model/experimentsManager.ts
0 → 100644
View file @
593a275c
import
{
MANAGER_IP
}
from
'
../const
'
;
import
{
AllExperimentList
}
from
'
../interface
'
;
import
{
requestAxios
}
from
'
../function
'
;
class
ExperimentsManager
{
private
experimentList
:
AllExperimentList
[]
=
[];
private
platform
:
string
[]
=
[];
private
errorMessage
:
string
=
''
;
public
getExperimentList
():
AllExperimentList
[]
{
return
this
.
experimentList
;
}
public
getPlatformList
():
string
[]
{
return
this
.
platform
;
}
public
getExpErrorMessage
():
string
{
return
this
.
errorMessage
;
}
public
async
init
():
Promise
<
void
>
{
await
requestAxios
(
`
${
MANAGER_IP
}
/experiments-info`
)
.
then
(
data
=>
{
const
platforms
:
Set
<
string
>
=
new
Set
();
for
(
const
item
of
data
)
{
if
(
item
.
port
!==
undefined
)
{
if
(
typeof
item
.
port
===
'
string
'
)
{
item
.
port
=
JSON
.
parse
(
item
.
port
);
}
}
platforms
.
add
(
item
.
platform
);
}
this
.
experimentList
=
data
;
this
.
platform
=
Array
.
from
(
platforms
);
})
.
catch
(
error
=>
{
this
.
errorMessage
=
error
.
message
;
});
}
}
export
{
ExperimentsManager
};
ts/webui/src/static/style/common.scss
View file @
593a275c
.cursor
{
.ellipsis
{
&
:hover
,
&
i
:hover
{
overflow
:
hidden
;
cursor
:
pointer
;
white-space
:
nowrap
;
}
text-overflow
:
ellipsis
;
}
}
\ No newline at end of file
.link
{
outline
:
none
;
color
:
#333
!
important
;
text-decoration
:
none
;
&
:hover
{
color
:
#0071bc
!
important
;
text-decoration
:
underline
;
}
&
:active
,
&
:visited
{
color
:
#0071bc
;
}
}
.cursor
{
&
:hover
,
&
i
:hover
{
cursor
:
pointer
;
}
}
ts/webui/src/static/style/experiment/experiment.scss
0 → 100644
View file @
593a275c
.expBackground
{
background
:
#f2f2f2
;
height
:
100%
;
.content
{
background
:
#fff
;
}
}
.experimentList
{
padding
:
42px
;
.box
{
.search
{
width
:
90%
;
&
-input
{
width
:
330px
;
}
}
.filter
{
width
:
10%
;
text-align
:
right
;
&
-button-open
{
background
:
#f3f2f1
;
}
}
}
.filter-condition
{
margin-top
:
26px
;
.reset
{
width
:
80px
;
position
:
relative
;
top
:
29px
;
}
&
-status
{
width
:
194px
;
}
&
-platform
{
width
:
150px
;
}
}
.hidden
{
display
:
none
;
}
.margin
{
margin-left
:
10px
;
}
.tagContainer
{
width
:
100%
;
.tag
{
font-weight
:
500
;
background
:
#f2f2f2
;
margin
:
0
4px
;
padding
:
0
6px
;
}
}
}
ts/webui/src/static/style/nav/nav.scss
View file @
593a275c
$barHeight
:
56px
;
$barHeight
:
56px
;
.navOptions
{
.navOptions
{
.ms-Button-icon
{
.ms-Button-icon
{
color
:
#fff
;
color
:
#fff
;
&
:hover
{
&
:hover
{
color
:
#fff
;
color
:
#fff
;
}
}
}
}
.ms-Button--commandBar
{
.ms-Button--commandBar
{
background-color
:
#0071bc
;
background-color
:
#0071bc
;
user-select
:
none
;
user-select
:
none
;
&
:hover
,
&
:hover
,
&
:active
{
&
:active
{
color
:
#fff
;
color
:
#fff
;
.ms-Button-icon
{
.ms-Button-icon
{
color
:
#fff
;
color
:
#fff
;
}
}
}
}
.ms-Button-textContainer
{
.ms-Button-textContainer
{
color
:
#fff
;
color
:
#fff
;
}
}
.ms-Button-menuIcon
{
.ms-Button-menuIcon
{
color
:
#fff
;
color
:
#fff
;
background-color
:
transparent
;
background-color
:
transparent
;
}
}
}
}
.experiment
{
position
:
relative
;
top
:
3px
;
text-decoration
:
none
;
}
}
}
.nav
{
.nav
{
height
:
$barHeight
;
width
:
100%
;
line-height
:
$barHeight
;
min-width
:
1200px
;
height
:
$barHeight
;
/* desktop mode useful */
line-height
:
$barHeight
;
.desktop-logo
{
position
:
relative
;
/* desktop mode useful */
top
:
6px
;
.desktop-logo
{
}
position
:
relative
;
top
:
6px
;
&
-refresh
{
}
position
:
relative
;
display
:
flex
;
.logoTitle
{
}
font-size
:
18px
;
color
:
#fff
;
&
-refresh-num
{
}
position
:
absolute
;
top
:
-13px
;
&
-refresh
{
left
:
17px
;
position
:
relative
;
color
:
#fff
;
display
:
flex
;
font-size
:
12px
;
}
}
&
-refresh-num
{
position
:
absolute
;
top
:
-13px
;
left
:
17px
;
color
:
#fff
;
font-size
:
12px
;
}
}
}
/* overview and detail tabs common style */
/* overview and detail tabs common style */
a
.common-tabs
{
a
.common-tabs
{
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
font-family
:
'Segoe UI'
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
font-size
:
16px
;
font-size
:
16px
;
color
:
#b8c7ce
;
color
:
#b8c7ce
;
text-decoration
:
none
;
text-decoration
:
none
;
}
}
.common-tabs
:visited
,
.common-tabs
:visited
,
.selected
:hover
{
.selected
:hover
{
color
:
#fff
;
color
:
#fff
;
text-decoration
:
none
;
text-decoration
:
none
;
}
}
.common-tabs
:hover
,
.common-tabs
:hover
,
.selected
{
.selected
{
color
:
#fff
;
color
:
#fff
;
border-bottom
:
1px
solid
#fff
;
border-bottom
:
1px
solid
#fff
;
}
}
.left-right-margin
{
.left-right-margin
{
margin-left
:
20px
;
margin-left
:
20px
;
margin-right
:
20px
;
margin-right
:
20px
;
}
.expNavTitle
{
span
{
color
:
#fff
;
text-decoration
:
none
;
position
:
relative
;
top
:
-4px
;
}
i
{
color
:
#fff
;
font-size
:
12px
;
position
:
relative
;
top
:
-3px
;
padding-left
:
4px
;
}
}
}
ts/webui/src/static/style/overview/basic.scss
0 → 100644
View file @
593a275c
.status
{
color
:
#0573bc
;
font-size
:
20px
;
font-weight
:
600
;
.status-text
{
display
:
inline-block
;
}
.color
{
color
:
#333
;
}
}
.inputBox
{
height
:
32px
;
margin-top
:
5px
;
}
/* office-fabric-ui progressIndicator */
.ms-ProgressIndicator-itemProgress
{
padding
:
0
;
}
ts/webui/src/static/style/overview/count.scss
View file @
593a275c
...
@@ -58,6 +58,7 @@ $margin: 24px;
...
@@ -58,6 +58,7 @@ $margin: 24px;
.concurrency
{
.concurrency
{
.editparam
{
.editparam
{
margin-top
:
5px
;
margin-top
:
5px
;
position
:
relative
;
}
}
}
}
.editparam
{
.editparam
{
...
@@ -124,5 +125,6 @@ $margin: 24px;
...
@@ -124,5 +125,6 @@ $margin: 24px;
.info
{
.info
{
position
:
absolute
;
position
:
absolute
;
z-index
:
999
;
z-index
:
999
;
left
:
0
;
left
:
-50%
;
width
:
270%
;
}
}
Prev
1
2
3
4
5
Next
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