tracts.driver_utils._get_driver_for_reoptimization#
- _get_driver_for_reoptimization(driver_spec, model_param_names, optimal_params)#
Creates a new driver specification for re-optimization, using the optimal parameters from a previous optimization as the starting parameters for the new optimization. The new driver specification is a copy of the original driver specification, with the starting parameters updated to the optimal parameters and the number of repetitions set to 1, so that no resampling of starting parameters is peformed.
- Parameters:
driver_spec (
InferenceConfig) – The configuration for the inference process, as specified in the driver file.model_param_names (
list[str]) – A list of all parameter names of the demographic model, in the order given by demographic_model.model_base_params.optimal_params (
ndarray) – The final optimal parameters in physical units, as returned by the optimization process.
- Returns:
A new driver specification for re-optimization, with the starting parameters updated to the optimal parameters and the number of repetitions set to 1.
- Return type: