CUFCTL / face-recognition

A GPU-accelerated real-time face recognition system based on classical machine learning algorithms
MIT License
23 stars 11 forks source link

Improve accuracy of ICA C implementation #16

Closed ctargon closed 7 years ago

ctargon commented 8 years ago

ICA C implementation is compiling, running, and producing accuracies between ~25%-70%. There are plenty of optimizations that can be incorporated and perhaps a missing line or two from the Matlab. Could use another pair of eyes to go through it and see if I missed anything.

bentsherman commented 8 years ago

Some notes on what Colin and I did today:

Some things that I plan to do once I have time:

Once I have done my clean-up, we should run cross-validation so that we can see how the accuracy of the C code changes as the training set shrinks.

Meanwhile, it might be useful for some people to play around with the parameters in the MATLAB ICA code that were not included in the C code and document their findings so that we know which parameters are worth keeping.

bentsherman commented 7 years ago

Okay, after a few debug sessions throughout last night and today, I was able to fix the issue we had with NaNs in our matrices. A few points:

In summary, the result of my changes is that the ICA C code seems to produce very similar results to the MATLAB code, including intermediate values. However, even with the break statement, the C code is still significantly slower. I would assume that many of the operations in the MATLAB code are multi-threaded, but there may be other differences. We'll need to add timing information to the ICA code so that we can identify any bottlenecks.

bentsherman commented 7 years ago

Converting the matrix library to single precision seems to have improved the performance of ICA somewhat.

ctargon commented 7 years ago

Accuracy is on par with Matlab