pyrevs.strategies.base.termination¶
Defines the interface and simple implementations of termination criteria.
Attributes¶
Classes¶
Termination criterion interface. |
|
Termination criterion based on time. |
|
Termination criterion based on score. |
|
Termination criterion based on model. |
Module Contents¶
- class TerminationCriterion[source]¶
Bases:
ProtocolTermination criterion interface.
- abstractmethod should_terminate(model: pyrevs.core.ForwardModelBaseClass[T_Noise, T_State], trajectory: pyrevs.trajectory.Trajectory) bool[source]¶
Check if the trajectory should terminate.
- Parameters:
model – the forward model
trajectory – the trajectory
- Returns:
True if the trajectory should terminate
- class TimeTerminationCriterion(end_time: float)[source]¶
Bases:
TerminationCriterionTermination criterion based on time.
Will trigger termination if the current time is greater than or equal to the end time.
- should_terminate(model: pyrevs.core.ForwardModelBaseClass[T_Noise, T_State], trajectory: pyrevs.trajectory.Trajectory) bool[source]¶
Check if the trajectory should terminate.
- class LowScoreTerminationCriterion(score_threshold: float)[source]¶
Bases:
TerminationCriterionTermination criterion based on score.
Will trigger termination if the current score is less than or equal to a threshold.
- should_terminate(model: pyrevs.core.ForwardModelBaseClass[T_Noise, T_State], trajectory: pyrevs.trajectory.Trajectory) bool[source]¶
Check if the trajectory should terminate.
- class ModelTerminationCriterion[source]¶
Bases:
TerminationCriterionTermination criterion based on model.
Will trigger termination if the forward model has decides to.
- should_terminate(model: pyrevs.core.ForwardModelBaseClass[T_Noise, T_State], trajectory: pyrevs.trajectory.Trajectory) bool[source]¶
Check if the trajectory should terminate.