model = Transducer(128, len(labels), 512, 256, am_layers=3, lm_layers=3, dropout=0.3, am_checkpoint='exp/am.bin', lm_checkpoint='exp/lm.bin') train = AudioDataset( '/media/lytic/STORE/ru_open_stt_wav/public_youtube1120_hq.txt', labels) test = AudioDataset( '/media/lytic/STORE/ru_open_stt_wav/public_youtube700_val.txt', labels) train.filter_by_conv(model.encoder.conv) train.filter_by_length(400) test.filter_by_conv(model.encoder.conv) test.filter_by_length(200) optimizer = torch.optim.Adam(model.parameters(), lr=3e-4, weight_decay=1e-5) model.cuda() sampler = BucketingSampler(train, 32) train = DataLoader(train, pin_memory=True, num_workers=4, collate_fn=collate_fn_rnnt,
from torch_baidu_ctc import ctc_loss torch.backends.cudnn.benchmark = True torch.manual_seed(0) np.random.seed(0) labels = Labels() model = AcousticModel(40, 512, 256, len(labels), n_layers=3, dropout=0.3) train = AudioDataset( '/media/lytic/STORE/ru_open_stt_wav/public_youtube1120_hq.txt', labels) test = AudioDataset( '/media/lytic/STORE/ru_open_stt_wav/public_youtube700_val.txt', labels) train.filter_by_conv(model.conv) train.filter_by_length(400) test.filter_by_conv(model.conv) test.filter_by_length(200) optimizer = torch.optim.Adam(model.parameters(), lr=3e-4, weight_decay=1e-5) scheduler = StepLR(optimizer, step_size=500, gamma=0.99) model.cuda() sampler = BucketingSampler(train, 32) train = DataLoader(train, pin_memory=True, num_workers=4,