Skip to content

Instantly share code, notes, and snippets.

" Adnan Haider
" Colors {{{
syntax enable " enable syntax processing
" }}}
" Misc {{{
set backspace=indent,eol,start
let g:vimwiki_list = [{'path': '~/.wiki/'}]
" }}}
" Spaces & Tabs {{{
set tabstop=2 " 4 space tab
@ahaider3
ahaider3 / gist:310879383fde68f1ad18c7aa81416dad
Created September 28, 2017 14:03 — forked from karpathy/gist:587454dc0146a6ae21fc
An efficient, batched LSTM.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@ahaider3
ahaider3 / min-char-rnn.py
Created September 27, 2017 14:45 — 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)
@ahaider3
ahaider3 / random_test.py
Created August 18, 2017 14:27
Tensorflow random initialization
import tensorflow as tf
import numpy as np
X_DIM=2048
Y_DIM=128
tf.set_random_seed(123)
varz = tf.get_variable("v", [X_DIM, Y_DIM],
dtype=tf.float32,
@ahaider3
ahaider3 / matmul_benchmark.py
Created July 10, 2017 15:30
Distributed Tensorflow Overhead Measurement Benchmark
from __future__ import print_function
import sys
import os
import argparse
import numpy as np
import time
import tensorflow as tf
# single node cluster spec params