leaspy.models.logistic

Classes

LogisticInitializationMixin

LogisticModel

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

Module Contents

class LogisticInitializationMixin[source]
class LogisticModel(name, **kwargs)[source]

Bases: LogisticInitializationMixin, leaspy.models.riemanian_manifold.RiemanianManifoldModel

Manifold model for multiple variables of interest (logistic 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:
NamedVariables

A dictionary-like object mapping variable names to their specifications.

Return type:

NamedVariables

static metric(*, g)[source]

Compute the metric tensor from input tensor g. This function calculates the metric as ((g + 1)^2 / g) element-wise.

Parameters:
gt torch.Tensor

Input tensor with values of the population parameter g for each feature.

Returns:
torch.Tensor

The computed metric tensor, same shape as g(number of features)

Parameters:

g (Tensor)

Return type:

Tensor

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

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.Tensor

Weighted value tensor after applying sigmoid transformation, representing the model output with sources.

Parameters:
Return type:

Tensor