leaspy.models.riemanian_manifold

Classes

RiemanianManifoldModel

Manifold model for multiple variables of interest (logistic or linear formulation).

Module Contents

class RiemanianManifoldModel(name, variables_to_track=None, **kwargs)[source]

Bases: leaspy.models.time_reparametrized.TimeReparametrizedModel

Manifold model for multiple variables of interest (logistic or linear formulation).

Parameters:
namestr

The name of the model.

**kwargs

Hyperparameters of the model (including noise_model)

Raises:
LeaspyModelInputError
  • If hyperparameters are inconsistent

Parameters:
classmethod compute_sufficient_statistics(state)[source]

Compute the model’s sufficient statistics.

Parameters:
stateState

The state to pick values from.

Returns:
SuffStatsRW

The computed sufficient statistics.

Parameters:

state (State)

Return type:

SuffStatsRW

get_variables_specs()[source]

Return the specifications of the variables (latent variables, derived variables, model ‘parameters’) that are part of the model.

Returns:
NamedVariables

A dictionary-like object mapping variable names to their specifications. These include ModelParameter, Hyperparameter, PopulationLatentVariable, and LinkedVariable instances.

Return type:

NamedVariables

static metric(*, g)[source]
Abstractmethod:

Parameters:

g (Tensor)

Return type:

Tensor

classmethod model_no_sources(*, rt, metric, v0, g)[source]

Return the model output when sources(spatial components) are not present.

Parameters:
rttorch.Tensor

The reparametrized time.

metricAny

The metric tensor used for computing the spatial/temporal influence.

v0Any

The values of the population parameter v0 for each feature.

gAny

The values of the population parameter g for each feature.

Returns:
torch.Tensor

The model output without contribution from source shifts.

Parameters:

rt (Tensor)

Return type:

Tensor

Notes

This implementation delegates to model_with_sources with space_shifts set to a zero tensor of shape (1, 1), effectively removing source effects.

classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)[source]
Abstractmethod:

Parameters:
Return type:

Tensor