Tactron 2学习笔记3 decoder篇

在这里插入图片描述
decoder由以下几个部分组成,包括prenet,attention,decoder_lstm,frame_projection,stop_projection等。

prenet

    首先,我们来看看prenet,从代码中类Prenet中可以看出,prenet的主体是two fully connected layers,每一层接一个dropout。

attention

    接着看看attention部分,称之为LocationSensitiveAttention,从代码中可以看出该attention方法继承的是 tensorflow.contrib.seq2seq.python.ops.attention_wrapper.BahdanauAttention。

decoder_lstm

    该模块里面是普通的 MultiRNNCell ,没什么特别的。

frame_projection

    该模块的输出是mel谱,其内部也是fully connected layer。

stop_projection

    该模块的作用是预测是否结束,是个简单的二分类问题,其内部也是fully connected layer。

    最后在tacotron 2中定义了类TacotronDecoderCell,将上述几个模块封装在一起。下面一起看看该类内部是怎么运行的,先看看该类的注释原文:
Decoder Step i:

  1. Prenet to compress last output information
  2. Concat compressed inputs with previous context vector (input feeding) *
  3. Decoder RNN (actual decoding) to predict current state s_{i} *
  4. Compute new context vector c_{i} based on s_{i} and a cumulative sum of previous alignments *
  5. Predict new output y_{i} using s_{i} and c_{i} (concatenated)
  6. Predict <stop_token> output ys_{i} using s_{i} and c_{i} (concatenated)
        概括来讲,Prenet的输出与上一次解码输出计算而得的上下文向量做拼接,然后整个送入RNN解码器中,RNN解码器的输出用来计算新的上下文向量,最后新计算出来的上下文向量与解码器输出做拼接,送入projection layer预测输出。
        在网络的最后,接了一个postnet来预测残差值,postnet的输入是上面的输出,将残差再输入frame_projection网络。最终,这里的输出加上上面的输出,就是网络的最后输出了。需要注意的是,由于前面decoder输出的mel谱或者线性谱,后面还需要接一个声码器,比如wavenet。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值