adaptive.BlockingRunner¶
BlockingRunner
¶
BlockingRunner(learner: LearnerType, goal: Callable[[LearnerType], bool] | None = None, *, loss_goal: float | None = None, npoints_goal: int | None = None, end_time_goal: datetime | None = None, duration_goal: timedelta | int | float | None = None, executor: ExecutorTypes | None = None, ntasks: int | None = None, log: bool = False, shutdown_executor: bool = False, retries: int = 0, raise_if_retries_exceeded: bool = True)
Bases: BaseRunner
Run a learner synchronously in an executor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
learner
|
adaptive.BaseLearner instance
|
|
required |
goal
|
callable
|
The end condition for the calculation. This function must take the learner as its sole argument, and return True when we should stop requesting more points. |
None
|
loss_goal
|
float
|
Convenience argument, use instead of |
None
|
npoints_goal
|
int
|
Convenience argument, use instead of |
None
|
end_time_goal
|
datetime
|
Convenience argument, use instead of |
None
|
duration_goal
|
timedelta or number
|
Convenience argument, use instead of |
None
|
executor
|
(Executor, Client, MPIPoolExecutor, Client or get_reusable_executor)
|
The executor in which to evaluate the function to be learned.
If not provided, a new |
None
|
ntasks
|
int
|
The number of concurrent function evaluations. Defaults to the number
of cores available in |
None
|
log
|
bool
|
If True, record the method calls made to the learner by this runner. |
False
|
shutdown_executor
|
bool
|
If True, shutdown the executor when the runner has completed. If
|
False
|
retries
|
int
|
Maximum amount of retries of a certain point |
0
|
raise_if_retries_exceeded
|
bool
|
Raise the error after a point |
True
|
Attributes:
| Name | Type | Description |
|---|---|---|
learner |
adaptive.BaseLearner instance
|
The underlying learner. May be queried for its state. |
log |
list or None
|
Record of the method calls made to the learner, in the format
|
to_retry |
list of tuples
|
List of |
tracebacks |
list of tuples
|
List of of |
pending_points |
list of tuples
|
A list of tuples with |
Methods:
| Name | Description |
|---|---|
elapsed_time : callable |
A method that returns the time elapsed since the runner was started. |
overhead : callable |
The overhead in percent of using Adaptive. This includes the
overhead of the executor. Essentially, this is
|