|
|
@ -49,14 +49,13 @@ class CustomConverter():
|
|
|
|
# batch should be located in list
|
|
|
|
# batch should be located in list
|
|
|
|
assert len(batch) == 1
|
|
|
|
assert len(batch) == 1
|
|
|
|
(xs, ys), utts = batch[0]
|
|
|
|
(xs, ys), utts = batch[0]
|
|
|
|
|
|
|
|
assert xs[0] is not None, "please check Reader and Augmentation impl."
|
|
|
|
|
|
|
|
|
|
|
|
# perform subsampling
|
|
|
|
# perform subsampling
|
|
|
|
if self.subsampling_factor > 1:
|
|
|
|
if self.subsampling_factor > 1:
|
|
|
|
xs = [x[::self.subsampling_factor, :] for x in xs]
|
|
|
|
xs = [x[::self.subsampling_factor, :] for x in xs]
|
|
|
|
|
|
|
|
|
|
|
|
# get batch of lengths of input sequences
|
|
|
|
# get batch of lengths of input sequences
|
|
|
|
print(xs)
|
|
|
|
|
|
|
|
print(ys)
|
|
|
|
|
|
|
|
ilens = np.array([x.shape[0] for x in xs])
|
|
|
|
ilens = np.array([x.shape[0] for x in xs])
|
|
|
|
|
|
|
|
|
|
|
|
# perform padding and convert to tensor
|
|
|
|
# perform padding and convert to tensor
|
|
|
|