Skip to content

Instantly share code, notes, and snippets.

View dmargala's full-sized avatar

Daniel Margala dmargala

  • Berkeley Lab (NERSC)
View GitHub Profile
@dmargala
dmargala / Dockerfile
Created February 26, 2021 20:06
Dockerfile with CUDA 11.0 + UCX + OpenMPI + Python (numpy, numba, cupy, mpi4py) for use with Shifter at NERSC on Cori GPU
FROM nvcr.io/nvidia/cuda:11.0-devel-ubuntu18.04
# GNU compiler
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
gcc \
gfortran && \
rm -rf /var/lib/apt/lists/*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmargala
dmargala / DeepLearningBook Figure 5.4.ipynb
Last active June 22, 2017 22:36
Explore model capacity as a function of the number of training examples
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmargala
dmargala / Prefix Beam Search.ipynb
Last active June 1, 2017 04:15
Interactive demo of prefix beam search from 1408.2873v2 (work in progress)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmargala
dmargala / wavelength_distortion.ipynb
Created December 20, 2016 01:54
non-parametric fitting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import numpy as np
np.random.seed(124897)
# number of people to start with
num_start = 56000
# number of times to repeat experiment
num_trials = 1000
# some arrays to store individual trial results
rounds_counter = np.zeros(num_trials)
@dmargala
dmargala / BarChartDemo.ipynb
Last active November 3, 2017 02:02
Python bar chart demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmargala
dmargala / blinders.py
Last active August 12, 2016 05:29
blinds statsmodel summary output
class Blinders(object):
def __init__(self, medusa, peripherals=['Std.Err.', 't', 'P>|t|']):
'''Helper to only view `peripherals` of `medusa`'''
# the coefficient we want to blind
self.medusa = medusa
# the stats we don't want to blind
self.peripherals = peripherals
def blind_summary(self, model):
'''Filters the result of `model.summary2()`'''