def __init__(self, out_units, num_postnet_layers, kernel_size, out_channels, is_training, drop_rate=0.5, trainable=True, name=None, dtype=None, **kwargs): super(PostNetV2, self).__init__(name=name, trainable=trainable, **kwargs) final_conv_layer = Conv1d(kernel_size, out_channels, activation=None, is_training=is_training, drop_rate=drop_rate, name=f"conv1d_{num_postnet_layers}", dtype=dtype) self.convolutions = [ Conv1d(kernel_size, out_channels, activation=tf.nn.tanh, is_training=is_training, drop_rate=drop_rate, name=f"conv1d_{i}", dtype=dtype) for i in range(1, num_postnet_layers) ] + [final_conv_layer] self.projection_layer = tf.layers.Dense(out_units, dtype=dtype)
def __init__(self, num_conv_layers, kernel_size, out_units, drop_rate, zoneout_factor_cell, zoneout_factor_output, is_training, lstm_impl=LSTMImpl.LSTMCell, trainable=True, name=None, dtype=None, **kwargs): super(EncoderV2, self).__init__(trainable=trainable, name=name, dtype=dtype, **kwargs) assert out_units % 2 == 0 self.out_units = out_units self.zoneout_factor_cell = zoneout_factor_cell self.zoneout_factor_output = zoneout_factor_output self.is_training = is_training self._lstm_impl = lstm_impl self.convolutions = [ Conv1d(kernel_size, out_units, activation=tf.nn.relu, is_training=is_training, drop_rate=drop_rate, name=f"conv1d_{i}", dtype=dtype) for i in range(0, num_conv_layers) ]