-
Notifications
You must be signed in to change notification settings - Fork 41
PC fix #164
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
Conversation
@galapaegos , if you get a chance, please compile with trace on and look at the remaining mismatches. I'm getting some normalize should be 0 errors that probably are an issue, and haven't inspected 3 body yet. |
The problem seems to be that the normalize (binned) call uses 3N-element non-incrementing "normalize" values (min, max, and bins for N observables), and this causes the PC increment to either expect 0 increment (no argument case) or 1 increment (argument case). |
import numpy as np
mean = 1.5
sigma = 2.5
x = np.array((1.2, 7.2))
f = np.exp(-(x - mean)**2 / sigma**2)
fn = f / np.sqrt(2 * np.pi * sigma**2)
print("g({}) = {} -> {} normalized".format(x[0], f[0], fn[0]))
print("g({}) = {} -> {} normalized".format(x[1], f[1], fn[1]))
# g(1.2) = 0.985703184122443 -> 0.15729547042910427 normalized
# g(7.2) = 0.005525397988803928 -> 0.0008817259495115716 normalized |
Right now, these are the same number: CHECK(gauss.getValue(EvalFunc::Prob) == 0.99282585_a);
CHECK(gauss.getValue(EvalFunc::Eval) == 0.99282585_a); And they shouldn't be. The Prob one should be multiplying by the normalization, which is not supposed to be one (and isn't, according to the check above this one). |
Ahh, I was looking at the wrong side. I believe I know the cause of this issue. The normalization value is being reset due to the second setIndices call under getValue. The idea is to pre-compute the values, then use them for other calculations. First, we need to add a 'normalize value' under PdfBase that will cache the computed value. This value will be written under populateArray. The default value needs to be 1.0. I think this will cover the cases. |
Thanks for fixing those irritating consts! I think it looks great. Will try to give one last look over and merge very soon. |
Nice; cached normalizations may be very useful; they could replace the host array at some point. |
…. Removed const from normalize routines
ParameterContainer is now checked when trace is on, and mismatched increments are errors. Several problems with 4 body amps mismatching fixed.
Also fixing extra white space and normalize spelling. Nicer makefile too. Bug in usage of setData fixed.