Generalization of Back propagation to Recurrent and Higher Order Neural Networks