Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Created December 20, 2022 19:39
Show Gist options
  • Save galenseilis/73c5e86d752c8292e2b442ed32fb2867 to your computer and use it in GitHub Desktop.
Save galenseilis/73c5e86d752c8292e2b442ed32fb2867 to your computer and use it in GitHub Desktop.
Statistical rethinking with Python
# Tensorflow
import tensorflow as tf
x = tf.range(1, 3, dtype='float32')
x *= 10
x = tf.math.log(x)
x = tf.reduce_sum(x)
x = tf.math.exp(x)
# PyMC
import numpy as np
x = np.arange(1, 3)
x *= 10
x = np.log(x)
x = np.sum(x)
x = np.exp(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment