t isn't used

This commit is contained in:
George Hotz 2020-10-23 06:17:40 -07:00
parent 49ae15a450
commit d56a0af6cb
1 changed files with 1 additions and 3 deletions

View File

@ -42,12 +42,10 @@ class RMSprop(Optimizer):
self.lr = lr
self.decay = decay
self.eps = eps
self.t = 0
self.v = [np.zeros_like(t.data) for t in self.params]
def step(self):
self.t += 1
for i, t in enumerate(self.params):
self.v[i] = self.decay * self.v[i] + (1 - self.decay) * np.square(t.grad)
t.data -= (self.lr / np.sqrt(self.v[i] + self.eps)) * t.grad
t.data -= (self.lr / np.sqrt(self.v[i] + self.eps)) * t.grad