RNN models and LR Schedulers - #4
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements RNN models and learning rate schedulers for the PT-MELT library. The changes include a new RecurrentNeuralNetwork model class with various pooling strategies, enhanced training functionality with scheduler support and early stopping, and improvements to the loss functions.
- Adds comprehensive RNN implementation with LSTM/GRU/vanilla RNN support and multiple pooling strategies
- Integrates learning rate schedulers and early stopping mechanisms into the training loop
- Refactors utility functions from standalone methods to inline implementations within blocks
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updates version and adds safetensors dependency |
| ptmelt/nn_utils.py | Comments out utility functions (get_activation, get_initializer, get_loss_fn) |
| ptmelt/models.py | Adds RNN model class, scheduler support, optimizer factory, and enhanced training loop |
| ptmelt/losses.py | Improves MixtureDensityLoss with MSE weighting and numerical stability |
| ptmelt/layers.py | Adds AttentionPool layer for RNN sequence pooling |
| ptmelt/blocks.py | Replaces imported utility functions with local implementations |
Comments suppressed due to low confidence (2)
ptmelt/models.py:1
- Remove commented-out code that has been replaced by the torch.clamp approach on the next line.
import warnings
ptmelt/models.py:1
- Remove commented-out code. The loss calculation has been refactored to handle different reduction strategies.
import warnings
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
nickwimer
added a commit
that referenced
this pull request
Oct 8, 2025
* Bayesian NNs (#3) * adding support for hyperparameter tuning using Ray * remove manditory r2 and rmse from plot text * WIP; initial code for ptBNN replicating tf flipout * adding in updates to BNN working tests for iaps... * adjusting the clamping for the MDN output to try to avoid NaNs * updates to MDN output for stability * adding in seed for reproduction testing * cleaning up before PR * fixing typos and adding in conditions for partial bayes blocks * removing pass for unsupported architectures...todo to fully implement * RNN models and LR Schedulers (#4) * moving utility functions into class files...might deprecate soon * making the mixture density loss have mse regularization * adding in schedulers and early stopping * fixing mse addition loss term for MDNs * updating regression notebook * adding in support for LSTM model from time series modeling work * cleaning up old commented code * removing commented code
nickwimer
added a commit
that referenced
this pull request
Jun 5, 2026
* adding support for hyperparameter tuning using Ray * remove manditory r2 and rmse from plot text * working MDN VAE with example notebook * Pulling main updates into vae branch (#5) * Bayesian NNs (#3) * adding support for hyperparameter tuning using Ray * remove manditory r2 and rmse from plot text * WIP; initial code for ptBNN replicating tf flipout * adding in updates to BNN working tests for iaps... * adjusting the clamping for the MDN output to try to avoid NaNs * updates to MDN output for stability * adding in seed for reproduction testing * cleaning up before PR * fixing typos and adding in conditions for partial bayes blocks * removing pass for unsupported architectures...todo to fully implement * RNN models and LR Schedulers (#4) * moving utility functions into class files...might deprecate soon * making the mixture density loss have mse regularization * adding in schedulers and early stopping * fixing mse addition loss term for MDNs * updating regression notebook * adding in support for LSTM model from time series modeling work * cleaning up old commented code * removing commented code * adding working MDN vae updated with new example notebook
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
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.
No description provided.