Skip to content

feat: add early stopping functionality to Maestro models and examples #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

AshAnand34
Copy link

Description

This pull request introduces early stopping functionality to the Multimodal Maestro framework, enabling more efficient training by halting when a monitored metric (e.g., validation loss) stops improving. The changes include updates to model configurations, the addition of an EarlyStoppingCallback, and examples demonstrating how to use this feature.

Early stopping functionality:

  • Callback addition:

    • Added EarlyStoppingCallback class in maestro/trainer/common/callbacks.py to integrate early stopping into PyTorch Lightning trainers. This monitors a specified metric and stops training when improvements cease. [1] [2]
  • Configuration updates:

    • Added early stopping parameters (early_stopping, early_stopping_patience, early_stopping_threshold, early_stopping_monitor) to the configurations for Florence2Configuration, PaliGemma2Configuration, and Qwen25VLConfiguration. These enable fine-tuning of early stopping behavior. [1] [2] [3] [4] [5] [6]
  • Training logic:

    • Updated the train methods for Florence-2, PaliGemma-2, and Qwen2.5-VL models to include the EarlyStoppingCallback when early stopping is enabled in the configuration. [1] [2] [3]

Related issue: #198

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

  • Example script:
    • Added a Python script (cookbooks/maestro_early_stopping_example.py) with examples of enabling early stopping for Florence-2, PaliGemma-2, and Qwen2.5-VL models.

Docs

  • Docs updated? What were the changes:
  • Notebook:
    • Added a Jupyter notebook (cookbooks/maestro_early_stopping.ipynb) that demonstrates how to use early stopping with the Florence-2 model. It includes setup, training, and visualization of training metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant