Improve logging in scipy (cg, bfgs, ...) trainer.