The sine function; in ML papers mostly inside positional encodings and rotary embeddings.
In ML papers
sinx is the sine of an angle x in radians. It goes up and down between −1 and 1 with period 2π.
In ML papers it shows up mainly as a way to encode position. The Transformer (Vaswani et al. 2017) adds sinusoidal positional encodings: even dimensions get sin(pos⋅ωi) and odd ones cos(pos⋅ωi), with a different frequency ωi per pair. Rotary embeddings (Su et al. RoFormer 2021) rotate each pair of query and key features by an angle mθi, using sin and cos of it. Fourier features and NeRF-style encodings do the same with sin(2kπx).
How to type it
LaTeX
Shows
\sin
sin
\arcsininverse sine
arcsin
A worked example
sin0=0,sin2π=1,sinπ=0
At position 1 and frequency 1, the first positional-encoding dimension is sin1≈0.841.
Common confusions
pos in the encoding formula is one variable ("position"), not p⋅o⋅s; see Multi-letter names.
arcsin (also sin−1) is the inverse function, not 1/sin.