dm_arch.py 文件源码

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

项目:deep-makeover 作者: david-gpu 项目源码 文件源码
def add_softmax(self):
        """Adds a softmax operation to this model"""

        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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号