lgatr.primitives.invariants
Invariants: inner product, absolute squared norm, and Pin-invariant utilities.
Functions
Compute a positive-semidefinite modification of the squared norm. |
|
|
Compute the inner product of multivectors |
- lgatr.primitives.invariants.abs_squared_norm(x)[source]
Compute a positive-semidefinite modification of the squared norm.
Suitable for layer normalization (the standard GA squared norm is not positive semidefinite).
- Parameters:
x (
Tensor) – Input multivector of shape(..., 16).- Returns:
Geometric-algebra norm of
x, shape(..., 1).- Return type:
outputs
- lgatr.primitives.invariants.inner_product(x, y)[source]
Compute the inner product of multivectors
f(x, y) = <x, y> = <~x y>_0.Equal to
geometric_product(reverse(x), y)[..., [0]], but faster.- Parameters:
x (
Tensor) – First input multivector of shape(..., 16)or(..., channels, 16). Batch dimensions must be broadcastable betweenxandy.y (
Tensor) – Second input multivector of shape(..., 16)or(..., channels, 16). Batch dimensions must be broadcastable betweenxandy.
- Returns:
Result of shape
(..., 1). Batch dimensions are the broadcast ofxandy.- Return type:
outputs