-
Notifications
You must be signed in to change notification settings - Fork 0
feat: likelihood breakpointer #103
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
feat: likelihood breakpointer #103
Conversation
iraedeus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| absolute difference between the current and previous log-likelihood values | ||
| falls below a specified threshold: | ||
|
|
||
| |L_{t+1} - L_t| < threshold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put math experessions in docstrings with ..math::
| def __init__(self, threshold: float): | ||
| self._validate(threshold) | ||
| self.threshold = threshold | ||
| self._L_old: Optional[float] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why two variables? It is enough to have 1 variable _likelihood_old
And do not use capital letters in mutable variables
…n init instead of two
This PR implements and tests the LikelihoodBreakpointer, which stops the EM-like iterative pipeline when the change in log-likelihood between consecutive iterations falls below a specified threshold (|L_{t+1} - L_t| < threshold).
Key changes:
Added LikelihoodBreakpointer class with proper convergence logic and validation.
Wrote unit tests using mocked likelihood sequences to reliably verify convergence detection, first-call behavior, and instance reuse after reset.
Closes #52