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