A Lagrangian Formulation For Optical Backpropagation Training In Kerr-Type Optical Networks