Skip to content

Commit 2f02d88

Browse files
mariomario
authored andcommitted
added __create_gamma__ function
1 parent 93790d0 commit 2f02d88

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

code/python/cni_toolbox/HGR.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,15 @@ def __create_gamma__(self):
394394
self.gamma = np.zeros((self.n_pixels, self.n_features))
395395
pix_id = np.linspace(0, self.n_pixels, self.n_features * self.n_gaussians)
396396

397+
x = np.floor(pix_id / self.r_stimulus)
398+
y = pix_id % self.r_stimulus
399+
400+
for i in range self.n_features:
401+
for j in range self.n_gaussians:
402+
self.gamma[:,i] += gaussian(x[i * n_gaussians + j],
403+
y[i * n_gaussians + j], sigma, x_coordinates, y_coordinates)
404+
405+
self.gamma[:, i] /= np.sum(self.gamma[:, i])
397406

398407

399408
def __convolution__(self, x):

0 commit comments

Comments
 (0)