tensorflow的可视化工具Tensorboard的使用——直方图(histogram,distributions)的使用

今天学习tensorboard中直方图的使用。首先了解下直方图的含义:
GB/T3358.1—2009对“直方图”的定义是:频数分布的一种图形表示,由一些相邻的长方形组成,每个长方形的底宽等于组距,面积与组的频数成比例。
也就是说,直方图是表示频次分布情况的一种图像,在tensorboard中,用直方图显示张量,主要就是显示张量中每个值的出现频次。
一、代码添加
首先在层的应用函数中加入数据采集代码。

    def get_output(self, inputs, is_training=True):
        with tf.name_scope('%s_cal' % (self.name)) as scope:
            # hidden states
            self.hidden = self.conv(inputs=inputs)
            tf.summary.histogram('histogram', self.conv.weights)
            #self.variable_summaries(self.conv.weights)
            # batch normalization 技术
            if self.batch_normal:
                self.hidden = self.bn(self.hidden, training=is_training)

            # activation
            if self.activation == 'relu':
                self.output = tf.nn.relu(self.hidden)
            elif self.activation == 'tanh':
   
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值