tracts.driver_utils.get_time_scaled_model_bounds#
- get_time_scaled_model_bounds(model, verbose=False)#
Computes a function that takes in optimizer parameters, converts them to physical parameters using the model’s parameter handler, and returns the violation score for those parameters. This is necessary because some optimizers may require parameters to be on a different scale (e.g. log scale) than the physical parameters used in the model, so this function serves as a wrapper to apply the necessary transformations before passing parameters to the model.
- Parameters:
model (
ParametrizedDemography) – The demographic model for which to compute the violation score.verbose (bool) – Whether to print detailed information about the violation score. Defaults to False.
- Returns:
A function that takes in optimizer parameters, converts them to physical parameters, and returns the violation score for those parameters.
- Return type:
Callable[[np.ndarray], float]