Added trainer.cpp

This file was uploaded to the wrong repository.