profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/brandonwillard/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Brandon T. Willard brandonwillard Chicago, IL https://brandonwillard.github.io/ applied math/stats person

aesara-devs/aesara 310

Aesara is a Python library that allows one to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.

blackjax-devs/blackjax 187

BlackJAX is a sampling library designed for ease of use, speed and modularity.

algernon/adderall 84

Hy on Adderall - a miniKanren implementation in Hy

AmpersandTV/pymc3-hmm 66

Hidden Markov models in PyMC3

aesara-devs/aehmc 11

An experimental HMC implementation in Aesara

algernon/monaxhyd 10

Hy on monaxhyd, a monad library for Hy

brandonwillard/adderall 0

Hy on Adderall - a miniKanren implementation in Hy

brandonwillard/aehmc 0

An experimental HMC implementation in Aesara

brandonwillard/aeppl 0

Tools for a[e] PPL in Aesara.

push eventbrandonwillard/staged-recipes

Brandon T. Willard

commit sha 034824a850a47be1feaa15e21cfb3cee2453e94c

Create a new recipe for AeHMC

view details

push time in 10 hours

push eventbrandonwillard/spacemacs-custom

Brandon T. Willard

commit sha 2ac85994a7c6c34520cd174532fdf9ad66f784e7

Use new pytest-btw package

view details

Brandon T. Willard

commit sha 21b0ca8614b1e2dd11ad376defb90b6b2b0cc700

Fix recent comint blocking issues when running pytest with pdb

view details

Brandon T. Willard

commit sha 7dfe08f1d3d44cd7165db605618d504713fcf1c0

Make *all* comint output read-only

view details

push time in 18 hours

Pull request review commentconda-forge/staged-recipes

Add a recipe for AeHMC

+{% set version = "0.0.2" %}++package:+  name: aehmc+  version: {{ version }}++source:+  url: https://pypi.io/packages/source/a/aehmc/aehmc-{{ version }}.tar.gz+  sha256: 1e3e648198baf4c610c09f77d91a3affbdb83cb1f212a6c327885cf4300b2ae2+  patches:++build:+  number: 0+  script: {{ PYTHON }} -m pip install . -vv+  noarch: python++requirements:+  host:+    - pip+    - python >=3.6+    - setuptools+  run:+    - python >=3.6+    - numpy >=1.18.1+    - scipy >=1.4.0+    - aesara >=2.1.1+    - aeppl >=0.0.5++test:+  imports:+    - aehmc

Good point; @rlouf, which modules should we import?

brandonwillard

comment created time in 21 hours

PullRequestReviewEvent

delete branch aesara-devs/aehmc

delete branch : nuts-logprob

delete time in a day

push eventaesara-devs/aehmc

Rémi Louf

commit sha 0d1d7c1bbc08c1ca1fe2d8ea53c47f2d8e276660

Build the NUTS kernel with a logprob function

view details

push time in a day

PR merged aesara-devs/aehmc

Build the NUTS kernel with a logprob function

We currently need to provide a potential function to build the NUTS kernel. However, end users are used to working with logprobs and not potentials so this might be confusing. We thus now require a logpropb function to build the NUTS kernel (it is already the case for the HMC kernel).

Closes #30

+16 -16

1 comment

2 changed files

rlouf

pr closed time in a day

issue closedaesara-devs/aehmc

`nuts.kernel` should take a `logprob_fn` as an argument

Like hmc.kernel does. It currently takes a potential function.

closed time in a day

rlouf

push eventbrandonwillard/staged-recipes

Brandon T. Willard

commit sha c1aee461b63bf07769efc962992347d5b4f365a8

Create a new recipe for AeHMC

view details

push time in a day

issue commentaesara-devs/aehmc

Create a conda-forge recipe

This was merged, closing.

We're still waiting for the conda-forge folks to merge https://github.com/conda-forge/staged-recipes/pull/15767.

brandonwillard

comment created time in a day

IssuesEvent

pull request commentaesara-devs/aehmc

Add logistic regression example with NUTS

Do we need to add an application to the aesara-devs org or something?

rlouf

comment created time in a day

delete branch brandonwillard/aesara

delete branch : fix-indices_from_subtensor-typing

delete time in a day

push eventaesara-devs/aesara

Brandon T. Willard

commit sha 62d2c048ac86d4b3e4a4480f72aa95f0af58548a

Fix docstring and type hints for indices_from_subtensor

view details

push time in a day

PR merged aesara-devs/aesara

