This class holds normalization data for inputs and outputs. It also contains methods to create the normalization HDF file.
Reads normalization data from the given HDF file and saves it into the member variables.
Parameters: normalizationFilePath (str) – path to the HDF file with normalization data.
createNormalizationFile(bundleFilePath, outputFilePath, dtype=<class 'numpy.float64'>, flag_includeOutputs=True)¶
Calculates means over inputs and outputs of datasets in the HDF files described by the given bundle file.
Each HDF dataset file is expected to have the following groups:
- NormalizationData.GROUP_INPUTS (the group for the input data)
- NormalizationData.GROUP_OUTPUTS (the group for the output data)
Each group may have datasets. Each dataset is expected to have shape (time frames, features). E.g. (267, 513) – 267 time frames each containing a feature vector of dimensionality 513.
The method writes results into the given output file. Availability of means and variances depends on whether the corresponding groups are available in the input dataset HDF files.
!!! IMPORTANT !!! General rule of thumb: if one dataset file has both input and output groups then you should make sure that all the dataset files have them. Otherwise means and variance will not be correct. It is OK if all the datasets have only the input group. In this case means and variance only for inputs will be calculated.
- bundleFilePath (str) – path to the bundle file. :see: BundleFile.BundleFile
- outputFilePath (str) – path to the output HDF normalization file.
- dtype (numpy.dtype) – type of data to use during calculations.
- flag_includeOutputs (bool) – if True then normalization data will be calculated for outputs (targets) as well.
Mean of the input data.
Return type: numpy.ndarray | None Returns: Mean of the input data if it is available or None otherwise.
Variance of the input data.
Return type: numpy.ndarray | None Returns: Variance of the input data if it is available or None otherwise.
Mean of the output data.
Return type: numpy.ndarray | None Returns: Mean of the output data if it is available or None otherwise.
Variance of the output data.
Return type: numpy.ndarray | None Returns: Variance of the output data if it is available or None otherwise.