ranjanan / MonteCarloIntegration.jl

A package for multi-dimensional integration using monte carlo methods
MIT License
37 stars 17 forks source link

Function that need the full xmat and using the previous result #21

Open yolhan83 opened 9 months ago

yolhan83 commented 9 months ago

Hello all, just putting here some features I had to manually add in my case, I needed to build an MLP model for a function really hard to compute and compare timings to integrate with vegas, to do so, I had to do function fun(x;model=model) @tullio xmat[j,i] := x[i][j] res = model(xmat) res[1,:] end which create a lot of allocation for no reason, I ended up changing the code to allow a function just to be computed as fun(xmat), also, I needed to integrate the error between the function and the model, it would be a lot faster to use the previously derived grid to begin with and there wasn't the option (for exemple, in python you can use the integrator once again and begin with the grid, but you can't sample from the grid which is why I came here). I just thought being able to use those two options (apply fun on the xmat, use lastly derived grid (result) ) would be cool. Thanks for the package by the way.