Target calculator module
Output generator
- class emsa.sensitivity.target_calc.output_generator.OutputGenerator(sim_object: SimulationBase)
Bases:
object- get_output(lhs_table: ndarray) Dict[str, Tensor]
R0 calculator (LHS)
- class emsa.sensitivity.target_calc.r0_calculator_lhs.R0CalculatorLHS(sim_object: SimulationBase)
Bases:
objectR0Calculator class for calculating the basic reproduction number (R0) for epidemic models.
- sim_object
An instance of SimulationBase containing simulation parameters and data.
- get_output(lhs_table: Tensor) Tensor
Calculate the R0 values for the given LHS (Latin Hypercube Sampling) table.
- Parameters:
lhs_table (torch.Tensor) – LHS table with sampled parameter values.
- Returns:
Calculated R0 values for each sample.
- Return type:
torch.Tensor
- Raises:
ValueError – If sampled parameters boundaries are not specified in the simulation object.
Solution based target calculator
- class emsa.sensitivity.target_calc.sol_based_target_calc.TargetCalc(model: SensitivityModelBase, targets, config: Dict[str, int])
Bases:
object- get_batch_solution(y0: Tensor, t_eval: Tensor, samples: Tensor) Tensor
- get_output(lhs_table: Tensor, batch_size: int) Dict[str, Tensor]
- get_true_finished() BoolTensor
- max_metric(solutions, comp) Tensor
- max_stopping_condition(comp, last_diff)
- save_finished_indices(solutions, indices) None
- save_output_for_finished(solutions: Tensor, indices) None
- sup_metric(solutions, comp) Tensor
- sup_stopping_condition(last_val)