syne_tune.backend.simulator_backend.events module
- class syne_tune.backend.simulator_backend.events.Event(trial_id)[source]
Bases:
object
Base class for events dealt with in the simulator.
-
trial_id:
int
-
trial_id:
- class syne_tune.backend.simulator_backend.events.StartEvent(trial_id)[source]
Bases:
Event
Start training evaluation function for
trial_id
. In fact, the function is run completely, andOnTrialResultEvent
events and oneCompleteEvent
are generated.-
trial_id:
int
-
trial_id:
- class syne_tune.backend.simulator_backend.events.CompleteEvent(trial_id, status)[source]
Bases:
Event
Job for trial
trial_id
completes with statusstatus
. This is registered at the backend.-
status:
str
-
status:
- class syne_tune.backend.simulator_backend.events.StopEvent(trial_id)[source]
Bases:
Event
Job for trial
trial_id
is stopped. This leads to all later events fortrial_id
to be deleted, and a newCompleteEvent
.-
trial_id:
int
-
trial_id:
- class syne_tune.backend.simulator_backend.events.OnTrialResultEvent(trial_id, result)[source]
Bases:
Event
Result reported by some worker arrives at the backend and is registered there.
-
result:
Dict
[str
,Any
]
-
result:
- class syne_tune.backend.simulator_backend.events.SimulatorState(event_heap=None, events_added=0)[source]
Bases:
object
Maintains the state of the simulator, in particular the event heap.
event_heap
is the priority queue for events, the key being(time, cnt)
, wheretime
is the event time, andcnt
is a non-negative int used to break ties. When an event is added, thecnt
value is taken fromevents_added
. This means that ties are broken first_in_first_out.- push(event, event_time)[source]
Push new event onto heap
- Parameters:
event (
Event
) –event_time (
float
) –