Closed kashif closed 2 years ago
Hi @kashif,
for the default encoder-decoder Transformer setting, one has to use Hopfield
instead of HopfieldLayer
, as the latter uses learnable parameters as the inputs for the key and query. See
https://github.com/ml-jku/hopfield-layers/blob/1497a4d3eaaa0003a8f73484a562329865a61d02/hflayers/__init__.py#L12-L15
for more information. Moreover, the input size of decoder_association_cross
needs to be equal to the number of features of a single instance/token, which is E
in your case:
decoder_association_cross = Hopfield(input_size=E, num_heads=num_heads)
Please let me know, if the issue is resolved.
thanks @bschaefl let me check and get back to you!
@bschaefl yes sorry it works now after replacing all the HopfieldLayer
s by Hopfield
and the fix thanks!
Hello, so I have an encoder-decoder setup with a
tgt_mask
in the decoder as follows:I create the mask via:
And when I run it I get:
So for example for
P=28
I have:and query has shape:
and key is:
for some reason even though the input to the decoder has tensor shapes:
Would you know what I am missing? Thanks!