Skip to contents

Flips each eigenvector's sign with probability 1/2, per the paper.

Usage

morie_gtrf_sign_flip(pe, rng)

Arguments

pe

Positional encoding matrix (n x d).

rng

Generator environment (shared with the Python arm).

Value

Sign-flipped encoding.

References

Dwivedi, V. P. and Bresson, X. (2020).

Examples

set.seed(4)
pe <- matrix(1:6, 3, 2)
morie_gtrf_sign_flip(pe, rng = rmorie:::.ghc_rng(1))
#>      [,1] [,2]
#> [1,]   -1   -4
#> [2,]   -2   -5
#> [3,]   -3   -6