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

Accuracy of integration as target #72

Open
jonas-eschle opened this issue Jun 10, 2021 · 2 comments
Open

Accuracy of integration as target #72

jonas-eschle opened this issue Jun 10, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jonas-eschle
Copy link

The problem

We would like to integrate a function for zfit that integrates a (blackbox) function up to a certain accuracy. So we are not interested in the number of dimensions but would like the algorithm to continue until the accuracy is reached (or maybe a max_iter value). Is that too much black-magic? Or what do you think?

Proposed solution

So far I am not quite sure on the internals and maybe it's also worth to have a new high level function for this logic.

Are you available/want to contribute?

Yes

@jonas-eschle jonas-eschle added the enhancement New feature or request label Jun 10, 2021
@scarlehoff
Copy link
Member

scarlehoff commented Jun 10, 2021

Let me see if I understood correctly:

Right now in order to integrate you have to provide a number of iterations and a number of events per iterations.

What you would like instead is to provide a target accuracy (say, 1%) and let the program iterate until said accuracy is reached, wright? (maybe providing a max. number of iterations so it doesn't hang forever).
And maybe, if after reaching the maximum number of iterations the desired accuracy is not obtained, bump the number of events per iterations and start again (also with some max.)

I think both would be doable as high level functions as you propose. Although maybe it also makes sense as part of the interface. I'll give it some thought, thanks for the suggestion.

It shouldn't even require too much black magic. To first approximation you want an if here:

sigma = np.sqrt(1.0 / weight_sum)
and if whatever desired precision is not found just go back to the beginning

@jonas-eschle
Copy link
Author

Yes indeed, that would be approximately my thought, just to make sure that this also runs within the tensorflow graph if possible, something like inside a while_loop

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

No branches or pull requests

2 participants