Can somebody explain me the the following parameters of Keras LSTM layer The Next CEO of Stack Overflow2019 Community Moderator ElectionClarification on the Keras Recurrent Unit CellReformatting data for future time series prediction LSTM(Keras)TypeError: unsupported operand type(s) for %: 'int' and 'NoneType'(Stateful LSTM Keras)LSTM not learning with extra nontemporal data added after LSTM layer - KerasBatch Size of Stateful LSTM in kerasLSTM with teacher forcing - NN fails to predict the sequenceWhat does GlobalMaxPooling1D() do to output of LSTM unit in Keras?Can't understand Output shape of a Dense layer - kerasHow to implement keras LSTM time seriesWhat is the difference between “Adding more LSTM layers” or “Adding more units on existence layers”?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

How do I go from 300 unfinished/half written blog posts, to published posts?

What makes a siege story/plot interesting?

Why does standard notation not preserve intervals (visually)

What is the difference between "behavior" and "behaviour"?

India just shot down a satellite from the ground. At what altitude range is the resulting debris field?

How to make a variable always equal to the result of some calculations?

Why doesn't a table tennis ball float on a surface of steel balls? How do we calculate buoyancy here?

Does it take more energy to get to Venus or to Mars?

Complex fractions

How to be diplomatic in refusing to write code that breaches the privacy of our users

Horror movie/show or scene where a horse creature opens its mouth really wide and devours a man in a stables

Title page not generated

Monthly twice production release for my software project

Was a professor correct to chastise me for writing "Prof. X" rather than "Professor X"?

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

How to Reset Passwords on Multiple Websites Easily?

What does "Its cash flow is deeply negative" mean?

Implement the Thanos sorting algorithm

Why did we only see the N-1 starfighters in one film?

Is HostGator storing my password in plaintext?

Science fiction short story involving a paper written by a schizophrenic

If/When UK leaves the EU, can a future goverment do a referendum to join EU

Apart from "berlinern", do any other German dialects have a corresponding verb?



Can somebody explain me the the following parameters of Keras LSTM layer



The Next CEO of Stack Overflow
2019 Community Moderator ElectionClarification on the Keras Recurrent Unit CellReformatting data for future time series prediction LSTM(Keras)TypeError: unsupported operand type(s) for %: 'int' and 'NoneType'(Stateful LSTM Keras)LSTM not learning with extra nontemporal data added after LSTM layer - KerasBatch Size of Stateful LSTM in kerasLSTM with teacher forcing - NN fails to predict the sequenceWhat does GlobalMaxPooling1D() do to output of LSTM unit in Keras?Can't understand Output shape of a Dense layer - kerasHow to implement keras LSTM time seriesWhat is the difference between “Adding more LSTM layers” or “Adding more units on existence layers”?










1












$begingroup$


keras.layers.LSTM(units,stateful=False,unroll=False)


What units,stateful and unroll represents here??










share|improve this question







New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$







  • 1




    $begingroup$
    You may want to see here.
    $endgroup$
    – Media
    Mar 22 at 19:30










  • $begingroup$
    These are explained in Keras documentation, is that documentation ambiguous ?
    $endgroup$
    – Shamit Verma
    Mar 23 at 8:56










  • $begingroup$
    No docs are not ambiguous but i am getting it from there thats y i asked it.
    $endgroup$
    – suraj
    Mar 23 at 15:41















1












$begingroup$


keras.layers.LSTM(units,stateful=False,unroll=False)


What units,stateful and unroll represents here??










share|improve this question







New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$







  • 1




    $begingroup$
    You may want to see here.
    $endgroup$
    – Media
    Mar 22 at 19:30










  • $begingroup$
    These are explained in Keras documentation, is that documentation ambiguous ?
    $endgroup$
    – Shamit Verma
    Mar 23 at 8:56










  • $begingroup$
    No docs are not ambiguous but i am getting it from there thats y i asked it.
    $endgroup$
    – suraj
    Mar 23 at 15:41













1












1








1


0



$begingroup$


keras.layers.LSTM(units,stateful=False,unroll=False)


What units,stateful and unroll represents here??










share|improve this question







New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




keras.layers.LSTM(units,stateful=False,unroll=False)


What units,stateful and unroll represents here??







deep-learning keras lstm






share|improve this question







New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Mar 22 at 19:02









surajsuraj

91




91




New contributor




suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






