lmjohns3 / theanets

Neural network toolkit for Python
http://theanets.rtfd.org
MIT License
328 stars 74 forks source link

Implementation of GRU #73

Closed saromanov closed 9 years ago

saromanov commented 9 years ago

Hi, guys! First, thanks for your library, i found it nice and very useful. I decided to implement GRU(Gated Recurrent Unit) , which descripted on the paper Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling and this is very similar to LSTM, but with less numbers of steps. Therefore, i took LSTM class and just "adapt" it to GRU. And my results(training with RMSProp): after 25 iterations of GRU i've got a loss=2.993710 and after 40 iterations of LSTM, loss = 3.501202. I'm not provide example, because to run it, you can just change lstm to gru from file lstm_chime.py(from examples)

from

def layer(n):
    return dict(form='bidirectional', worker='lstm', size=n)

to

def layer(n):
    return dict(form='bidirectional', worker='gru', size=n)

And just run it. What do you think about it?

lmjohns3 commented 9 years ago

Fantastic, thank you!!