UIUCSinhaLab/GEMSTAT

Problem in Corr

Opened this issue · 1 comments

The correlation coefficient objective function gives 'nan' error probably because of division by zero error.

Bryan came up with these changes quickly:

Tools.cpp - line 994 : double corr_xy = cov_xy / sqrt( x_var * y_var + 0.000001 );
ObjFunc.cpp - line 36 : totalSim += abs( corr( prediction[i], ground_truth[i] ) );

The second change should be added to the main code immediately.
The first, the whitening in Tools.cpp, might be done differently, with like a soft-min or an if or something.