Skip to content

Potential Implementation error #1

@WeiChungChang

Description

@WeiChungChang

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.

algo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions