code example of shallow neural network -- xor gate