def test_htk_lstm_truncated_distributed_gpu(device_id): params = [ "-n", "3", "-datadir", an4_dataset_directory(), "-q", "1", "-m", "640", "-e", "1000", "-device", str(device_id) ] mpiexec_test(device_id, script_under_test, mpiexec_params, params, 0.76, True)
def test_htk_lstm_truncated_distributed_block_momentum(device_id): params = [ "-n", "3", "-m", "640", "-e", "1000", "-datadir", an4_dataset_directory(), "-b", "1600", "-device", str(device_id) ] mpiexec_test(device_id, script_under_test, mpiexec_params, params, 0.76, False, 4)
def test_htk_lstm_truncated_distributed_block_momentum(device_id): params = [ "-n", "3", "-m", "640", "-e", "1000", "-datadir", an4_dataset_directory(), "-b", "1600", "-device", str(device_id) ] mpiexec_test(device_id, script_under_test, mpiexec_params, params, 0.76, False, 4)
def test_htk_lstm_truncated_distributed_gpu_with_cv(device_id): # Make sure that full sequence cross validation # works in the middle of bptt training params = [ "-n", "2", "-datadir", an4_dataset_directory(), "-q", "1", "-m", "640", "-e", "1500", "-cvfreq", "1000", "-device", str(device_id) ] output = mpiexec_execute(device_id=device_id, script=script_under_test, mpiexec_params=mpiexec_params, params=params) results = re.findall(r"Finished Evaluation \[.+?\]: Minibatch\[.+?\]: metric = (.+?)%", output) assert len(results) == 6, output
def test_checkpointing_with_truncated_sequences(tmpdir): model_path = os.path.join(tmpdir.strpath, 'Models') data_path = an4_dataset_directory() os.chdir(data_path) features_file = os.path.join(data_path, 'glob_0000.scp') labels_file = os.path.join(data_path, 'glob_0000.mlf') label_mapping_file = os.path.join(data_path, 'state.list') htk_lstm_truncated(features_file, labels_file, label_mapping_file, minibatch_size=640, epoch_size=1000, max_epochs=2, model_path=model_path) htk_lstm_truncated(features_file, labels_file, label_mapping_file, minibatch_size=640,epoch_size=1000, max_epochs=4, restore=True, model_path=model_path)
def test_checkpointing_with_truncated_sequences(tmpdir): model_path = os.path.join(tmpdir.strpath, 'Models') data_path = an4_dataset_directory() os.chdir(data_path) features_file = os.path.join(data_path, 'glob_0000.scp') labels_file = os.path.join(data_path, 'glob_0000.mlf') label_mapping_file = os.path.join(data_path, 'state.list') htk_lstm_truncated(features_file, labels_file, label_mapping_file, minibatch_size=640, epoch_size=1000, max_epochs=2, model_path=model_path) htk_lstm_truncated(features_file, labels_file, label_mapping_file, minibatch_size=640, epoch_size=1000, max_epochs=4, restore=True, model_path=model_path)