Skip to content
Advertisement

Tag: lstm

Specifying number of cells in LSTM layer in PyTorch

I don’t fully understand the LSTM layer in PyTorch. When I instantiate an LSTM layer how can I specify the number of LSTM cells inside the layer? My first thought was that it was the “num_layers” argument, if we assume that LSTM cells are connected vertically. But if that is the case how can we implement stacked LSTM with for

Implementing a minimal LSTMCell in Keras using RNN and Layer classes

I am trying to implement a simple LSTMCell without the “fancy kwargs” defaultly implemented in the tf.keras.layers.LSTMCell class, following a schematic model like this. It doesn’t really have a direct purpose, I would just like to practice implementing a more complex RNNCell than the one described here in the Examples section. My code is the following: However, when I tried

keras lstm error: expected to see 1 array

so i want to make a lstm network to run on my data but i get this message: ValueError: Error when checking input: expected lstm_1_input to have shape (None, 1) but got array with shape (1, 557) this is my code: Answer You need to change the input_shape value for LSTM layer. Also, x_train must have the following shape. So,

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflow)

I want to install tensorflow to use Keras LSTM I installed Keras, and i import this lines to my code. Error is when runnig the code: Cmd error when i write “pip install tensorflow” : Pip version is 19.3 , python version 3.7 Answer On Windows, you must use Python 3.7.6 (64 bits) (or later version, provided it is 64-bits)

Advertisement