Last active
October 23, 2019 00:09
-
-
Save stefanv/ccbda6f293b79ad4710972cdd8612bbd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
xs = np.linspace(2, 5, 10000) # 10000 samples of x between 2 and 5 | |
ys = np.linspace(1, 2, 10000) # 10000 samples of y between 1 and 2 | |
ix = np.random.randint(0, 10000, size=(10000, 2)) # random index, 2 parameters | |
def my_model(x, y): | |
... # do some magic | |
return 42 # spit out your evaluation of the model for a given x, y | |
N = 200 | |
results = [] | |
for i in range(N): | |
xi, yi = ix[i, 0], ix[i, 1] | |
x = xs[xi] | |
y = ys[yi] | |
results.append(my_model(x, y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment