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')
评论列表
文章目录