ray.air.integrations.comet.CometLoggerCallback#
- class ray.air.integrations.comet.CometLoggerCallback(online: bool = True, tags: List[str] = None, save_checkpoints: bool = False, **experiment_kwargs)[source]#
Bases:
LoggerCallback
CometLoggerCallback for logging Tune results to Comet.
Comet (https://comet.ml/site/) is a tool to manage and optimize the entire ML lifecycle, from experiment tracking, model optimization and dataset versioning to model production monitoring.
This Ray Tune
LoggerCallback
sends metrics and parameters to Comet for tracking.In order to use the CometLoggerCallback you must first install Comet via
pip install comet_ml
Then set the following environment variables
export COMET_API_KEY=<Your API Key>
Alternatively, you can also pass in your API Key as an argument to the CometLoggerCallback constructor.
CometLoggerCallback(api_key=<Your API Key>)
- Parameters:
online – Whether to make use of an Online or Offline Experiment. Defaults to True.
tags – Tags to add to the logged Experiment. Defaults to None.
save_checkpoints – If
True
, model checkpoints will be saved to Comet ML as artifacts. Defaults toFalse
.**experiment_kwargs – Other keyword arguments will be passed to the constructor for comet_ml.Experiment (or OfflineExperiment if online=False).
Please consult the Comet ML documentation for more information on the Experiment and OfflineExperiment classes: https://comet.ml/site/
Example:
from ray.air.integrations.comet import CometLoggerCallback tune.run( train, config=config callbacks=[CometLoggerCallback( True, ['tag1', 'tag2'], workspace='my_workspace', project_name='my_project_name' )] )
Methods
Get the state of the callback.
Handle logging when a trial restores.
Log the current result of a Trial upon each iteration.
Initialize an Experiment (or OfflineExperiment if self.online=False) and start logging to Comet.
Called after a trial saved a checkpoint with Tune.
Called after experiment is over and all trials have concluded.
Called at the start of each tuning loop step.
Called at the end of each tuning loop step.
Called after a trial instance failed (errored) but the trial is scheduled for retry.
Set the state of the callback.
Called once at the very beginning of training.