第10章現代のリカレントニューラルネットワーク
10.6.1. Encoder10.6.1 エンコーダ
In the encoder interface, we just specify that the encoder takes variable-length sequences as input
X. The implementation will be provided by any model that inherits this base Encoder class.英語のヒント
エンコーダのインターフェースでは、エンコーダが可変長の系列を入力
Xとしてとることだけを指定する。実装は、この基底のEncoderクラスを継承するどのモデルでも提供される。class Encoder(nn.Module): #@save
"""The base encoder interface for the encoder--decoder architecture."""
def __init__(self):
super().__init__()
# Later there can be additional arguments (e.g., length excluding padding)
def forward(self, X, *args):
raise NotImplementedError