Run an Experiment in Jupyter Notebooks¶
Comet integrates seamlessly with hosted Jupyter Notebook services, including Google's Colab, Microsoft's Azure Notebooks, Amazon SageMaker Studio Lab, Amazon SageMaker notebook instance, and others.
Start logging data to Comet¶
You can pip install and configure the comet_ml
library from any notebook using:
1 2 3 4 |
|
You can then create a new experiment using the Experiment
class which will start the Comet auto-loggers and allow you to log custom metrics:
1 2 3 4 5 6 7 8 |
|
Please refer to Logging Experiment data for information on how to log different data types, integrations for an overview of the frameworks that Comet integrates with and corresponding functionalities, and Python SDK for a complete reference to all the methods provided by comet_ml
.
Note
When you call exp.end()
, Comet will know the training is completed and will log all the executed cells. This allows you to know exactly what code was run and in what order meaning every training run is reproducible even in Notebooks !
Display the Comet UI directly in a Notebook¶
Another key feature of Comet in Notebooks is the ability to display the Comet UI within a cell using the Experiment.display()
method:
1 2 3 4 5 6 |
|
The following tab names are available:
panels | code | parameters |
metrics | graph | output |
system-metrics | installed-packages | notes |
graphics | audio | text |
confusion-matrices | histograms | other |
html | assets | artifacts |
End an Experiment¶
When running Comet in a Notebook, we must end your Experiment explicitly when the training is finished using the Experiment.end()
method:
1 |
|
When as experiment is ended, Comet will finish uploading all remaining data as well as all the code cells that where executed before returning.