leaspy.models.shared_speed_logistic#
Classes#
Logistic model for multiple variables of interest, imposing same average |
Module Contents#
- class SharedSpeedLogisticModel(name, **kwargs)#
Bases:
leaspy.models.logistic.LogisticInitializationMixin,leaspy.models.time_reparametrized.TimeReparametrizedModelLogistic model for multiple variables of interest, imposing same average evolution pace for all variables (logistic curves are only time-shifted).
- Parameters:
- name
str The name of the model.
- **kwargs
Hyperparameters of the model.
- name
- Parameters:
name (str)
- static metric(*, g_deltas_exp)#
Compute the metric term for the logistic model.
This scaling term modulates the curvature of the logistic trajectory.
- Parameters:
- g_deltas_exp
torch.Tensor Product of slope and exp(-deltas).
- g_deltas_exp
- Returns:
torch.TensorMetric value, computed as:
\[\frac{(g \cdot e^{-\delta} + 1)^2}{g \cdot e^{-\delta}}\]
- Parameters:
g_deltas_exp (Tensor)
- Return type:
- static deltas_exp(*, deltas_padded)#
Compute the exponential of the negative deltas.
- Parameters:
- deltas_padded
torch.Tensor Padded deltas.
- deltas_padded
- Returns:
torch.TensorExponential of the negative deltas.
- Parameters:
deltas_padded (Tensor)
- Return type:
- static g_deltas_exp(*, g, deltas_exp)#
- static pad_deltas(*, deltas)#
Prepend deltas with a zero as delta_1 is set to zero in the equations.
- static denom(*, g_deltas_exp)#
Compute the denominator for the \(\gamma_{t_0}\) calculation.
- static gamma_t0(*, denom)#
Compute the \(\gamma_{t_0}\) value, which is the inverse of the denominator.
- Parameters:
- denom
torch.Tensor Denominator term.
- denom
- Returns:
torch.Tensor\(\gamma_{t_0}\) value.
- Parameters:
denom (Tensor)
- Return type:
- static g_metric(*, gamma_t0)#
Compute the g_metric value, which is the square of gamma_t0.
- Parameters:
- gamma_t0
torch.Tensor \(\gamma_{t_0}\) value.
- gamma_t0
- Returns:
torch.Tensor\(g_{metric}\) value, computed as:
\[g\_metric = \frac{1}{(\gamma_{t0} \cdot (1 - \gamma_{t0}))^2}\]
- Parameters:
gamma_t0 (Tensor)
- Return type:
- static collin_to_d_gamma_t0(*, deltas_exp, denom)#
Compute the collinear term to d_gamma_t0.
- Parameters:
- deltas_exp
torch.Tensor Exponential of the negative deltas.
- denom
torch.Tensor Denominator term.
- deltas_exp
- Returns:
torch.TensorCollinear term to d_gamma_t0
- Parameters:
- Return type:
- classmethod model_with_sources(*, rt, space_shifts, metric, deltas_padded, log_g)#
Returns a model 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])
deltas_padded (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
log_g (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])
- Return type:
- classmethod model_no_sources(*, rt, metric, deltas_padded, log_g)#
Returns a model without sources.
- Parameters:
- Return type:
- get_variables_specs()#
Get the specifications of the variables used in the model.
- Return type: