Skip to content

Commit fe020e3

Browse files
committed
gaussian/mexican_hat minor bug fix
1 parent 5ba89fe commit fe020e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

minisom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ def activate(self, x):
245245

246246
def _gaussian(self, c, sigma):
247247
"""Returns a Gaussian centered in c."""
248-
d = 2*pi*sigma*sigma
248+
d = 2*sigma*sigma
249249
ax = exp(-power(self._xx-self._xx.T[c], 2)/d)
250250
ay = exp(-power(self._yy-self._yy.T[c], 2)/d)
251251
return (ax * ay).T # the external product gives a matrix
252252

253253
def _mexican_hat(self, c, sigma):
254254
"""Mexican hat centered in c."""
255255
p = power(self._xx-self._xx.T[c], 2) + power(self._yy-self._yy.T[c], 2)
256-
d = 2*pi*sigma*sigma
256+
d = 2*sigma*sigma
257257
return (exp(-p/d)*(1-2/d*p)).T
258258

259259
def _bubble(self, c, sigma):

0 commit comments

Comments
 (0)