Shortcuts

pypose.optim.kernel.SoftLOne

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

The robust SoftLOne kernel cost function.

\[\bm{y}_i=2\left ( \delta \sqrt{\frac{1}{{\delta{}}^{2}}+\bm{x}_i}- 1\right ) \]

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

Parameters

delta (float, optional) – Specify the SoftLOne cost. The value must be positive. 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.SoftLOne()
>>> input = torch.tensor([0, 0.5, 1, 2, 3])
>>> kernel(input)
tensor([0.0000, 0.4495, 0.8284, 1.4641, 2.0000])
../../_images/softlone.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