aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf-graph/demo/tf-graph-demo.html
blob: d6e736d185fbb3e658c8384d9cd0aa88c3c7b85c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../tf-graph-board/tf-graph-board.html">
<link rel="import" href="../../tf-graph-loader/tf-graph-loader.html">
<link rel="import" href="../../tf-graph/tf-graph-controls.html">
<!-- Element for tf-graph demo page

Example

<tf-graph-demo></tf-graph-demo>

-->

<dom-module id="tf-graph-demo">
<template>
<style>

:host /deep/ {
  font-family: 'Roboto', sans-serif;
}

.main {
  position: absolute;
  right: 0;
  left: 250px;
  height: 100%;
}

.side {
  position: absolute;
  left: 0;
  width: 250px;
  height: 100%;
  border: 1px solid black;
  box-sizing: border-box;
}

.all {
  position: relative;
  width: 100%;
  height: 100%
}

</style>
<div class="all">
  <div class="side">
    <tf-graph-controls
        color-by-params="[[colorByParams]]"
        has-stats="[[hasStats]]"
        color-by="{{colorBy}}"
        datasets="[[datasets]]",
        selected-dataset="{{selectedDataset}}"
        selected-file="{{selectedFile}}"
    ></tf-graph-controls>
    <tf-graph-loader id="loader"
        datasets="[[datasets]]",
        selected-dataset="[[selectedDataset]]"
        selected-file="[[selectedFile]]"
        out-graph-hierarchy="{{graphHierarchy}}"
        out-graph="{{graph}}"
        out-graph-name="{{graphName}}"
        has-stats="{{hasStats}}"
        progress="{{_progress}}"
    ></tf-graph-loader>
  </div>
  <div class="main">
    <tf-graph-board id="graphboard"
        graph-hierarchy="[[graphHierarchy]]"
        graph="[[graph]]"
        has-stats="[[hasStats]]"
        graph-name="[[graphName]]"
        progress="[[_progress]]"
        color-by="[[colorBy]]"
        color-by-params="{{colorByParams}}"
    ></tf-graph-board>
  </div>
</div>
</template>
</dom-module>

<script>
(function(){

var datasets = [
  {
    name: "Mnist Eval",
    path: "mnist_eval.pbtxt",
  },
  {
    name: "Mnist Train (with stats)",
    path: "mnist_train.pbtxt",
    statsPath: "mnist_train_stats.json"
  },
  {
    name: "Inception Train (huge)",
    path: "inception_train.pbtxt",
  },
  {
    name: "Inception Train Eval",
    path: "inception_train_eval.pbtxt",
  },
  {
    name: "Inception Test",
    path: "inception_test_eval.pbtxt",
  },
  {
    name: "PTB Word LSTM Train",
    path: "ptb_word_lstm_train.pbtxt",
  },
  {
    name: "PTB Word LSTM Train Eval",
    path: "ptb_word_lstm_train_eval.pbtxt",
  },
  {
    name: "PTB Word LSTM Test",
    path: "ptb_word_lstm_test_eval.pbtxt",
  },
  {
    name: "Cifar10 Train",
    path: "cifar10_train.pbtxt",
  },
  {
    name: "Cifar10 Multi-GPU Train",
    path: "cifar10_multi_gpu_train.pbtxt",
  },
  {
    name: "Cifar10 Eval",
    path: "cifar10_eval.pbtxt",
  },
  {
    name: "Fatcat LSTM",
    path: "fatcat_lstm.pbtxt",
  },
  {
    name: "Legacy Inception Renamed",
    path: "legacy_inception_renamed.pbtxt",
  },
  {
    name: "Wolfe (Broken)",
    path: "wolfe1.pbtxt",
  },
  {
    name: "Wolfe (Fixed)",
    path: "wolfe2.pbtxt",
  },
  {
    name: "AlexNet",
    path: "alexnet.pbtxt",
  },
  {
    name: "TestError404",
    path: "nofile"
  }
];

Polymer({
  is: 'tf-graph-demo',
  properties: {
    hasStats: Boolean,
    datasets: {
      type: Object,
      value: function() {
        return this._getDatasets();
      }
    },
    selectedDataset: {
      type: Number,
      value: 1
    },
    _progress: Object
  },
  _getDatasets: function() {
    return _.map(datasets, function(dataset) {
      var result = {
        name: dataset.name,
        path: this.resolveUrl('tf_model_zoo/' + dataset.path)
      };
      if (dataset.statsPath != null) {
        result.statsPath = this.resolveUrl('tf_model_zoo/' + dataset.statsPath);
      }
      return result;
    }, this);
  }
});
})();
</script>