small update

This commit is contained in:
Morten Hjorth-Jensen
2022-10-31 12:57:57 +01:00
parent 52c686aec2
commit f0023dec32
9 changed files with 1195 additions and 897 deletions
+3 -3
View File
@@ -2553,11 +2553,11 @@ for epoch in range(n_epochs):
# Previous value for the outer product of gradients
Previous = Giter
# Accumulated gradient
Giter +=gradients @ gradients.T
# Giter +=gradients @ gradients.T
# Scaling with rho the new and the previous results
Gnew = (rho*Previous+(1-rho)*Giter)
Giter = (rho*Giter+(1-rho)*gradients*gradients)
# Taking the diagonal only and inverting
Ginverse = np.c_[eta/(delta+np.sqrt(np.diagonal(Gnew)))]
Ginverse = np.c_[eta/(delta+np.sqrt(np.diagonal(Giter)))]
# Hadamard product
update = np.multiply(Ginverse,gradients)
theta -= update