nnmnkwii.util.meanvar¶
-
nnmnkwii.util.
meanvar
(dataset, lengths=None)[source]¶ Mean/variance 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.
Returns: Mean and variance for each dimention.
Return type: See also
Examples
>>> from nnmnkwii.util import meanvar >>> 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(y) for y in Y] >>> data_mean, data_var = meanvar(Y, lengths)