Skip to content

Instantly share code, notes, and snippets.

View honnibal's full-sized avatar

Matthew Honnibal honnibal

View GitHub Profile
@honnibal
honnibal / install-cuda.sh
Created December 9, 2018 08:15
Provision GPU for Ubuntu 18.04
#!/usr/bin/env bash
# First download cudnn to a directory /tmp/binaries.
# The filename should be cudnn-9.2-linux-x64-v7.1.tgz
set -e
# Install driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
@honnibal
honnibal / prodigy_srs.py
Created April 22, 2019 10:33
Script to jury-rig a little spaced-repeition system out of the Prodigy annotation tool
"""See https://twitter.com/honnibal/status/1120020992636661767 """
import time
import srsly
from prodigy import recipe
from prodigy.components.db import connect
from prodigy.util import INPUT_HASH_ATTR, set_hashes
from prodigy.components.filters import filter_duplicates
def get_rank_priority(data):
@honnibal
honnibal / theano_mlp_small.py
Last active March 1, 2023 15:10
Stripped-down example of Multi-layer Perceptron MLP in Theano
"""A stripped-down MLP example, using Theano.
Based on the tutorial here: http://deeplearning.net/tutorial/mlp.html
This example trims away some complexities, and makes it easier to see how Theano works.
Design changes:
* Model compiled in a distinct function, so that symbolic variables are not in run-time scope.
* No classes. Network shown by chained function calls.