leaspy.models.utils.attributes.logistic_parallel_attributes module

class LogisticParallelAttributes(name, dimension, source_dimension)

Bases: AbstractManifoldModelAttributes

Attributes of leaspy logistic parallel models.

Contains the common attributes & methods of the logistic parallel models’ attributes.

Parameters:
namestr
dimensionint
source_dimensionint
Raises:
LeaspyModelInputError

if any inconsistent parameters for the model.

See also

MultivariateParallelModel
Attributes:
namestr (default ‘logistic_parallel’)

Name of the associated leaspy model.

dimensionint
source_dimensionint
has_sourcesbool

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

update_possibilitiesset[str] (default {‘all’, ‘g’, ‘deltas’, ‘betas’} )

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

positionstorch.Tensor (scalar) (default None)

positions = exp(realizations[‘g’]) such that “p0” = 1 / (1 + positions * exp(-deltas))

deltastorch.Tensor [dimension] (default None)

deltas = [0, delta_2_realization, …, delta_n_realization]

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

Matrix A such that w_i = A * s_i.

Methods

get_attributes()

Returns the following attributes: positions, deltas & mixing_matrix.

move_to_device(device)

Move the tensor attributes of this class to the specified device.

update(names_of_changed_values, values)

Update model group average parameter(s).

get_attributes()

Returns the following attributes: positions, deltas & mixing_matrix.

Returns:
positions: torch.Tensor
deltas: torch.Tensor
mixing_matrix: torch.Tensor
move_to_device(device: device)

Move the tensor attributes of this class to the specified device.

Parameters:
devicetorch.device
update(names_of_changed_values, values)

Update model group average parameter(s).

Parameters:
names_of_changed_valuesset[str]
Elements of set must be either:
  • all (update everything)

  • g correspond to the attribute positions.

  • deltas correspond to the attribute deltas.

  • betas correspond to the linear combination of columns from the orthonormal basis so to derive the mixing_matrix.

valuesdict [str, torch.Tensor]

New values used to update the model’s group average parameters

Raises:
LeaspyModelInputError

If names_of_changed_values contains unknown parameters.