Skip to content

Commit

Permalink
Merge pull request #980 from pymc-devs/discrete_metrop
Browse files Browse the repository at this point in the history
Improved handling of discrete variables by metropolis step method
  • Loading branch information
springcoil committed Feb 17, 2016
2 parents 2e35805 + e69ef7a commit da477bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pymc3/step_methods/metropolis.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, vars=None, S=None, proposal_dist=NormalProposal, scaling=1.,
self.accepted = 0

# Determine type of variables
self.discrete = np.array([v.dtype in discrete_types for v in vars])
self.discrete = np.ravel([[v.dtype in discrete_types ] * (v.dsize or 1) for v in vars])
self.any_discrete = self.discrete.any()
self.all_discrete = self.discrete.all()

Expand Down
1 change: 1 addition & 0 deletions pymc3/tuning/starting.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def find_MAP(start=None, vars=None, fmin=None, return_raw=False,
"estimates may not be accurate for the default " +
"parameters. Defaulting to non-gradient minimization " +
"fmin_powell.")
fmin = optimize.fmin_powell

if fmin is None:
if disc_vars:
Expand Down

0 comments on commit da477bd

Please sign in to comment.