Training NN with CG minimization.