apple / ml-cvnets

CVNets: A library for training computer vision networks
https://apple.github.io/ml-cvnets
Other
1.76k stars 225 forks source link

Fixed the missing token normalization for cross-attention computation #82

Open goutamyg opened 1 year ago

goutamyg commented 1 year ago

For a downstream task, I see better training convergence upon normalizing both x and _xprev during the computation of cross-attention here: https://github.com/apple/ml-cvnets/blob/main/cvnets/modules/transformer.py#L258

Currently, I am conducting model training with and without the proposed normalization of _xprev and will share the results for the two cases. In the meantime, if this change makes sense, kindly include it. Let me know if you need any related info.