Skip to content

Patience#66

Merged
htjb merged 7 commits into
masterfrom
patience
Nov 25, 2025
Merged

Patience#66
htjb merged 7 commits into
masterfrom
patience

Conversation

@htjb
Copy link
Copy Markdown
Owner

@htjb htjb commented Nov 25, 2025

Description

Adding a patience parameter to the MAF and clusterMAF training.

Fixes #55

Checklist:

  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes (python -m pytest)
  • I have added tests that prove my fix is effective or that my feature works
  • I have appropriately incremented the semantic version number in both README.rst and margarine/_version.py

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a configurable patience parameter to control early stopping behavior in MAF and clusterMAF training, addressing issue #55. Previously, patience was hard-coded to 2% of total epochs; now users can customize this value or use the default.

Key changes:

  • Added patience parameter to MAF.train() and clusterMAF.train() methods with default of 2% of epochs
  • Refactored early stopping logic to use the configurable patience value
  • Updated tests to explicitly specify patience value
  • Incremented version from 1.4.0 to 1.4.1

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
margarine/maf.py Added patience parameter to train() method signature, default calculation logic, and passed to _training() method
margarine/clustered.py Added patience parameter to train() method and forwarded to individual MAF flows
tests/test_stats.py Updated MAF training call to include explicit patience=20
tests/test_clusters.py Updated clusterMAF training call to include explicit patience=20
pyproject.toml Version bump to 1.4.1
margarine/_version.py Version bump to 1.4.1
README.rst Version bump to 1.4.1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread margarine/maf.py
Comment thread margarine/clustered.py Outdated
Comment thread tests/test_stats.py Outdated
@htjb htjb merged commit 94c9e2d into master Nov 25, 2025
6 checks passed
@htjb htjb deleted the patience branch November 25, 2025 15:56
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.

Patience for early stopping

2 participants