-
Notifications
You must be signed in to change notification settings - Fork 13
EM for hmm-glm #429
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
BalzaniEdoardo
wants to merge
29
commits into
development
Choose a base branch
from
glm-hmm-em
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
EM for hmm-glm #429
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## development #429 +/- ##
===============================================
- Coverage 72.47% 70.26% -2.21%
===============================================
Files 97 104 +7
Lines 9413 9901 +488
===============================================
+ Hits 6822 6957 +135
- Misses 2591 2944 +353 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors and significantly improves the GLM-HMM Expectation-Maximization (EM) algorithm implementation, with major improvements to code organization, performance, and test coverage.
Key Changes
GLM-HMM EM Algorithm Improvements
projection_weightsto tuple-basedglm_params(coef, intercept) for clearer separation of concernsTest Suite Reorganization
test_glm_hmm_algorithms.py(+2,421 lines)test_base_regressor_subclasses.py(+1,143 lines) to avoid duplication across GLM and GLM-HMM teststest_glm.py(-1,296 lines net) by moving shared teststest_glm_hmm.py(-1,234 lines) in favor of the new comprehensive test suiteCode Architecture Improvements
BaseRegressorgeneric withParamsTtype parameter for better type safetyinitialize_params()into public API and private_initialize_parameters()for clearer responsibilitiesinverse_link_function_utils.pyfromglm/to top-levelsrc/nemos/for better accessibilitytype_casting.pyfor consistent JAX array conversionNew Features
scripts/generate_simulation_glm_hmm.pyfor generating synthetic GLM-HMM datasets with configurable neurons and statesprepare_likelihood_func()for consistent likelihood function preparation across population and single-neuron GLMsOther Improvements
Testing
Statistics
Breaking Changes
glm_params: Tuple[Array, Array]instead ofprojection_weights: Array. Code using the GLM-HMM API will need to be updated accordingly.