Minimize a function over a hyperparameter space. For most parameters, see `hyperopt.fmin.fmin`. Parameters ---------- catch_eval_exceptions : bool, default False If set to True, exceptions raised by either the evaluation of the configuration
(
self,
fn,
space,
algo=None,
max_evals=None,
timeout=None,
loss_threshold=None,
max_queue_len=1,
rstate=None,
verbose=False,
pass_expr_memo_ctrl=None,
catch_eval_exceptions=False,
return_argmin=True,
show_progressbar=True,
early_stop_fn=None,
trials_save_file="",
)
| 628 | return rval |
| 629 | |
| 630 | def fmin( |
| 631 | self, |
| 632 | fn, |
| 633 | space, |
| 634 | algo=None, |
| 635 | max_evals=None, |
| 636 | timeout=None, |
| 637 | loss_threshold=None, |
| 638 | max_queue_len=1, |
| 639 | rstate=None, |
| 640 | verbose=False, |
| 641 | pass_expr_memo_ctrl=None, |
| 642 | catch_eval_exceptions=False, |
| 643 | return_argmin=True, |
| 644 | show_progressbar=True, |
| 645 | early_stop_fn=None, |
| 646 | trials_save_file="", |
| 647 | ): |
| 648 | """Minimize a function over a hyperparameter space. |
| 649 | |
| 650 | For most parameters, see `hyperopt.fmin.fmin`. |
| 651 | |
| 652 | Parameters |
| 653 | ---------- |
| 654 | |
| 655 | catch_eval_exceptions : bool, default False |
| 656 | If set to True, exceptions raised by either the evaluation of the |
| 657 | configuration space from hyperparameters or the execution of `fn` |
| 658 | , will be caught by fmin, and recorded in self._dynamic_trials as |
| 659 | error jobs (JOB_STATE_ERROR). If set to False, such exceptions |
| 660 | will not be caught, and so they will propagate to calling code. |
| 661 | |
| 662 | show_progressbar : bool or context manager, default True. |
| 663 | Show a progressbar. See `hyperopt.progress` for customizing progress reporting. |
| 664 | |
| 665 | """ |
| 666 | # -- Stop-gap implementation! |
| 667 | # fmin should have been a Trials method in the first place |
| 668 | # but for now it's still sitting in another file. |
| 669 | from .fmin import fmin |
| 670 | |
| 671 | return fmin( |
| 672 | fn, |
| 673 | space, |
| 674 | algo=algo, |
| 675 | max_evals=max_evals, |
| 676 | timeout=timeout, |
| 677 | loss_threshold=loss_threshold, |
| 678 | trials=self, |
| 679 | rstate=rstate, |
| 680 | verbose=verbose, |
| 681 | max_queue_len=max_queue_len, |
| 682 | allow_trials_fmin=False, # -- prevent recursion |
| 683 | pass_expr_memo_ctrl=pass_expr_memo_ctrl, |
| 684 | catch_eval_exceptions=catch_eval_exceptions, |
| 685 | return_argmin=return_argmin, |
| 686 | show_progressbar=show_progressbar, |
| 687 | early_stop_fn=early_stop_fn, |