leaspy.models.utils.attributes.abstract_manifold_model_attributes

Classes

AbstractManifoldModelAttributes

Abstract base class for attributes of leaspy manifold models.

Module Contents

class AbstractManifoldModelAttributes(name, dimension, source_dimension)[source]

Bases: leaspy.models.utils.attributes.abstract_attributes.AbstractAttributes

Abstract base class for attributes of leaspy manifold models.

Contains the common attributes & methods of the different attributes classes. Such classes are used to update the models’ attributes.

Parameters:
namestr
dimensionint
source_dimensionint (default None)
Attributes:
namestr (default None)

Name of the associated leaspy model.

dimensionint
source_dimensionint
univariatebool

Whether model is univariate or not (i.e. dimension == 1)

has_sourcesbool

Whether model has sources or not (not univariate and source_dimension >= 1)

update_possibilitiesset[str]

Contains the available parameters to update. Different models have different parameters.

positionstorch.Tensor [dimension] (default None)

<!> Depending on the model it does not correspond to the same thing.

velocitiestorch.Tensor [dimension] (default None)

Vector of velocities for each feature (positive components). For multivariate models only (except for parallel model as it is useless).

orthonormal_basistorch.Tensor [dimension, dimension - 1] (default None)

For multivariate and multivariate parallel models, with source_dimension >= 1.

betastorch.Tensor [dimension - 1, source_dimension] (default None)

For multivariate and multivariate parallel models, with source_dimension >= 1.

mixing_matrixtorch.Tensor [dimension, source_dimension] (default None)

Matrix A such that w_i = A * s_i. For multivariate and multivariate parallel models, with source_dimension >= 1.

Raises:
LeaspyModelInputError

if any inconsistent parameter.

Parameters:
  • name (str)

  • dimension (int)

  • source_dimension (int)

positions: torch.FloatTensor
velocities: torch.FloatTensor
mixing_matrix: torch.FloatTensor
betas: torch.FloatTensor
orthonormal_basis = None
update_possibilities
get_attributes()[source]

Returns the attributes of the model, which is a tuple of three torch tensors.

For the precise definitions of those attributes please refer to the exact attributes class associated to your model.

Returns:
positions: torch.Tensor
velocities: torch.Tensor
mixing_matrix: torch.Tensor
Return type:

Tuple[torch.FloatTensor, torch.FloatTensor, torch.FloatTensor]