DeepChem logging in 3 lines of code
WandbLogger instance into a DeepChem model attaches W&B logging to the training run, so metrics produced during fit automatically stream to your W&B project.

Report and Google Colab
The following resources show the integration in practice before you wire it into your own code:- Explore the W&B with DeepChem: Molecular Graph Convolutional Networks article for example charts generated using the W&B DeepChem integration.
- To dive straight into working code, check out this Google Colab.
Track experiments
The rest of this page explains how to set up an API key, install thewandb library, and enable logging for either a TorchModel or KerasModel.
Set up W&B for DeepChem models of type KerasModel or TorchModel.
Sign up and create an API key
An API key authenticates your machine to W&B. You can generate an API key from your user profile.For a more streamlined approach, go to User Settings and create an API key. Copy the API key immediately and save it in a secure location such as a password manager.
- Click your user profile icon in the upper right corner.
- Select User Settings, then scroll to the API Keys section.
Install the wandb library and log in
To install the wandb library locally and log in:
- Command Line
- Python
- Python notebook
-
Set the
WANDB_API_KEYenvironment variable to your API key. Replace values enclosed in<>with your own: -
Install the
wandblibrary and log in.
Log your training and evaluation data to W&B
Withwandb installed and authenticated, you can now attach a WandbLogger to your DeepChem model so that training and evaluation data flow to W&B.
Training loss and evaluation metrics log to W&B automatically. To enable optional evaluation, use the DeepChem ValidationCallback. The WandbLogger detects the ValidationCallback and logs the metrics it produces.
- TorchModel
- KerasModel
model.fit runs, training loss and any evaluation metrics emitted by the ValidationCallback appear in your W&B project under the run created by WandbLogger.