Skip to content

Instantly share code, notes, and snippets.

@eigenfoo
Last active March 28, 2020 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eigenfoo/8917e2fd72ea8940d54916c1cfbe1755 to your computer and use it in GitHub Desktop.
Save eigenfoo/8917e2fd72ea8940d54916c1cfbe1755 to your computer and use it in GitHub Desktop.
def linear_regression(x):
scale = yield tfd.HalfCauchy(0, 1)
coefs = yield tfd.Normal(tf.zeros(x.shape[1]), 1, )
predictions = yield tfd.Normal(tf.linalg.matvec(x, coefs), scale)
return predictions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment