A Max-Sum algorithm for training discrete neural networks. (13th August 2015)