Bounds and norm facts for dependent tensors.
The proofs use coordinate extensionality and finite sums. They therefore describe the mathematical tensor independently of its packed physical storage.
The dot product is symmetric.
Squared norm #
The squared Euclidean norm of all coordinates of a tensor.
Instances For
A tensor squared norm is nonnegative.
A tensor has zero squared norm exactly when every coordinate is zero.
theorem
Spec.normalizeL2Regularized_eq
{n : ℕ}
(x : TorchLean.Tensor ℝ [n])
(epsilon : ℝ)
(hepsilon : 0 < epsilon)
(mean : Bool := false)
:
normalizeL2RegularizedSpec x epsilon mean = TorchLean.Tensor.map
(fun (value : ℝ) => value / √((if mean = true then x.squareSpec.meanSpec else x.squareSpec.sumSpec) + epsilon)) x
Scaling the vector and epsilon together preserves the regularized real normalization.
The same identity covers RMS normalization when mean is true.