Fix docstring and type hints for indices_from_subtensor

This PR fixes some docstring and type hinting issues in indices_from_subtensor.

+6 -6

1 comment

1 changed file

brandonwillard

pr closed time in a day

pull request commentaesara-devs/aeppl

Add support for `Scan` `Op`s in `joint_logprob`

I just added a commit that handles the first remaining issue (i.e. the section in https://github.com/aesara-devs/aeppl/pull/24#issuecomment-922369850 titled "Add MeasurableVariable detection for Subtensor Scan output")

kc611

comment created time in 2 days

push eventkc611/aeppl

Brandon T. Willard

commit sha 4d27b626dc86c5ee119c33308ef76154f2494605

Handle value mappings for Scans with taps and initial values

view details

push time in 2 days

PR opened aesara-devs/aesara

Fix docstring and type hints for indices_from_subtensor

This PR fixes some docstring and type hinting issues in indices_from_subtensor.

+6 -6

0 comment

1 changed file

pr created time in 2 days

create barnchbrandonwillard/aesara

branch : fix-indices_from_subtensor-typing

created branch time in 2 days

push eventbrandonwillard/python-btw

Brandon T. Willard

commit sha a3a4c2c12f74ade49fe0c0d163b4ea010b936e08

Remove comint read-only hooks

view details

push time in 2 days

push eventbrandonwillard/spacemacs

Maxi Wolff

commit sha f5bd49cc8e99ec5ec63f3581200c350d55a20c5b

Revise some smaller layers

view details

push time in 2 days

PullRequestReviewEvent

issue openedAmpersandTV/pymc3-hmm

Use `datashader` for time-series distribution plots

The following seems to demonstrate how we can use datashader to produce distribution plots rather quickly for large series:

import pickle

import datashader as ds
import datashader.transfer_functions as tf

import matplotlib.pyplot as plt


# Load posterior predictive estimates for a simulated series
with open("sample_pp_trace.pkl", "rb") as f:
    pp_trace = pickle.load(f)


pp_trace.observed_data
# <xarray.Dataset>
# Dimensions:  (dt: 8784)
# Coordinates:
#   * dt       (dt) datetime64[ns] 2020-02-11T01:00:00 ... 2021-02-11
# Data variables:
#     Y_t      (dt) int64 1955927 1870384 1793920 ... 1940015 1790022 1737292
# Attributes:
#     created_at:                 2021-09-21T20:21:14.864357
#     arviz_version:              0.11.2
#     inference_library:          pymc3
#     inference_library_version:  3.11.2

pp_trace.posterior_predictive
# <xarray.Dataset>
# Dimensions:     (beta_dim_0: 2016, chain: 1, draw: 100, dt: 8784, xi_0_dim_0: 2016, xi_1_dim_0: 2016)
# Coordinates:
#   * chain       (chain) int64 0
#   * draw        (draw) int64 0 1 2 3 4 5 6 7 8 9 ... 91 92 93 94 95 96 97 98 99
#   * dt          (dt) datetime64[ns] 2020-02-11T01:00:00 ... 2021-02-11
#   * beta_dim_0  (beta_dim_0) int64 0 1 2 3 4 5 ... 2010 2011 2012 2013 2014 2015
#   * xi_0_dim_0  (xi_0_dim_0) int64 0 1 2 3 4 5 ... 2010 2011 2012 2013 2014 2015
#   * xi_1_dim_0  (xi_1_dim_0) int64 0 1 2 3 4 5 ... 2010 2011 2012 2013 2014 2015
# Data variables:
#     S_t         (chain, draw, dt) int64 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
#     beta        (chain, draw, beta_dim_0) float64 -0.3512 0.75 ... -0.2256
#     xi_0        (chain, draw, xi_0_dim_0) float64 0.0004301 ... -0.0001103
#     xi_1        (chain, draw, xi_1_dim_0) float64 -40.1 -4.832 ... 3.142 3.291
#     mu          (chain, draw, dt) float64 1.888e+06 1.862e+06 ... 1.477e+06
#     Y_t         (chain, draw, dt) float64 1.979e+06 1.799e+06 ... 1.491e+06
# Attributes:
#     created_at:                 2021-09-21T20:21:14.861233
#     arviz_version:              0.11.2
#     inference_library:          pymc3
#     inference_library_version:  3.11.2

df = pp_trace.posterior_predictive.Y_t[0].drop("chain").to_dataframe()
df = df.reset_index()
df.dt = df.dt.astype(int)

N_obs = pp_trace.posterior_predictive.dt.data.shape[0]

canvas = ds.Canvas(
    plot_width=N_obs,
    plot_height=300,
    # x_range=(ds_df.dt.min(), ds_df.dt.max()),
    y_range=(0.0, df["Y_t"].max()),
    x_axis_type="linear",
    y_axis_type="linear",
)

agg = canvas.points(df, "dt", "Y_t")
agg.coords.update({"dt": pp_trace.posterior_predictive.dt.data})

shade_res = tf.shade(agg, cmap="black", how="eq_hist")

res_img = tf.Image(shade_res)

plt.close()

fig, ax = plt.subplots(figsize=(10, 5))

qmesh = res_img.plot(cmap="Blues", ax=ax, label="posterior predictives")

ax.step(
    pp_trace.observed_data.dt.data,
    pp_trace.observed_data.Y_t.data,
    color="black",
    label="obs",
    alpha=0.7,
    linewidth=1.3,
)

# XXX: Don't use `ax.legend`; it might freeze the plot!
fig.legend()

The whole picture won't look good for some obvious reasons, but, after zooming in, the results look similar to the ones we're producing (albeit with much more effort and less scalability): example-series-no-zoom

After zooming: example-series-zoomed

Let's try to improve these results and replace our current time-series histogram approach with this one.

created time in 2 days

created tagAmpersandTV/pymc3-hmm

tagv0.1.10

Hidden Markov models in PyMC3

created time in 2 days

release AmpersandTV/pymc3-hmm

v0.1.10

released time in 2 days

push eventAmpersandTV/pymc3-hmm

Jeffrey Enos

commit sha 5b82ec0bbbf3b0255e65e11b6970fbac1d278bd9

Remove conditioning in distribution_subset_args

view details

Brandon T. Willard

commit sha 2e3104a7242f5bcba4d3a64483c4903e0c6dce5c

Return distribution_subset_args dict instead of list

view details

push time in 2 days

PR merged AmpersandTV/pymc3-hmm

Remove conditioning in distribution_subset_args bug important

This PR removes the point argument and related conditioning logic from distribution_subset_args to avoid the potential name conflicts described in #91.

Closes #91.

+17 -63

0 comment

2 changed files

jeffreyenos

pr closed time in 2 days

issue closedAmpersandTV/pymc3-hmm

Incorrect conditioning in `SwitchingProcess.random`

In SwitchingProcess.random, there are two places where point is used to condition variables: distribution_subset_args and the component distribution's random method. distribution_subset_args substitutes values by matching the component distribution's formal parameter names to the keys of point, while the component distribution's random method tries to match on user-defined distribution and variable names. This can lead to confusion and / or incorrect conditioning when the formal parameter names and user-defined names are the same.

There is already a test where this issue can be demonstrated:

https://github.com/AmpersandTV/pymc3-hmm/blob/26f7009ab3e87570f0a56948a23b1f8d00bb22ed/tests/test_distributions.py#L428-L439

In the above, the Constant distribution used for the Poisson mean is given the user-defined name "c". However, the Constant distribution's formal parameter name is also c:

https://github.com/AmpersandTV/pymc3-hmm/blob/26f7009ab3e87570f0a56948a23b1f8d00bb22ed/pymc3_hmm/distributions.py#L441-L450

So in the above test, conditioning on the point {"c": 100.0} causes the Poisson mean and the value for the Constant component distribution (i.e. the zero state of the mixture) to be set to 100. That is, the below assertion:

assert np.all(test_sample[..., test_states == 0] == 0)

will fail.

closed time in 2 days

jeffreyenos

push eventjeffreyenos/pymc3-hmm

Jeffrey Enos

commit sha 2fa247c0177ee5c4c8d3b0ad76ac10711940c05f

Remove conditioning in distribution_subset_args

view details

Brandon T. Willard

commit sha b5463d244e4b6f5f86fb14fb6f6cf47458509bc7

Return distribution_subset_args dict instead of list

view details

push time in 2 days

push eventjeffreyenos/pymc3-hmm

Jeffrey Enos

commit sha 5dc2e953f19cbe3fda4a08a798b6c64e24ab2fe1

Remove conditioning in distribution_subset_args

view details

Brandon T. Willard

commit sha 7232045ae6a8ccfb0cc014550060c0f80a2ffc50

Return distribution_subset_args dict instead of list

view details

push time in 2 days