This very simple, elementary example shows the PyTorch example for learning the very simple pattern XOR logical pattern.
XOR may seem like a simple operation to learn, but its history is rich. In fact the pre-cursor to the neural network, the perceptron was not able to learn this pattern and it has been argued that Artificial Intelligence research was pushed back. See more about the perceptron at https://en.wikipedia.org/wiki/Perceptron
Please install anaconda first and the pre-requisites for PyTorch.
Simply run:
python XOR.py