Skip to content

How to exclude model __init__ parameters from the lightning CLI? #19245

Discussion options

You must be logged in to vote

A parameter that is in __init__ is something that should be specified by the user and not computed. If you compute something based on init params, then internally give it a different name since it is not the same as what gets provided.

What you need is argument linking. Have a look at #13403 (comment), also cli argument linking and jsonargparse argument linking. You could link the entire data module. Though, it might be cleaner to link a @property that provides whatever needs computing.

Note. When an argument is linked, it doesn't show up in the config. Since the value is derived instead of provided.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@NiklasKappel
Comment options

@mauvilsa
Comment options

Answer selected by NiklasKappel
@NiklasKappel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment