fl4health.utils.snapshotter module¶
- class AbstractSnapshotter[source]¶
-
- abstract load_attribute(attribute_snapshot, attribute)[source]¶
Abstract method to load the state of the attribute. This method should be implemented based on the type of the attribute and the way it should be loaded.
- class BytesSnapshotter[source]¶
Bases:
AbstractSnapshotter
[bytes
]
- class EnumSnapshotter[source]¶
Bases:
AbstractSnapshotter
[Enum
]
- class HistorySnapshotter[source]¶
Bases:
AbstractSnapshotter
[History
]
- class LRSchedulerSnapshotter[source]¶
Bases:
AbstractSnapshotter
[LRScheduler
]
- class OptimizerSnapshotter[source]¶
Bases:
AbstractSnapshotter
[Optimizer
]
- class SerializableObjectSnapshotter[source]¶
Bases:
AbstractSnapshotter
[MetricManager
|LossMeter
|ReportsManager
]- load_attribute(attribute_snapshot, attribute)[source]¶
Load the state of the serializable objects (either single or dictionary of them).
- Parameters:
attribute_snapshot (dict[str, Any]) – The snapshot containing the state of the serializable objects.
attribute (dict[str, MetricManager | LossMeter | ReportsManager]) – The serializable objects to be loaded
- Return type:
- save_attribute(attribute)[source]¶
Save the state of the serializable objects (either single or dictionary of them).
- Parameters:
attribute (dict[str, MetricManager | LossMeter | ReportsManager]) – The serializable objects to be saved.
- Returns:
A dictionary containing the state of the serializable objects.
- Return type:
- class SingletonSnapshotter[source]¶
Bases:
AbstractSnapshotter
[int
|float
|bool
]- load_attribute(attribute_snapshot, attribute)[source]¶
Load the state of the singleton (either single or dictionary of them).
- class StringSnapshotter[source]¶
Bases:
AbstractSnapshotter
[str
]
- class TorchModuleSnapshotter[source]¶
Bases:
AbstractSnapshotter
[Module
]