Is there a way to calculate the total number of parameters in a LSTM network.
I have found a example but I\'m unsure of how correct this is or If I have understood i
No - the number of parameters of a LSTM layer in Keras equals to:
params = 4 * ((size_of_input + 1) * size_of_output + size_of_output^2)
Additional 1
comes from bias terms. So n
is size of input (increased by the bias term) and m
is size of output of a LSTM layer.
So finally :
4 * (4097 * 256 + 256^2) = 4457472