ddbourgin / numpy-ml

Machine learning, in numpy
https://numpy-ml.readthedocs.io/
GNU General Public License v3.0
15.35k stars 3.72k forks source link

Error in LSTM Implementation #42

Closed chaaland closed 4 years ago

chaaland commented 4 years ago

System information

Describe the current behavior Forward pass implementation of LSTM is incorrect

Describe the expected behavior Code is currently as below. This forget and update gate biases have typos

        # compute the input to the gate functions at timestep t
        _Go = Zt @ Wo + bo
        _Gf = Zt @ Wf + bo
        _Gu = Zt @ Wu + bo
        _Gc = Zt @ Wc + bc

Code to reproduce the issue

Other info / logs

ddbourgin commented 4 years ago

@chaaland - that's a bug, alright! Yet another reminder never to copy-paste code :) Thanks for pointing this out!