Avoid the explicit need to create self.criterion
and self.optimizer
in models
#134
Labels
enhancement
New feature or request
Currently the last step in the
__init__
function for the built in models is to do this:It represents boilerplate code and would be easy to forget.
Python dataclasses have a nice post_init function, but regular classes do not. It seems that functionality like that would be ideal in this case. Since it could be defined in the
@fibad_model
decorator, and the user wouldn't be required to implement anything.Alternatively - we could leave this a boilerplate that the user has to write. Doing so would mean that the user would have to be explicitly aware of the fact that they are creating the optimizer and loss function that they think they are.
The text was updated successfully, but these errors were encountered: