# Comet.ml


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Registration

1.  Create account: [comet.ml/signup](https://www.comet.ml/signup).
2.  Export API key to the environment variable (more help
    [here](https://www.comet.ml/docs/v2/guides/getting-started/quickstart/#get-an-api-key)).
    In your terminal run:

<!-- -->

    export COMET_API_KEY='YOUR_LONG_API_TOKEN'

or include it in your `./comet.config` file (**recommended**). More help
is
[here](https://www.comet.ml/docs/v2/guides/tracking-ml-training/jupyter-notebooks/#set-your-api-key-and-project-name).

## Installation

1.  You need to install neptune-client. In your terminal run:

<!-- -->

    pip install comet_ml

or (alternative installation using conda). In your terminal run:

    conda install -c anaconda -c conda-forge -c comet_ml comet_ml

## How to use?

Key is to create the callback `CometMLCallback` before you create
[`Learner()`](https://docs.fast.ai/learner.html#learner) like this:

    from fastai.callback.comet import CometMLCallback

    comet_ml_callback = CometCallback('PROJECT_NAME')  # specify project

    learn = Learner(dls, model,
                    cbs=comet_ml_callback
                    )

    learn.fit_one_cycle(1)

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/callback/comet.py#L18"
target="_blank" style="float:right; font-size:smaller">source</a>

### CometCallback

``` python

def CometCallback(
    project_name, log_model_weights:bool=True
):

```

*Log losses, metrics, model weights, model architecture summary to
neptune*
