Commit 3c1ab084 authored by M. François's avatar M. François

Tanh deprecated in pytorch

parent 82217ab9
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment