import scipy.stats as stats
import theano
import theano.tensor as tt
import pymc3 as pm
from symbolic_pymc.theano.pymc3 import model_graph, graph_model
from symbolic_pymc.theano.utils import canonicalize
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pstats | |
import cProfile | |
from unification import var | |
from kanren import run, eq | |
# Logical conjunction | |
from kanren import lall as lconj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unification import var | |
from kanren import run, eq | |
# Logical conjunction | |
from kanren import lall as lconj | |
# Logical disjunction | |
from kanren import lany as ldisj | |
# `conde((a, b), (c, d), ...)` == `ldisj(lconj(a, b), lconj(c, d), ...)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
# from tensorflow.python.framework import ops | |
# ops.disable_eager_execution() | |
# Make sure we're in eager-mode | |
assert tf.executing_eagerly() | |
@tf.function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import tensorflow_probability as tfp | |
from tensorflow.python.framework import ops | |
ops.disable_eager_execution() | |
x_tf = tf.constant(1, name='x', dtype=tf.float64) | |
# An `Operation` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Using https://github.com/jasonhemann/microKanren | |
(load "microKanren.scm") | |
(load "miniKanren-wrappers.scm") | |
(define reduces | |
(lambda (a b) | |
(conde | |
((fresh (x) | |
(== a `(+ ,x ,x)) | |
(== b `(* 2 ,x)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Make `pp` use IPython's pretty printer, instead of the standard `pprint` module. | |
# | |
# Sources: https://nedbatchelder.com/blog/200704/my_pdbrc.html | |
# | |
# XXX: This .pdbrc is only valid for Python >= 3.4 | |
# | |
import pdb | |
import inspect as __inspect | |
from pprint import pprint as __pprint |