LightningArgumentParser¶
- class lightning.pytorch.cli.LightningArgumentParser(*args, description='pytorch-lightning trainer command line tool', env_prefix='PL', default_env=False, **kwargs)[소스]¶
기반 클래스:
object
Extension of jsonargparse’s ArgumentParser for pytorch-lightning.
Initialize argument parser that supports configuration file input.
For full details of accepted arguments see ArgumentParser.__init__.
- 매개변수
- add_lightning_class_args(lightning_class, nested_key, subclass_mode=False, required=True)[소스]¶
Adds arguments from a lightning class to a nested key of the parser.
- 매개변수
lightning_class¶ (
Union
[Callable
[...
,Union
[Trainer
,LightningModule
,LightningDataModule
,Callback
]],Type
[Trainer
],Type
[LightningModule
],Type
[LightningDataModule
],Type
[Callback
]]) – A callable or any subclass of {Trainer, LightningModule, LightningDataModule, Callback}.nested_key¶ (
str
) – Name of the nested namespace to store arguments.subclass_mode¶ (
bool
) – Whether allow any subclass of the given class.
- 반환 형식
- 반환
A list with the names of the class arguments added.
- add_lr_scheduler_args(lr_scheduler_class=(<class 'torch.optim.lr_scheduler.LRScheduler'>, <class 'lightning.pytorch.cli.ReduceLROnPlateau'>), nested_key='lr_scheduler', link_to='AUTOMATIC')[소스]¶
Adds arguments from a learning rate scheduler class to a nested key of the parser.
- 매개변수
lr_scheduler_class¶ (
Union
[Type
[LRScheduler
],Type
[ReduceLROnPlateau
],Tuple
[Union
[Type
[LRScheduler
],Type
[ReduceLROnPlateau
]],...
]]) – Any subclass oftorch.optim.lr_scheduler.{_LRScheduler, ReduceLROnPlateau}
. Use tuple to allow subclasses.nested_key¶ (
str
) – Name of the nested namespace to store arguments.link_to¶ (
str
) – Dot notation of a parser key to set arguments or AUTOMATIC.
- 반환 형식