# tf.keras.callbacks.CallbackList

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L198-L618) |

Container abstracting a list of callbacks.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

\`tf.compat.v1.keras.callbacks.CallbackList\`

<br />

    tf.keras.callbacks.CallbackList(
        callbacks=None, add_history=False, add_progbar=False, model=None, **params
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `callbacks` | List of `Callback` instances. |
| `add_history` | Whether a `History` callback should be added, if one does not already exist in the `callbacks` list. |
| `add_progbar` | Whether a `ProgbarLogger` callback should be added, if one does not already exist in the `callbacks` list. |
| `model` | The `Model` these callbacks are used with. |
| `**params` | If provided, parameters will be passed to each `Callback` via [`Callback.set_params`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/keras/callbacks/Callback#set_params). |

<br />

## Methods

### `append`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L299-L300)

    append(
        callback
    )

### `make_logs`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L613-L618)

    make_logs(
        model, logs, outputs, mode, prefix=''
    )

Computes logs for sending to `on_batch_end` methods.

### `on_batch_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L418-L420)

    on_batch_begin(
        batch, logs=None
    )

### `on_batch_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L422-L424)

    on_batch_end(
        batch, logs=None
    )

### `on_epoch_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L426-L438)

    on_epoch_begin(
        epoch, logs=None
    )

Calls the `on_epoch_begin` methods of its callbacks.

This function should only be called during TRAIN mode.

<br />

<br />

<br />

| Args ||
|---|---|
| `epoch` | Integer, index of epoch. |
| `logs` | Dict. Currently no data is passed to this argument for this method but that may change in the future. |

<br />

### `on_epoch_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L440-L453)

    on_epoch_end(
        epoch, logs=None
    )

Calls the `on_epoch_end` methods of its callbacks.

This function should only be called during TRAIN mode.

<br />

<br />

<br />

| Args ||
|---|---|
| `epoch` | Integer, index of epoch. |
| `logs` | Dict, metric results for this training epoch, and for the validation epoch if validation is performed. Validation result keys are prefixed with `val_`. |

<br />

### `on_predict_batch_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L499-L509)

    on_predict_batch_begin(
        batch, logs=None
    )

Calls the `on_predict_batch_begin` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `batch` | Integer, index of batch within the current epoch. |
| `logs` | Dict, contains the return value of `model.predict_step`, it typically returns a dict with a key 'outputs' containing the model's outputs. |

<br />

### `on_predict_batch_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L511-L519)

    on_predict_batch_end(
        batch, logs=None
    )

Calls the `on_predict_batch_end` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `batch` | Integer, index of batch within the current epoch. |
| `logs` | Dict. Aggregated metric results up until this batch. |

<br />

### `on_predict_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L565-L574)

    on_predict_begin(
        logs=None
    )

Calls the 'on_predict_begin\` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `logs` | Dict. Currently no data is passed to this argument for this method but that may change in the future. |

<br />

### `on_predict_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L576-L585)

    on_predict_end(
        logs=None
    )

Calls the `on_predict_end` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `logs` | Dict. Currently, no data is passed via this argument for this method, but that may change in the future. |

<br />

### `on_test_batch_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L477-L487)

    on_test_batch_begin(
        batch, logs=None
    )

Calls the `on_test_batch_begin` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `batch` | Integer, index of batch within the current epoch. |
| `logs` | Dict, contains the return value of `model.test_step`. Typically, the values of the `Model`'s metrics are returned. Example: `{'loss': 0.2, 'accuracy': 0.7}`. |

<br />

### `on_test_batch_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L489-L497)

    on_test_batch_end(
        batch, logs=None
    )

Calls the `on_test_batch_end` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `batch` | Integer, index of batch within the current epoch. |
| `logs` | Dict. Aggregated metric results up until this batch. |

<br />

### `on_test_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L543-L552)

    on_test_begin(
        logs=None
    )

Calls the `on_test_begin` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `logs` | Dict. Currently no data is passed to this argument for this method but that may change in the future. |

<br />

### `on_test_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L554-L563)

    on_test_end(
        logs=None
    )

Calls the `on_test_end` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `logs` | Dict. Currently, no data is passed via this argument for this method, but that may change in the future. |

<br />

### `on_train_batch_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L455-L465)

    on_train_batch_begin(
        batch, logs=None
    )

Calls the `on_train_batch_begin` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `batch` | Integer, index of batch within the current epoch. |
| `logs` | Dict, contains the return value of `model.train_step`. Typically, the values of the `Model`'s metrics are returned. Example: `{'loss': 0.2, 'accuracy': 0.7}`. |

<br />

### `on_train_batch_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L467-L475)

    on_train_batch_end(
        batch, logs=None
    )

Calls the `on_train_batch_end` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `batch` | Integer, index of batch within the current epoch. |
| `logs` | Dict. Aggregated metric results up until this batch. |

<br />

### `on_train_begin`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L521-L530)

    on_train_begin(
        logs=None
    )

Calls the `on_train_begin` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `logs` | Dict. Currently, no data is passed via this argument for this method, but that may change in the future. |

<br />

### `on_train_end`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L532-L541)

    on_train_end(
        logs=None
    )

Calls the `on_train_end` methods of its callbacks.

<br />

<br />

<br />

| Args ||
|---|---|
| `logs` | Dict. Currently, no data is passed via this argument for this method, but that may change in the future. |

<br />

### `set_model`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L307-L312)

    set_model(
        model
    )

### `set_params`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L302-L305)

    set_params(
        params
    )

### `__iter__`

[View source](https://github.com/keras-team/keras/tree/v2.13.1/keras/callbacks.py#L587-L588)

    __iter__()