Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
tensorflow
提交
b286628d
T
tensorflow
项目概览
xxadev
/
tensorflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b286628d
编写于
3月 14, 2017
作者:
D
Dandelion Mané
提交者:
TensorFlower Gardener
3月 14, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Automated rollback of change 148478960
Change: 150139549
上级
b083c1b6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
191 addition
and
3 deletion
+191
-3
tensorflow/tensorboard/backend/application.py
tensorflow/tensorboard/backend/application.py
+34
-2
tensorflow/tensorboard/components/tf_dashboard_common/tf-categorizer.html
...rboard/components/tf_dashboard_common/tf-categorizer.html
+1
-0
tensorflow/tensorboard/components/tf_dashboard_common/tf-dashboard.html
...sorboard/components/tf_dashboard_common/tf-dashboard.html
+1
-0
tensorflow/tensorboard/components/tf_dashboard_common/tf-downloader.html
...orboard/components/tf_dashboard_common/tf-downloader.html
+99
-0
tensorflow/tensorboard/components/tf_dashboard_common/tf-panes-helper.html
...board/components/tf_dashboard_common/tf-panes-helper.html
+35
-1
tensorflow/tensorboard/components/tf_histogram_dashboard/tf-histogram-dashboard.html
...onents/tf_histogram_dashboard/tf-histogram-dashboard.html
+1
-0
tensorflow/tensorboard/components/tf_scalar_dashboard/tf-scalar-dashboard.html
...d/components/tf_scalar_dashboard/tf-scalar-dashboard.html
+20
-0
未找到文件。
tensorflow/tensorboard/backend/application.py
浏览文件 @
b286628d
...
...
@@ -22,6 +22,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
csv
import
imghdr
import
mimetypes
import
os
...
...
@@ -30,7 +31,9 @@ import threading
import
time
import
six
from
six
import
StringIO
from
six.moves
import
urllib
from
six.moves
import
xrange
# pylint: disable=redefined-builtin
from
six.moves.urllib
import
parse
as
urlparse
from
werkzeug
import
wrappers
...
...
@@ -89,6 +92,7 @@ class _OutputFormat(object):
compressed histograms support CSV).
"""
JSON
=
'json'
CSV
=
'csv'
def
standard_tensorboard_wsgi
(
logdir
,
purge_orphaned_data
,
reload_interval
):
...
...
@@ -266,7 +270,14 @@ class TensorBoardWSGIApp(object):
run
=
request
.
args
.
get
(
'run'
)
values
=
self
.
_multiplexer
.
Scalars
(
run
,
tag
)
return
http_util
.
Respond
(
request
,
values
,
'application/json'
)
if
request
.
args
.
get
(
'format'
)
==
_OutputFormat
.
CSV
:
string_io
=
StringIO
()
writer
=
csv
.
writer
(
string_io
)
writer
.
writerow
([
'Wall time'
,
'Step'
,
'Value'
])
writer
.
writerows
(
values
)
return
http_util
.
Respond
(
request
,
string_io
.
getvalue
(),
'text/csv'
)
else
:
return
http_util
.
Respond
(
request
,
values
,
'application/json'
)
@
wrappers
.
Request
.
application
def
_serve_graph
(
self
,
request
):
...
...
@@ -331,7 +342,28 @@ class TensorBoardWSGIApp(object):
tag
=
request
.
args
.
get
(
'tag'
)
run
=
request
.
args
.
get
(
'run'
)
compressed_histograms
=
self
.
_multiplexer
.
CompressedHistograms
(
run
,
tag
)
return
http_util
.
Respond
(
request
,
compressed_histograms
,
'application/json'
)
if
request
.
args
.
get
(
'format'
)
==
_OutputFormat
.
CSV
:
string_io
=
StringIO
()
writer
=
csv
.
writer
(
string_io
)
# Build the headers; we have two columns for timing and two columns for
# each compressed histogram bucket.
headers
=
[
'Wall time'
,
'Step'
]
if
compressed_histograms
:
bucket_count
=
len
(
compressed_histograms
[
0
].
compressed_histogram_values
)
for
i
in
xrange
(
bucket_count
):
headers
+=
[
'Edge %d basis points'
%
i
,
'Edge %d value'
%
i
]
writer
.
writerow
(
headers
)
for
compressed_histogram
in
compressed_histograms
:
row
=
[
compressed_histogram
.
wall_time
,
compressed_histogram
.
step
]
for
value
in
compressed_histogram
.
compressed_histogram_values
:
row
+=
[
value
.
rank_in_bps
,
value
.
value
]
writer
.
writerow
(
row
)
return
http_util
.
Respond
(
request
,
string_io
.
getvalue
(),
'text/csv'
)
else
:
return
http_util
.
Respond
(
request
,
compressed_histograms
,
'application/json'
)
@
wrappers
.
Request
.
application
def
_serve_images
(
self
,
request
):
...
...
tensorflow/tensorboard/components/tf_dashboard_common/tf-categorizer.html
浏览文件 @
b286628d
...
...
@@ -49,6 +49,7 @@ categories are exclusive.
<style>
:host
{
display
:
block
;
padding-bottom
:
15px
;
}
paper-checkbox
{
--paper-checkbox-checked-color
:
var
(
--paper-grey-600
);
...
...
tensorflow/tensorboard/components/tf_dashboard_common/tf-dashboard.html
浏览文件 @
b286628d
...
...
@@ -19,6 +19,7 @@ limitations under the License.
<link
rel=
"import"
href=
"tf-dashboard-layout.html"
>
<link
rel=
"import"
href=
"tensorboard-color.html"
>
<link
rel=
"import"
href=
"dashboard-style.html"
>
<link
rel=
"import"
href=
"tf-downloader.html"
>
<link
rel=
"import"
href=
"tf-no-data-warning.html"
>
<script
src=
"reload-behavior.js"
></script>
tensorflow/tensorboard/components/tf_dashboard_common/tf-downloader.html
0 → 100644
浏览文件 @
b286628d
<!--
@license
Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<link
rel=
"import"
href=
"../polymer/polymer.html"
>
<link
rel=
"import"
href=
"../paper-dropdown-menu/paper-dropdown-menu.html"
>
<link
rel=
"import"
href=
"../paper-menu/paper-menu.html"
>
<link
rel=
"import"
href=
"../paper-item/paper-item.html"
>
<dom-module
id=
"tf-downloader"
>
<template>
<paper-dropdown-menu
no-label-float=
"true"
label=
"run to download"
selected-item-label=
"{{_run}}"
>
<paper-menu
class=
"dropdown-content"
>
<template
is=
"dom-repeat"
items=
"[[runs]]"
>
<paper-item
no-label-float=
true
>
[[item]]
</paper-item>
</template>
</paper-menu>
</paper-dropdown-menu>
<div
class=
"center"
>
<span>
<a
download=
"[[_csvName(_run)]]"
href=
"[[_csvUrl(_run, urlFn)]]"
>
CSV
</a>
<a
download=
"[[_jsonName(_run)]]"
href=
"[[_jsonUrl(_run, urlFn)]]"
>
JSON
</a>
</span>
</div>
<style>
:host
{
display
:
flex
;
height
:
32px
;
}
.center
{
display
:
flex
;
align-self
:
center
;
}
paper-dropdown-menu
{
width
:
100px
;
--paper-input-container-label
:
{
font-size
:
10px
;
}
--paper-input-container-input
:
{
font-size
:
10px
;
}
}
a
{
font-size
:
10px
;
border-radius
:
3px
;
border
:
1px
solid
#EEE
;
}
paper-input
{
font-size
:
22px
;
}
</style>
</template>
<script>
Polymer
({
is
:
"
tf-downloader
"
,
properties
:
{
_run
:
String
,
runs
:
Array
,
tag
:
String
,
urlFn
:
Function
,
},
_csvUrl
:
function
(
_run
,
urlFn
)
{
return
urlFn
(
this
.
tag
,
_run
)
+
"
&format=csv
"
;
},
_jsonUrl
:
function
(
_run
,
urlFn
)
{
return
urlFn
(
this
.
tag
,
_run
);
},
_csvName
:
function
(
_run
)
{
return
"
run_
"
+
_run
+
"
,tag_
"
+
this
.
tag
+
"
.csv
"
;
},
_jsonName
:
function
(
_run
)
{
return
"
run-
"
+
_run
+
"
-tag-
"
+
this
.
tag
+
"
.json
"
;
},
});
</script>
</dom-module>
tensorflow/tensorboard/components/tf_dashboard_common/tf-panes-helper.html
浏览文件 @
b286628d
...
...
@@ -26,7 +26,7 @@ It renders a tf-collapsable-pane for each category. Inside each category, the
provided content template is rendered repeatedly for each tag within that
category.
This helper also incorporates an expand button for
This helper also incorporates an expand button
and data download utility
for
each card.
To use it, just specify a template inside tf-panes-helper that contains the
...
...
@@ -47,6 +47,10 @@ code that will be replicated for each tag.
If you want for the template to be replicated for each tag and run, not only for
each tag, you can set the repeatForRuns property to true.
You can also set the showDownloadLinks property, which will show a menu with
options to download JSON and CSV data. For this, you must also set the
downloadLinkUrlFunction property to an appropriate value.
@element tf-panes-helper
-->
<dom-module
id=
"tf-panes-helper"
>
...
...
@@ -87,6 +91,14 @@ each tag, you can set the repeatForRuns property to true.
icon=
"fullscreen"
on-tap=
"_toggleExpanded"
></paper-icon-button>
<template
is=
"dom-if"
if=
"[[showDownloadLinks]]"
>
<tf-downloader
runs=
"[[item.runs]]"
tag=
"[[item.tag]]"
url-fn=
"[[downloadLinkUrlFunction]]"
>
</tf-downloader>
</template>
</div>
</div>
</template>
...
...
@@ -159,6 +171,12 @@ each tag, you can set the repeatForRuns property to true.
.card-expanded
.expand-button
{
background
:
var
(
--tb-ui-light-accent
);
}
tf-downloader
{
margin-right
:
30px
;
pointer-events
:
auto
;
}
</style>
</template>
<script>
...
...
@@ -211,6 +229,22 @@ each tag, you can set the repeatForRuns property to true.
* displayed).
*/
selectedRuns
:
Array
,
/**
* If true, shows a menu with download links for the template data.
* If this is set to true, urlFn must also be provided.
*/
showDownloadLinks
:
Boolean
,
/**
* Function that returns the route to get data to download. Must be
* provided if showDownloadLinks is enabled.
*/
downloadLinkUrlFunction
:
Function
,
_contentTemplate
:
{
type
:
Object
,
value
:
null
},
_stampedTemplates
:
{
type
:
Array
,
value
:
function
()
{
return
[]
}
...
...
tensorflow/tensorboard/components/tf_histogram_dashboard/tf-histogram-dashboard.html
浏览文件 @
b286628d
...
...
@@ -63,6 +63,7 @@ contains vz-histogram-timeseries embedded inside tf-panes-helper's.
run2tag=
"[[run2tag]]"
runs=
"[[runs]]"
selected-runs=
"{{_selectedRuns}}"
show-download-links=
"{{_showDownloadLinks}}"
>
<div
class=
"sidebar-section"
>
<tf-option-selector
...
...
tensorflow/tensorboard/components/tf_scalar_dashboard/tf-scalar-dashboard.html
浏览文件 @
b286628d
...
...
@@ -67,6 +67,10 @@ contains vz-line-charts embedded inside tf-panes-helper's.
selected-runs=
"{{_selectedRuns}}"
>
<div
class=
"extend-first-section"
>
<paper-checkbox
id=
"download-option"
checked=
"{{_showDownloadLinks}}"
>
Data download links
</paper-checkbox>
<div
id=
"tooltip-sorting"
>
<div
id=
"tooltip-sorting-label"
>
Tooltip sorting method:
</div>
<paper-dropdown-menu
...
...
@@ -111,6 +115,8 @@ contains vz-line-charts embedded inside tf-panes-helper's.
data-provider=
"[[dataProvider]]"
run2tag=
"[[run2tag]]"
selected-runs=
"[[_selectedRuns]]"
show-download-links=
"[[_showDownloadLinks]]"
download-link-url-function=
"[[scalarUrl]]"
>
<template>
<vz-line-chart
...
...
@@ -183,6 +189,17 @@ contains vz-line-charts embedded inside tf-panes-helper's.
value
:
"
scalar
"
},
router
:
Object
,
scalarUrl
:
{
type
:
Function
,
computed
:
"
_getScalarUrl(router)
"
},
_showDownloadLinks
:
{
type
:
Boolean
,
notify
:
true
,
value
:
TF
.
URIStorage
.
getBooleanInitializer
(
'
_showDownloadLinks
'
,
false
),
observer
:
'
_showDownloadLinksObserver
'
},
_smoothingWeight
:
{
type
:
Number
,
notify
:
true
,
...
...
@@ -203,6 +220,9 @@ contains vz-line-charts embedded inside tf-panes-helper's.
this
.
fire
(
"
rendered
"
);
});
},
_getScalarUrl
:
function
()
{
return
this
.
router
.
scalars
;
},
_showDownloadLinksObserver
:
TF
.
URIStorage
.
getBooleanObserver
(
'
_showDownloadLinks
'
,
false
),
_smoothingWeightObserver
:
TF
.
URIStorage
.
getNumberObserver
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录