def update(self, x):
"""Single step learning update"""
# print x.shape
x = x.reshape((self.ndims, 1))
y = np.dot(self.w.T, x)
# GHA rule in matrix form
d_w = self.anneal(self.cnt) * self.eta * (np.dot(x, y.T) - np.dot(self.w, np.tril(np.dot(y, y.T))))
self.w += d_w
self.cnt += 1
return y
评论列表
文章目录