Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
2d9c7a55
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
8
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2d9c7a55
编写于
6月 23, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 23, 2020
浏览文件
操作
浏览文件
下载
差异文件
!341 Improve the overall function logic of setting threshold
Merge pull request !341 from 王卫宁/wwn
上级
d7cb244c
5a7c61ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
95 addition
and
116 deletion
+95
-116
mindinsight/ui/src/views/train-manage/scalar.vue
mindinsight/ui/src/views/train-manage/scalar.vue
+95
-116
未找到文件。
mindinsight/ui/src/views/train-manage/scalar.vue
浏览文件 @
2d9c7a55
...
...
@@ -652,6 +652,37 @@ export default {
// Draw chart
if
(
!
this
.
compare
)
{
this
.
updateOrCreateChar
(
sampleIndex
);
this
.
getCache
();
if
(
this
.
thresholdLocal
&&
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
&&
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
)
{
const
tempStorgeArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
],
),
);
let
pieceStr
=
''
;
pieceStr
=
this
.
formatePieceStr
(
tempStorgeArr
);
sampleObject
.
pieceStr
=
pieceStr
;
tempStorgeArr
.
forEach
((
item
)
=>
{
item
.
color
=
this
.
thresholdColor
;
});
if
(
sampleObject
.
charObj
)
{
this
.
setVisualMap
(
sampleObject
,
tempStorgeArr
);
}
}
else
{
sampleObject
.
pieceStr
=
''
;
sampleObject
.
charData
.
charOption
.
series
[
0
].
markLine
=
false
;
}
}
else
{
this
.
abort
=
true
;
}
...
...
@@ -678,8 +709,6 @@ export default {
}
let
returnFlag
=
false
;
const
seriesData
=
[];
const
piecesData
=
[];
const
markLineData
=
[];
const
oriData
=
sampleObject
.
charData
.
oriData
;
const
runName
=
sampleObject
.
runNames
;
const
curBackName
=
runName
+
this
.
backendString
;
...
...
@@ -691,6 +720,7 @@ export default {
lineStyle
:
{
color
:
sampleObject
.
colors
,
},
markLine
:
[],
};
const
dataObjBackend
=
{
name
:
curBackName
,
...
...
@@ -720,96 +750,6 @@ export default {
}
else
{
returnFlag
=
true
;
}
this
.
getCache
();
if
(
this
.
thresholdLocal
&&
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
&&
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
)
{
const
tempStorgeArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
],
),
);
tempStorgeArr
.
forEach
((
item
)
=>
{
if
(
item
.
lt
)
{
item
.
lt
=
Number
(
item
.
lt
.
toFixed
(
5
));
}
if
(
item
.
gt
)
{
item
.
gt
=
Number
(
item
.
gt
.
toFixed
(
5
));
}
});
let
pieceStr
=
''
;
if
(
tempStorgeArr
.
length
===
1
)
{
if
(
!
isNaN
(
tempStorgeArr
[
0
].
gt
)
&&
!
isNaN
(
tempStorgeArr
[
0
].
lt
))
{
pieceStr
=
`(
${
tempStorgeArr
[
0
].
gt
}
,
${
tempStorgeArr
[
0
].
lt
}
)`
;
}
else
if
(
!
isNaN
(
tempStorgeArr
[
0
].
gt
)
&&
isNaN
(
tempStorgeArr
[
0
].
lt
)
)
{
pieceStr
=
`(
${
tempStorgeArr
[
0
].
gt
}
,Infinity)`
;
}
else
if
(
!
isNaN
(
tempStorgeArr
[
0
].
lt
)
&&
isNaN
(
tempStorgeArr
[
0
].
gt
)
)
{
pieceStr
=
`(-Infinity,
${
tempStorgeArr
[
0
].
lt
}
)`
;
}
}
if
(
tempStorgeArr
.
length
===
2
)
{
if
(
!
isNaN
(
tempStorgeArr
[
0
].
lt
)
&&
!
isNaN
(
tempStorgeArr
[
1
].
gt
))
{
pieceStr
=
`(-Infinity,
${
tempStorgeArr
[
0
].
lt
}
),(
${
tempStorgeArr
[
1
].
gt
}
,Infinity)`
;
}
else
if
(
!
isNaN
(
tempStorgeArr
[
0
].
gt
)
&&
!
isNaN
(
tempStorgeArr
[
1
].
lt
)
)
{
pieceStr
=
`(-Infinity,
${
tempStorgeArr
[
1
].
lt
}
),(
${
tempStorgeArr
[
0
].
gt
}
,Infinity)`
;
}
}
sampleObject
.
pieceStr
=
pieceStr
;
if
(
tempStorgeArr
.
length
===
1
)
{
let
itemValue
;
if
(
tempStorgeArr
[
0
][
'
lt
'
]
||
tempStorgeArr
[
0
][
'
lt
'
]
===
0
)
{
itemValue
=
tempStorgeArr
[
0
][
'
lt
'
];
}
else
{
itemValue
=
tempStorgeArr
[
0
][
'
gt
'
];
}
tempStorgeArr
.
push
({
value
:
tempStorgeArr
[
0
][
'
lt
'
]
||
tempStorgeArr
[
0
][
'
lt
'
]
===
0
?
itemValue
+
1
:
itemValue
-
1
,
});
}
tempStorgeArr
.
forEach
((
item
)
=>
{
if
(
item
.
lt
||
item
.
lt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
||
item
.
gt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
}
item
.
color
=
this
.
thresholdColor
;
piecesData
.
push
(
item
);
});
dataObj
.
lineStyle
.
color
=
null
;
dataObj
.
markLine
=
{
precision
:
5
,
silent
:
true
,
data
:
markLineData
,
};
}
else
{
sampleObject
.
pieceStr
=
''
;
dataObj
.
markLine
=
null
;
}
seriesData
.
push
(
dataObj
,
dataObjBackend
);
if
(
returnFlag
)
{
...
...
@@ -1107,6 +1047,7 @@ export default {
},
series
:
seriesData
,
};
return
tempOption
;
},
...
...
@@ -1727,7 +1668,43 @@ export default {
sampleObject
.
updateFlag
=
true
;
sampleObject
.
charObj
.
clear
();
this
.
updateOrCreateChar
(
sampleIndex
);
const
tempOption
=
sampleObject
.
charData
.
charOption
;
if
(
tempOption
.
visualMap
&&
tempOption
.
visualMap
[
'
pieces
'
]
&&
tempOption
.
visualMap
[
'
pieces
'
].
length
>
0
)
{
tempOption
.
visualMap
=
false
;
tempOption
.
series
[
0
].
markLine
=
null
;
sampleObject
.
charObj
.
setOption
(
tempOption
,
true
);
this
.
getCache
();
if
(
this
.
thresholdLocal
&&
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
&&
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
)
{
const
tempStorgeArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
],
),
);
tempStorgeArr
.
forEach
((
item
)
=>
{
item
.
color
=
this
.
thresholdColor
;
});
if
(
sampleObject
.
charObj
)
{
this
.
setVisualMap
(
sampleObject
,
tempStorgeArr
);
}
}
else
{
sampleObject
.
pieceStr
=
''
;
sampleObject
.
charData
.
charOption
.
series
[
0
].
markLine
=
false
;
}
}
else
{
this
.
updateOrCreateChar
(
sampleIndex
);
}
},
/**
...
...
@@ -1803,6 +1780,7 @@ export default {
*/
delThreshold
(
sampleItem
)
{
this
.
stopUpdateSamples
();
this
.
$confirm
(
this
.
$t
(
'
scalar.isDelete
'
),
this
.
$t
(
'
scalar.info
'
),
{
confirmButtonText
:
this
.
$t
(
'
public.sure
'
),
cancelButtonText
:
this
.
$t
(
'
public.cancel
'
),
...
...
@@ -1826,17 +1804,27 @@ export default {
}
sampleItem
.
pieceStr
=
''
;
const
tempCharOption
=
sampleItem
.
charData
.
charOption
;
tempCharOption
.
visualMap
.
pieces
=
[];
tempCharOption
.
visualMap
=
false
;
tempCharOption
.
series
[
0
].
lineStyle
.
color
=
sampleItem
.
colors
;
tempCharOption
.
series
[
0
].
markLine
=
[];
if
(
tempCharOption
.
visualMap
&&
tempCharOption
.
visualMap
[
'
pieces
'
]
&&
tempCharOption
.
visualMap
[
'
pieces
'
].
length
>
0
)
{
tempCharOption
.
visualMap
=
false
;
tempCharOption
.
series
[
0
].
markLine
=
null
;
tempCharOption
.
series
[
0
].
lineStyle
.
color
=
sampleItem
.
colors
;
}
sampleItem
.
charObj
.
setOption
(
tempCharOption
,
true
);
if
(
this
.
isTimeReload
)
{
this
.
autoUpdateSamples
();
}
sampleItem
.
charObj
.
setOption
(
tempCharOption
,
true
);
this
.
$forceUpdate
();
})
.
catch
(()
=>
{});
.
catch
(()
=>
{
if
(
this
.
isTimeReload
)
{
this
.
autoUpdateSamples
();
}
});
},
/**
...
...
@@ -1927,17 +1915,18 @@ export default {
*/
setVisualMap
(
sampleObject
,
chartPieces
)
{
// empty array
if
(
chartPieces
.
length
===
0
)
{
return
;
}
const
markLineData
=
[];
chartPieces
.
forEach
((
item
)
=>
{
if
(
item
.
lt
||
item
.
lt
===
0
)
{
if
(
!
isNaN
(
item
.
lt
)
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
||
item
.
gt
===
0
)
{
if
(
!
isNaN
(
item
.
gt
)
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
...
...
@@ -1950,6 +1939,7 @@ export default {
item
.
color
=
this
.
thresholdColor
;
});
// one filter condition
if
(
chartPiecesTemp
.
length
===
1
)
{
if
(
!
isNaN
(
chartPiecesTemp
[
0
][
'
lt
'
])
&&
...
...
@@ -2001,6 +1991,7 @@ export default {
}
}
// two filter condition
if
(
chartPiecesTemp
.
length
===
2
)
{
const
relationalArr
=
[];
relationalArr
[
0
]
=
chartPiecesTemp
[
0
].
lt
||
chartPiecesTemp
[
1
].
lt
;
...
...
@@ -2058,6 +2049,7 @@ export default {
*/
formatePieceStr
(
piecesArr
)
{
// empty array
if
(
piecesArr
.
length
===
0
)
{
return
;
}
...
...
@@ -2070,6 +2062,7 @@ export default {
}
});
let
pieceStr
;
// only one filter condition
if
(
piecesArr
.
length
===
1
)
{
if
(
!
isNaN
(
piecesArr
[
0
].
gt
)
&&
!
isNaN
(
piecesArr
[
0
].
lt
))
{
pieceStr
=
`(
${
piecesArr
[
0
].
gt
}
,
${
piecesArr
[
0
].
lt
}
)`
;
...
...
@@ -2079,6 +2072,7 @@ export default {
pieceStr
=
`(-Infinity,
${
piecesArr
[
0
].
lt
}
)`
;
}
}
// two filter condition
if
(
piecesArr
.
length
===
2
)
{
if
(
!
isNaN
(
piecesArr
[
0
].
lt
)
&&
!
isNaN
(
piecesArr
[
1
].
gt
))
{
pieceStr
=
`(-Infinity,
${
piecesArr
[
0
].
lt
}
),(
${
piecesArr
[
1
].
gt
}
,Infinity)`
;
...
...
@@ -2152,21 +2146,6 @@ export default {
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
=
{};
}
const
markLineData
=
[];
chartPieces
.
forEach
((
item
)
=>
{
if
(
item
.
lt
||
item
.
lt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
||
item
.
gt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
}
});
const
chartPiecesTemp
=
JSON
.
parse
(
JSON
.
stringify
(
chartPieces
));
chartPiecesTemp
.
forEach
((
item
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录