Skip to content

Commit fbb6820

Browse files
mariomario
authored andcommitted
corrected shape f phi and y in update
1 parent 2c54728 commit fbb6820

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

code/python/cni_toolbox/HGR.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ def update(self, data, stimulus):
105105

106106
phi = np.matmul(stimulus, self.gamma)
107107
phi = self.phi_processor.convolve(phi)
108-
phi = self.phi_processor.update(phi)
109-
y = self.data_processor.update(data)
110-
self.theta += self.eta * \
111-
(np.matmul(phi.transpose(), y) -
108+
phi = self.phi_processor.update(phi).reshape(1,-1)
109+
y = self.data_processor.update(data).reshape(1,-1)
110+
self.theta += self.eta * (np.dot(
111+
phi.transpose(), y) -
112112
np.matmul(
113-
np.matmul(phi.transpose(), phi),
113+
np.outer(phi, phi),
114114
self.theta))
115115

116116
def ridge(self, data, stimulus):

0 commit comments

Comments
 (0)