torchquad icon indicating copy to clipboard operation
torchquad copied to clipboard

Suggestions for VEGAS algorithm changes

Open FHof opened this issue 2 years ago • 0 comments

Feature

Desired Behavior / Functionality

It could be possible to change torchquad's VEGAS algorithm so that it converges a bit faster with common integrands.

  • A method could be added to to VEGASMap which splits each interval in the middle. When executed this would double the number of intervals while the mapping stays the same (until the next map update). With this it could be possible to warm up the VEGASMap first with a small number of intervals and points per iteration, then split the intervals and continue the warm-up with more points.
  • Currently every fifth iteration VEGAS may abort, or reset the collected results and increase the number of samples per iteration. This behaviour is from the VEGAS implementation on which torchquad's VEGAS is based on. The chi2 / 5.0 < 1.0 condition may be incorrect since according to the G. P. Lepage paper and tutorial, chi2 should be in the order of the number of iterations minus one, which corresponds to chi2 / 4.0 < 1.0.
  • If the VEGAS quadrature is executed sequentially many times with an integrand whose parameters change only slightly over time, it may sometimes be beneficial to re-use a previous VEGASMap and VEGASStratification. This situation may occur when VEGAS is used in a function which is optimised with stochastic gradient descent.

What Needs to Be Done

  • Implement the VEGASMap interval splitting in vegas_map.py and use it for the warm-up in vegas.py
  • Investigate if the condition on chi2 in vegas.py works well or should be changed
  • Change VEGAS so that it is possible to continue the integration with a new integrand but the same VEGASMap and VEGASStratification

FHof avatar Apr 30 '22 09:04 FHof