pypose.randn_SE3¶
- class pypose.randn_SE3(*lsize, sigma=1.0, **kwargs)[source]¶
Returns
SE3_type
LieTensor filled with the Exponential map of the randomse3_type
LieTensor generated usingpypose.randn_se3()
.\[\mathrm{data}[*, :] = \mathrm{Exp}([\tau_x, \tau_y, \tau_z, \delta_x, \delta_y, \delta_z]), \]where \([\tau_x, \tau_y, \tau_z]\) is generated from a normal distribution \(\mathcal{N}(0, \sigma_t)\), \([\delta_x, \delta_y, \delta_z]\) is generated using
pypose.randn_so3()
with with standard deviation \(\sigma_r\), and \(\mathrm{Exp}()\) is the Exponential map. Note that standard deviations \(\sigma_t\) and \(\sigma_r\) are specified bysigma
(\(\sigma\)), where \(\sigma = (\sigma_t, \sigma_r)\).For detailed explanation, please see
pypose.randn_se3()
andpypose.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 or (float...), optional) – standard deviation (\(\sigma_t\) and \(\sigma_r\)) for the two normal distribution. 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 (seetorch.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
. IfNone
, uses the current device for the default tensor type (seetorch.set_default_tensor_type()
). Device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types.
- Returns
a
SE3_type
LieTensor- Return type
Note
The parameter \(\sigma\) can either be:
a single
float
– in which all the elements in theSE3_type
share the same sigma, i.e., \(\sigma_{\rm{t}}\) = \(\sigma_{\rm{r}}\) = \(\sigma\).a
tuple
of two floats – in which case, the specific sigmas are assigned independently, i.e., \(\sigma\) = (\(\sigma_{\rm{t}}\), \(\sigma_{\rm{r}}\)).a
tuple
of four floats – in which case, the specific sigmas for each translation data are assigned independently, i.e., \(\sigma\) = (\(\sigma_{\rm{tx}}\), \(\sigma_{\rm{ty}}\), \(\sigma_{\rm{tz}}\), \(\sigma_{\rm{r}}\)).
Example
For \(\sigma = (\sigma_t, \sigma_r)\)
>>> pp.randn_SE3(2, sigma=(1.0, 2.0)) SE3Type LieTensor: tensor([[ 0.2947, -1.6990, -0.5535, 0.4439, 0.2777, 0.0518, 0.8504], [ 0.6825, 0.2963, 0.3410, 0.3375, -0.2355, 0.7389, -0.5335]])
For \(\sigma = (\sigma_{tx}, \sigma_{ty}, \sigma_{tz}, \sigma_{r})\)
>>> pp.randn_SE3(2, sigma=(1.0, 1.5, 2.0, 2.0)) SE3Type LieTensor: tensor([[-1.5689, -0.6772, 0.3580, -0.2509, 0.8257, -0.4950, 0.1018], [ 0.2613, -2.7613, 0.2151, -0.8802, 0.2619, 0.3044, 0.2531]])