-
Notifications
You must be signed in to change notification settings - Fork 146
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
PropagationGuidedNeighborhood computes the wrong value of logSum #647
Comments
Thank you for the bug report. Kind regards, |
Great! One more thing, should line 150 be |
The article states that "the list keeps the most affected variables". |
It seems that |
A more clear way to change this sorting may be to use
/Magnus |
@mr-tl candidates = IntStream.range(0, n)
.filter(i -> fragment.get(i) && all[i] > 0)
.boxed()
.sorted(Comparator.comparingInt(i -> all[(int) i]).reversed())
.limit(listSize)
.collect(Collectors.toList()); What about : candidates = IntStream.range(0, n)
.filter(i -> fragment.get(i) && all[i] > 0)
.boxed()
.sorted(Comparator.comparingInt(i -> all[i]))
.sorted(Comparator.reverseOrder())
.limit(listSize)
.collect(Collectors.toList()); ? |
Yes, the only difference being that I stated the type of
Hmm, but that would double the amount of work, no? Two And your second /Magnus |
I agree, I'm not a huge fan of this, even if that works.
Yes, I will try JMH to check what is the best option, and let us know. |
The JMH file I executed is here. With n = 10000:
With n = 1000 (random change density of
Results came in. I suppose we should ignore the last option. CP |
I see that your commit for the reversed order uses both negating the sorting value:
and then the However, as I said in my previous comment, See the documentation for
|
Fixed, thank you for your vigilance.
I should have checked that in the first place, you're right. |
The implementation looks correct now, thank for taking care of it! However, I have been going through the original PGLNS paper and the implementation here, and there something that's been bugging me: why do we have the But first, I would like to point out that the original paper is actually not very clear on how this list is to be used. The paper essentially states that there is a list, it is of size 10, it is sorted by how much propagation that has occurred, and it is used to select which variable to freeze. However, it is not described how it is used to select a variable, except for in the experiments section which states that they "always select the most affected variable", i.e., the first element of the list. But the paper never explains why the list is then of length 10 and not of length 1, nor does it explain when any but the first element of the list is selected. The current implementation in Choco can essentially be boiled down into the following code w.r.t the
Here I would argue that the It therefore seems much more reasonable for me to simply compute the Sorry for the long post, normally I would make a pull request but this was faster than setting up a development environment, doing tests, etc. Still, I hope the point of my suggestion comes across. |
One more thing, related to Reverse PGLNS (RPGLNS): When going through the PGLNS paper yet again I noticed that RPGLNS is ment to be used together with PGLNS and not as a stand-alone thing as in the Choco implementation. Furthermore, it seems like the |
Well, there are many things to discuss.
I confess that I removed that in the last commit, based on diagonal reading of the article. Then the more tricky ones.
It is not clear to me how often this case happens. If you have any clues, I'll take it.
Once again, I don't know.
In our implementation, I would say no. Indeed,
I agree, under those conditions, it is a better idea, unless we are able to propose a new operator.
You are right, we need to add a map that maintains the closeness relation per pair of variables. |
It looks like someone forgot to delete lines 106 to 108 in PropagationGuidedNeighborhood.java.
In previous versions, line 105 was
logSum = 0
but was at some point this updated to belogSum = Arrays.stream(variables).mapToDouble(v -> Math.log(v.getDomainSize())).sum();
, which directly computes the logSum and makes lines 106 to 108 obsolete.However, because lines 106 to 108 remain and increase the value of logSum, the resulting value is actually two times the intended value.
The text was updated successfully, but these errors were encountered: