Named Tuples¶
Named tuples used throughout the package to make code clearer.
-
class
glompo.common.namedtuples.Result[source]¶ Final result delivered by GloMPOManager.
Create new instance of Result(x, fx, stats, origin)
-
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__(_cls, x: Sequence[float], fx: float, stats: Dict[str, Any], origin: Dict[str, Any])¶ Create new instance of Result(x, fx, stats, origin)
-
__repr__()¶ Return a nicely formatted representation string
-
-
class
glompo.common.namedtuples.Bound[source]¶ Class of parameter bounds.
Create new instance of Bound(min, max)
-
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__(_cls, min: float, max: float)¶ Create new instance of Bound(min, max)
-
__repr__()¶ Return a nicely formatted representation string
-
-
class
glompo.common.namedtuples.OptimizerPackage[source]¶ Package of an initialized optimizer, its unique identifier and multiprocessing variables.
Create new instance of OptimizerPackage(opt_id, optimizer, call_kwargs, signal_pipe, allow_run_event, slots)
-
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__(_cls, opt_id: int, optimizer: Callable, call_kwargs: Dict[str, Any], signal_pipe: multiprocessing.connection.Connection, allow_run_event: multiprocessing.context.BaseContext.Event, slots: int)¶ Create new instance of OptimizerPackage(opt_id, optimizer, call_kwargs, signal_pipe, allow_run_event, slots)
-
__repr__()¶ Return a nicely formatted representation string
-
allow_run_event¶ Used by the manager to pause the optimizer.
Type: multiprocessing.Event
-
call_kwargs¶ Dictionary of kwargs send to
BaseOptimizer.minimize()Type: Dict[str, Any]
-
optimizer¶ Instance of
BaseOptimizerType: Callable
-
signal_pipe¶ Used to send messages between the optimizer and manager.
Type: Connection
-
-
class
glompo.common.namedtuples.IterationResult[source]¶ Return type of each optimizer iteration.
Create new instance of IterationResult(opt_id, x, fx, extras)
-
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__(_cls, opt_id: int, x: Sequence[float], fx: float, extras: Sequence[Any])¶ Create new instance of IterationResult(opt_id, x, fx, extras)
-
__repr__()¶ Return a nicely formatted representation string
-
extras¶ Possible returns if
detailed_call()is used.Type: Sequence[Any]
-
-
class
glompo.common.namedtuples.ProcessPackage[source]¶ Package of a running process and its communication channels.
Create new instance of ProcessPackage(process, signal_pipe, allow_run_event, slots)
-
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__(_cls, process: Union[multiprocessing.context.Process, threading.Thread], signal_pipe: multiprocessing.connection.Connection, allow_run_event: multiprocessing.context.BaseContext.Event, slots: int)¶ Create new instance of ProcessPackage(process, signal_pipe, allow_run_event, slots)
-
__repr__()¶ Return a nicely formatted representation string
-
allow_run_event¶ Used by the manager to pause the optimizer.
Type: multiprocessing.Event
-
signal_pipe¶ Used to send messages between the optimizer and manager.
Type: Connection
-
-
class
glompo.common.namedtuples.OptimizerCheckpoint[source]¶ Information needed in the manager about initialized optimizers for checkpoint loading.
Create new instance of OptimizerCheckpoint(opt_type, slots)
-
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__(_cls, opt_type: Type[BaseOptimizer], slots: int)¶ Create new instance of OptimizerCheckpoint(opt_type, slots)
-
__repr__()¶ Return a nicely formatted representation string
-
opt_type¶ Class of optimizer to be restarted.
Type: Type[ BaseOptimizer]
-