Shortcuts

pypose.optim.kernel.Scale

class pypose.optim.kernel.Scale(delta=1.0)[source]

The robust Scale kernel cost function.

\[\bm{y}_i=\delta*\bm{x}_i \]

where \(\delta\) (delta) is a scalar, \(\bm{x}\) and \(\bm{y}\) are the input and output tensors, respectively.

Parameters

delta (float) – Specify the scale factor. Should be between 0 and 1. Default: 1.0

Note

The input has to be a non-negative tensor and the output tensor has the same shape with the input.

Example

>>> import pypose.optim.kernel as ppok
>>> kernel = ppok.Scale()
>>> input = torch.tensor([0, 0.5, 1, 2, 3])
>>> kernel(input)
tensor([0.0000, 0.5000, 1.0000, 2.0000, 3.0000])
../../_images/scale.png
forward(input)[source]
Parameters

input (torch.Tensor) – the input tensor (non-negative).

Docs

Access documentation for PyPose

View Docs

Tutorials

Get started with tutorials and examples

View Tutorials

Get Started

Find resources and how to start using pypose

View Resources