saattrupdan:

train_model


What you actually wanted to create is both train and validation inside a single method. Just to confirm, right?
From some other ML libraries, that method would be called something like fit.
And it has lot of sense calling it fit because “fit” is foundation for the later terms overfitting and underfitting and we all know these are related to both train and validation losses.
The problem with this I think you can only create this as an abstract method, since models are different.
The dynamic nature of Python allows abstract methods, and I don’t see why this may not be possible.