Please refer to the paper's algo:
Given example images (x1, y1), . . . , (xn , yn ) where
yi = 0, 1 for negative and positive examples respectively.
• Initialize weights w1,i = 1/2m , 1/2l for yi = 0, 1 respectively,
where m and l are the number of negatives and positives
respectively.

compared to the source code
std::fill(posWeights.begin(), posWeights.end(), 1.0f / 2.0f * positiveSet.size());
std::fill(negWeights.begin(), negWeights.end(), 1.0f / 2.0f * negativeSet.size());
for input positive size = 10; each of posWeights initially is set to 5;
However, it should be 1/(2*10) = 0.05 instead.
It is from the associative law of multiplication.
Hence a brackets should be put, such as:
std::fill(posWeights.begin(), posWeights.end(), 1.0f / ( 2.0f * positiveSet.size() ) );
to exactly match the algorithm.
Thanks
Please refer to the paper's algo:
compared to the source code
for input positive size = 10; each of posWeights initially is set to 5;
However, it should be 1/(2*10) = 0.05 instead.
It is from the associative law of multiplication.
Hence a brackets should be put, such as:
std::fill(posWeights.begin(), posWeights.end(), 1.0f / ( 2.0f * positiveSet.size() ) );
to exactly match the algorithm.
Thanks