Utilities#

pyhopper.wrap_n_times(func, n, yield_after=0, reduction='mean', pass_index_arg=False)#
pyhopper.merge_dicts(*args)[source]#

Merges multiple dictionaries (``dict``s) into a single dictionary. Raises ValueError if a key is contained in two dicts with different values.

Parameters

args – Sequence of ``dict``s that

Returns

The merged dict

pyhopper.PruneEvaluation()[source]#

Common base class for all non-exit exceptions.

pyhopper.should_prune(of_estimate)[source]#

Asks the pruner object passed to search.run if the current evaluation should be pruned (= stopped)

Parameters

of_estimate (float) – An estimate of the true object function. For instance, this can be the training accuracy of a neural network after a few epochs.

Returns

True if the pruner thinks this parameter candidate is not worth continuing evaluating. False if no pruner object was passed to search.run or if the pruner determines the candidate is worth further evaluating.

Return type

bool