Young87

当前位置:首页 >个人收藏

Tensorboard实现神经网络的可视化

 本篇博客介绍使用Tensorboard实现神经网络的可视化,首先是实现可视化的代码:

# encoding:utf-8
import tensorflow as tf


# 添加层
def add_layer(inputs, in_size, out_size, activation_function=None):
    with tf.name_scope('layer'):
        with tf.name_scope('weights'):
            W = tf.Variable(tf.random_normal([in_size, out_size]), name='W')
        with tf.name_scope('bias'):
            b = tf.Variable(tf.zeros([1, out_size]) + 0.1, name='b')
        with tf.name_scope('Wx_plus_b'):
            Wx_plus_b = tf.matmul(inputs, W) + b
        if activation_function is None:
            outputs = Wx_plus_b
        else:
            outputs = activation_function(Wx_plus_b)
        return outputs

with tf.name_scope('inputs'):
    xs = tf.placeholder(tf.float32, [None, 1], name='x_input')
    ys = tf.placeholder(tf.float32, [No

除特别声明,本站所有文章均为原创,如需转载请以超级链接形式注明出处:SmartCat's Blog

上一篇: virtualenv虚拟独立python环境使用

下一篇: 关于react组件化,解决后来修改极为麻烦的问题

精华推荐