evaluation.py 文件源码

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

项目:attend_infer_repeat 作者: akosiorek 项目源码 文件源码
def log_norm(expr_list, name):
    """

    :param expr_list:
    :param name:
    :return:
    """
    n_elems = 0
    norm = 0.
    for e in nest.flatten(expr_list):
        n_elems += tf.reduce_prod(tf.shape(e))
        norm += tf.reduce_sum(e**2)
    norm /= tf.to_float(n_elems)
    tf.summary.scalar(name, norm)
    return norm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号