suraj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    $begingroup$
    You may want to see here.
    $endgroup$
    – Media
    Mar 22 at 19:30










  • $begingroup$
    These are explained in Keras documentation, is that documentation ambiguous ?
    $endgroup$
    – Shamit Verma
    Mar 23 at 8:56










  • $begingroup$
    No docs are not ambiguous but i am getting it from there thats y i asked it.
    $endgroup$
    – suraj
    Mar 23 at 15:41












  • 1




    $begingroup$
    You may want to see here.
    $endgroup$
    – Media
    Mar 22 at 19:30










  • $begingroup$
    These are explained in Keras documentation, is that documentation ambiguous ?
    $endgroup$
    – Shamit Verma
    Mar 23 at 8:56










  • $begingroup$
    No docs are not ambiguous but i am getting it from there thats y i asked it.
    $endgroup$
    – suraj
    Mar 23 at 15:41







1




1




$begingroup$
You may want to see here.
$endgroup$
– Media
Mar 22 at 19:30




$begingroup$
You may want to see here.
$endgroup$
– Media
Mar 22 at 19:30












$begingroup$
These are explained in Keras documentation, is that documentation ambiguous ?
$endgroup$
– Shamit Verma
Mar 23 at 8:56




$begingroup$
These are explained in Keras documentation, is that documentation ambiguous ?
$endgroup$
– Shamit Verma
Mar 23 at 8:56












$begingroup$
No docs are not ambiguous but i am getting it from there thats y i asked it.
$endgroup$
– suraj
Mar 23 at 15:41




$begingroup$
No docs are not ambiguous but i am getting it from there thats y i asked it.
$endgroup$
– suraj
Mar 23 at 15:41










1 Answer
1






active

oldest

votes


















1












$begingroup$

units : According to the official docs, it defines the output dimensionality. In simple words, the number of LSTM units which will be used.




units: Positive integer, dimensionality of the output space.




Units are nothing but the LSTM cells which will be used to process the inputs.



stateful :



According to the docs :




stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch.




If this argument is set to False then, the states or the memory of the LSTM cell will get reset at every sample which is passed through it. It follows this manner:



  1. Take a sample from the batch.

  2. The sample will pass through the LSTM and produce a state vector ( conditional memory ).

  3. The output is given

  4. If stateful=True then, the state vector will be used as the initial state for the 2nd sample.

  5. If stateful=False then, a new state vector will be used for the 2nd sample.

Hence, the memory should migrate from one sample to another is decided by the stateful argument.



unroll :



According to the docs,




unroll: Boolean (default False). If True, the network will be unrolled, else a symbolic loop will be used. Unrolling can speed-up a RNN, although it tends to be more memory-intensive. Unrolling is only suitable for short sequences.




It can thought as :




RNNs, once unfolded in time, can be seen as very deep feedforward networks in which all the layers share the same weights. ( Deep Learning, Nature, 2015 )




You can read an excellent article here.



The unrolling will the make the LSTM, a deep feed forward network which has shared weights. You can see and understand through this figure.



Unrolled LSTM






share|improve this answer









$endgroup$












  • $begingroup$
    Thank you so much Subham ✌✌👍
    $endgroup$
    – suraj
    Mar 23 at 15:41











Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






suraj is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47809%2fcan-somebody-explain-me-the-the-following-parameters-of-keras-lstm-layer%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1












$begingroup$

units : According to the official docs, it defines the output dimensionality. In simple words, the number of LSTM units which will be used.




units: Positive integer, dimensionality of the output space.




Units are nothing but the LSTM cells which will be used to process the inputs.



stateful :



According to the docs :




stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch.




If this argument is set to False then, the states or the memory of the LSTM cell will get reset at every sample which is passed through it. It follows this manner:



  1. Take a sample from the batch.

  2. The sample will pass through the LSTM and produce a state vector ( conditional memory ).

  3. The output is given

  4. If stateful=True then, the state vector will be used as the initial state for the 2nd sample.

  5. If stateful=False then, a new state vector will be used for the 2nd sample.

Hence, the memory should migrate from one sample to another is decided by the stateful argument.



unroll :



According to the docs,




unroll: Boolean (default False). If True, the network will be unrolled, else a symbolic loop will be used. Unrolling can speed-up a RNN, although it tends to be more memory-intensive. Unrolling is only suitable for short sequences.




It can thought as :




RNNs, once unfolded in time, can be seen as very deep feedforward networks in which all the layers share the same weights. ( Deep Learning, Nature, 2015 )




You can read an excellent article here.



The unrolling will the make the LSTM, a deep feed forward network which has shared weights. You can see and understand through this figure.



Unrolled LSTM






share|improve this answer









$endgroup$












  • $begingroup$
    Thank you so much Subham ✌✌👍
    $endgroup$
    – suraj
    Mar 23 at 15:41















1












$begingroup$

units : According to the official docs, it defines the output dimensionality. In simple words, the number of LSTM units which will be used.




units: Positive integer, dimensionality of the output space.




Units are nothing but the LSTM cells which will be used to process the inputs.



stateful :



According to the docs :




stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch.




