karpathy/randomfun

es.ipynb: In Gaussian, do you multiply by sigma**2 intentionally?

gandalfsaxe opened this issue · 2 comments

Hi,

In es.ipynb I noticed that your four Gaussian functions don't have braces around sigma**2, looks like this:

G1 = np.exp(-((X-mux)**2+(Y-muy)**2)/2.0*sigma**2)
instead of:
G1 = np.exp(-((X-mux)**2+(Y-muy)**2)/2.0*(sigma**2))

So you actually multiply by sigma**2 in the exponential function, instead of dividing as you would in a normal Gaussian function.

This doesn't have any consequence for the toy example, I'm just curious if it was intentional (there could be a reason of doing this that I'm not aware of)?

@gandalfsaxe
G1 = np.exp(-((X-mux)**2+(Y-muy)**2)/(2.0*sigma**2))

Yeah agreed. Found another minor mistake and made a PR actually 😊