Use functools for reduce in backprop trainer to work