complex_util.py 文件源码

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

项目:tensorflow_with_latest_papers 作者: NickShahML 项目源码 文件源码
def modrelu_c(in_c, bias):
    if not in_c.dtype.is_complex:
        raise(ValueError('modrelu_c: Argument in_c must be complex type'))
    if bias.dtype.is_complex:
        raise(ValueError('modrelu_c: Argument bias must be real type'))
    n = tf.complex_abs(in_c)
    scale = 1./(n+1e-5)
    return complex_mul_real(in_c, ( tf.nn.relu(n+bias)*scale ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号