nnmnkwii.util.scale¶
-
nnmnkwii.util.
scale
(x, data_mean, data_std)[source]¶ Mean/variance scaling.
Given mean and variances, apply mean-variance normalization to data.
Parameters: Returns: Scaled data.
Return type: Examples
>>> from nnmnkwii.util import meanstd, scale >>> 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_std = meanstd(Y, lengths) >>> scaled_y = scale(Y[0], data_mean, data_std)