gansformer icon indicating copy to clipboard operation
gansformer copied to clipboard

question on duplex attention (k means) code

Open nintendops opened this issue 2 years ago • 0 comments

First, thank you for this amazing work!

I am suspecting that an indentation is missing at the following position of the code:

https://github.com/dorarad/gansformer/blob/3a9efa4545be25604b70560b7f491ec3633c14a3/pytorch_version/training/networks.py#L784

The reason why it raises my suspicion is that, if the code is executed as it is, it seems like the actual key values (to_tensor) are never involved in the computation of the attention scores when k means is enabled. If I am mistaken, would you mind explain why line 787 replaces the original attention scores with the values computed here (where the embedding "to_centroids" seems to be initialized to be a mapping of the queries)?

nintendops avatar Oct 15 '22 10:10 nintendops