If this argument is set to False then, the states or the memory of the LSTM cell will get reset at every sample which is passed through it. It follows this manner:



  1. Take a sample from the batch.

  2. The sample will pass through the LSTM and produce a state vector ( conditional memory ).

  3. The output is given

  4. If stateful=True then, the state vector will be used as the initial state for the 2nd sample.

  5. If stateful=False then, a new state vector will be used for the 2nd sample.

Hence, the memory should migrate from one sample to another is decided by the stateful argument.



unroll :



According to the docs,




unroll: Boolean (default False). If True, the network will be unrolled, else a symbolic loop will be used. Unrolling can speed-up a RNN, although it tends to be more memory-intensive. Unrolling is only suitable for short sequences.




It can thought as :




RNNs, once unfolded in time, can be seen as very deep feedforward networks in which all the layers share the same weights. ( Deep Learning, Nature, 2015 )




You can read an excellent article here.



The unrolling will the make the LSTM, a deep feed forward network which has shared weights. You can see and understand through this figure.



Unrolled LSTM






share|improve this answer









$endgroup$












  • $begingroup$
    Thank you so much Subham ✌✌👍
    $endgroup$
    – suraj
    Mar 23 at 15:41













1












1








1





$begingroup$

units : According to the official docs, it defines the output dimensionality. In simple words, the number of LSTM units which will be used.




units: Positive integer, dimensionality of the output space.




Units are nothing but the LSTM cells which will be used to process the inputs.



stateful :



According to the docs :




stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch.




If this argument is set to False then, the states or the memory of the LSTM cell will get reset at every sample which is passed through it. It follows this manner:



  1. Take a sample from the batch.

  2. The sample will pass through the LSTM and produce a state vector ( conditional memory ).

  3. The output is given

  4. If stateful=True then, the state vector will be used as the initial state for the 2nd sample.

  5. If stateful=False then, a new state vector will be used for the 2nd sample.

Hence, the memory should migrate from one sample to another is decided by the stateful argument.



unroll :



According to the docs,




unroll: Boolean (default False). If True, the network will be unrolled, else a symbolic loop will be used. Unrolling can speed-up a RNN, although it tends to be more memory-intensive. Unrolling is only suitable for short sequences.




It can thought as :




RNNs, once unfolded in time, can be seen as very deep feedforward networks in which all the layers share the same weights. ( Deep Learning, Nature, 2015 )




You can read an excellent article here.



The unrolling will the make the LSTM, a deep feed forward network which has shared weights. You can see and understand through this figure.



Unrolled LSTM






share|improve this answer









$endgroup$



units : According to the official docs, it defines the output dimensionality. In simple words, the number of LSTM units which will be used.




units: Positive integer, dimensionality of the output space.




Units are nothing but the LSTM cells which will be used to process the inputs.



stateful :



According to the docs :




stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch.




If this argument is set to False then, the states or the memory of the LSTM cell will get reset at every sample which is passed through it. It follows this manner:



  1. Take a sample from the batch.

  2. The sample will pass through the LSTM and produce a state vector ( conditional memory ).

  3. The output is given

  4. If stateful=True then, the state vector will be used as the initial state for the 2nd sample.

  5. If stateful=False then, a new state vector will be used for the 2nd sample.

Hence, the memory should migrate from one sample to another is decided by the stateful argument.



unroll :



According to the docs,




unroll: Boolean (default False). If True, the network will be unrolled, else a symbolic loop will be used. Unrolling can speed-up a RNN, although it tends to be more memory-intensive. Unrolling is only suitable for short sequences.




It can thought as :




RNNs, once unfolded in time, can be seen as very deep feedforward networks in which all the layers share the same weights. ( Deep Learning, Nature, 2015 )




You can read an excellent article here.



The unrolling will the make the LSTM, a deep feed forward network which has shared weights. You can see and understand through this figure.



Unrolled LSTM







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 23 at 8:27









Shubham PanchalShubham Panchal

36118




36118











  • $begingroup$
    Thank you so much Subham ✌✌👍
    $endgroup$
    – suraj
    Mar 23 at 15:41
















  • $begingroup$
    Thank you so much Subham ✌✌👍
    $endgroup$
    – suraj
    Mar 23 at 15:41















$begingroup$
Thank you so much Subham ✌✌👍
$endgroup$
– suraj
Mar 23 at 15:41




$begingroup$
Thank you so much Subham ✌✌👍
$endgroup$
– suraj
Mar 23 at 15:41










suraj is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















suraj is a new contributor. Be nice, and check out our Code of Conduct.












suraj is a new contributor. Be nice, and check out our Code of Conduct.











suraj is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Data Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47809%2fcan-somebody-explain-me-the-the-following-parameters-of-keras-lstm-layer%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?