convolution encoder with GLU and res connections

This commit is contained in:
erogol 2020-08-13 12:42:48 +02:00
parent 498a3ea36f
commit 45fbc0d003
2 changed files with 10 additions and 15 deletions

View File

@ -65,7 +65,7 @@ class ConvLayerNorm(nn.Module):
self.proj.bias.data.zero_()
def forward(self, x, x_mask):
x_org = x
x_res = x
for i in range(self.num_layers):
x = self.conv_layers[i](x * x_mask)
x = self.norm_layers[i](x * x_mask)

View File

@ -69,20 +69,15 @@ class GlowTts(nn.Module):
self.length_scale=1.
self.encoder = Encoder(num_chars,
out_channels,
hidden_channels_enc or hidden_channels,
filter_channels,
filter_channels_dp,
encoder_type,
num_heads,
num_layers_enc,
kernel_size,
dropout_p,
rel_attn_window_size=rel_attn_window_size,
input_length=input_length,
mean_only=mean_only,
use_prenet=True,
c_in_channels=c_in_channels)
out_channels=out_channels,
hidden_channels=hidden_channels,
filter_channels=filter_channels,
filter_channels_dp=filter_channels_dp,
num_layers=num_layers_enc,
kernel_size=kernel_size,
dropout_p=dropout_p,
mean_only=mean_only,
c_in_channels=c_in_channels)
self.decoder = Decoder(out_channels,
hidden_channels_dec or hidden_channels,