Skip to content

Commit

Permalink
Fixed max train time issue for MC OCAS
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Mar 9, 2012
1 parent 0d72eb6 commit 7a9c865
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/shogun/classifier/svm/MulticlassOCAS.cpp
Expand Up @@ -36,7 +36,6 @@ CMulticlassOCAS::CMulticlassOCAS() :
set_max_iter(1000000);
set_method(1);
set_buf_size(5000);
set_max_train_time(CMath::ALMOST_INFTY);
}

CMulticlassOCAS::CMulticlassOCAS(float64_t C, CDotFeatures* train_features, CLabels* train_labels) :
Expand All @@ -47,7 +46,6 @@ CMulticlassOCAS::CMulticlassOCAS(float64_t C, CDotFeatures* train_features, CLab
set_max_iter(1000000);
set_method(1);
set_buf_size(5000);
set_max_train_time(CMath::ALMOST_INFTY);
}

void CMulticlassOCAS::register_parameters()
Expand Down
9 changes: 3 additions & 6 deletions src/shogun/classifier/svm/libocas.cpp
Expand Up @@ -451,7 +451,7 @@ ocas_return_value_T svm_ocas_solver(
if( ocas.Q_P - ocas.Q_D <= TolRel*LIBOCAS_ABS(ocas.Q_P)) ocas.exitflag = 1;
if( ocas.Q_P - ocas.Q_D <= TolAbs) ocas.exitflag = 2;
if( ocas.Q_P <= QPBound) ocas.exitflag = 3;
if( ocas.ocas_time >= MaxTime) ocas.exitflag = 4;
if(MaxTime>0 && ocas.ocas_time >= MaxTime) ocas.exitflag = 4;
if(ocas.nCutPlanes >= BufSize) ocas.exitflag = -1;

} /* end of the main loop */
Expand Down Expand Up @@ -898,10 +898,7 @@ ocas_return_value_T svm_ocas_solver_difC(
if( ocas.Q_P - ocas.Q_D <= TolRel*LIBOCAS_ABS(ocas.Q_P)) ocas.exitflag = 1;
if( ocas.Q_P - ocas.Q_D <= TolAbs) ocas.exitflag = 2;
if( ocas.Q_P <= QPBound) ocas.exitflag = 3;
if (MaxTime>0)
{
if( ocas.ocas_time >= MaxTime) ocas.exitflag = 4;
}
if(MaxTime>0 && ocas.ocas_time >= MaxTime) ocas.exitflag = 4;
if(ocas.nCutPlanes >= BufSize) ocas.exitflag = -1;

} /* end of the main loop */
Expand Down Expand Up @@ -1470,7 +1467,7 @@ ocas_return_value_T msvm_ocas_solver(
if( ocas.Q_P - ocas.Q_D <= TolRel*LIBOCAS_ABS(ocas.Q_P)) ocas.exitflag = 1;
if( ocas.Q_P - ocas.Q_D <= TolAbs) ocas.exitflag = 2;
if( ocas.Q_P <= QPBound) ocas.exitflag = 3;
if( ocas.ocas_time >= MaxTime) ocas.exitflag = 4;
if(MaxTime>0 && ocas.ocas_time >= MaxTime) ocas.exitflag = 4;
if(ocas.nCutPlanes >= BufSize) ocas.exitflag = -1;

} /* end of the main loop */
Expand Down

0 comments on commit 7a9c865

Please sign in to comment.