change order BN + ReLU to ReLU + BN for SS

This commit is contained in:
erogol 2020-12-29 15:25:41 +01:00
parent ac5c9217d1
commit 3fa408a5ea
3 changed files with 4 additions and 4 deletions

View File

@ -27,8 +27,8 @@ class ConvBN(nn.Module):
def forward(self, x):
o = self.conv1d(x)
o = self.pad(o)
o = self.norm(o)
o = nn.functional.relu(o)
o = self.norm(o)
return o

View File

@ -25,7 +25,7 @@ class Decoder(nn.Module):
self.post_conv = nn.Conv1d(hidden_channels, hidden_channels, 1)
self.post_net = nn.Sequential(
ConvBNBlock(hidden_channels, 4, 1, num_conv_blocks=2),
ConvBNBlock(hidden_channels, residual_conv_bn_params['kernel_size'], 1, num_conv_blocks=2),
nn.Conv1d(hidden_channels, out_channels, 1),
)
@ -33,4 +33,4 @@ class Decoder(nn.Module):
# TODO: implement multi-speaker
o = self.decoder(x, x_mask)
o = self.post_conv(o) + x
return self.post_net(o)
return self.post_net(o) * x_mask

View File

@ -154,8 +154,8 @@ class Encoder(nn.Module):
o = self.pre(x) * x_mask
o = self.encoder(o, x_mask)
o = self.post_conv(o + x)
o = self.post_bn(o)
o = F.relu(o)
o = self.post_bn(o)
o = self.post_conv2(o)
# [B, C, T]
return o * x_mask