I am a bit new to python and want to get into numpy. I try to solve the gaussian kernel function with 2 for-loops:
for n in range(0, 6):
for k in range(len(centers_Hex)):
expo_sum[n+1] += np.exp(-np.linalg.norm(z_approx-center_Matrix[n][k])**2/(2*sigma**2))
where center_Matrix includesa matrix of (x,y) coordinates for the center of the gaussian bell, z_approx is the data_point which i want to calculate and sigma is a variable. So how can I simplify these two for loops? My main problem is the linalg.norm for the simplification.
Thank you!