Callbacks
Bases: Callback
Weights & Biases Logging callback. To use this callback pip install wandb.
Any metric that contains epoch will be plotted with epoch and all the other metrics will be plotted against
global_step which is total training steps. You can change the default axis by providing default_step_metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_model |
bool
|
Whether to upload model artifact to Wandb |
False
|
code_file |
Optional[str]
|
path of the code you want to upload as artifact to Wandb |
None
|
default_step_metric |
Metrics will be plotted against the |
'global_step'
|
from gradsflow.callbacks import WandbCallback
from timm import create_model
cnn = create_model("resnet18", pretrained=False, num_classes=1)
model = Model(cnn)
model.compile()
cb = WandbCallback()
autodataset = None # create your dataset
model.fit(autodataset, callbacks=cb)
Bases: Callback
Tracks the carbon emissions produced by deep neural networks using
CodeCarbon. To use this callback first install codecarbon using
pip install codecarbon.
For offline use, you must have to specify the country code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offline |
bool
|
whether to use internet connection or not. You will have to provide the country code |
False
|
**kwargs |
passed directly to codecarbon class. |
{}
|
Bases: Callback
Comet Logging callback.
This callback requires comet-ml to be pre-installed (pip install comet-ml).
Automatically log your Experiment to Comet logging platform. You need to provide API key either by setting
environment variable COMET_API_KEY or directly pass as an argument to the callback.
Checkout the documentation for more examples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_name |
str
|
Name of the Project |
'awesome-project'
|
api_key |
Optional[str]
|
project API key |
os.environ.get('COMET_API_KEY')
|
offline |
bool
|
log experiment offline |
False
|