Given the i'th example in the training set, (x (i) , y (i) ), the perceptron updates are as follows: The first step involves inference over the set Z, rather than Y as would be standard in the perceptron.
decoding during training can be achieved by dynamic programming over head automata alone, which is very efficient.