Skip to content

Instantly share code, notes, and snippets.

View griesmey's full-sized avatar
🏠
Working from home

Robert Griesmeyer griesmey

🏠
Working from home
  • Monster
  • Las Vegas
View GitHub Profile
@griesmey
griesmey / kmeans.py
Created August 18, 2015 16:31
implementation of KMeans in Python
from math import sqrt
import sys
from collections import defaultdict
from itertools import izip
class Point(object):
def __init__(self, x, y, id=None):
self.x = x
self.y = y
@karpathy
karpathy / min-char-rnn.py
Last active May 6, 2024 16:42
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)