【发布时间】:2021-01-31 13:58:00
【问题描述】:
我对如何在 TensorFlow 中重构以下 Pytorch 代码感到困惑。它同时使用输入大小 x 和隐藏大小 h 来创建 GRU 层
import torch
torch.nn.GRU(64, 64*2, batch_first=True, return_state=True)
本能地,我首先尝试了以下方法:
import tensorflow as tf
tf.keras.layers.GRU(64, return_state=True)
但是,我意识到它并没有真正考虑到h 或隐藏大小。这种情况我该怎么办?
【问题讨论】:
标签: tensorflow deep-learning pytorch recurrent-neural-network gated-recurrent-unit