How to calculate the number of parameters of an LSTM network?

后端 未结 6 546
情歌与酒
情歌与酒 2020-12-04 20:37

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

6条回答
  •  半阙折子戏
    2020-12-04 20:43

    The others have pretty much answered it. But just for further clarification, on creating an LSTM layer. The number of params is as follows:

    No of params= 4*((num_features used+1)*num_units+ num_units^2)

    The +1 is because of the additional bias we take.

    Where the num_features is the num_features in your input shape to the LSTM: Input_shape=(window_size,num_features)

提交回复
热议问题