Skip to content

Instantly share code, notes, and snippets.

View leonidk's full-sized avatar

Leonid Keselman leonidk

View GitHub Profile
@leonidk
leonidk / process.ipynb
Last active November 4, 2021 15:57
just some voting stuff
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leonidk
leonidk / sample.py
Created April 14, 2023 19:14
Low Discrepency sequences in arbitrary dimensions
import numpy as np
class QuasiRandom():
def __init__(self,dim=1,seed=None):
self.dim = dim
self.x = np.random.rand(dim) if seed is None else seed
root_sys = [1] +[0 for i in range(dim-1)] + [-1,-1]
self.const = sorted(np.roots(root_sys))[-1].real
self.phi = np.array([1/(self.const)**(i+1) for i in range(dim)])
def generate(self,n_points=1):