Conversation
|
Thanks @scarlehoff ! I will give this a go soon myself and let you know |
|
One question @LucianHL this diff_2 variable https://github.com/LucianHL/fixpar_nnpdf/blob/ef15a43c594cce182a67abc97c5e78059768fc23/fixpar_nnpdf.py#L431 I see that it is set to True for the direct fit to pseudodata but why would the derivative need to be different in that case? (I'm also wondering about the Removing both of them would simplify the code quite a bit) |
|
Hi yes the I am not sure about |
|
The output of e.g. the longmin config file is: does that mean that the constraint is computed but not utilized? |
|
Ah I see what you mean - no it is not imposed in the minimisation by default at the moment. The key line is: and so I have to head out to give a talk now so will be offline for the rest of the afternoon but can pick up any further queries after that. |
|
Hi, sorry a rather basic query - I have so far been using conda to install the nnpdf code so far and am not certain of the easiest way to get that to work with your PR? |
I see, than that's still missing here. I'll add it, thanks!
You can install the specific branch with pip, so either cloning the repository -> checking out the branch -> pip install -e . or just (in the conda environment). What I usually do is to install with conda just |
|
So, @LucianHL I'm looking at this, I see that when pos_const is active, there are these two loops in which the Then, Is that correct? (I guess this is part of jaccalc_"oldmin" only?) (just to say, no rush at all!! as you can see i can only work intermitently...) |
|
No problem - you are doing all the work at the moment so I'm happy to answer questions as quickly as I can! Yes that is right that
this should correspond to the PDF being fed in being Of course that would be for the sake of cross checking alone, as you are always taking numerical derivative wrt the whole theory (not just the PDFs) in the new code. So nothing - real theory vs. positivity - should be treated differently in your case. |
I'm doing a lot of buraucracy and meetings these days, this is the fun part :__
so, the reason we use Ok, knowing this I'll try to add the positivity "naively" without looking at what was done before. |
|
Sounds good, thanks!
Yes actually on reflection if you are feeding in simply dPDF/dpar to the positivity then it should be fine to just have this as 0 if the PDF is positive and ~ PDF if it is negative. I guess the issue comes in when you take finite differences, if these happen to lie across the point where the PDF is zero. Anyway yes as you say you don't really need to know any of this for what you are doing. From my point of view though I will update the |
directly the datasets whenever possible
So the naive (just 0 when it is positive) implementation seems to do ok. This was with a smaller positivity multiplier with respect to the default. Although the moment the positivity is added it takes much longer to converge. Not sure whether just running for longer will get it to 0 (or with a bigger multiplier) or whether it makes sense to do like in NNPDF and have a dynamic value for lambda that grows with the number of trials. Now the only things missing (in the sense that I'm not sure I understand what they do) are:
it says
Everything else I think it is for plotting or reporting which I think can be ignored for now (getting the final error set, evolved and everything @tgiani was looking into it so I shouldn't have touched that part, if I did and broke something it was by mistake!) |
|
Thanks a lot, and sorry for the delay!
Indeed, when I have implemented positivity constraints this was done in a rather similar way to NNPDF - basically just running a set of fits, with lambda set e.g. 10, then increased and so on. This is actually still there in
That was very much an intermediary check for a particular fit - it can just be removed (i.e. assumed to be false).
Correct, possible what you are seeing is different flags to output pseudodata? Or alternatively in the code there is the possibility of fitting PDF level pseudodata (which possibly we don't want to keep), so it might be that? |
|
That runs for me nicely with a quick test - I will come back to this soon but a quick observation is that by the look of it you will indeed be doing the multiple runs with increasing I will try some of the longer runs to test them as well. |
|
I've pushed my changes to the positivity, I just activate it when the chi2 is about ~2.5 (or when the fit is going to go out because it converged) and seems to work ok without a huge penalty to the time: it probably can be improved, but I think I'll change now to make it into 3 scripts: fit, evolution, hessian errors that can be ready for making it public. |
|
Thank you! I will take a look. |
I've moved things a bit around, the structure I'm trying to achieve is more or less the following:
which fwiw doesn't even need to be python.
The rest (minimization algorithm, hessian part, glue) will remain more or less the same other than what needed to change for the two points above.
With the idea that one can give an nnpdf runcard + a config file from here and then you get a fixpar version of what you would get from nnpdf.
To run with this branch you need this PR from NNPDF: NNPDF/nnpdf#2320 (it includes the speed up for the convolutions I mentioned the other day @tgiani). The long minimization takes about 1 hour in my PC with 8 cores.