How to refer to dataset attributes in CLI config file? #12953
-
I'm writing a yaml config file for a pytorch-lightning CLI script. The file specifies model, data, trainer arguments and misc parameters. The model arguments depend on the dataset -- specifically, the dimension of the model's first layer needs to match what's in the data. Do I need to hardcode this value or is there a way to tell PL to discover it dynamically? Here's an example:
How should I fill in d_input? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I think you have to hard-code it here, but @carmocca can confirm. |
Beta Was this translation helpful? Give feedback.
-
You can use argument linking: https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html#argument-linking Or variable interpolation with omegaconf: https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html#variable-interpolation |
Beta Was this translation helpful? Give feedback.
You can use argument linking: https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html#argument-linking
And have any initial default value
Or variable interpolation with omegaconf: https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html#variable-interpolation