Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖

Dan Foreman-Mackey dfm

🤖
View GitHub Profile
View aas-macros.bib
% Expand NASA ADS journal macros
% ref: https://ui.adsabs.harvard.edu/help/actions/journal-macros
@string{aas="American Astronomical Society Meeting Abstracts"}
@string{aj="Astronomical Journal"}
@string{actaa="Acta Astronomica"}
@string{araa="Annual Review of Astron and Astrophysis"}
@string{apj="Astrophysical Journal"}
@string{apjl="Astrophysical Journal, Letters"}
@string{apjs="Astrophysical Journal, Supplement"}
@string{ao="Applied Optics"}
@dfm
dfm / intro-to-jax-part3.ipynb
Created June 28, 2022 22:38
intro-to-jax-part3.ipynb
View intro-to-jax-part3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfm
dfm / intro-to-jax-part2.ipynb
Created June 28, 2022 22:38
intro-to-jax-part2.ipynb
View intro-to-jax-part2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfm
dfm / live-intro-to-jax.ipynb
Last active March 29, 2022 05:15
Live coded notebooks for the GPRV workshop. Check out https://github.com/dfm/gprv for more self contained versions.
View live-intro-to-jax.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfm
dfm / numpyro_ncx2.py
Last active July 13, 2021 16:11
Noncentral chi squared distribution
View numpyro_ncx2.py
import tensorflow_probability.substrates.jax as tfp
import jax.numpy as jnp
import jax.scipy as jsp
from jax import lax
import jax.random as random
from numpyro.distributions import constraints
from numpyro.distributions.distribution import Distribution
from numpyro.distributions.util import is_prng_key, promote_shapes, validate_sample
def _random_chi2(key, df, shape=(), dtype=jnp.float_):
@dfm
dfm / environment.yml
Last active July 2, 2021 21:51
My default environment
View environment.yml
channels:
- conda-forge
dependencies:
- python =3.9
- numpy
- mkl-service
- scipy
- matplotlib
- jupyter
- jupyterlab
@dfm
dfm / rtds_mirror.py
Last active May 30, 2021 18:28
A script to download a mirror copy of all of the generated docs for a ReadTheDocs project. httrack must be installed for this to work and you'll need to provide an API token for RTDs.
View rtds_mirror.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import time
import json
import argparse
import requests
import tempfile
View emcee_pz_dist.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View deterministic_op.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mp-bug.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.