modified posterior perceptron trainer to return weights after average