Skip to content

Instantly share code, notes, and snippets.

Brandon T. Willard brandonwillard

View GitHub Profile
@brandonwillard
brandonwillard / pymc3-poisson-zero-testing-example.ipynb
Last active Jun 20, 2020
PyMC3 Poisson-Zero HMM Testing Example
View pymc3-poisson-zero-testing-example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brandonwillard
brandonwillard / numba_bug.py
Created Jun 7, 2020 — forked from nouiz/numba_bug.py
Test how to make a Theano op that call Numba.
View numba_bug.py
import numba
import numpy
#The filter2d with the same signature as Theano
#but not a class method.
def filter2d_theano(node, inputs, outputs):
image, filt = inputs
M, N = image.shape
Mf, Nf = filt.shape
@brandonwillard
brandonwillard / pymc3-to-randomvariable.py
Created Jun 7, 2020
Automatic PyMC3 to RandomVariable conversion prototype
View pymc3-to-randomvariable.py
import theano
import theano.tensor as tt
import pymc3 as pm
from warnings import warn
from unittest.mock import patch
from types import SimpleNamespace
from inspect import Signature
from collections import OrderedDict
View pymc3-toposorting.py
import numpy as np
import theano.tensor as tt
import pymc3 as pm
from itertools import chain, filterfalse
tt.optimizer = 'fast_compile'
@brandonwillard
brandonwillard / ox-jupyter-notebook-notes.org
Created Mar 25, 2020
Notes on a Better Implementation of org-to-jupyter-notebook Conversion
View ox-jupyter-notebook-notes.org

Overall, it looks easier to write a Jupyter Notebook exporter from scratch. The Notebook format is given here.

(require 'ox-gfm)

(org-export-define-derived-backend 'jnb 'gfm
  :filters-alist '((:filter-parse-tree . org-jnb-separate-elements))
  :menu-entry
@brandonwillard
brandonwillard / simple_dlm_sim_example.py
Last active Mar 16, 2020
Simple Theano DLM Simulation Example using Symbolic PyMC
View simple_dlm_sim_example.py
import numpy as np
import theano
import theano.tensor as tt
import matplotlib.pyplot as plt
from theano.printing import debugprint as tt_dprint
from symbolic_pymc.theano.random_variables import NormalRV, MvNormalRV, InvGammaRV, observed
@brandonwillard
brandonwillard / beta-binomial-conjugate-example.ipynb
Last active Jun 24, 2020
Symbolic-PyMC Beta-Binomial Conjugate Example
View beta-binomial-conjugate-example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brandonwillard
brandonwillard / pymc3-model-graph-exa.md
Last active Jan 6, 2020
PyMC3 Model Graph Dependencies Example
View pymc3-model-graph-exa.md
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
@brandonwillard
brandonwillard / airflow-interactive-testing.org
Last active Oct 16, 2019
Local Airflow Interactive Testing/Development in Python
View airflow-interactive-testing.org

Interactive Airflow Debugging

@brandonwillard
brandonwillard / pymc4-radon-optimization.org
Last active Oct 17, 2019
Symbolic PyMC Radon Model Optimization in PyMC4
View pymc4-radon-optimization.org

Symbolic PyMC: Radon Example in PyMC4

You can’t perform that action at this time.