baseminimizer

Definition of minimizers, wrappers etc.

class zfit.minimizers.baseminimizer.BaseMinimizer(name, tolerance, verbosity, minimizer_options, strategy=None, **kwargs)[source]

Bases: 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

copy()[source]
minimize(loss: zfit.core.interfaces.ZfitLoss, params: Optional[Iterable[zfit.core.interfaces.ZfitParameter]] = None) → zfit.minimizers.fitresult.FitResult[source]

Fully minimize the loss with respect to params.

Parameters
  • loss (ZfitLoss) – Loss to be minimized.

  • params (list(zfit.Parameter) – The parameters with respect to which to minimize the loss. If None, the parameters will be taken from the loss.

Returns

The fit result.

Return type

FitResult

step(loss, params: Union[Iterable[zfit.core.interfaces.ZfitParameter], None, Iterable[str]] = None)[source]

Perform a single step in the minimization (if implemented).

Parameters

() (params) –

Returns:

Raises

NotImplementedError – if the step method is not implemented in the minimizer.

property tolerance
class zfit.minimizers.baseminimizer.BaseStrategy[source]

Bases: zfit.minimizers.baseminimizer.ZfitStrategy

minimize_nan(loss, params, minimizer, loss_value=None, gradient_values=None)[source]
class zfit.minimizers.baseminimizer.DefaultStrategy[source]

Bases: zfit.minimizers.baseminimizer.BaseStrategy

minimize_nan(loss, params, minimizer, loss_value=None, gradient_values=None)
exception zfit.minimizers.baseminimizer.FailMinimizeNaN[source]

Bases: Exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class zfit.minimizers.baseminimizer.ToyStrategyFail[source]

Bases: zfit.minimizers.baseminimizer.BaseStrategy

minimize_nan(loss, params, minimizer, loss_value=None, gradient_values=None)
class zfit.minimizers.baseminimizer.ZfitStrategy[source]

Bases: abc.ABC

abstract minimize_nan(loss, loss_value, params)[source]
zfit.minimizers.baseminimizer.print_gradients(params, values, gradients, loss=None)[source]
zfit.minimizers.baseminimizer.print_params(params, values, loss=None)[source]