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
bf8be1e7
Unverified
Commit
bf8be1e7
authored
Aug 28, 2020
by
Yuge Zhang
Committed by
GitHub
Aug 28, 2020
Browse files
Merge pull request #2837 from microsoft/v1.8
Merge v1.8 back to master
parents
320407b1
e06a9dda
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
16 deletions
+34
-16
src/webui/src/static/model/trial.ts
src/webui/src/static/model/trial.ts
+16
-11
src/webui/src/static/style/compare.scss
src/webui/src/static/style/compare.scss
+8
-3
test/config/training_service.yml
test/config/training_service.yml
+1
-1
tools/nni_cmd/config_utils.py
tools/nni_cmd/config_utils.py
+9
-1
No files found.
src/webui/src/static/model/trial.ts
View file @
bf8be1e7
...
@@ -112,14 +112,14 @@ class Trial implements TableObj {
...
@@ -112,14 +112,14 @@ class Trial implements TableObj {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const
duration
=
(
endTime
-
this
.
info
.
startTime
!
)
/
1000
;
const
duration
=
(
endTime
-
this
.
info
.
startTime
!
)
/
1000
;
let
accuracy
;
let
accuracy
;
if
(
this
.
acc
!==
undefined
&&
this
.
acc
.
default
!==
undefined
){
if
(
this
.
acc
!==
undefined
&&
this
.
acc
.
default
!==
undefined
)
{
if
(
typeof
this
.
acc
.
default
===
'
number
'
){
if
(
typeof
this
.
acc
.
default
===
'
number
'
)
{
accuracy
=
JSON5
.
parse
(
this
.
acc
.
default
);
accuracy
=
JSON5
.
parse
(
this
.
acc
.
default
);
}
else
{
}
else
{
accuracy
=
this
.
acc
.
default
;
accuracy
=
this
.
acc
.
default
;
}
}
}
}
return
{
return
{
key
:
this
.
info
.
id
,
key
:
this
.
info
.
id
,
sequenceId
:
this
.
info
.
sequenceId
,
sequenceId
:
this
.
info
.
sequenceId
,
...
@@ -227,7 +227,7 @@ class Trial implements TableObj {
...
@@ -227,7 +227,7 @@ class Trial implements TableObj {
Object
.
entries
(
acc
).
forEach
(
item
=>
{
Object
.
entries
(
acc
).
forEach
(
item
=>
{
const
[
k
,
v
]
=
item
;
const
[
k
,
v
]
=
item
;
const
column
=
space
.
axes
.
get
(
k
);
const
column
=
space
.
axes
.
get
(
k
);
if
(
column
!==
undefined
)
{
if
(
column
!==
undefined
)
{
ret
.
set
(
column
,
v
);
ret
.
set
(
column
,
v
);
}
else
{
}
else
{
...
@@ -245,7 +245,7 @@ class Trial implements TableObj {
...
@@ -245,7 +245,7 @@ class Trial implements TableObj {
}
}
public
finalKeys
():
string
[]
{
public
finalKeys
():
string
[]
{
if
(
this
.
acc
!==
undefined
){
if
(
this
.
acc
!==
undefined
)
{
return
Object
.
keys
(
this
.
acc
);
return
Object
.
keys
(
this
.
acc
);
}
else
{
}
else
{
return
[];
return
[];
...
@@ -304,11 +304,16 @@ class Trial implements TableObj {
...
@@ -304,11 +304,16 @@ class Trial implements TableObj {
}
}
private
renderNumber
(
val
:
any
):
string
{
private
renderNumber
(
val
:
any
):
string
{
if
(
typeof
val
===
'
number
'
){
if
(
typeof
val
===
'
number
'
)
{
if
(
isNaNorInfinity
(
val
))
{
if
(
isNaNorInfinity
(
val
))
{
return
`
${
val
}
`
;
// show 'NaN' or 'Infinity'
return
`
${
val
}
`
;
// show 'NaN' or 'Infinity'
}
else
{
}
else
{
return
`
${
formatAccuracy
(
val
)}
(FINAL)`
;
if
(
this
.
accuracy
===
undefined
)
{
return
`
${
formatAccuracy
(
val
)}
(LATEST)`
;
}
else
{
return
`
${
formatAccuracy
(
val
)}
(FINAL)`
;
}
}
}
}
else
{
}
else
{
// show other types, such as {tensor: {data: }}
// show other types, such as {tensor: {data: }}
...
@@ -317,8 +322,8 @@ class Trial implements TableObj {
...
@@ -317,8 +322,8 @@ class Trial implements TableObj {
}
}
public
formatLatestAccuracy
():
string
{
// TODO: this should be private
public
formatLatestAccuracy
():
string
{
// TODO: this should be private
if
(
this
.
status
===
'
SUCCEEDED
'
){
if
(
this
.
status
===
'
SUCCEEDED
'
)
{
return
(
this
.
accuracy
===
undefined
?
'
--
'
:
this
.
renderNumber
(
this
.
accuracy
));
return
(
this
.
accuracy
===
undefined
?
'
--
'
:
this
.
renderNumber
(
this
.
accuracy
));
}
else
{
}
else
{
if
(
this
.
accuracy
!==
undefined
)
{
if
(
this
.
accuracy
!==
undefined
)
{
return
this
.
renderNumber
(
this
.
accuracy
);
return
this
.
renderNumber
(
this
.
accuracy
);
...
@@ -330,7 +335,7 @@ class Trial implements TableObj {
...
@@ -330,7 +335,7 @@ class Trial implements TableObj {
return
this
.
renderNumber
(
metricAccuracy
(
latest
));
return
this
.
renderNumber
(
metricAccuracy
(
latest
));
}
}
}
}
}
}
}
}
...
...
src/webui/src/static/style/compare.scss
View file @
bf8be1e7
...
@@ -2,16 +2,21 @@
...
@@ -2,16 +2,21 @@
/* decide modal size */
/* decide modal size */
.ms-Dialog-main
{
.ms-Dialog-main
{
width
:
50%
;
width
:
50%
;
overflow
:
hidden
;
min-width
:
450px
;
}
.ms-Modal-scrollableContent
{
overflow-x
:
hidden
;
}
}
/* compare-md: table style */
/* compare-md: table style */
.flex
{
display
:
flex
;
}
&
-table
{
&
-table
{
width
:
92%
;
width
:
92%
;
margin
:
0
auto
;
margin
:
0
auto
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
border
:
1px
solid
transparent
;
border
:
1px
solid
transparent
;
overflow
:
auto
;
overflow
:
auto
hidden
;
color
:
#333
;
color
:
#333
;
tr
{
tr
{
line-height
:
30px
;
line-height
:
30px
;
...
...
test/config/training_service.yml
View file @
bf8be1e7
...
@@ -10,7 +10,7 @@ kubeflow:
...
@@ -10,7 +10,7 @@ kubeflow:
kubeflowConfig
:
kubeflowConfig
:
operator
:
tf-operator
operator
:
tf-operator
apiVersion
:
v1
alpha2
apiVersion
:
v1
storage
:
azureStorage
storage
:
azureStorage
keyVault
:
keyVault
:
vaultName
:
vaultName
:
...
...
tools/nni_cmd/config_utils.py
View file @
bf8be1e7
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
import
os
import
os
import
json
import
json
import
shutil
from
.constants
import
NNICTL_HOME_DIR
from
.constants
import
NNICTL_HOME_DIR
from
.command_utils
import
print_error
class
Config
:
class
Config
:
'''a util class to load and save config'''
'''a util class to load and save config'''
...
@@ -77,7 +79,13 @@ class Experiments:
...
@@ -77,7 +79,13 @@ class Experiments:
def
remove_experiment
(
self
,
expId
):
def
remove_experiment
(
self
,
expId
):
'''remove an experiment by id'''
'''remove an experiment by id'''
if
expId
in
self
.
experiments
:
if
expId
in
self
.
experiments
:
self
.
experiments
.
pop
(
expId
)
fileName
=
self
.
experiments
.
pop
(
expId
).
get
(
'fileName'
)
if
fileName
:
logPath
=
os
.
path
.
join
(
NNICTL_HOME_DIR
,
fileName
)
try
:
shutil
.
rmtree
(
logPath
)
except
FileNotFoundError
:
print_error
(
'{0} does not exist.'
.
format
(
logPath
))
self
.
write_file
()
self
.
write_file
()
def
get_all_experiments
(
self
):
def
get_all_experiments
(
self
):
...
...
Prev
1
2
3
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