Make pretrain() work with existing structs and training functions