Esempio n. 1
0
 def test_multiprocessing(self):
     background = MultiProcessing(self.transformer)
     assert_equal(list(background.get_epoch_iterator()),
                  list(zip(range(1, 101))))
Esempio n. 2
0
def test_multiprocessing():
    stream = IterableDataset(range(100)).get_example_stream()
    plus_one = Mapping(stream, lambda x: (x[0] + 1, ))
    background = MultiProcessing(plus_one)
    for a, b in zip(background.get_epoch_iterator(), range(1, 101)):
        assert a == (b, )
Esempio n. 3
0
 def test_multiprocessing(self):
     background = MultiProcessing(self.transformer)
     assert_equal(list(background.get_epoch_iterator()),
                  list(zip(range(1, 101))))
Esempio n. 4
0
def test_multiprocessing():
    stream = IterableDataset(range(100)).get_example_stream()
    plus_one = Mapping(stream, lambda x: (x[0] + 1,))
    background = MultiProcessing(plus_one)
    for a, b in zip(background.get_epoch_iterator(), range(1, 101)):
        assert a == (b,)
Esempio n. 5
0
        path=args.data_path,
        which_set=args.train_dataset,
        batch_size=args.batch_size,
        use_ivectors=args.use_ivectors,
        truncate_ivectors=args.truncate_ivectors,
        ivector_dim=args.ivector_dim)
    train_ds = MultiProcessing(train_ds, max_store=200)
    valid_ds = fuel_utils.get_datastream(
        path=args.data_path,
        which_set=args.valid_dataset,
        batch_size=args.batch_size,
        use_ivectors=args.use_ivectors,
        truncate_ivectors=args.truncate_ivectors,
        ivector_dim=args.ivector_dim)
    test_ds = fuel_utils.get_datastream(
        path=args.data_path,
        which_set=args.test_dataset,
        batch_size=args.batch_size,
        use_ivectors=args.use_ivectors,
        truncate_ivectors=args.truncate_ivectors,
        ivector_dim=args.ivector_dim)

    for e_idx in range(1, args.num_epochs + 1):
        sw = StopWatch()

        for b_idx, data in enumerate(train_ds.get_epoch_iterator(), start=1):
            sw.print_elapsed()

            time.sleep(0.1)
            sw.reset()