General Backpropagation Algorithm for Training Second-order Neural Networks