Why Trigonometric Function for Positional Encoding?
As we have seen in Positional Encoding in Transformer, one of the ways of encoding order is to use fixed embedding like sine or cosine function
The main benefits of trigonometric functions are:
- Numerically stable
- Need no training
- Predictable as it has a specific pattern
- No extra parameters