深度学习总结:Tensorboard可视化里面的events, graph, histogram
生活随笔
收集整理的這篇文章主要介紹了
深度学习总结:Tensorboard可视化里面的events, graph, histogram
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Tensorboard可視化里面的events, graph, histogram
graph:顯示整個靜態圖
tf.variable_scope就是用于放graph,tf.name_scope用的少了,因為w,b已經被封裝了。
with tf.variable_scope('Inputs'):tf_x = tf.placeholder(tf.float32, x.shape, name='x')tf_y = tf.placeholder(tf.float32, y.shape, name='y')histogram:顯示權重的分布,也就是顯示矩陣
with tf.variable_scope('Net'):l1 = tf.layers.dense(tf_x, 10, tf.nn.relu, name='hidden_layer')output = tf.layers.dense(l1, 1, name='output_layer')# add to histogram summarytf.summary.histogram('h_out', l1)tf.summary.histogram('pred', output)evens:顯示loss,也就是顯示標量
loss = tf.losses.mean_squared_error(tf_y, output, scope='loss') train_op = tf.train.GradientDescentOptimizer(learning_rate=0.5).minimize(loss) tf.summary.scalar('loss', loss) # add loss to scalar summary這些東西需要放進一個文件里:需要建立一個問題,和建立一個放入的操作:
writer = tf.summary.FileWriter('./log', sess.graph) # write to file merge_op = tf.summary.merge_all() # operation to merge all summarytensorflow是一個盒子,看東西必須借助一個工具,它的名字叫session.run():
_, result = sess.run([train_op, merge_op], {tf_x: x, tf_y: y})writer.add_summary(result, step)去頁面看圖:
$ tensorboard --logdir path/to/log 與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的深度学习总结:Tensorboard可视化里面的events, graph, histogram的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 深度学习总结:用pytorch做drop
- 下一篇: 深度学习总结:tensorflow和py