GitHub - oreilly-japan/deep-learning-from-scratch-3: 『ゼロから作る Deep Learning ❸』(O'Reilly Japan, 2020) と PyTorch を比較してみたい。
- https://github.com/oreilly-japan/deep-learning-from-scratch-3/blob/master/dezero/layers.py#L13-L83
- https://github.com/pytorch/pytorch/blob/v1.5.1/torch/nn/modules/module.py#L32-L1194
が対応しているはず。
- https://github.com/oreilly-japan/deep-learning-from-scratch-3/blob/master/dezero/layers.py#L89-L117
- https://github.com/pytorch/pytorch/blob/v1.5.1/torch/nn/modules/linear.py#L33-L92
が対応しているはず。
- https://github.com/oreilly-japan/deep-learning-from-scratch-3/blob/master/dezero/layers.py#L221-L246
- https://github.com/pytorch/pytorch/blob/v1.5.1/torch/nn/modules/rnn.py#L23-L395
が対応しているはず。
このもとで
- https://github.com/oreilly-japan/deep-learning-from-scratch-3/blob/master/steps/step59.py#L20-L32
- Word-by-word Training an RNN - PyTorch Forums
- https://gist.github.com/spro/ef26915065225df65c1187562eca7ec4#file-pytorch-simple-rnn-py-L26-L51
の SimpleRNN
は概ね対応し合っていると思われる。
TensorFlow では
- https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/layers/recurrent.py#L204-L978
- https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/layers/recurrent.py#L1382-L1631
が RNN
の対応するコードなんだろうけど・・・よく分からないな・・・。