How to use the edward2.Bernoulli function in edward2

To help you get started, we’ve selected a few edward2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyro-ppl / numpyro / benchmarks / covtype.py View on Github external
def edward_model(features):
    """Bayesian logistic regression, which returns labels given features."""
    coeffs = ed.MultivariateNormalDiag(
        loc=tf.zeros(features.shape[1]), name="coeffs")
    labels = ed.Bernoulli(
        logits=tf.tensordot(features, coeffs, [[1], [0]]), name="labels")
    return labels