Crate caffe2op_lpnorm

source ·

Structs

  • | Given one input float tensor X, derivative | dout, and produces one output float | tensor dX. | | dX is the derivative of the Lp norm of | tensor X, computed as dx = d(sum over | |x^p|)/dx, in which p is either 1 or 2(currently | only supports l1 and l2 norm) determined | by the argument p. |
  • | This op computes the $L_p$ norm of the | one dimensional input tensor $X$, and | outputs a one dimensional output tensor | $Y$. Here, the $L_p$ norm is calculated | as | | $$L_p(\mathbf{x}) = \sum_i x_i^p$$ | | This op supports $p$ values of 1 or 2. | If the average argument is set, the norm | is calculated as | | Lp_averaged_norm(x) is defined as | | Lp_averaged_norm(x) = LpNorm(x) / | size(x). | | Github Links: | | - https://github.com/pytorch/pytorch/blob/master/caffe2/operators/lpnorm_op.h | //- https://github.com/pytorch/pytorch/blob/master/caffe2/operators/lpnorm_op.cc |