This example trains both a Quaternion-valued RNN and a Real-valued RNN on a simple copy-task, and generates the corresponding plots. By default, the experiments follow the experimental protocol described in the paper : Quaternion Recurrent Neural Networks.
A GPU with a running CUDA installation is required.
pip install torch torchvision matplotlib
python copy_task.py