プリンキピア

第9章リカレントニューラルネットワーク

9.5. Recurrent Neural Network Implementation from Scratch9.5 リカレントニューラルネットワークのゼロからの実装

We are now ready to implement an RNN from scratch. In particular, we will train this RNN to function as a character-level language model (see Section 9.4) and train it on a corpus consisting of the entire text of H. G. Wells’ The Time Machine, following the data processing steps outlined in Section 9.2. We start by loading the dataset.
英語のヒント
これで、RNNをゼロから実装する準備が整った。特に、このRNNを文字単位の言語モデル(9.4節を参照)として働くよう訓練し、9.2節で示したデータ処理の手順に従って、H. G. ウェルズの『タイム・マシン』の全文からなるコーパスで訓練する。まずデータセットを読み込む。
%matplotlib inline
import math
import torch
from torch import nn
from torch.nn import functional as F
from d2l import torch as d2l