stacie.conditioning module¶
Cost function pre-conditioning.
- class ConditionedCost(cost, par_scales, cost_scale)[source]¶
Bases:
objectA wrapper for the cost function taking care of pre-conditioning.
The goal of the pre-conditioner is to let the optimizer work with normalized parameters, and to scale the cost function to a normalized range, such that all quantities are close to 1, even if the spectra and the frequencies have very different orders of magnitude.
- Parameters:
- __call__(pars, *, deriv=0)[source]¶
Evaluate the pre-conditioned cost function.
- Parameters:
- Return type:
- Returns:
results – The cost function value and its derivatives. In vectorized calculations, the last axis of the gradient and the last two of the Hessian correspond to the parameters.
-
cost:
Callable[[ndarray[tuple[int,...],dtype[float]],int],list[ndarray[tuple[int,...],dtype[float]]]]¶