Skip to content

Conversation

@scarlehoff
Copy link
Member

@scarlehoff scarlehoff commented Oct 11, 2021

Closes #1347. In practice (for the user) nothing changes afaik, one can continue using ThPredictionResult.from_convolution but now it will use the python convolutions module instead. Everything works just the same, only a few regression test change but these changes are in the third digit (the annoying part is that the picture in test_plot changes also in a few pixels which is enough for the test to fail, so I had to redo that as well).

I added a few checks to convolutions.py but on second thought I don't know if they are very useful or at all.

Note: I'm not touching https://github.com/NNPDF/nnpdf/blob/master/validphys2/src/validphys/chi2grids.py since that module gets completely changed in #1424 and these two PR don't overlap for any other action.

@scarlehoff scarlehoff linked an issue Oct 11, 2021 that may be closed by this pull request
Base automatically changed from use_internal_cuts_for_fkstuff to master October 11, 2021 13:08
@scarlehoff scarlehoff marked this pull request as ready for review October 12, 2021 10:25
@Zaharid
Copy link
Contributor

Zaharid commented Oct 12, 2021

Overall looks fine, but would like to go over this slowly when I have time. As an aside, we should change how the providers in results.py work at some point later: there should be separate actions for getting data and theory predictions (where theory predictions don't need e.g. a covmat) and these should be combined in the results action.

Copy link
Contributor

@siranipour siranipour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm yet to play with it, so will get round to this soon. I'm a bit confused at the need for taking central_value as an explicit argument though

@scarlehoff
Copy link
Member Author

Overall looks fine, but would like to go over this slowly when I have time

No rush (no infinite tranquility either, but no rush). For the LHAPDFSet alternative I will probably have to build on top of this one but the rest should continue being independent of each other.

@scarlehoff
Copy link
Member Author

Regarding the fact of doing central predictions and the envelope separately: this can be easily implemented but it needs to be done in #1433 since I can add a flag to grid_values to include or not central values (instead in this PR I would need to either modify convolution or libNNPDF to be then remove in #1433)

@scarlehoff scarlehoff force-pushed the removing_cpp_thpredictions branch from 4e8c31f to 0bad6c1 Compare November 1, 2021 20:43
@scarlehoff
Copy link
Member Author

scarlehoff commented Nov 10, 2021

The central_value problem will be solved two PR after this one so this one can be accepted and merged if people is pleased with the rest (if people is not pleased then such information would also be appreciated)

Sorry if I'm being pushy but I would like to work on this while I still remember what I was doing.

Copy link
Contributor

@Zaharid Zaharid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to look into how hessian sets are supposed to work here.

all_centrals = []
for d in datasets:
all_preds.append(predictions(d, pdf))
all_centrals.append(central_predictions(d, pdf))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note to mostly myself that we are supposed to be rid of this in some subsequent PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I can do is to promise I will work on this as soon as the dust is settled on the rest so that it doesn't get forgotten.

@scarlehoff
Copy link
Member Author

I think we need to look into how hessian sets are supposed to work here.

Maybe we should have hessian regression tests as well...

@scarlehoff
Copy link
Member Author

scarlehoff commented Nov 15, 2021

Mm, by using stats_class the MC pdfs are broken instead.

Edit: because libNNPDF uses the "pandas default" for ddof https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.html so I'll change MCStats to reflect that.

@scarlehoff
Copy link
Member Author

In the last commit I've had to update the regression test but it passes for rtol=1e-4 so I think it is ok.

@scarlehoff scarlehoff changed the base branch from master to regression_test_thprediction_hessian November 17, 2021 15:22
@Zaharid Zaharid added Core changes enhancement New feature or request run-fit-bot Starts fit bot from a PR. labels Nov 18, 2021
@Zaharid
Copy link
Contributor

Zaharid commented Nov 18, 2021

FWIW this is still using the cpp commondata, for e.g. results. I suppose we would want to change that later.

@Zaharid
Copy link
Contributor

Zaharid commented Nov 18, 2021

I would want to make sure that nothing catastrophic happens with the vp report, but other than that it looks fine (given the various discussions on future directions).

Base automatically changed from regression_test_thprediction_hessian to master November 18, 2021 16:15
@Zaharid
Copy link
Contributor

Zaharid commented Nov 18, 2021

@scarlehoff the problem looks real.

The relevant part being

   File "/usr/share/miniconda/envs/nnpdfenv/lib/python3.9/site-packages/validphys/results.py", line 549, in abs_chi2_data
    chi2s = all_chi2(results)
  File "/usr/share/miniconda/envs/nnpdfenv/lib/python3.9/site-packages/validphys/calcutils.py", line 73, in all_chi2
    diffs = th_result._rawdata - data_result.central_value[:,np.newaxis]
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

Copy link
Contributor

@Zaharid Zaharid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fail.

@Zaharid
Copy link
Contributor

Zaharid commented Nov 25, 2021

@scarlehoff this error https://github.com/NNPDF/nnpdf/runs/4324437054?check_suite_focus=true seems genuine (and not obvious to be what it is by looking quickly at it).

@scarlehoff
Copy link
Member Author

scarlehoff commented Nov 25, 2021

Is the random NaN problem that I am unable to reproduce. I have a computer with Ubuntu looping on the test but it never fails...

edit: sometimes I miss Travis' debug capabilities :P

@github-actions
Copy link

Greetings from your nice fit 🤖 !
I have good news for you, I just finished my tasks:

Check the report carefully, and please buy me a ☕ , or better, a GPU 😉!

@scarlehoff scarlehoff force-pushed the removing_cpp_thpredictions branch from 35d845b to ab2242d Compare November 29, 2021 10:19
@scarlehoff scarlehoff changed the base branch from master to dispatch_python November 29, 2021 10:19
@scarlehoff scarlehoff added run-fit-bot Starts fit bot from a PR. and removed run-fit-bot Starts fit bot from a PR. labels Nov 29, 2021
@scarlehoff scarlehoff marked this pull request as ready for review November 29, 2021 10:22
@scarlehoff
Copy link
Member Author

Rebased. After a tortuous journey this should all pass and work fine now.

@github-actions
Copy link

Greetings from your nice fit 🤖 !
I have good news for you, I just finished my tasks:

Check the report carefully, and please buy me a ☕ , or better, a GPU 😉!

Base automatically changed from dispatch_python to master December 1, 2021 15:20
Copy link
Contributor

@Zaharid Zaharid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have ran this with a few options, and also looked at it many times by now. Seems fine to me.

@Zaharid Zaharid merged commit 8a00917 into master Dec 2, 2021
@Zaharid Zaharid deleted the removing_cpp_thpredictions branch December 2, 2021 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core changes destroyingc++ enhancement New feature or request run-fit-bot Starts fit bot from a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThPredictionsResult should not use C++

4 participants