drytorch.trackers.sqlalchemy
Module containing sqlalchemy Table classes and a tracker to track metrics.
Classes
|
Table for experiments. |
|
Table for the logs of the metrics. |
|
Table for runs. |
|
Tracker that creates a connection to a SQL database using sqlalchemy. |
|
Table for sources. |
|
Table for tags for experiments. |
- class Experiment(experiment_name)[source]
Bases:
objectTable for experiments.
- row_id
the unique id for the table.
- Type:
- experiment_name
the experiment’s name.
- Type:
- runs
the entry for the run for the experiment.
- tags
the list of tags for the experiment.
- class Log(source, epoch, metric_name, value)[source]
Bases:
objectTable for the logs of the metrics.
- Parameters:
- row_id
the unique id for the table.
- Type:
- source_id
the id of the source creating the log.
- Type:
- source
the entry for the source creating the log.
- epoch
the number of epochs the model has been trained.
- Type:
- metric_name
the name of the metric.
- Type:
- value
the value of the metric.
- Type:
- created_at
the timestamp for the entry creation.
- class Run(run_id, run_ts, experiment)[source]
Bases:
objectTable for runs.
A new run is created for each experiment scope, unless specified.
- row_id
the unique id for the table.
- Type:
- run_id
global identifier for the run.
- Type:
- run_ts
the run’s timestamp.
- experiment_id
the id of the experiment for the run.
- Type:
- experiment
the entry for the experiment for the run.
- sources
the list of sources from experiments
- class SQLConnection(engine: Engine | None = None)[source]
Bases:
MetricLoaderTracker that creates a connection to a SQL database using sqlalchemy.
- default_url
by default, it creates a local sqlite database.
- Type:
ClassVar[sqlalchemy.engine.url.URL]
- engine
the sqlalchemy Engine for the connection.
- session_factory
the Session class to initiate a sqlalchemy session.
Initialize.
- Parameters:
engine (Engine) – the engine for the session. Default uses default_url.
- property run: Run
The current run.
- Raises:
AccessOutsideScopeError – if there is no active run.
- notify(event: Event) None[source]
- notify(event: StartExperimentEvent) None
- notify(event: ActorRegistrationEvent) None
- notify(event: MetricEvent) None
Notify the tracker of an event.
- Parameters:
event (Event) – the event to notify about.
- Return type:
None
- class Source(model_name, model_ts, source_name, source_ts, run)[source]
Bases:
objectTable for sources.
- Parameters:
- row_id
the unique id for the table.
- Type:
- model_name
the model’s name.
- Type:
- model_ts
the model’s timestamp.
- source_name
the source’s name.
- Type:
- source_ts
the source’s timestamp.
- run_table_id
the table id for the current experiment’s run.
- Type:
- run
the entry for the current experiment’s run.
- logs
the list of logs originating from the source.