Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Implementation error #1

Open
WeiChungChang opened this issue Jul 23, 2018 · 0 comments
Open

Potential Implementation error #1

WeiChungChang opened this issue Jul 23, 2018 · 0 comments

Comments

@WeiChungChang
Copy link

WeiChungChang commented Jul 23, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant