Skip to content

Instantly share code, notes, and snippets.

View mpezeshki's full-sized avatar

Mohammad Pezeshki mpezeshki

  • Mila
  • Montreal, Canada
View GitHub Profile
@mpezeshki
mpezeshki / lstm.py
Created May 25, 2017 01:02
LSTM implementation in Theano in 50 lines
import numpy as np
import theano
import theano.tensor as T
from theano.tensor.nnet import sigmoid
from utils import gloro_init, zeros_init
# x: B, T, F
def lstm(x, idim, hdim, odim, batch_size, name):
# W_i, W_f, W_c, W_o
@mpezeshki
mpezeshki / minibatch_ocr.py
Created October 14, 2015 16:33 — forked from kastnerkyle/minibatch_ocr.py
Minibatch OCR using modified CTC from Shawn Tan and Mohammad Pezeshki
"""
bitmap utils and much of the ctc code modified
From Shawn Tan, Rakesh and Mohammad Pezeshki
"""
# Author: Kyle Kastner
# License: BSD 3-clause
from theano import tensor
from scipy import linalg
import theano
import numpy as np
@mpezeshki
mpezeshki / crbm.py
Last active August 29, 2015 14:08 — forked from gwtaylor/crbm.py
""" Theano CRBM implementation.
For details, see:
http://www.uoguelph.ca/~gwtaylor/publications/nips2006mhmublv
Sample data:
http://www.uoguelph.ca/~gwtaylor/publications/nips2006mhmublv/motion.mat
@author Graham Taylor"""
import numpy