What does numpy.linalg.norm do for the following values? I’m at a loss for it.
train_images = [[0.13333333 0.15294118 0.15686275 ... 0.12941176 0.19215686 0.23529412]
[0.38823529 0.38431373 0.38431373 ... 0.57647059 0.58039216 0.56862745]
[0.79607843 0.79215686 0.79607843 ... 0.77647059 0.77647059 0.76862745]...] #A 2D array of 4096D RGB values
#linalg = numpy.linalg.norm(train_images)
linalg = [24.82338754 29.76918332 34.40623519....] #1D of values
And I’m suppose to use it to find a K-nearest neighbor function where
image = [0.13333333 0.15294118 0.15686275 ... 0.12941176 0.19215686 0.23529412] #first image in the train_images
closest = [0.21960784 0.21568627 0.22745098 ... 0.25098039 0.28627451 0.29803922] #the correct closest image
But I have absolutely no idea where this comes to be when the linalg.norm of each image is 24.823387541 (for the given image) and 28.79391195 (for the closest image)
What’s actually happening? What does linalg.nom do? Why are those two images considered the closest?