Skip to content
Snippets Groups Projects
Commit f2227de9 authored by Ludovic Hussonnois's avatar Ludovic Hussonnois
Browse files

BUG: Apply missing BUG correction from develop merge.

BUG: maximum train and validation sizes were not correctly handled
(ac574321)

BUG: fix TrainImagesClassifier when bm=0.
(2a3cce86)
parent ff6fea99
No related branches found
No related tags found
No related merge requests found
......@@ -196,17 +196,20 @@ TrainImagesBase::SamplingRates TrainImagesBase::ComputeFinalMaximumSamplingRates
// only fmt will be used for both training and validation samples
// So we try to compute the total number of samples given input
// parameters mt, mv and vtr.
if( mt > -1 && mv > -1 )
{
rates.fmt = mt + mv;
}
if( mt > -1 && mv <= -1 && vtr < 0.99999 )
if( mt > -1 && vtr < 0.99999 )
{
rates.fmt = static_cast<long>(( double ) mt / ( 1.0 - vtr ));
}
if( mt <= -1 && mv > -1 && vtr > 0.00001 )
if( mv > -1 && vtr > 0.00001 )
{
rates.fmt = static_cast<long>(( double ) mv / vtr);
if( rates.fmt > -1 )
{
rates.fmt = std::min( rates.fmt, static_cast<long>(( double ) mv / vtr) );
}
else
{
rates.fmt = static_cast<long>(( double ) mv / vtr);
}
}
}
}
......@@ -228,8 +231,10 @@ void TrainImagesBase::ComputeSamplingRate(const std::vector<std::string> &statis
{
if( maximum > -1 )
{
std::ostringstream oss;
oss << maximum;
GetInternalApplication( "rates" )->SetParameterString( "strategy", "constant", false );
GetInternalApplication( "rates" )->SetParameterInt( "strategy.constant.nb", static_cast<int>(maximum), false );
GetInternalApplication( "rates" )->SetParameterString( "strategy.constant.nb", oss.str(), false );
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment