normalizations.py 文件源码

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

项目:tensorflow-layer-library 作者: bioinf-jku 项目源码 文件源码
def max_norm_all_tensors(tensor_list, clip: bool = True):
    """Normalization of list of tensors by maximum of tensors"""
    maxima = [tf.reduce_max(tf.abs(tensor)) for tensor in tensor_list]
    maxima = tf.stack(maxima)
    if clip:
        maximum = tf.reduce_max(maxima) + 1e-16
    else:
        maximum = tf.reduce_max(maxima)
    return [tf.divide(tensor, maximum) for tensor in tensor_list]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号