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

Class MinMax_LogNormalizer

climart/data_transform/normalization.py:164–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163
164class MinMax_LogNormalizer(NormalizationMethod):
165 def __init__(self, min=None, max_minus_min=None, **kwargs):
166 super().__init__(**kwargs)
167 self.min_max_normalizer = MinMax_Normalizer(min, max_minus_min)
168
169 def normalize(self, data, *args, **kwargs):
170 normalized_data = self.min_max_normalizer.normalize(data)
171 normalized_data = np.log(normalized_data)
172 return normalized_data
173
174 def inverse_normalize(self, normalized_data):
175 data = np.exp(normalized_data)
176 data = self.min_max_normalizer.inverse_normalize(data)
177 return data
178
179 def stored_values(self):
180 return self.min_max_normalizer.stored_values()
181
182 def change_input_type(self, new_type):
183 self.min_max_normalizer.change_input_type(new_type)
184
185 def apply_torch_func(self, fn):
186 self.min_max_normalizer.apply_torch_func(fn)
187
188
189def get_normalizer(normalizer='z', *args, **kwargs) -> NormalizationMethod:

Callers 1

get_normalizerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected