Shortcuts

pypose.randn_like

class pypose.randn_like(input, sigma=1.0, **kwargs)[source]

Returns a LieTensor with the same size as input that is filled with random LieTensor with the corresponding input.ltype.

The corresponding random generator can be

List of available random LieTensor generator of input ltype.

Name

ltype

randn function

Manifold

randn function

Orthogonal Group

SO3_type

randn_SO3()

so3_type

randn_so3()

Euclidean Group

SE3_type

randn_SE3()

se3_type

randn_se3()

Similarity Group

Sim3_type

randn_Sim3()

sim3_type

randn_sim3()

Scaling Orthogonal

RxSO3_type

randn_RxSO3()

rxso3_type

randn_rxso3()

Parameters
  • input (LieTensor) – the size of input will determine size of the output tensor.

  • sigma (float or (float...), optional) – standard deviation for generating random LieTensors. Default: 1.0.

  • dtype (torch.dtype, optional) – the desired data type of returned Tensor. Default: if None, defaults to the dtype of input.

  • layout (torch.layout, optional) – the desired layout of returned tensor. Default: if None, defaults to the layout of input.

  • device (torch.device, optional) – the desired device of returned tensor. Default: if None, defaults to the device of input.

  • requires_grad (bool, optional) – If autograd should record operations on the returned tensor. Default: False.

  • memory_format (torch.memory_format, optional) – the desired memory format of returned Tensor. Default: torch.preserve_format.

Note

The parameter sigma (\(\sigma\)) can either be:

  • a single float – in which all the elements in the LieType share the same sigma.

  • a tuple of a number of floats – in which case, the specific sigma for each element can be assigned independently.

Note

If we have:

import pypose as pp
x = pp.SO3([0, 0, 0, 1])

Then the following two usages are equivalent:

pp.randn_like(x)
pp.randn_SO3(x.lshape, dtype=x.dtype, layout=x.layout, device=x.device)

Example

>>> x = pp.so3(torch.tensor([[0, 0, 0]]))
>>> pp.randn_like(x)
so3Type LieTensor:
tensor([[ 0.5162, -0.4600, -0.9085]])

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