lstm with layer normalization implemented in pytorch
User can simply replace torch.nn.LSTM with lstm.LSTM
This code is modified from Implementation of Leyer norm LSTM
lstm with layer normalization
License: MIT License
lstm with layer normalization implemented in pytorch
User can simply replace torch.nn.LSTM with lstm.LSTM
This code is modified from Implementation of Leyer norm LSTM
I tried replacing a regular pytorch lstm with this implementation and I get this error. I am not quite sure what I am supposed to put as the 'hiddens' argment for the network to train properly.
`if name == 'main':
model = LSTM(50, 100, 2,batch_first=True)
x = Variable(Tensor(32,50, 50))
h = model.init_hidden(32)
print(model(x, h))`
and it will return :
`Traceback (most recent call last):'
'File "lstm.py", line 379, in '
' print(model(x, h))'
' File "Python\Python35\lib\site-packages\torch\nn\modules\module.py", line 489, in call'
' result = self.forward(*input, **kwargs)'
' File "lstm.py", line 92, in forward'
' f_x, f_h = self.layer_forward(l, x, h, image_emb)'
' File "lstm.py", line 72, in layer_forward'
' y, h = l(x, h, image_emb)'
' File "Python\Python35\lib\site-packages\torch\nn\modules\module.py", line 489, in call'
' result = self.forward(*input, **kwargs)'
' File "lstm.py", line 336, in forward'
' preact = i2h + h2h'
'RuntimeError: The size of tensor a (50) must match the size of tensor b (32) at non-singleton dimension 0`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.