Shortcuts

pypose.randn_SO3

class pypose.randn_SO3(*lsize, sigma=1.0, **kwargs)[source]

Returns SO3_type LieTensor filled with the Exponential map of the random so3_type LieTensor.

\[\begin{aligned} \mathrm{data}[*, :] &= \mathrm{Exp}([\delta_x, \delta_y, \delta_z]) \\ &= \mathrm{Exp}([\delta_x', \delta_y', \delta_z'] \cdot \theta), \end{aligned} \]

where \([\delta_x', \delta_y', \delta_z']\) is generated from uniform distribution \(\mathcal{U}_{\mathrm{s}}\) on a standard sphere, \(\mathrm{Exp}()\) is the Exponential map, \(\theta\) is generated from a normal distribution \(\mathcal{N}(0, \sigma)\) where \(\sigma\) (sigma) is the standard deviation.

For detailed explanation, please see pypose.randn_so3() and pypose.Exp().

Parameters
  • lsize (int...) – a sequence of integers defining the lshape of the output tensor. Can be a variable number of arguments or a collection like a list or tuple.

  • sigma (float, optional) – standard deviation for the angle of the generated rotation. Default: 1.0.

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

  • generator (torch.Generator, optional) – a pseudorandom number generator for sampling

  • dtype (torch.dtype, optional) – the desired data type of returned tensor. Default: None. If None, uses a global default (see torch.set_default_tensor_type()).

  • layout (torch.layout, optional) – the desired layout of returned Tensor. Default: torch.strided.

  • device (torch.device, optional) – the desired device of returned tensor. Default: None. If None, uses the current device for the default tensor type (see torch.set_default_tensor_type()). Device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types.

Returns

a SO3_type LieTensor.

Return type

LieTensor

Example

>>> pp.randn_SO3(sigma=0.1, requires_grad=True)
SO3Type LieTensor:
LieTensor([ 0.0082,  0.0077, -0.0018,  0.9999], requires_grad=True)
>>> pp.randn_SO3(2, sigma=0.1, requires_grad=True, dtype=torch.float64)
SO3Type LieTensor:
tensor([[ 2.6857e-03, -8.3274e-03, -6.0457e-04,  9.9996e-01],
        [ 3.8711e-02, -6.3148e-02, -1.9388e-02,  9.9706e-01]],
        dtype=torch.float64, requires_grad=True)
map to buried treasure

Visualization of pypose.randn_SO3(). A total of 5000 random rotations are sampled using pypose.randn_SO3() and applied to the basepoint [0, 0, 1] (shown in blue).

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