diff --git a/neural_filters/neural_filter_2CC.py b/neural_filters/neural_filter_2CC.py index 1857ec4e33363b866fec473fe555b4c2e4e16afd..00ef8ed342cd89e53002150ddee750688b9d930a 100644 --- a/neural_filters/neural_filter_2CC.py +++ b/neural_filters/neural_filter_2CC.py @@ -115,7 +115,7 @@ class NeuralFilter2CC(torch.nn.Module): def step(self, input_var, hidden, a=None, b=None): if a is None or b is None: modulus = torch.sigmoid(self.bias_modulus) - cosangle = F.tanh(self.bias_theta) + cosangle = torch.tanh(self.bias_theta) a = 2 * cosangle * modulus b = - modulus.pow(2) @@ -141,7 +141,7 @@ class NeuralFilter2CC(torch.nn.Module): # do not recompute this at each step to gain efficiency modulus = torch.sigmoid(self.bias_modulus) - cosangle = F.tanh(self.bias_theta) + cosangle = torch.tanh(self.bias_theta) a = 2 * cosangle * modulus b = - modulus.pow(2) @@ -155,7 +155,7 @@ class NeuralFilter2CC(torch.nn.Module): def print_param(self): modulus = torch.sigmoid(self.bias_modulus) - cosangle = F.tanh(self.bias_theta) + cosangle = torch.tanh(self.bias_theta) p1 = -2 * cosangle * modulus p2 = modulus.pow(2) print('{}\t{}'.format(p1.data[0], p2.data[0])) @@ -163,7 +163,7 @@ class NeuralFilter2CC(torch.nn.Module): @property def denominator(self): modulus = torch.sigmoid(self.bias_modulus) - cosangle = F.tanh(self.bias_theta) + cosangle = torch.tanh(self.bias_theta) p1 = -2 * cosangle * modulus p2 = modulus.pow(2) p1 = p1.detach().cpu().numpy()