Skip to content

Commit 703f127

Browse files
committed
update: remove backward function for ERF1994
1 parent efc55f6 commit 703f127

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

pytorch_optimizer/optimizer/trac.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ def forward(self, z: torch.Tensor) -> torch.Tensor:
7373
out = -torch.exp(torch.log(self.w_algorithm(z * self.i)) - z ** 2) + 1 # fmt: skip
7474
return torch.complex(out.real * sign_r, out.imag * sign_i)
7575

76-
@staticmethod
77-
def backward(z: torch.Tensor) -> torch.Tensor:
78-
r"""Compute the gradient of the error function of a complex number.
79-
80-
As we know the analytical derivative of the error function, we can use it directly.
81-
82-
:param z: torch.Tensor. A tensor of complex numbers.
83-
"""
84-
return 2.0 / torch.sqrt(torch.tensor(torch.pi)) * torch.exp(-(z ** 2)) # fmt: skip
85-
8676

8777
class TRAC(BaseOptimizer):
8878
r"""A Parameter-Free Optimizer for Lifelong Reinforcement Learning.

0 commit comments

Comments
 (0)