Best practice for re-using arguments between multiple parent classes in pl cli #11656
Unanswered
Jimmy2027
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 2 comments 6 replies
-
cc: @carmocca |
Beta Was this translation helpful? Give feedback.
2 replies
-
This structure is perfectly fine. Remember that you can compose multiple configuration files
You could also use a configuration object that's shared between classes or use Mixins but they are not "better" solutions, just different ways of setting up the structure. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm wondering what the recommended practice is when using
LightningCLI
and reusing multiple arguments between multiple parent classes.In the example below, all arguments to instantiate the baseclass
BaseModel
have to be defined in bothImageClassifier1
andImageClassifier2
, together with their default values which can get cumbersome for many parameters and confusing when mixing up defaults.Is there a better way to do this?
Example:
Beta Was this translation helpful? Give feedback.
All reactions