vedastr icon indicating copy to clipboard operation
vedastr copied to clipboard

Is Layer Normalization in TransformerEncoderLayer2D placed in the correct position?

Open S-aiueo32 opened this issue 4 years ago • 5 comments

Hello,

I found Layer Normalization is placed after self-attention and the residual connection in TransformerEncoderLayer2D. https://github.com/Media-Smart/vedastr/blob/d61776461d8a9c469d6875abd437de64b039a39e/vedastr/models/bodies/sequences/transformer/unit/encoder.py#L60-L63

I think it is a common way of basic transformers, however, the official implementation of SATRN places it before. Do you have any plans to align your code to the original one, or basis for reliability?

S-aiueo32 avatar Nov 14 '20 09:11 S-aiueo32

Yes, we implement satrn before the code released. We will update the satrn in the future.

ChaseMonsterAway avatar Nov 16 '20 02:11 ChaseMonsterAway

Good! I will keep this issue open for future fix about it!

S-aiueo32 avatar Nov 16 '20 16:11 S-aiueo32

this bug is not fixed for now ????

Johnson-yue avatar Feb 22 '21 01:02 Johnson-yue

this bug is not fixed for now ????

We do some other jobs for now, i will fix it as soon as possible.

ChaseMonsterAway avatar Feb 22 '21 02:02 ChaseMonsterAway

ok,thanks

Johnson-yue avatar Feb 22 '21 05:02 Johnson-yue