When using num_layers > 1 for ftr_ext=lstm, training crashes because incorrect calls for LSTM state (there's no LstmStateTuple.h when num_layers > 1, we have to call LstmStateTuple[-1].h). This PR fixes such issue.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
List all changes
Please list all changes in the commit.
Fix bugs in lstm_model.py
Add more unit tests regarding bidirectional and num_layers in test_lstm_model
Limit the choice of unit_type of lstm because current implementation only works for LSTM cell
Testing
Unit tests in test_lstm_model. These tests test for shape and thus guarantee a smooth run
Test Configuration:
Checklist
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules
…coder
Description
When using num_layers > 1 for ftr_ext=lstm, training crashes because incorrect calls for LSTM state (there's no
LstmStateTuple.h
when num_layers > 1, we have to callLstmStateTuple[-1].h
). This PR fixes such issue.Type of change
List all changes
Please list all changes in the commit.
Testing
Test Configuration:
Checklist