Shortcuts

pypose.cumprod

class pypose.cumprod(input, dim, left=True)[source]

Returns the cumulative product (@) of LieTensor along a dimension.

  • Left product:

\[y_i = x_i ~\times~ x_{i-1} ~\times~ \cdots ~\times~ x_1, \]
  • Right product:

\[y_i = x_1 ~\times~ x_2 ~\times~ \cdots ~\times~ x_i, \]

where \(\times\) denotes the group product (@), \(x_i,~y_i\) are the \(i\)-th item along the dim dimension of the input and output LieTensor, respectively.

Parameters
  • input (LieTensor) – the input LieTensor

  • dim (int) – the dimension to do the operation over

  • left (bool, optional) – whether perform left product in cumprod. If set it to False, this function performs right product. Defaul: True

Returns

The LieTensor

Return type

LieTensor

Note

  • The time complexity of the function is \(\mathcal{O}(\log N)\), where \(N\) is the LieTensor size along the dim dimension.

Example

  • Left product with \(\text{input} \in\) SE3

>>> input = pp.randn_SE3(2)
>>> pp.cumprod(input, dim=0)
SE3Type LieTensor:
tensor([[-1.9615, -0.1246,  0.3666,  0.0165,  0.2853,  0.3126,  0.9059],
        [ 0.7139,  1.3988, -0.1909, -0.1780,  0.4405, -0.6571,  0.5852]])
  • Right product with \(\text{input} \in\) SO3

>>> input = pp.randn_SO3(1,2)
>>> pp.cumprod(input, dim=1, left=False)
SO3Type LieTensor:
tensor([[[ 0.5798, -0.1189, -0.2429,  0.7686],
        [ 0.7515, -0.1920,  0.5072,  0.3758]]])

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