-
Notifications
You must be signed in to change notification settings - Fork 41
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
increase the number of burn-in steps #65
Conversation
convoys/regression.py
Outdated
dim, nwalkers, i+1, nburnin+nsteps)) | ||
sys.stdout.flush() | ||
sys.stdout.write('\n') | ||
result['samples'] = sampler.chain[:, nburnin:, :].reshape((-1, dim)).T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (82 > 79 characters)
convoys/regression.py
Outdated
data = x0 | ||
sys.stdout.write('\n') | ||
for i, _ in enumerate(sampler.sample(p0, iterations=nburnin+nsteps)): | ||
sys.stdout.write('MCMC in %d dimensions with %d walkers: %6d/%-6d\r' % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (88 > 79 characters)
convoys/regression.py
Outdated
else: | ||
data = x0 | ||
sys.stdout.write('\n') | ||
for i, _ in enumerate(sampler.sample(p0, iterations=nburnin+nsteps)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (81 > 79 characters)
convoys/regression.py
Outdated
print('\n') | ||
sys.stdout.write('\n') | ||
for i, _ in enumerate(sampler.sample(p0, iterations=nburnin+nsteps)): | ||
sys.stdout.write('MCMC in %d dimensions with %d walkers: %6d/%-6d\r' % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (88 > 79 characters)
convoys/regression.py
Outdated
sampler.run_mcmc(p0, nburnin+nsteps) | ||
print('\n') | ||
sys.stdout.write('\n') | ||
for i, _ in enumerate(sampler.sample(p0, iterations=nburnin+nsteps)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (81 > 79 characters)
convoys/regression.py
Outdated
@@ -205,6 +209,8 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |||
sys.stdout.write('\n') | |||
result['samples'] = sampler.chain[:, n_burnin:, :] \ | |||
.reshape((-1, dim)).T | |||
if fix_k: result['samples'][0, :] = log(fix_k) | |||
if fix_p: result['samples'][1, :] = log(fix_p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple statements on one line (colon)
convoys/regression.py
Outdated
@@ -205,6 +209,8 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |||
sys.stdout.write('\n') | |||
result['samples'] = sampler.chain[:, n_burnin:, :] \ | |||
.reshape((-1, dim)).T | |||
if fix_k: result['samples'][0, :] = log(fix_k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple statements on one line (colon)
convoys/regression.py
Outdated
@@ -181,6 +181,10 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |||
) | |||
result = {'map': res.x} | |||
|
|||
# TODO: should not use fixed k/p as search parameters | |||
if fix_k: result['map'][0] = log(fix_k) | |||
if fix_p: result['map'][1] = log(fix_p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple statements on one line (colon)
convoys/regression.py
Outdated
@@ -181,6 +181,10 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |||
) | |||
result = {'map': res.x} | |||
|
|||
# TODO: should not use fixed k/p as search parameters | |||
if fix_k: result['map'][0] = log(fix_k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple statements on one line (colon)
convoys/regression.py
Outdated
# Callback for progress to stdout | ||
n_iterations = [0] # Dumb hack to make the scope right | ||
sys.stdout.write('\n') | ||
def callback(x): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 1 blank line before a nested definition, found 0
noticed it makes a huge difference