I am not sure how to calculate my LSTM weights based on this link and my Keras programing as below:
model = Sequential()
model.add(LSTM1(A1, input_shape=(2,B1), return_sequences=True, stateful=False))
model.add(LSTM2(A2, return_sequences=True, stateful=False))
model.add(LSTM3(A3, return_sequences=False, stateful=False))
model.add(Dense(B2, activation='softmax'))
model.summary()
Is that correct?
Input = A1
Output = B2
Hidden Layers = 2
Cells in layer number one = A2
Cells in layer number two = A3
Finally:
4*ni*(ni−1+ni) for each layer is calculated as below:
X1=4*A1*(A1-1+A1)
X2=4*A2*(A2-1+A2)
X3=4*A3*(A3-1+A3)
X4=4*B2*(B2-1+B2)
Total number of weights = X1+X2+X3+X4
All my problem is about understanding the concept of cell in Keras and not in LSTM itself.