|View source on GitHub|
Triggers saves policy checkpoints an agent's policy.
tf_agents.train.triggers.PolicySavedModelTrigger( saved_model_dir: Text, agent:
tf_agents.agents.TFAgent, train_step: tf.Variable, interval: int, async_saving: bool = False, metadata_metrics: Optional[Mapping[Text, py_metric.PyMetric]] = None, start: int = 0 )
Used in the notebooks
|Used in the tutorials|
On construction this trigger will generate a saved_model for a:
collect_policy, and a
raw_policy. When triggered a
checkpoint will be saved which can be used to updated any of the saved_model
||Base dir where checkpoints will be saved.|
||Agent to extract policies from.|
How often, in train_steps, the trigger will save. Note that as
long as the >=
||If True saving will be done asynchronously in a separate thread. Note if this is on the variable values in the saved checkpoints/models are not deterministic.|
A dictionary of metrics, whose
||Initial value for the trigger passed directly to the base class. It helps control from which train step the weigts of the model are saved.|
reset() -> None
Resets the trigger interval.
__call__( value: int, force_trigger: bool = False ) -> None
Maybe trigger the event based on the interval.
||the value for triggering.|
If True, the trigger will be forced triggered unless the
last trigger value is equal to