Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mem_cell_ct =100 but only 4 LSTM nodes #12

Open
ichraibi opened this issue Jan 18, 2017 · 5 comments
Open

mem_cell_ct =100 but only 4 LSTM nodes #12

ichraibi opened this issue Jan 18, 2017 · 5 comments

Comments

@ichraibi
Copy link

ichraibi commented Jan 18, 2017

Hi,
I was wondering how did you choose the number of memory cells?
And why and how did you choose 100 as a value for your parameter?

And finally, just to be clear : Do you create in the code, 4 LSTM nodes, because of the 4 "input sequence- target value" pairs?

And what is the difference between a memory cell and a LSTM node? I've quickly read the paper that you recommand in your blog, but it's still not clear for me.

Thanks in advance for your answers.
Ick

@ScottMackay2
Copy link
Contributor

ScottMackay2 commented Jan 22, 2017

As far as I can see, he choose for 100 hidden cells because that is the double of the randomly chosen 50 input cells.

Choosing the amount of hidden cells could be a bit of a guessing game. Trying different numbers to see what works best. This is the case for most neural networks (as far as I know of, all of them)

There are tricks that makes the guessing simpler. Like, making the hidden layer use twice as much cells as input cells (as in this example). Or choosing the average of the input + output cells. I for example tested it with 26 ((50inputs + 1output) / 2) hidden cells. And that resulted in about the same loss.

But there are also networks that try to find the amount of hidden cells for them self. More explanation can be found in this thread: http://stackoverflow.com/questions/3345079/estimating-the-number-of-neurons-and-number-of-layers-of-an-artificial-neural-ne

About LSTM nodes. They seem to me that their only use is to remember the input at a certain time step and couple that with the states of all cells of the LstmState object. This way the back propagation could work. (you need the input values times the difference to find the error of the weights). Summary in the program: LstmNode is used to couple self.state (all the values in all the cells) with self.xc (the input).

@xiaohu2015
Copy link

In fact, the project only uses one memory cell, which has big difference from LSTM node. The memory cell in this work really means the hidden size of the cell.

@zackchase
Copy link

zackchase commented Feb 6, 2017 via email

@xiaohu2015
Copy link

I think the notation in the literature is not consistent. I refer to https://arxiv.org/abs/1506.00019

@jsbhat
Copy link

jsbhat commented Nov 17, 2017

@zackchase As far I understood, the terminology can be confusing.
However, what @ScottMackay2 writes makes sense to me from the code and implementation point of view of unrolling the LSTM network.

In lstm.py, LSTM nodes refer to the repeating (same weight parameters, varying cell states) hidden layer of memory cells in the unrolled network. In example_0, the number of nodes is set programmatically to the maximum number (n=4) of time steps of the random 50 dimensional input sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants