I\'m trying to optimise a 3-input XOR gate using an adapted Metropolis algorithm. Essentially, a random weight from a node is varied by a small random amount each iteration,