如何计算循环神经网络的浮点运算

2024-09-30 18:13:10 发布

您现在位置:Python中文网/ 问答频道 /正文

如何计算递归神经网络(RNN)的浮点运算。该层结构是门控循环单元GRU,是一个完全连接的层。你知道吗

我已经用https://github.com/Lyken17/pytorch-OpCounter找到了flop的数目,但是我正在尝试手动计算数学计算

self.rnn_gru = nn.GRU(input_size=1, hidden_size=20, num_layers=1, batch_first=True, dropout=0.2)
self.linear = nn.Linear(in_features=20, out_features=4)

Tags: httpsselfgithubcomsize神经网络nnpytorch