Skip to content

Commit

Permalink
Make ElemwiseCategorical default.
Browse files Browse the repository at this point in the history
  • Loading branch information
twiecki committed Apr 15, 2017
1 parent a165af6 commit 72900ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pymc3/step_methods/gibbs.py
Expand Up @@ -46,7 +46,7 @@ def astep(self, q, logp):
@staticmethod
def competence(var):
if isinstance(var.distribution, Categorical):
return Competence.COMPATIBLE
return Competence.IDEAL
return Competence.INCOMPATIBLE


Expand Down
3 changes: 2 additions & 1 deletion pymc3/step_methods/metropolis.py
Expand Up @@ -317,6 +317,7 @@ def astep(self, q0, logp):
q = np.copy(q0)
logp_curr = logp(q)

# TODO Replace loop with theano.scan
for idx in order:
curr_val, q[idx] = q[idx], True - q[idx]
logp_prop = logp(q)
Expand All @@ -335,7 +336,7 @@ def competence(var):
distribution = getattr(
var.distribution, 'parent_dist', var.distribution)
if isinstance(distribution, pm.Bernoulli) or (var.dtype in pm.bool_types):
return Competence.IDEAL
return Competence.COMPATIBLE
elif isinstance(distribution, pm.Categorical) and (distribution.k == 2):
return Competence.IDEAL
return Competence.INCOMPATIBLE
Expand Down

0 comments on commit 72900ce

Please sign in to comment.