garage.experiment.snapshotter module¶
Defines SnapshotConfig and Snapshotter.
-
class
SnapshotConfig(snapshot_dir, snapshot_mode, snapshot_gap)¶ Bases:
tuple-
snapshot_dir¶ Alias for field number 0
-
snapshot_gap¶ Alias for field number 2
-
snapshot_mode¶ Alias for field number 1
-
-
class
Snapshotter(snapshot_dir='/home/docs/checkouts/readthedocs.org/user_builds/garage/checkouts/v2019.10.1/docs/data/local/experiment', snapshot_mode='last', snapshot_gap=1)[source]¶ Bases:
objectSnapshotter snapshots training data.
When training, it saves data to binary files. When resuming, it loads from saved data.
Parameters: - snapshot_dir (str) – Path to save the log and iteration snapshot.
- snapshot_mode (str) – Mode to save the snapshot. Can be either “all” (all iterations will be saved), “last” (only the last iteration will be saved), “gap” (every snapshot_gap iterations are saved), or “none” (do not save snapshots).
- snapshot_gap (int) – Gap between snapshot iterations. Wait this number of iterations before taking another snapshot.
-
load(load_dir, itr='last')[source]¶ Load one snapshot of parameters from disk.
Parameters: Returns: Loaded snapshot
Return type:
-
snapshot_dir¶ Return the directory of snapshot.
-
snapshot_gap¶ Return the wait number of snapshot.
-
snapshot_mode¶ Return the type of snapshot.