MCPcopy Create free account
hub / github.com/RolnickLab/climart / LogZ_Normalizer

Class LogZ_Normalizer

climart/data_transform/normalization.py:135–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135class LogZ_Normalizer(NormalizationMethod):
136 def __init__(self, mean=None, std=None, **kwargs):
137 super().__init__(**kwargs)
138 self.z_normalizer = Z_Normalizer(mean, std)
139
140 def normalize(self, data, *args, **kwargs):
141 normalized_data = np.log(data + 1e-5)
142 normalized_data = self.z_normalizer.normalize(normalized_data)
143 return normalized_data
144
145 def inverse_normalize(self, normalized_data):
146 data = self.z_normalizer.inverse_normalize(normalized_data)
147 data = np.exp(data) - 1e-5
148 return data
149
150 def stored_values(self):
151 return self.z_normalizer.stored_values()
152
153 def change_input_type(self, new_type):
154 self.z_normalizer.change_input_type(new_type)
155
156 def apply_torch_func(self, fn):
157 self.z_normalizer.apply_torch_func(fn)
158
159 def __call__(self, data, *args, **kwargs):
160 normalized_data = np.log(data + 1e-5)
161 return self.z_normalizer(normalized_data)
162
163
164class MinMax_LogNormalizer(NormalizationMethod):

Callers 1

get_normalizerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected