"""Auto-generated stub for module: early_stopping."""
from typing import Any

# Constants
logger: Any

# Classes
class EarlyStopping:
    # Stop training when validation loss stops improving.
    #
    #     Tracks the lowest observed loss.  If the loss does not decrease by
    #     at least *min_delta* for *patience* consecutive calls to
    #     :meth:`update`, the :attr:`stop` flag is set to ``True``.
    #
    #     Example::
    #
    #         es = EarlyStopping(patience=10, min_delta=0.001)
    #         for epoch in range(max_epochs):
    #             loss = train_and_validate(...)
    #             es.update(loss)
    #             if es.stop:
    #                 break
    #
    #     Args:
    #         patience: Number of updates without improvement before stopping.
    #         min_delta: Minimum decrease in loss to count as an improvement.

    def __init__(self: Any, patience: int = 5, min_delta: float = 0.001) -> None:
        """
        Initialize early-stopping state.
        
                Args:
                    patience: Number of updates without improvement before stopping.
                    min_delta: Minimum decrease in loss to count as an improvement.
        """
        ...

    def reset(self: Any) -> None:
        """
        Reset internal state so the instance can be reused.
        """
        ...

    def update(self: Any, val_loss: float) -> None:
        """
        Record a new validation loss and check whether to stop.
        
                Args:
                    val_loss: Current epoch's validation loss.
        """
        ...

