Wrapper function for epochs
Generalize training strategy