layers.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:TensorBase 作者: dancsalo 项目源码 文件源码
def conv_batch_norm(self, x, epsilon=1e-3, clean=False, count=1):
        # Calculate batch mean and variance
        batch_mean1, batch_var1 = tf.nn.moments(x, [0, 1, 2], keep_dims=True)

        # Apply the initial batch normalizing transform
        z1_hat = (x - batch_mean1) / tf.sqrt(batch_var1 + epsilon)
        if clean is True:
            self.clean_batch_dict[count] = (tf.squeeze(batch_mean1), tf.squeeze(batch_var1))
            self._clean_z[count] = z1_hat
        return z1_hat
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号