add plotting of training error