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
b51c1562
"vscode:/vscode.git/clone" did not exist on "0b6807caa4c9d555aca65ccc57319cf47cf4920e"
Commit
b51c1562
authored
Oct 16, 2018
by
Lijiao
Committed by
fishyds
Oct 16, 2018
Browse files
Fix bug of trial hypermeters (#222)
parent
b88d3909
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
16 deletions
+59
-16
src/webui/src/components/Para.tsx
src/webui/src/components/Para.tsx
+1
-1
src/webui/src/components/Sessionpro.tsx
src/webui/src/components/Sessionpro.tsx
+29
-8
src/webui/src/components/TrialStatus.tsx
src/webui/src/components/TrialStatus.tsx
+26
-7
src/webui/src/style/logPath.css
src/webui/src/style/logPath.css
+3
-0
No files found.
src/webui/src/components/Para.tsx
View file @
b51c1562
...
...
@@ -99,7 +99,7 @@ class Para extends React.Component<{}, ParaState> {
speDimName
.
push
(
tem
);
}
if
(
accParaData
[
item
].
status
===
'
SUCCEEDED
'
)
{
if
(
accParaData
[
item
].
finalMetricData
!==
undefined
)
{
if
(
accParaData
[
item
].
finalMetricData
&&
accParaData
[
item
].
hyperParameters
)
{
// get acc array
accPara
.
push
(
parseFloat
(
accParaData
[
item
].
finalMetricData
.
data
));
// get dim and every line specific number
...
...
src/webui/src/components/Sessionpro.tsx
View file @
b51c1562
...
...
@@ -7,6 +7,10 @@ import JSONTree from 'react-json-tree';
require
(
'
../style/sessionpro.css
'
);
require
(
'
../style/logPath.css
'
);
interface
ErrorPara
{
error
?:
string
;
}
interface
TableObj
{
key
:
number
;
id
:
string
;
...
...
@@ -19,7 +23,7 @@ interface TableObj {
}
interface
Parameters
{
parameters
:
object
;
parameters
:
ErrorPara
;
logPath
?:
string
;
isLink
?:
boolean
;
}
...
...
@@ -189,7 +193,11 @@ class Sessionpro extends React.Component<{}, SessionState> {
if
(
tableData
[
item
].
finalMetricData
)
{
acc
=
parseFloat
(
tableData
[
item
].
finalMetricData
.
data
);
}
desJobDetail
.
parameters
=
JSON
.
parse
(
tableData
[
item
].
hyperParameters
).
parameters
;
if
(
tableData
[
item
].
hyperParameters
)
{
desJobDetail
.
parameters
=
JSON
.
parse
(
tableData
[
item
].
hyperParameters
).
parameters
;
}
else
{
desJobDetail
.
parameters
=
{
error
:
'
This trial
\'
s parameters are not available.
'
};
}
if
(
tableData
[
item
].
logPath
!==
undefined
)
{
desJobDetail
.
logPath
=
tableData
[
item
].
logPath
;
const
isSessionLink
=
/^http/gi
.
test
(
tableData
[
item
].
logPath
);
...
...
@@ -344,6 +352,10 @@ class Sessionpro extends React.Component<{}, SessionState> {
}];
const
openRow
=
(
record
:
TableObj
)
=>
{
let
isHasParameters
=
true
;
if
(
record
.
description
.
parameters
.
error
)
{
isHasParameters
=
false
;
}
const
openRowDataSource
=
{
parameters
:
record
.
description
.
parameters
};
...
...
@@ -354,12 +366,21 @@ class Sessionpro extends React.Component<{}, SessionState> {
}
return
(
<
pre
id
=
"description"
className
=
"jsontree"
>
<
JSONTree
hideRoot
=
{
true
}
shouldExpandNode
=
{
()
=>
true
}
// default expandNode
getItemString
=
{
()
=>
(<
span
/>)
}
// remove the {} items
data
=
{
openRowDataSource
}
/>
{
isHasParameters
?
<
JSONTree
hideRoot
=
{
true
}
shouldExpandNode
=
{
()
=>
true
}
// default expandNode
getItemString
=
{
()
=>
(<
span
/>)
}
// remove the {} items
data
=
{
openRowDataSource
}
/>
:
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
Error:
</
span
>
<
span
className
=
"error"
>
'This trial's parameters are not available.'
</
span
>
</
div
>
}
{
isLogLink
?
...
...
src/webui/src/components/TrialStatus.tsx
View file @
b51c1562
...
...
@@ -17,8 +17,12 @@ echarts.registerTheme('my_theme', {
color
:
'
#3c8dbc
'
});
interface
ErrorPara
{
error
?:
string
;
}
interface
DescObj
{
parameters
:
Object
;
parameters
:
ErrorPara
;
logPath
?:
string
;
isLink
?:
boolean
;
}
...
...
@@ -237,6 +241,8 @@ class TrialStatus extends React.Component<{}, TabState> {
:
''
;
if
(
trialJobs
[
item
].
hyperParameters
!==
undefined
)
{
desc
.
parameters
=
JSON
.
parse
(
trialJobs
[
item
].
hyperParameters
).
parameters
;
}
else
{
desc
.
parameters
=
{
error
:
'
This trial
\'
s parameters are not available.
'
};
}
if
(
trialJobs
[
item
].
logPath
!==
undefined
)
{
desc
.
logPath
=
trialJobs
[
item
].
logPath
;
...
...
@@ -478,6 +484,10 @@ class TrialStatus extends React.Component<{}, TabState> {
];
const
openRow
=
(
record
:
TableObj
)
=>
{
let
isHasParameters
=
true
;
if
(
record
.
description
.
parameters
.
error
)
{
isHasParameters
=
false
;
}
const
parametersRow
=
{
parameters
:
record
.
description
.
parameters
};
...
...
@@ -488,12 +498,21 @@ class TrialStatus extends React.Component<{}, TabState> {
}
return
(
<
pre
className
=
"hyperpar"
>
<
JSONTree
hideRoot
=
{
true
}
shouldExpandNode
=
{
()
=>
true
}
// default expandNode
getItemString
=
{
()
=>
(<
span
/>)
}
// remove the {} items
data
=
{
parametersRow
}
/>
{
isHasParameters
?
<
JSONTree
hideRoot
=
{
true
}
shouldExpandNode
=
{
()
=>
true
}
// default expandNode
getItemString
=
{
()
=>
(<
span
/>)
}
// remove the {} items
data
=
{
parametersRow
}
/>
:
<
div
className
=
"logpath"
>
<
span
className
=
"logName"
>
Error:
</
span
>
<
span
className
=
"error"
>
'This trial's parameters are not available.'
</
span
>
</
div
>
}
{
isLogLink
?
...
...
src/webui/src/style/logPath.css
View file @
b51c1562
...
...
@@ -12,3 +12,6 @@
color
:
blue
;
text-decoration
:
underline
;
}
.error
{
color
:
#CB4B16
;
}
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