layers.py 文件源码

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

项目:vae-npvc 作者: JeremyCCHsu 项目源码 文件源码
def mu_law_decode_nonlinear(output, quantization_channels=256):
    '''
    Uncompress the waveform amplitudes using mu-law non-linearity. 
    NOTE: This mu-law functions as a non-linear function.
    '''
    with tf.name_scope('decode'):
        mu = quantization_channels - 1
        # Map values back to [-1, 1].
        # signal = 2 * (tf.to_float(output) / mu) - 1
        signal = output
        # Perform inverse of mu-law transformation.
        magnitude = (1 / mu) * ((1 + mu)**abs(signal) - 1)
        return tf.sign(signal) * magnitude
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号