Merge pull request #1 from buaahsh/main
Fix decoder_embed_dim in Fairseq example
This commit is contained in:
commit
afd9094fb5
|
@ -271,10 +271,10 @@ class TranslationModel(FairseqEncoderDecoderModel):
|
||||||
output_projection.weight = decoder_embed_tokens.weight
|
output_projection.weight = decoder_embed_tokens.weight
|
||||||
else:
|
else:
|
||||||
output_projection = torch.nn.Linear(
|
output_projection = torch.nn.Linear(
|
||||||
decoder_embed_dim, len(tgt_dict), bias=False
|
args.decoder_embed_dim, len(tgt_dict), bias=False
|
||||||
)
|
)
|
||||||
torch.nn.init.normal_(
|
torch.nn.init.normal_(
|
||||||
output_projection.weight, mean=0, std=decoder_embed_dim ** -0.5
|
output_projection.weight, mean=0, std=args.decoder_embed_dim ** -0.5
|
||||||
)
|
)
|
||||||
|
|
||||||
encoder = cls.build_encoder(
|
encoder = cls.build_encoder(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user