Skip to content

Instantly share code, notes, and snippets.

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

ST kadster

🏠
Working from home
View GitHub Profile
@georgeblck
georgeblck / batch-lstm.R
Created February 14, 2017 12:59
An efficient, batched LSTM in R
###
### This is a batched LSTM forward and backward pass. Written by Andrej Karpathy (@karpathy)
### BSD License
### Re-written in R by @georgeblck
###
rm(list=ls(all=TRUE))
LSTM.init <- function(input_size, hidden_size, fancy_forget_bias_init = 3){
# Initialize parameters of the LSTM (both weights and biases in one matrix)
@karpathy
karpathy / gist:587454dc0146a6ae21fc
Last active May 16, 2024 19:55
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):