pypose.optim.kernel.Arctan¶
- class pypose.optim.kernel.Arctan(delta=1.0)[source]¶
The robust Arctan kernel cost function.
\[\bm{y}_i=\delta ^{2}\arctan \left ( \frac{\bm{x}_i}{\delta ^{2}}\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 Arctan cost. 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.Arctan() >>> input = torch.tensor([0, 0.5, 1, 2, 3]) >>> kernel(input) tensor([0.0000, 0.4636, 0.7854, 1.1071, 1.2490])