Shortcuts

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__.

매개변수
  • description (str) – Description of the tool shown when running --help.

  • env_prefix (str) – Prefix for environment variables. Set default_env=True to enable env parsing.

  • default_env (bool) – Whether to parse environment variables.

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.

매개변수
반환 형식

List[str]

반환

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 of torch.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.

반환 형식

None

add_optimizer_args(optimizer_class=(<class 'torch.optim.optimizer.Optimizer'>, ), nested_key='optimizer', link_to='AUTOMATIC')[소스]

Adds arguments from an optimizer class to a nested key of the parser.

매개변수
반환 형식

None