srez_model.py 文件源码

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

项目:tensorflow-srgan 作者: olgaliak 项目源码 文件源码
def add_softmax(self):
        """Adds a softmax operation to this model"""

        with tf.variable_scope(self._get_layer_str()):
            this_input = tf.square(self.get_output())
            reduction_indices = list(range(1, len(this_input.get_shape())))
            acc = tf.reduce_sum(this_input, reduction_indices=reduction_indices, keep_dims=True)
            out = this_input / (acc+FLAGS.epsilon)
            #out = tf.verify_tensor_all_finite(out, "add_softmax failed; is sum equal to zero?")

        self.outputs.append(out)
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号