美文网首页我爱编程
Tensorboard——高级可视化

Tensorboard——高级可视化

作者: 优秀的莱恩 | 来源:发表于2018-04-06 16:21 被阅读35次
    with tf.name_scope('SGD'):
        # Gradient Descent
        optimizer = tf.train.GradientDescentOptimizer(learning_rate)
        # Op to calculate every variable gradient
        grads = tf.gradients(loss, tf.trainable_variables())
        grads = list(zip(grads, tf.trainable_variables()))
        # Op to update all variables according to their gradient
        apply_grads = optimizer.apply_gradients(grads_and_vars=grads)
    
    # Create summaries to visualize weights
    for var in tf.trainable_variables():
        tf.summary.histogram(var.name, var)
    # Summarize all gradients
    for grad, var in grads:
        tf.summary.histogram(var.name + '/gradient', grad)
    
    image.png

    https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/tensorboard_advanced.py

    相关文章

      网友评论

        本文标题:Tensorboard——高级可视化

        本文链接:https://www.haomeiwen.com/subject/ubdshftx.html