Good results but many divergent samples: what, me worry?

On top of that, the pymc impl of invlogit doesn’t seem that great either:

def invlogit(x, eps=sys.float_info.epsilon):
    """The inverse of the logit function, 1 / (1 + exp(-x))."""
    return (1.0 - 2.0 * eps) / (1.0 + tt.exp(-x)) + eps

Theano has its own ideas about what to do with this:

h = theano.function([x_], pm.math.invlogit(x_))
theano.printing.debugprint(h)
Elemwise{Composite{(i0 + (scalar_sigmoid(i1) * i2))}} [id A] ''   0
 |TensorConstant{2.22044604..250313e-16} [id B]
 |x [id C]
 |TensorConstant{0.9999999999999996} [id D]

We should fix the theano sigmoid and use that in invlogit directly I think…

2 Likes