Perform L p L_p Lp normalization of inputs over specified dimension.
For a tensor input
of sizes ( n 0 , . . . , n d i m , . . . , n k ) (n_0, ..., n_{dim}, ..., n_k) (n0,...,ndim,...,nk), each n d i m n_{dim} ndim -element vector v v v along dimension dim
is transformed as
v = v max ( ∥ v ∥ p , ϵ ) . v = \frac{v}{\max(\lVert v \rVert_p, \epsilon)}. v=max(∥v∥p,ϵ)v.
With the default arguments it uses the Euclidean norm over vectors along dimension 1 1 1 for normalization.
input (Tensor) – input tensor of any shape
p (float) – the exponent value in the norm formulation. Default: 2
dim (int or tuple of ints) – the dimension to reduce. Default: 1
eps (float) – small value to avoid division by zero. Default: 1e-12
out (Tensor, optional) – the output tensor. If out
is used, this operation won’t be differentiable.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4