nnmnkwii.preprocessing.minmax¶
-
nnmnkwii.preprocessing.
minmax
(dataset, lengths=None)[source]¶ Min/max computation given a iterable dataset
Dataset can have variable length samples. In that cases, you need to explicitly specify lengths for all the samples.
- Parameters
dataset (nnmnkwii.datasets.Dataset) – Dataset
lengths – (list): Frame lengths for each dataset sample.
Examples
>>> from nnmnkwii.preprocessing import minmax >>> from nnmnkwii.util import example_file_data_sources_for_acoustic_model >>> from nnmnkwii.datasets import FileSourceDataset >>> X, Y = example_file_data_sources_for_acoustic_model() >>> X, Y = FileSourceDataset(X), FileSourceDataset(Y) >>> lengths = [len(x) for x in X] >>> data_min, data_max = minmax(X, lengths)