Named Tuples

Named tuples used throughout the package to make code clearer.

class Bound(min, max)[source]

Class of parameter bounds.

Create new instance of Bound(min, max)

max: float

Upper parameter bound.

Type

float

min: float

Lower parameter bound.

Type

float

class IterationResult(opt_id, x, fx, extras)[source]

Return type of each optimizer iteration.

Create new instance of IterationResult(opt_id, x, fx, extras)

extras: Sequence[Any]

Possible returns if detailed_call() is used.

Type

Sequence[Any]

fx: float

Corresponding function evaluation.

Type

float

opt_id: int

Unique optimizer identification number.

Type

int

x: Sequence[float]

Location in input space.

Type

Sequence[float]

class OptimizerCheckpoint(opt_type, slots)[source]

Information needed in the manager about initialized optimizers for checkpoint loading.

Create new instance of OptimizerCheckpoint(opt_type, slots)

opt_type: Type[BaseOptimizer]

Class of optimizer to be restarted.

Type

Type[BaseOptimizer]

slots: int

Maximum number of thread/processes the optimizer may spawn.

Type

int

class OptimizerPackage(opt_id, optimizer, signal_pipe, allow_run_event, slots)[source]

Package of an initialized optimizer, its unique identifier and multiprocessing variables.

Create new instance of OptimizerPackage(opt_id, optimizer, signal_pipe, allow_run_event, slots)

allow_run_event: multiprocessing.synchronize.Event

Used by the manager to pause the optimizer.

Type

multiprocessing.Event

opt_id: int

Unique optimizer identification number.

Type

int

optimizer: Callable

Instance of BaseOptimizer

Type

Callable

signal_pipe: multiprocessing.connection.Connection

Used to send messages between the optimizer and manager.

Type

Connection

slots: int

Maximum number of thread/processes the optimizer may spawn.

Type

int

class ProcessPackage(process, signal_pipe, allow_run_event, slots)[source]

Package of a running process and its communication channels.

Create new instance of ProcessPackage(process, signal_pipe, allow_run_event, slots)

allow_run_event: multiprocessing.synchronize.Event

Used by the manager to pause the optimizer.

Type

multiprocessing.Event

process: Union[multiprocessing.context.Process, threading.Thread]

Process within which optimizer is run.

Type

Union[Process, Thread]

signal_pipe: multiprocessing.connection.Connection

Used to send messages between the optimizer and manager.

Type

Connection

slots: int

Maximum number of thread/processes the optimizer may spawn.

Type

int

class Result(x, fx, stats, origin)[source]

Final result delivered by GloMPOManager.

Create new instance of Result(x, fx, stats, origin)

fx: float

The lowest function value found.

Type

float

origin: Dict[str, Any]

Optimizer name, settings, starting point and termination condition.

Type

Dict[str, Any]

stats: Dict[str, Any]

Dictionary of statistics surrounding the optimization.

Type

Dict[str, Any]

x: Sequence[float]

Location in input space producing the lowest function value.

Type

Sequence[float]