Add graph to trainingcategory, implemented the training calculation