Remove final dropout

This commit is contained in:
Daniel Povey 2022-04-01 19:33:20 +08:00
parent 92ec2e356e
commit 45f872c27d

View File

@ -80,7 +80,6 @@ class Conformer(EncoderInterface):
)
self.encoder = ConformerEncoder(encoder_layer, num_encoder_layers)
self.final_dropout = nn.Dropout(p=dropout)
if output_dim == d_model:
self.encoder_output_layer = nn.Identity()
else:
@ -119,7 +118,6 @@ class Conformer(EncoderInterface):
x = self.encoder(x, pos_emb, src_key_padding_mask=mask,
warmup=warmup) # (T, N, C)
x = self.final_dropout(x)
x = self.encoder_output_layer(x)
x = x.permute(1, 0, 2) # (T, N, C) ->(N, T, C)