diff --git a/teng_ml/util/transform.py b/teng_ml/util/transform.py index db78cc6..971c704 100644 --- a/teng_ml/util/transform.py +++ b/teng_ml/util/transform.py @@ -1,5 +1,6 @@ import numpy as np from scipy.interpolate import interp1d +from torch import mul class Normalize: """ @@ -41,6 +42,15 @@ class NormalizeAmplitude: return f"NormalizeAmplitude(high={self.high})" +class Multiply: + def __init__(self, multiplier): + self.multiplier = multiplier + def __call__(self, data): + return data * self.multiplier + def __repr__(self): + return f"Multiply(multiplier={self.multiplier})" + + class ConstantInterval: """ Interpolate the data to have a constant interval / sample rate,