leaspy.models.shared_speed_logistic¶
Classes¶
Logistic model for multiple variables of interest, imposing same average |
Module Contents¶
- class SharedSpeedLogisticModel(name, **kwargs)[source]¶
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)[source]¶
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.Tensor- Metric 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)[source]¶
Compute the exponential of the negative deltas.
- Parameters:
deltas_padded (
torch.Tensor): Padded deltas.- Returns:
torch.Tensor: Exponential of the negative deltas.
- static pad_deltas(*, deltas)[source]¶
Prepend deltas with a zero as delta_1 is set to zero in the equations. .
- Parameters:
deltas (
torch.Tensor): Deltas tensor.- Returns:
torch.Tensor: Padded deltas tensor.
- static denom(*, g_deltas_exp)[source]¶
Compute the denominator for the \(\gamma_{t_0}\) calculation.
- static gamma_t0(*, denom)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Returns a model with sources.
- Parameters:
rt (TensorOrWeightedTensor[float])
space_shifts (TensorOrWeightedTensor[float])
metric (TensorOrWeightedTensor[float])
deltas_padded (TensorOrWeightedTensor[float])
log_g (TensorOrWeightedTensor[float])
- Return type:
- classmethod model_no_sources(*, rt, metric, deltas_padded, log_g)[source]¶
Returns a model without sources.
- Parameters:
rt (TensorOrWeightedTensor[float])
metric (TensorOrWeightedTensor[float])
deltas_padded (TensorOrWeightedTensor[float])
log_g (TensorOrWeightedTensor[float])
- Return type: