Skip to content
Snippets Groups Projects
Commit 63680f4b authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

max normalization allows to define norm values

parent e44371f2
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,14 @@ def norm_max(tensor: Tensor) -> Tensor:
class MaxNormTransform(Transform):
def __init__(self, max_vals: Tuple[float, float] = None):
self.max_vals = max_vals
def __call__(
self, inputs: Tensor, outputs_expected: Tensor
) -> Tuple[Tensor, Tensor]:
if self.max_vals:
return inputs / self.max_vals[0], outputs_expected / self.max_vals[1]
return norm_max(inputs), outputs_expected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment