Layers

The following layers have been simplified for torch.jit:

HomogeneousShapeLayer

class HomogeneousShapeLayer(shapes, n_dims, use_cpp=False)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Module to Perform a Shape Prediction (including a global homogeneous transformation)

forward(params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac44a8>)[source]

Performs the actual prediction

Parameters:params (torch.Tensor) – input parameters
Returns:predicted shape
Return type:torch.Tensor
num_params

Property to access these layer’s number of parameters

Returns:number of parameters
Return type:int

HomogeneousTransformationLayer

class HomogeneousTransformationLayer(n_dims: int, use_cpp=False)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Wrapper Class to Wrap the Python and C++ API into a combined python API

forward(shapes: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac49b0>, params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac49e8>)[source]

Selects individual parameters from params and forwards them through the actual layer implementation

Parameters:
  • shapes (torch.Tensor) – shapes to transform
  • params (torch.Tensor) – parameters specifying the affine transformation
Returns:

the transformed shapes in cartesian coordinates

Return type:

torch.Tensor

num_params

_HomogeneousTransformationLayerPy

class _HomogeneousTransformationLayerPy(n_dims)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Module to perform homogeneous transformations in 2D and 3D (Implemented in Python)

_ensemble_2d_matrix(rotation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4c50>, translation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4c88>, scale_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4cc0>)[source]

ensembles the homogeneous transformation matrix for 2D

Parameters:
  • rotation_params (torch.Tensor) – parameters specifying the rotation (one parameter)
  • translation_params (torch.Tensor) – parameters specifying the translation (two parameters)
  • scale_params (torch.Tensor) – parameter specifying the global scaling factor (one parameter) (currently only isotropic scaling supported)
Returns:

2D transformation matrix

Return type:

torch.Tensor

_ensemble_3d_matrix(rotation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4cf8>, translation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4d30>, scale_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4d68>)[source]

ensembles the homogeneous transformation matrix for 3D

Parameters:
  • rotation_params (torch.Tensor) – parameters specifying the rotation (three parameters)
  • translation_params (torch.Tensor) – parameters specifying the translation (three parameters)
  • scale_params (torch.Tensor) – parameter specifying the global scaling factor (one parameter) (currently only isotropic scaling supported)
Returns:

3D transformation matrix

Return type:

torch.Tensor

_ensemble_trafo(rotation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4ba8>, translation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4be0>, scale_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4c18>)[source]

ensembles the transformation matrix in 2D and 3D

Parameters:
  • rotation_params (torch.Tensor) – parameters specifying the rotation (one per DoF)
  • translation_params (torch.Tensor) – parameters specifying the translation (one per dimension)
  • scale_params (torch.Tensor) – parameter specifying the global scaling factor (currently only isotropic scaling supported)
Returns:

transformation matrix

Return type:

torch.Tensor

forward(shapes: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4a90>, rotation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4ac8>, translation_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4b00>, scale_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac4b38>)[source]

ensembles the homogeneous transformation matrix and applies it to the shape tensor

Parameters:
  • shapes (torch.Tensor) – shapes to transform
  • rotation_params (torch.Tensor) – parameters specifying the rotation (one per DoF)
  • translation_params (torch.Tensor) – parameters specifying the translation (one per dimension)
  • scale_params (torch.Tensor) – parameter specifying the global scaling factor (currently only isotropic scaling supported)
Returns:

the transformed shapes in cartesian coordinates

Return type:

torch.Tensor

ShapeLayer

class ShapeLayer(shapes, use_cpp=False)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

forward(shape_params: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5843ac41d0>)[source]
num_params