fixed figure plotting - saves figure after every ten epochs if the outputfolder is defined