Comments (7)
Sure!
It's a common trick when dealing with the LSTM family.
- As convolution is a linear operation, you can merge the two convolutions for each gate (horizontally, by reading the equations) by concatenating x_t and h_{t-1} and provide the concatenated tensor as input to a single convolution. This leaves us with 4 convolutions. Now,
- Since each output channel is computed independently (and each convolution acts on the same input tensor, i.e. the concatenated tensor of point 1), you can actually do a single convolution and split channels afterward. This mechanic becomes clearer by looking at the output channels of the conv (they are
4 * self.hidden_dim
) and the line in which they are split:
cc_i, cc_f, cc_o, cc_g = torch.split(combined_conv, self.hidden_dim, dim=1)
Does this make sense?
D
from convlstm_pytorch.
No it's not. I don't have problem with the order.
what u are doing is:
i_t = sigmoid(W *(x_t, h_{t-1}, c_{t-1}))
f_t = sigmoid(W *(x_t, h_{t-1}, c_{t-1}))
So first of all W is the same for all lines, so instead of having W_xi, W_xf, W_hi, W_hf, ... u have one W.
second of all the products are not modelled (for instance W_{ci} .* c_{t-1})
from convlstm_pytorch.
Hi @Melika-Ayoughi,
and thank you for your interest.
I'm not sure I understood your concern.
Is it possibly a duplicate of this issue?
Please forgive me if it's not.
D
from convlstm_pytorch.
Ok, I think I see your point now.
This repo implements the following dynamic:
Which is significantly different from the one you reported. Thank you for pointing it out, we should mention it in the README.
D
from convlstm_pytorch.
great! I still don't understand how your implementation has all these weights and not just one weight. can u explain that? because u only convolve x_t and w once. so I assumed there would only be one w and not 8!
from convlstm_pytorch.
I have a question regarding your implementation:
As I understood the original convolutional lstm formulation is as follows:
But in your implementation, u used only one convolution layer. I don't understand how these 2 correspond with each other. because in the formulation, c is only used in the Hadamard product and not in convolutions, but here c and h are both used in convolutions.
in fact, all weights are shared for all 4 formulas, although there are 11 weights in the original formula.
The reported formulation of the ConvLSTM was first introduced in this paper (I believe): https://arxiv.org/pdf/1506.04214.pdf.
The real difference between this implementation and the reported formulation lies in the fact that the paper 'extends' a variant of the LSTM, where each gates gets a contribution from the past cell state.
from convlstm_pytorch.
Hi, I'm curious are there any particular reasons for implementing this variant of the LSTM model? Rather than the original one from the paper https://arxiv.org/pdf/1506.04214.pdf? I'm specifically asking about using
Thank you!
from convlstm_pytorch.
Related Issues (20)
- Missing Hadamard Products in Forward pass HOT 2
- Does the stateful implementataion work similar to the LSTMs statefulness. HOT 1
- Does this implenation support GPU acceleration, like cuda? HOT 1
- multi-gpu use HOT 1
- Reproducing Moving Mnist with ConvLSTM HOT 4
- hidden state raises NotImplementedError() HOT 8
- why out_channels=4 * self.hidden_dim? HOT 2
- summary[m_key]["input_shape"] = list(input[0].size()) with empty input HOT 3
- split_size_or_sections HOT 1
- output shape probelm HOT 3
- kernel_size = (2, 2) causes dimension issues HOT 2
- ReadMe example missing a comma HOT 1
- Valid padding and custom strides
- Run training on 3-channels video frames HOT 2
- What is the difference between hidden_state and hidden_dim? HOT 2
- Question: Shouldn't each layer have multiple cells? HOT 1
- RuntimeError HOT 2
- computation graph broken HOT 1
- Lstm, generate .pkl. RuntimeError: cuDNN error: CUDNN_STATUS_MAPPING_ERROR
- Understanding the algo. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from convlstm_pytorch.