Skip to content

Commit

Permalink
done.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminKmz committed Oct 2, 2018
1 parent 6af7647 commit f6664e4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file added __pycache__/sample_ising.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion sample_ising.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_sample(W, u, n):
def gibbs_sampling(model, n):
X = np.array([+1 if np.random.rand() < .5 else -1 for i in range(model.d)])
samples = [np.copy(X)]
for i in range(2*n + 100):
for i in range(2*n + 99):
for j in range(model.d):
p = model.conditonal(j, X)
X[j] = +1 if np.random.rand() < p else -1
Expand Down

0 comments on commit f6664e4

Please sign in to comment.