Skip to content

Instantly share code, notes, and snippets.

View tigerneil's full-sized avatar
🎯
Focusing

Xiaohu Zhu tigerneil

🎯
Focusing
View GitHub Profile
"""
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):
import theano
from pylearn2.models import mlp
from pylearn2.training_algorithms import sgd
from pylearn2.termination_criteria import EpochCounter
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
import numpy as np
from random import randint
class XOR(DenseDesignMatrix):
"""
Simple implementation of Identity Recurrent Neural Networks (IRNN)
Reference
A Simple Way to Initialize Recurrent Networks of Rectified Linear Units
http://arxiv.org/abs/1504.00941
"""
import numpy as np
"""
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):
@tigerneil
tigerneil / rl_iclr2016.md
Created April 3, 2016 10:39
Reinforcement learning related submissions at ICLR2016

Prioritized Experience Replay

Experience replay lets online reinforcement learning agents remember and reuse experiences from the past. In prior work, experience transitions were uniformly sampled from a replay memory. However, this approach simply replays transitions at the same frequency that they were originally experienced, regardless of their significance. In this paper we develop a framework for prioritizing experience, so as to replay important transitions more frequently, and therefore learn more efficiently. We use prioritized experience replay in Deep Q-Networks (DQN), a reinforcement learning algorithm that achieved human-level performance across many Atari games. DQN with prioritized experience replay achieves a new state-of-the-art, outperforming DQN with uniform replay on 42 out of 57 games.

Authors: Tom Schaul schaul@gmail.com, John Quan johnquan@google.com, Ioannis Antonoglou ioannisa@google.com, David Silver davidsilver@google.com

Recurrent Reinforcement Learning: A Hybrid Ap

@tigerneil
tigerneil / rank_metrics.py
Created April 21, 2016 08:08 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@tigerneil
tigerneil / CATCH_Keras_RL.md
Created May 18, 2016 06:03 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example
@tigerneil
tigerneil / gruln.py
Created July 28, 2016 09:15 — forked from udibr/gruln.py
Keras GRU with Layer Normalization
from keras.layers import GRU, initializations, K
from collections import OrderedDict
class GRULN(GRU):
'''Gated Recurrent Unit with Layer Normalization
Current impelemtation only works with consume_less = 'gpu' which is already
set.
# Arguments
output_dim: dimension of the internal projections and the final output.
@tigerneil
tigerneil / StreamingKMeans.scala
Created August 31, 2016 10:41 — forked from freeman-lab/StreamingKMeans.scala
Spark Streaming + MLLib integration examples
package thunder.streaming
import org.apache.spark.{SparkConf, Logging}
import org.apache.spark.rdd.RDD
import org.apache.spark.SparkContext._
import org.apache.spark.streaming._
import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.mllib.clustering.KMeansModel
import scala.util.Random.nextDouble
@tigerneil
tigerneil / translations.md
Created November 24, 2016 15:50 — forked from colah/translations.md
A list of translations of posts from colah.github.io