drytorch.core.tracking
Module for coordinating logging of metadata, internal messages and metrics.
- DEFAULT_TRACKERS
named trackers registered to experiments by default.
- Type:
Functions
|
Add a list of trackers to the default ones. |
Remove all default trackers. |
Classes
|
Notifies tracker of an event. |
Class that handles and generates metadata. |
|
|
Abstract base class for tracking events with priority ordering. |
- class EventDispatcher(exp_name)[source]
Bases:
objectNotifies tracker of an event.
- named_trackers
a dictionary of trackers, indexed by their names.
- Type:
Initialize.
- Parameters:
exp_name (str) – name of the current experiment.
- publish(event: Event) None[source]
Publish an event to all registered trackers.
- Parameters:
event (Event) – the event to publish.
- Raises:
KeyboardInterrupt – if a tracker raises KeyboardInterrupt.
SystemExit – if a tracker raises SystemExit.
- Return type:
None
- subscribe(*trackers: Tracker, **named_trackers: Tracker) None[source]
Subscribe trackers to the dispatcher.
- Parameters:
- Raises:
TrackerAlreadyRegisteredError – if a tracker is already registered.
- Return type:
None
- class MetadataManager[source]
Bases:
objectClass that handles and generates metadata.
Initialize.
- register_actor(actor: Any, model: ModelProtocol[Any, Any]) None[source]
Record metadata of an object that acts on a model.
- Parameters:
actor (Any) – the object acting on the model.
model (ModelProtocol[Any, Any]) – the model that is called.
- Return type:
None
- register_model(model: ModelProtocol[Any, Any]) None[source]
Record metadata of a given model.
- Parameters:
model (ModelProtocol[Any, Any]) – the model to document.
- Return type:
None
- unregister_actor(actor: Any) None[source]
Unregister an object that acts on a model.
- Parameters:
actor (Any) – the object actin on the model.
- Return type:
None
- unregister_model(model: ModelProtocol[Any, Any]) None[source]
Record metadata of a given model.
- Parameters:
model (ModelProtocol[Any, Any]) – the model to document.
- Return type:
None
- class Tracker[source]
Bases:
objectAbstract base class for tracking events with priority ordering.
- abstractmethod notify(event: Event) None[source]
- abstractmethod notify(event: StartExperimentEvent) None
- abstractmethod notify(event: StopExperimentEvent) None
Notify the tracker of an event.
- Parameters:
event (Event) – the event to notify about.
- Return type:
None