models.py 文件源码

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

项目:vae-npvc 作者: JeremyCCHsu 项目源码 文件源码
def _generator(self, z, y, is_training):
        '''
        Input:
            z: shape=[b, c]
            y: speaker label; shape=[b,], dtype=int64
        Return:
            xh: reconstructed version of `x` (the input to the VAE)
        '''
        self.speaker_repr = self._l2_regularized_embedding(
            n_class=self.arch['y_dim'],
            h_dim=self.arch['yemb_dim'],
            scope_name='y_embedding',
            var_name='y_emb'
        )

        c = tf.nn.embedding_lookup(self.speaker_repr, y)
        x = tf.concat([z, c], -1)
        for o in self.arch['decoder']['output']:
            x = tf.layers.dense(x, units=o, activation=lrelu)            
            # x = tf.layers.batch_normalization(x, training=is_training)
        return tf.layers.dense(x, units=self.arch['x_dim'], name='xh')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号