leaspy.models.logistic#
Classes#
Manifold model for multiple variables of interest (logistic formulation). |
Module Contents#
- class LogisticInitializationMixin#
- class LogisticModel(name, **kwargs)#
Bases:
LogisticInitializationMixin,leaspy.models.riemanian_manifold.RiemanianManifoldModelManifold model for multiple variables of interest (logistic formulation).
- Parameters:
name (str)
- get_variables_specs()#
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.
- Return type:
- static metric(*, g)#
Compute the metric tensor from input tensor g. This function calculates the metric as ((g + 1)^2 / g) element-wise.
- Parameters:
- g
torch.Tensor Input tensor with values of the population parameter g for each feature.
- g
- Returns:
torch.TensorThe computed metric tensor, same shape as g(number of features)
- Parameters:
g (Tensor)
- Return type:
- classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)#
Return the model output when sources(spatial components) are present.
- Parameters:
- rtTensorOrWeightedTensor[float]
Tensor containing the reparametrized time.
- space_shiftsTensorOrWeightedTensor[float]
Tensor containing the values of the space-shifts
- metricTensorOrWeightedTensor[float]
Tensor containing the metric tensor used for computing the spatial/temporal influence.
- v0TensorOrWeightedTensor[float]
Tensor containing the values of the population parameter v0 for each feature.
- gTensorOrWeightedTensor[float]
Tensor containing the values of the population parameter g for each feature.
- Returns:
torch.TensorWeighted value tensor after applying sigmoid transformation, representing the model output with sources.
- Parameters:
rt (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
space_shifts (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
metric (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
v0 (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
g (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
- Return type: