We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello @mattiadg
When I don't use the --distance-penalty flag I get the following error:
--distance-penalty
File "~/FBK-Fairseq-ST/fairseq/models/s_transformer.py", line 472, in __init__ init_variance=(args.init_variance if args.distance_penalty == 'gauss' else None) TypeError: __init__() got an unexpected keyword argument 'penalty'
The problem comes from the following lines in the constructor of TransformerEncoderLayer:
TransformerEncoderLayer
attn = LocalMultiheadAttention if args.distance_penalty != False else MultiheadAttention self.self_attn = attn( self.embed_dim, args.encoder_attention_heads, dropout=args.attention_dropout, penalty=args.distance_penalty, init_variance=(args.init_variance if args.distance_penalty == 'gauss' else None) )
The argumentspenalty and init_variance do not exist in MultiheadAttention, so I substituted these lines by:
penalty
init_variance
MultiheadAttention
if args.distance_penalty != False: self.self_attn = LocalMultiheadAttention( self.embed_dim, args.encoder_attention_heads, dropout=args.attention_dropout, penalty=args.distance_penalty, init_variance=(args.init_variance if args.distance_penalty == 'gauss' else None) ) else: self.self_attn = MultiheadAttention( self.embed_dim, args.encoder_attention_heads, dropout=args.attention_dropout, )
The text was updated successfully, but these errors were encountered:
Do you want to submit a pull request?
Sorry, something went wrong.
👍
Successfully merging a pull request may close this issue.
Hello @mattiadg
When I don't use the
--distance-penalty
flag I get the following error:The problem comes from the following lines in the constructor of
TransformerEncoderLayer
:The arguments
penalty
andinit_variance
do not exist inMultiheadAttention
, so I substituted these lines by:The text was updated successfully, but these errors were encountered: