Four-input parity network (source code)

= Four-input parity network

Let $S$ be the number of active inputs. Four <hidden units> $h_m=H(S-m+1/2)$, $m=1,2,3,4$, detect successively larger counts. A <binary threshold unit> with weights $(1,-1,1,-1)$ on these features and threshold $1/2$ returns one precisely for $S=1,3$. Each hidden input weight is one. This computes parity with a single hidden layer, but representability does not guarantee easy learning by <backpropagation>.