Bug fix for MLP predict for small values to avoid nan responses.
This commit is contained in:
parent
2f0676fb88
commit
edb6a0e889
@ -432,8 +432,15 @@ public:
|
||||
double* data = sums.ptr<double>(i);
|
||||
for( j = 0; j < cols; j++ )
|
||||
{
|
||||
double t = scale2*(1. - data[j])/(1. + data[j]);
|
||||
data[j] = t;
|
||||
if(!cvIsInf(data[j]))
|
||||
{
|
||||
double t = scale2*(1. - data[j])/(1. + data[j]);
|
||||
data[j] = t;
|
||||
}
|
||||
else
|
||||
{
|
||||
data[j] = -scale2;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user