Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
68fe7b8c
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
68fe7b8c
编写于
4月 26, 2020
作者:
P
ph
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix histogram and data-map issue
上级
04782eb9
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
173 addition
and
15 deletion
+173
-15
mindinsight/ui/src/assets/images/fit.png
mindinsight/ui/src/assets/images/fit.png
+0
-0
mindinsight/ui/src/locales/zh-cn.json
mindinsight/ui/src/locales/zh-cn.json
+7
-5
mindinsight/ui/src/views/train-manage/data-map.vue
mindinsight/ui/src/views/train-manage/data-map.vue
+126
-2
mindinsight/ui/src/views/train-manage/graph.vue
mindinsight/ui/src/views/train-manage/graph.vue
+4
-0
mindinsight/ui/src/views/train-manage/histogram.vue
mindinsight/ui/src/views/train-manage/histogram.vue
+22
-8
mindinsight/ui/src/views/train-manage/training-dashboard.vue
mindinsight/ui/src/views/train-manage/training-dashboard.vue
+14
-0
未找到文件。
mindinsight/ui/src/assets/images/fit.png
0 → 100644
浏览文件 @
68fe7b8c
403 字节
mindinsight/ui/src/locales/zh-cn.json
浏览文件 @
68fe7b8c
...
...
@@ -45,8 +45,8 @@
"learningRate"
:
"学习率"
,
"modelSize"
:
"模型大小"
,
"dataProcess"
:
"数据处理"
,
"noDataFound"
:
"暂无满足筛选条件的数据"
,
"noDataTips"
:
"请点击“显示全量数据”按钮查看全量数据"
,
"noDataFound"
:
"暂无满足筛选条件的数据"
,
"noDataTips"
:
"请点击“显示全量数据”按钮查看全量数据"
,
"userDefined"
:
"自定义数据"
,
"metric"
:
"度量指标"
,
"deviceNum"
:
"device数目"
...
...
@@ -56,8 +56,8 @@
"key"
:
"KEY"
,
"value"
:
"VALUE"
,
"dataTraceTips"
:
"该数据涉及合并操作"
,
"noDataFound"
:
"暂无满足筛选条件的数据"
,
"noDataTips"
:
"请点击“显示全量数据”按钮查看全量数据"
"noDataFound"
:
"暂无满足筛选条件的数据"
,
"noDataTips"
:
"请点击“显示全量数据”按钮查看全量数据"
},
"trainingDashboard"
:
{
"trainingDashboardTitle"
:
"训练看板"
,
...
...
@@ -66,7 +66,8 @@
"trainingScalar"
:
"训练标量信息"
,
"samplingData"
:
"数据抽样"
,
"imagesampleSwitch"
:
"切换标签"
,
"invalidId"
:
"无效的训练作业"
"invalidId"
:
"无效的训练作业"
,
"summaryDirPath"
:
"summary路径:"
},
"scalar"
:
{
"titleText"
:
"标量"
,
...
...
@@ -120,6 +121,7 @@
"graph"
:
{
"titleText"
:
"计算图"
,
"downloadPic"
:
"下载"
,
"fitScreen"
:
"适应屏幕"
,
"nodeInfo"
:
"节点信息"
,
"legend"
:
"图例"
,
"nameSpace"
:
"命名空间"
,
...
...
mindinsight/ui/src/views/train-manage/data-map.vue
浏览文件 @
68fe7b8c
...
...
@@ -46,6 +46,9 @@ limitations under the License.
<div
:title=
"$t('graph.fullScreen')"
class=
"full-screen-button"
@
click=
"fullScreen = !fullScreen"
></div>
<div
:title=
"$t('graph.fitScreen')"
class=
"fit-screen"
@
click=
"fit()"
></div>
</div>
<!-- Right column -->
<div
id=
"sidebar"
...
...
@@ -340,6 +343,7 @@ export default {
* Initialization method executed after the graph rendering is complete
*/
startApp
()
{
this
.
initZooming
();
const
nodes
=
d3
.
selectAll
(
'
g.node, g.cluster
'
);
nodes
.
on
(
'
click
'
,
(
target
,
index
,
nodesList
)
=>
{
this
.
selectNodeInfo
(
target
);
...
...
@@ -347,9 +351,109 @@ export default {
nodes
.
classed
(
'
selected
'
,
false
);
d3
.
select
(
`g[id="
${
selectedNode
.
id
}
"]`
).
classed
(
'
selected
'
,
true
);
});
d3
.
select
(
'
svg
'
).
on
(
'
dblclick.zoom
'
,
null
);
},
/**
* Initializing the Zoom Function of a Graph
*/
initZooming
()
{
const
graphDom
=
document
.
querySelector
(
'
#graph0
'
);
const
graphBox
=
graphDom
.
getBBox
();
const
padding
=
4
;
const
pointer
=
{
start
:
{
x
:
0
,
y
:
0
,
},
end
:
{
x
:
0
,
y
:
0
,
},
};
const
zoom
=
d3
.
zoom
()
.
on
(
'
start
'
,
(
target
)
=>
{
pointer
.
start
.
x
=
event
.
x
;
pointer
.
start
.
y
=
event
.
y
;
})
.
on
(
'
zoom
'
,
(
target
)
=>
{
const
transformData
=
this
.
getTransformData
(
graphDom
);
let
tempStr
=
''
;
let
change
=
{};
let
scale
=
transformData
.
scale
[
0
];
const
graphRect
=
graphDom
.
getBoundingClientRect
();
const
mapping
=
{
width
:
graphBox
.
width
/
graphRect
.
width
,
height
:
graphBox
.
height
/
graphRect
.
height
,
};
if
(
event
.
type
===
'
mousemove
'
)
{
pointer
.
end
.
x
=
event
.
x
;
pointer
.
end
.
y
=
event
.
y
;
change
=
{
x
:
(
pointer
.
end
.
x
-
pointer
.
start
.
x
)
*
mapping
.
width
*
scale
,
y
:
(
pointer
.
end
.
y
-
pointer
.
start
.
y
)
*
mapping
.
height
*
scale
,
};
pointer
.
start
.
x
=
pointer
.
end
.
x
;
pointer
.
start
.
y
=
pointer
.
end
.
y
;
}
else
if
(
event
.
type
===
'
wheel
'
)
{
const
wheelDelta
=
event
.
wheelDelta
;
const
rate
=
Math
.
abs
(
wheelDelta
/
100
);
scale
=
wheelDelta
>
0
?
transformData
.
scale
[
0
]
*
rate
:
transformData
.
scale
[
0
]
/
rate
;
scale
=
Math
.
max
(
this
.
scaleRange
[
0
],
scale
);
scale
=
Math
.
min
(
this
.
scaleRange
[
1
],
scale
);
change
=
{
x
:
(
graphRect
.
x
+
padding
/
mapping
.
width
-
event
.
x
)
*
mapping
.
width
*
(
scale
-
transformData
.
scale
[
0
]),
y
:
(
graphRect
.
bottom
-
padding
/
mapping
.
height
-
event
.
y
)
*
mapping
.
height
*
(
scale
-
transformData
.
scale
[
0
]),
};
}
tempStr
=
`translate(
${
transformData
.
translate
[
0
]
+
change
.
x
}
,
${
transformData
.
translate
[
1
]
+
change
.
y
}
) scale(
${
scale
}
)`
;
graphDom
.
setAttribute
(
'
transform
'
,
tempStr
);
});
const
svg
=
d3
.
select
(
'
svg
'
);
svg
.
on
(
'
.zoom
'
,
null
);
svg
.
call
(
zoom
);
svg
.
on
(
'
dblclick.zoom
'
,
null
);
},
/**
* Obtains the transform data of a node.
* @param {Object} node Node dom data
* @return {Object} transform data of a node
*/
getTransformData
(
node
)
{
if
(
!
node
)
{
return
[];
}
const
transformData
=
node
.
getAttribute
(
'
transform
'
);
const
attrObj
=
{};
if
(
transformData
)
{
const
lists
=
transformData
.
trim
().
split
(
'
'
);
lists
.
forEach
((
item
)
=>
{
const
index1
=
item
.
indexOf
(
'
(
'
);
const
index2
=
item
.
indexOf
(
'
)
'
);
const
name
=
item
.
substring
(
0
,
index1
);
const
params
=
item
.
substring
(
index1
+
1
,
index2
)
.
split
(
'
,
'
)
.
map
((
i
)
=>
{
return
parseFloat
(
i
)
||
0
;
});
attrObj
[
name
]
=
params
;
});
}
return
attrObj
;
},
/**
* Process the selected node information.
* @param {Object} target Selected Object
...
...
@@ -397,6 +501,15 @@ export default {
});
}
},
/**
* Adapt to the screen
*/
fit
()
{
const
graphDom
=
document
.
getElementById
(
'
graph0
'
);
const
box
=
graphDom
.
getBBox
();
const
str
=
`translate(
${
-
box
.
x
}
,
${
-
box
.
y
}
) scale(1)`
;
graphDom
.
setAttribute
(
'
transform
'
,
str
);
},
/**
* Collapse on the right
*/
...
...
@@ -511,10 +624,21 @@ export default {
cursor
:
pointer
;
width
:
12px
;
height
:
12px
;
z-index
:
999
;
z-index
:
999
;
display
:
inline-block
;
background-image
:
url('../../assets/images/full-screen.png')
;
}
.fit-screen
{
position
:
absolute
;
width
:
16px
;
height
:
14px
;
right
:
32px
;
top
:
10px
;
z-index
:
999
;
cursor
:
pointer
;
display
:
inline-block
;
background-image
:
url('../../assets/images/fit.png')
;
}
}
}
.cl-data-map.full-screen
{
...
...
mindinsight/ui/src/views/train-manage/graph.vue
浏览文件 @
68fe7b8c
...
...
@@ -1010,6 +1010,10 @@ export default {
source
=
node
.
name
;
for
(
let
i
=
0
;
i
<
Math
.
min
(
5
,
keys
.
length
);
i
++
)
{
target
=
keys
[
i
];
isConst
=
!!
(
this
.
allGraphData
[
keys
[
i
]]
&&
this
.
allGraphData
[
keys
[
i
]].
type
===
'
Const
'
);
const
nodeStr
=
isConst
?
`shape="circle";width="0.14";height="0.14";fixedsize=true;`
+
`label="
${
target
.
split
(
'
/
'
).
pop
()}
\n\n\n";`
...
...
mindinsight/ui/src/views/train-manage/histogram.vue
浏览文件 @
68fe7b8c
...
...
@@ -138,6 +138,8 @@ export default {
zrDrawElement
:
{
hoverDots
:
[]},
chartTipFlag
:
false
,
charResizeTimer
:
null
,
changeAxisTimer
:
null
,
changeViewTimer
:
null
,
};
},
computed
:
{
...
...
@@ -394,19 +396,29 @@ export default {
* @param {Number} val Current mode
*/
timeTypeChange
(
val
)
{
if
(
this
.
changeAxisTimer
)
{
clearTimeout
(
this
.
changeAxisTimer
);
}
this
.
changeAxisTimer
=
setTimeout
(()
=>
{
this
.
curPageArr
.
forEach
((
item
)
=>
{
this
.
updateSampleData
(
item
);
});
},
500
);
},
/**
* The view display type is changed
* @param {Number} val Current mode
*/
viewTypeChange
(
val
)
{
if
(
this
.
changeViewTimer
)
{
clearTimeout
(
this
.
changeViewTimer
);
}
this
.
changeViewTimer
=
setTimeout
(()
=>
{
this
.
curPageArr
.
forEach
((
item
)
=>
{
this
.
formatDataToChar
(
item
);
this
.
updateSampleData
(
item
);
});
},
200
);
},
/**
* Update the data list based on the filtered tags
...
...
@@ -996,7 +1008,9 @@ export default {
const
z
=
this
.
getValue
(
rawData
,
dataIndex
,
i
++
);
const
pt
=
getCoord
([
x
,
y
],
sampleObject
);
// linear map in z axis
if
(
maxZ
!==
minZ
)
{
pt
[
1
]
-=
((
z
-
minZ
)
/
(
maxZ
-
minZ
))
*
yValueMapHeight
;
}
points
.
push
(
pt
);
}
return
points
;
...
...
mindinsight/ui/src/views/train-manage/training-dashboard.vue
浏览文件 @
68fe7b8c
...
...
@@ -21,6 +21,12 @@ limitations under the License.
<div
class=
"cl-dashboard-top-title"
>
{{
$t
(
'
trainingDashboard.trainingDashboardTitle
'
)
}}
</div>
<div
class=
"path-message"
>
<span>
{{
$t
(
'
symbols.leftbracket
'
)
}}
</span>
<span>
{{
$t
(
'
trainingDashboard.summaryDirPath
'
)
}}
</span>
<span>
{{
summaryPath
}}
</span>
<span>
{{
$t
(
'
symbols.rightbracket
'
)
}}
</span>
</div>
</div>
<div
class=
"cl-dashboard-center"
>
<div
class=
"cl-dashboard-con-up"
...
...
@@ -166,6 +172,7 @@ export default {
return
{
// training job id
trainingJobId
:
''
,
summaryPath
:
''
,
defColorCount
:
CommonProperty
.
commonColorArr
.
length
,
// default color
colorNum
:
0
,
charObj
:
null
,
...
...
@@ -284,6 +291,7 @@ export default {
init
()
{
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
id
)
{
this
.
trainingJobId
=
this
.
$route
.
query
.
id
;
this
.
summaryPath
=
decodeURIComponent
(
this
.
trainingJobId
);
}
else
{
this
.
trainingJobId
=
''
;
this
.
$message
.
error
(
this
.
$t
(
'
trainingDashboard.invalidId
'
));
...
...
@@ -1720,6 +1728,12 @@ export default {
height
:
56px
;
vertical-align
:
middle
;
background
:
#ffffff
;
.path-message
{
display
:
inline-block
;
line-height
:
20px
;
padding
:
18px
16px
;
font-weight
:
bold
;
}
.cl-dashboard-top-title
{
float
:
left
;
color
:
#000000
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录