We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
I'd like to use a quasirandom distribution over the standard simplex.
Describe the solution you'd like
Add a class nengo.dists.ScatteredSimplex analogous to nengo.dists.ScatteredHypersphere.
nengo.dists.ScatteredSimplex
nengo.dists.ScatteredHypersphere
Describe alternatives you've considered
Example:
import numpy as np from matplotlib import pyplot as plt import mpltern from nengo.dists import Distribution, QuasirandomSequence class ScatteredSimplex(Distribution): def __init__( self, base=QuasirandomSequence() ): self.base = base def sample(self, n, d=1, rng=np.random): # uniform distribution u = self.base.sample(n, d, rng) # exponential distribution e = -np.log(u) # uniform simplex distribution x = e / e.sum(-1, keepdims=True) return x def main(): x = ScatteredSimplex().sample(10**5, 3) fig, ax = plt.subplots(subplot_kw={'projection': 'ternary'}) ax.scatter(*x.T, lw=0, s=.5) plt.show() if __name__ == '__main__': main()
Result:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
I'd like to use a quasirandom distribution over the standard simplex.
Describe the solution you'd like
Add a class
nengo.dists.ScatteredSimplex
analogous tonengo.dists.ScatteredHypersphere
.Describe alternatives you've considered
Example:
Result:
The text was updated successfully, but these errors were encountered: