Refactoring trainers in order to accommodate convolutional networks