-
Notifications
You must be signed in to change notification settings - Fork 10
Add gradient descent docs #142
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds comprehensive documentation examples demonstrating two approaches for fitting HMMs using gradient descent, resolving issue #51. The tutorial covers: (1) using gradient-based optimization within the EM algorithm for observation models without closed-form updates, and (2) end-to-end gradient-based fitting of all HMM parameters using automatic differentiation with the forward algorithm.
- Implements a custom
NormalModelobservation model with gradient-basedfit!method using BFGS optimization - Demonstrates fitting HMMs via Baum-Welch EM with gradient descent in the M-step for observation parameters
- Shows how to optimize all HMM parameters jointly using autodiff over the forward algorithm's log-likelihood
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| examples/gradientdescent.jl | New tutorial file demonstrating gradient descent approaches for HMM fitting with comprehensive examples and tests |
| docs/make.jl | Adds the gradient descent tutorial to the documentation build configuration |
| docs/Project.toml | Adds Optim.jl dependency for documentation examples |
| test/Project.toml | Adds Optim.jl dependency for running tutorial tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
=======================================
Coverage 95.28% 95.28%
=======================================
Files 18 18
Lines 509 509
=======================================
Hits 485 485
Misses 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gdalle
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.
I like the idea very much! Here are a few suggestions, thank you for the initiative
Co-authored-by: Guillaume Dalle <[email protected]>
|
Test for current version of Julia failed as |
Adds a documentation example to resolve #51. Adds two examples 1.) fitting an hmm inside EM with GD and 2.) fitting an HMM by using autodiff + GD over all parameters. Let me know how this looks! happy to make changes
EDIT by @gdalle: