Skip to content

Commit

Permalink
Increase default maxiter of random sparse coding to avoid failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
pluskid committed May 6, 2012
1 parent 555d971 commit 394b8a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shogun/multiclass/ecoc/ECOCRandomSparseEncoder.h
Expand Up @@ -29,8 +29,8 @@ class CECOCRandomSparseEncoder: public CECOCEncoder
*
* @see get_default_code_length
*/
CECOCRandomSparseEncoder(int32_t maxiter=1000, int32_t codelen=0,
float64_t pzero=0.5, float64_t pposone=0.25, float64_t pnegone=0.25);
CECOCRandomSparseEncoder(int32_t maxiter=10000, int32_t codelen=0,
float64_t pzero=0.3, float64_t pposone=0.35, float64_t pnegone=0.35);

/** destructor */
virtual ~CECOCRandomSparseEncoder() {}
Expand Down Expand Up @@ -79,7 +79,7 @@ class CECOCRandomSparseEncoder: public CECOCEncoder
*/
bool check_probability(float64_t pzero, float64_t pposone, float64_t pnegone)
{
if (pzero + pposone + pnegone != 1)
if (CMath::abs(pzero + pposone + pnegone - 1) > 1e-5)
return false;
return true;
}
Expand Down

0 comments on commit 394b8a5

Please sign in to comment.