| 241 | class SpectrogramDataModuleFromConfig(DataModuleFromConfig): |
| 242 | '''avoiding duplication of hyper-parameters in the config by gross patching here ''' |
| 243 | def __init__(self, batch_size, num_workers,spec_dir_path=None,main_spec_dir_path=None,other_spec_dir_path=None, |
| 244 | mel_num=None, spec_len=None, spec_crop_len=1248,drop=0,mode='pad', |
| 245 | require_caption=True, train=None, validation=None, test=None, predict=None, wrap=False): |
| 246 | specs_dataset_cfg = { |
| 247 | 'spec_dir_path': spec_dir_path, |
| 248 | 'main_spec_dir_path':main_spec_dir_path, |
| 249 | 'other_spec_dir_path':other_spec_dir_path, |
| 250 | 'require_caption': require_caption, |
| 251 | 'mel_num': mel_num, |
| 252 | 'spec_len': spec_len, |
| 253 | 'spec_crop_len': spec_crop_len, |
| 254 | 'mode': mode, |
| 255 | 'drop': drop |
| 256 | } |
| 257 | for name, split in {'train': train, 'validation': validation, 'test': test}.items(): |
| 258 | if split is not None: |
| 259 | split.params.specs_dataset_cfg = specs_dataset_cfg |
| 260 | super().__init__(batch_size, train, validation, test, predict, wrap, num_workers) |
| 261 | |
| 262 | |
| 263 | |