# orbit.utils.EpochHelper

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/orbit/utils/epoch_helper.py#L20-L65) |

A helper class handle bookkeeping of epochs in custom training loops.

    orbit.utils.EpochHelper(
        epoch_steps: int, global_step: tf.Variable
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `epoch_steps` | An integer indicating how many steps are in an epoch. |
| `global_step` | A [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable) providing the current global step. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `batch_index` | Index of the next batch within the current epoch. |
| `current_epoch` | <br /> <br /> |

<br />

## Methods

### `epoch_begin`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/orbit/utils/epoch_helper.py#L36-L44)

    epoch_begin()

Returns whether a new epoch should begin.

### `epoch_end`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/orbit/utils/epoch_helper.py#L46-L56)

    epoch_end()

Returns whether the current epoch should end.