Skip to content

Instantly share code, notes, and snippets.

View kastnerkyle's full-sized avatar

Kyle Kastner kastnerkyle

View GitHub Profile
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 29, 2024 17:57
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
## Unrolled GAN
# A Brock, 2016
# This code implements the toy experiment for unrolled GANs.
# TODO: Make shared variables and reduce the memory transfer overhead
# Imports
import numpy as np
import os
import requests
from bs4 import BeautifulSoup
class GSheet(object):
base_sheet_url = 'https://spreadsheets.google.com/feeds/worksheets/{0}/private/full'
list_worksheet_url = 'https://spreadsheets.google.com/feeds/list/{0}/{{}}/private/full'
cell_worksheet_url = 'https://spreadsheets.google.com/feeds/cells/{0}/{{}}/private/full'
HTTPheaders = {'content-type': 'application/atom+xml'}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import theano
import theano.tensor as T
import numpy as np
import cPickle
import random
import matplotlib.pyplot as plt
class RNN(object):
def __init__(self, nin, n_hidden, nout):
@windytan
windytan / fm.c
Last active August 26, 2019 03:49
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <fftw3.h>
#define FFTLEN 2048
#define SRATE 22050
// Return sinusoid power from complex DFT coefficients
double power (fftw_complex coeff) {
@jboner
jboner / latency.txt
Last active May 9, 2024 06:01
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD