Skip to content

Instantly share code, notes, and snippets.

View cwood1967's full-sized avatar

Chris Wood cwood1967

  • Stowers Institute
  • Kansas City, MO
View GitHub Profile
@cwood1967
cwood1967 / min-char-rnn.py
Created March 14, 2017 16:03 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@cwood1967
cwood1967 / fastexp.java
Created January 9, 2017 03:14 — forked from Alrecenk/fastexp.java
Very fast accurate approximation to Math.exp in java using floating point bit hacks.
/* fast floating point exp function
* must initialize table with buildexptable before using
Based on
A Fast, Compact Approximation of the Exponential Function
Nicol N. Schraudolph 1999
Adapted to single precision to improve speed and added adjustment table to improve accuracy.
Alrecenk 2014