Normalizer
This module defines the Normalizer class, which handles the normalization of images and tags based on a given configuration.
The class includes methods to precompile normalization functions, normalize images and tags, and define specific normalization strategies such as Z-score and uniform normalization. The normalization process involves replacing NaN values, creating masks, and scaling values to a specified range. The module also provides functions to recover the original values from the normalized data. The Normalizer class ensures that both images and tags are consistently normalized according to the specified configuration, facilitating further processing and analysis.
Normalizer(conf)
Class to handle the normalization of images and tags.
Parameters:
-
conf
(dict
) –Dictionary containing the configuration
Source code in src/speckcn2/normalizer.py
30 31 |
|
normalize_imgs_and_tags(all_images, all_tags, all_ensemble_ids)
Normalize both the input images and the tags to be between 0 and 1.
Parameters:
-
all_images
(list
) –List of all images
-
all_tags
(list
) –List of all tags
-
conf
(dict
) –Dictionary containing the configuration
Returns:
-
dataset
(list
) –List of tuples (image, normalized_tag)
Source code in src/speckcn2/normalizer.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|