Rename trainers #996
adamjstewart
started this conversation in
Ideas
Replies: 3 comments 4 replies
-
What confusion? |
Beta Was this translation helpful? Give feedback.
3 replies
-
More general response for each proposal above
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I also like task-oriented the best but think the current trainer-oriented is fine and not confusing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current naming of our trainers has led to much confusion. Here are some proposals for a new naming scheme, loosely ordered by my own personal preference.
Lightning-style
In PyTorch Lightning, there are
LightningDataModules
andLightningModules
. In TorchGeo, there areGeoDataModules
, and... you guessed it,GeoModules
. The proposed naming scheme would look like:Pros: consistency with PyTorch Lightning base class names
Cons: possible ambiguity between modules and
nn.Module
Sklearn-style
PyTorch Lightning seems to be loosely designed around scikit-learn, which calls these objects estimators. Since there isn't a standard naming scheme introduced by Lightning, we could follow the sklearn philosophy instead. The proposed naming scheme would look like:
Pros: no ambiguity with other names
Cons: wtf is an "estimator"?
Task-oriented
Our current trainers are organized around the tasks they try to solve. We could also name them as such:
Pros: most similar to our current implementation
Cons: no other library does this
Trainer-oriented
This is our current implementation. Not changing anything is always an option:
Pros: backwards compatible
Cons: ambiguity between trainers and
pl.Trainer
Model-oriented
pl.Trainer
takes two inputs, a model and a datamodule. We could call our trainers models:Pros: both models and trainers inherit from
nn.Module
Cons: do I even need to explain how confusing this is?
Note that all of these can optionally have a
Module
,Task
, orTrainer
appended to the name. That's another thing to debate. Our data modules haveDataModule
appended to the name, but that's mostly to prevent name clashes between datasets and data modules. Our datasets/models/transforms don't do this, so I don't think our trainers should either.This is obviously a big change to our API, and not something to take lightly. I don't want to make this change unless we can decide on a good evidence-based solution. If we just pick whichever one sounds right, we'll end up changing again in a year, which I don't want. I tried opening Lightning-AI/pytorch-lightning#14351 to discuss this but it seems like there is no community standard yet. So we also have the opportunity to define this standard ourselves.
Beta Was this translation helpful? Give feedback.
All reactions