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

Quasi Monte Carlo Rd Sampling #153

Merged
merged 6 commits into from Sep 5, 2018
Merged

Quasi Monte Carlo Rd Sampling #153

merged 6 commits into from Sep 5, 2018

Conversation

arvoelke
Copy link
Owner

@arvoelke arvoelke commented Aug 30, 2018

Resolves #152. Code is modified from http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/

This is a new method for sampling points from the sphere and ball (encoders and evaluation points).
It is still possible to use the old method by passing base=Sobol() to the constructor of all of the distributions, instead of the new default of base=Rd(). The biggest benefit is the new method works for arbitrary dimension, whereas the old method regressed to Nengo's independent distribution for d > 40.

Some plots from the new method (to be in the documentation upon release):

new_documentation

new_documentation2

new_documentation3

Versus the old method (Sobol):

old_documentation1

old_documentation2

old_documentation3

@codecov-io
Copy link

codecov-io commented Aug 30, 2018

Codecov Report

Merging #153 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #153   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          29     29           
  Lines        1374   1398   +24     
  Branches      157    162    +5     
=====================================
+ Hits         1374   1398   +24
Impacted Files Coverage Δ
nengolib/stats/ntmdists.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a523f79...293492c. Read the comment docs.

@arvoelke arvoelke merged commit 293492c into master Sep 5, 2018
@arvoelke arvoelke deleted the quasi_rd branch September 5, 2018 16:47
@arvoelke
Copy link
Owner Author

arvoelke commented Sep 5, 2018

@astoeckel Since you were using the Halton sequence, this might be of interest to you. This is a new quasi-random sequence, that's been implemented as a Nengo distribution. You can use it to generate scattered points on the cube, sphere, or ball.

Links to staging documentation (with inline code examples):

@carlosgmartin
Copy link

carlosgmartin commented Apr 9, 2023

@arvoelke Could @sdementen's suggestions be incorporated? (Avoiding Python for loops, which are slow, as much as possible.)

@arvoelke
Copy link
Owner Author

Thanks for the feedback/request. Done in #191 which has been merged into master. It is unlikely to be released to pypi due to compatibility drift that should be sorted out. It should be possible to install/depend on master directly if this speed-up is needed.

@carlosgmartin
Copy link

carlosgmartin commented Apr 10, 2023

@arvoelke Thanks! I see a few other places in the code could benefit from vectorization as well, if you're interested. Let me know if you'd like me to open an issue or pull request.

@arvoelke
Copy link
Owner Author

I'd be interested in PRs if they are motivated by things that you're running and then you found that your changes helped run them faster/etc (as opposed to just optimizing code for the sake of it).

If you are hungry for speed-ups across the board I would suggest looking into Pyston. The lite version can be installed via pip install pyston_lite_autoload and provides a boost in speed to the entire Python process. I've had good experiences with both lite and full versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve quasirandom sequences
4 participants