Closed bentsherman closed 7 years ago
ICA seems to be working properly during training, it produces similar matrices as the MATLAB code. I'm going to investigate db_recognize
and the kNN classifier.
When I use the L2 distance for ICA I get similar recognition accuracy to the MATLAB code, which is good. However, I have found a bug with how kNN sorts neighbors by distance when using COS distance, so I will fix this first and then compare the distance functions for ICA.
The problem with the COS distance was actually with the kNN classifier; when comparing neighbors it would take the difference in distances and cast it to an integer, which means that differences between -1 and 1 would be rounded to 0. Since the COS distance returned values between -1 and 1, this case happened a lot, which caused the COS distance to yield poor results for all of the algorithms. I changed kNN to compare floating point values properly, and I also changed the COS distance to range from 0 to 2 so that it's more like a "distance".
At this point it seems that the COS distance might give comparable results to L2 for all three algorithms (at least for easy cases), so we'll definitely want to run some experiments that compare the distance functions across each algorithm.
I don't know if the bug has resurfaced or if it was never fixed, but ICA still tends to classify images under
s10
with the ORL dataset. An example run: