API reference: fastai integration#
NeptuneCallback class provided by the Neptune-fastai integration captures metadata that is generated when training models with fastai.
Creates a Neptune callback for logging metadata during a fastai training loop.
The callback logs parameters, metrics, losses, model configuration, optimizer configuration, and info about the dataset: path, number of samples, and hash value.
Metrics and losses are logged separately for each
learner.fit() call. For example, when you call
learner.fit(n) the first time, it will create a folder named
fit_0 under the
metrics folder that contains optimizer hyperparameters, batch, and loader level metrics:
||-||(required) An existing run reference, as returned by
||Namespace under which all metadata logged by the Neptune callback will be stored. If omitted, defaults to an empty string, in which case the metadata is logged directly under the run, without a common "root" namespace.|
||Which model checkpoints created by
Create a Neptune run:
If Neptune can't find your project name or API token
As a best practice, you should save your Neptune API token and project name as environment variables:
You can, however, also pass them as arguments when initializing Neptune:
Also works for
API token: In the bottom-left corner, expand the user menu and select Get my API token.
- Project name: in the top-right menu: → Edit project details.
If you haven't registered, you can also log anonymously to a public project (make sure not to publish sensitive data through your code!):
Log a single training phase or all phases of the learner:
You can log your model weight files during a single training phase or all training phases by adding
SaveModelCallback() to the callbacks list of your learner or fit method.
neptune-fastai repo on GitHub