<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/utils/progbar.py#L12-L298) |

Displays a progress bar.

    tf.keras.utils.Progbar(
        target,
        width=20,
        verbose=1,
        interval=0.05,
        stateful_metrics=None,
        stateless_metrics=None,
        unit_name='step'
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Distributed training with DTensors](https://www.tensorflow.org/tutorials/distribute/dtensor_ml_tutorial) - [Using DTensors with Keras](https://www.tensorflow.org/tutorials/distribute/dtensor_keras_tutorial) |

If neither of `stateful_metrics` and `stateless_metrics` is provided, all
metrics are assumed to be stateless (averaged by the progress bar before
display).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `target` | Total number of steps expected, None if unknown. |
| `width` | Progress bar width on screen. |
| `verbose` | Verbosity mode, 0 (silent), 1 (verbose), 2 (semi-verbose) |
| `stateful_metrics` | Iterable of string names of metrics that should *not* be averaged over time. Metrics in this list will be displayed as-is. If provided, do not provide `stateless_metrics`. |
| `stateless_metrics` | Iterable of string names of metrics that *should* be averaged over time. Metrics in this list will be averaged by the progbar before display. If provided, do not provide `stateful_metrics`. |
| `interval` | Minimum visual progress update interval (in seconds). |
| `unit_name` | Display name for step counts (usually "step" or "sample"). |

<br />

## Methods

### `add`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/utils/progbar.py#L239-L240)

    add(
        n, values=None
    )

### `update`

[View source](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/utils/progbar.py#L85-L237)

    update(
        current, values=None, finalize=None
    )

Updates the progress bar.

<br />

<br />

<br />

| Args ||
|---|---|
| `current` | Index of current step. |
| `values` | List of tuples: `(name, value_for_last_step)`. If `name` is in `stateful_metrics`, `value_for_last_step` will be displayed as-is. Else, an average of the metric over time will be displayed. |
| `finalize` | Whether this is the last update for the progress bar. If `None`, defaults to `current >= self.target`. |

<br />