def METHOD_NAME(self) -> tf.keras.optimizers.Optimizer:
    """Get the base optimizer used by the current model."""
    optimizer = self.model.optimizer
    # The optimizer might be wrapped by another class, so unwrap it
    while hasattr(optimizer, "_optimizer"):
        optimizer = optimizer._optimizer  # pylint:disable=protected-access
    return optimizer