Add files via upload

This commit is contained in:
David Rotermund 2023-01-05 13:24:47 +01:00 committed by GitHub
parent 81ec320f5c
commit f12a1b1e75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,6 +60,8 @@ class Adam(torch.optim.Optimizer):
state_steps = [] state_steps = []
sbs_setting = [] sbs_setting = []
assert len(self.param_groups) == 1
for id, p in enumerate(self.params): for id, p in enumerate(self.params):
if p.grad is not None: if p.grad is not None:
params_with_grad.append(p) params_with_grad.append(p)
@ -95,7 +97,7 @@ class Adam(torch.optim.Optimizer):
state_steps, state_steps,
beta1=self.beta1, beta1=self.beta1,
beta2=self.beta2, beta2=self.beta2,
lr=self.lr, lr=self.param_groups[0]["lr"],
eps=self.eps, eps=self.eps,
maximize=self.maximize, maximize=self.maximize,
) )
@ -149,6 +151,6 @@ class Adam(torch.optim.Optimizer):
else: else:
delta = torch.exp(-step_size * (exp_avg / denom)) delta = torch.exp(-step_size * (exp_avg / denom))
print( print(
f"{float(delta.min()) - 1.0:.4e} {float(delta.max()) - 1.0:.4e}" f"{float(delta.min()) - 1.0:.4e} {float(delta.max()) - 1.0:.4e} {lr:.4e}"
) )
param *= delta param *= delta