lightning
Functions and classes which interface with pytorch_lightning
This functionality is WIP.
See scpc for a working example.
- raises ImportError:
If
pytorch_lightning
is not installed.
- class pydrobert.torch.lightning.LitDataModule(params, num_workers=None, pin_memory=None)[source]
An ABC handling DataLoader parameterizations and partitions for lightning
- class pydrobert.torch.lightning.LitDataModuleParams(*, common, predict, predict_dir, prefer_split, test, test_dir, train, train_dir, val, val_dir, name)[source]
Base class LitDataModule parameters
- pclass
alias of
Parameterized
- class pydrobert.torch.lightning.LitDataModuleParamsMetaclass(name, bases, dict_)[source]
ABC for LitDataModuleParams
- class pydrobert.torch.lightning.LitSpectDataModule(data_params, batch_first=False, sort_batch=False, suppress_alis=True, tokens_only=True, suppress_uttids=None, shuffle=None, num_workers=None, pin_memory=None, warn_on_missing=True, on_uneven_distributed='raise')[source]
A LitDataModule for SpectDataLoaders
- property batch_size
training batch size
This property is just the value of
self.params.train_params.batch_size
. It is exposed in caseauto_scale_batch_size
is desired.- Type:
- get_info_dict_value(key, default=None)[source]
Get a value from the info dict
The info dict is gathered in
setup()
ifparams.info_path
is notNone
.
- max_ali_class()[source]
int: the maximum token id in the ali/ subdirectory (usually of training)
Determined in
setup()
if params.info_path is notNone
.
- property max_ref_class
The maximum token id in the ref/ subdirectory (usually of training)
Corresponds to the
- property num_filts
size of the last dimension of tensors in feat/
Determined in
setup()
if params.info_path is notNone
.- Type:
- pclass
alias of
LitSpectDataModuleParams
- class pydrobert.torch.lightning.LitSpectDataModuleParams(*, info_path, mvn_path, common, predict, predict_dir, prefer_split, test, test_dir, train, train_dir, val, val_dir, name)[source]
Parameters for LitSpectDataModule
- pclass
alias of
SpectDataLoaderParams