leaspy.models.linear¶
Classes¶
Compute initial values for model parameters. |
|
Manifold model for multiple variables of interest (linear formulation). |
Module Contents¶
- class LinearModel(name, **kwargs)[source]¶
Bases:
LinearInitializationMixin,leaspy.models.riemanian_manifold.RiemanianManifoldModelManifold model for multiple variables of interest (linear formulation).
- Parameters:
name (str)
- get_variables_specs()[source]¶
Return the specifications of the variables (latent variables, derived variables, model ‘parameters’) that are part of the model.
- Returns:
- :class:`~leaspy.variables.specs.NamedVariables
A dictionary-like object mapping variable names to their specifications.
- Return type:
- static metric(*, g)[source]¶
Compute the metric tensor for the model.
- Parameters:
- g
torch.Tensor Input tensor with values of the population parameter g for each feature.
- g
- Returns:
torch.TensorA tensor of ones with the same shape as g.
- Parameters:
g (Tensor)
- Return type:
- classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)[source]¶
Return the model output when sources(spatial components) are present.
- Parameters:
- rt
torch.Tensor The reparametrized time.
- space_shifts
torch.Tensor The values of the space-shifts
- 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.
- rt
- Returns:
torch.TensorThe model output with contribution from sources.
- Parameters:
- Return type: