Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Eric Ma ericmjl

🎯
Focusing
Block or report user

Report or block ericmjl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ericmjl
ericmjl / display.py
Created Apr 28, 2019
Custom module that wraps waveshare's e-paper display code.
View display.py
from PIL import Image
def read_img(fname):
b = Image.open("images/{fname}_b.bmp".format(fname=fname))
r = Image.open("images/{fname}_r.bmp".format(fname=fname))
return b, r
def display(fname, epd):
b, r = read_img(fname)
@ericmjl
ericmjl / preprocess.py
Created Apr 28, 2019
Custom python module for preprocessing a png (generated from adobe illustrator) into its constituent red and black channels.
View preprocess.py
from PIL import Image
import numpy as np
from pathlib import Path
def open(fname):
img = Image.open(fname).resize((384, 640))
return img
def array(img):
@ericmjl
ericmjl / pymc4-dev-environment.yml
Created Jan 20, 2019
PyMC4 dev environment spec for conda
View pymc4-dev-environment.yml
name: pymc4-dev
channels:
- defaults
- conda-forge
- ericmjl
dependencies:
- python=3.6
- jupyter
- jupyterlab
- conda
View mpnn-chainer-test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View error.txt
============================= test session starts ==============================
platform darwin -- Python 3.6.7, pytest-4.0.2, py-1.7.0, pluggy-0.8.0
rootdir: /Users/ericmjl/github/software/autograd-sparse, inifile:
collected 3 items / 2 deselected
tests/test_sparse.py F [100%]
=================================== FAILURES ===================================
_____________________________ test_sparse_dot_grad _____________________________
View autograd-scipy-sparse-grad.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericmjl
ericmjl / gp-test.ipynb
Created Dec 13, 2018
Extending GPs to 2 dimensions
View gp-test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericmjl
ericmjl / environment.yml
Created Dec 12, 2018
DL introductory hands-on workshop specfile
View environment.yml
name: dl-workshop
channels:
- defaults
- conda-forge
- ericmjl
dependencies:
- python=3.7
- jupyter
- jupyterlab
- conda
@ericmjl
ericmjl / gp-test.ipynb
Created Dec 11, 2018
Doing GPs in numpy!
View gp-test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericmjl
ericmjl / holoviews_datashader.py
Created Aug 31, 2018
Holoviews dynamic map with datashader
View holoviews_datashader.py
import datashader as ds
import holoviews as hv
from holoviews.operation.datashader import datashade
hv.extension('bokeh')
def scatter(dim1, dim2):
def _scatter(data):
return hv.Scatter(data, kdims=[dim1], vdims=[dim2], extents=(-10, -10, 10, 10))
return _scatter
You can’t perform that action at this time.