ops.py 文件源码

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

项目:dnc-theano 作者: khaotik 项目源码 文件源码
def op_norm2(s_x_, axis_=-1, use_mean_=False, keepdims_=True):
    '''
    Square of L2 norm

    Args:
        s_x_: input (batch of) vector
        axis_: int or tuple of int
        use_mean_: cause mean of square to be one instead of sum
    '''
    op_sum = T.sum if not use_mean_ else T.mean
    return op_sum(T.sqr(s_x_), axis=axis_, keepdims=keepdims_)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号