Commit ac574321 authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: maximum train and validation sizes were not correctly handled

parent 6943826f
......@@ -336,20 +336,23 @@ void DoExecute() ITK_OVERRIDE
// 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)
if (mt > -1 && vtr < 0.99999)
{
fmt = mt + mv;
fmt = static_cast<long>((double) mt / (1.0 - vtr));
}
if (mt > -1 && mv <= -1 && vtr < 0.99999)
if (mv > -1 && vtr > 0.00001)
{
fmt = static_cast<long>((double) mt / (1.0 - vtr));
if (fmt > -1 )
{
fmt = std::min(fmt, static_cast<long>((double) mv / vtr));
}
if (mt <= -1 && mv > -1 && vtr > 0.00001)
else
{
fmt = static_cast<long>((double) mv / vtr);
}
}
}
}
// Sampling rates for training
GetInternalApplication("rates")->SetParameterStringList("il",polyStatTrainOutputs, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment