Definition of minimizers, wrappers etc.
zfit.minimizers.baseminimizer.
FailMinimizeNaN
Bases: Exception
Exception
args
with_traceback
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
ZfitStrategy
Bases: abc.ABC
abc.ABC
minimize_nan
float
BaseStrategy
Bases: zfit.minimizers.baseminimizer.ZfitStrategy
zfit.minimizers.baseminimizer.ZfitStrategy
ToyStrategyFail
Bases: zfit.minimizers.baseminimizer.BaseStrategy
zfit.minimizers.baseminimizer.BaseStrategy
PushbackStrategy
Pushback by adding nan_penalty * counter to the loss if NaNs are encountered.
The counter indicates how many NaNs occurred in a row. The nan_tolerance is the upper limit, if this is exceeded, the fallback will be used and an error is raised.
nan_penalty (Union[float, int]) – Value to add to the previous loss in order to penalize the step taken.
Union
int
nan_tolerance (int) – If the number of NaNs encountered in a row exceeds this number, the fallback is used.
DefaultStrategy
alias of zfit.minimizers.baseminimizer.PushbackStrategy
zfit.minimizers.baseminimizer.PushbackStrategy
DefaultToyStrategy
Bases: zfit.minimizers.baseminimizer.PushbackStrategy, zfit.minimizers.baseminimizer.ToyStrategyFail
zfit.minimizers.baseminimizer.ToyStrategyFail
Same as DefaultStrategy, but does not raise an error on full failure, instead return an invalid FitResult.
This can be useful for toy studies, where multiple fits are done and a failure should simply be counted as a failure instead of rising an error.
BaseMinimizer
Bases: zfit.minimizers.interface.ZfitMinimizer
zfit.minimizers.interface.ZfitMinimizer
Minimizer for loss functions.
Additional minimizer_options (given as **kwargs) can be accessed and changed via the attribute (dict) minimizer.minimizer_options.
tolerance
step
Perform a single step in the minimization (if implemented).
params (Union[Iterable[ZfitParameter], None, Iterable[str]]) –
Iterable
ZfitParameter
None
str
Returns:
MinimizeStepNotImplementedError – if the step method is not implemented in the minimizer.
minimize
Fully minimize the loss with respect to params.
loss (ZfitLoss) – Loss to be minimized.
ZfitLoss
params (Optional[Iterable[ZfitParameter]]) – The parameters with respect to which to minimize the loss. If None, the parameters will be taken from the loss.
Optional
FitResult
The fit result.
copy
print_params
print_gradients