Skip to content

Instantly share code, notes, and snippets.

View tigerneil's full-sized avatar
🎯
Focusing

Xiaohu Zhu tigerneil

🎯
Focusing
View GitHub Profile
@tigerneil
tigerneil / elasticsearch.yml
Created August 27, 2014 10:10
elasticsearch.yam for maleskine
in elasticsearch.yml add the
```
analyzer:
ik:
alias:
- ik_analyzer
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
ik_max_word:
type: ik
use_smart: false
@tigerneil
tigerneil / elasticsearch-ik-mmseg.rmd
Last active August 29, 2015 14:05
elasticsearch.yml for mmseg
create two directory: `/config/mmseg`, `/plugins/analysis-mmseg`
1. got to [`https://github.com/medcl/elasticsearch-rtf/tree/master/config/mmseg`](https://github.com/medcl/elasticsearch-rtf/tree/master/config/mmseg)`, download the files:
chars.dic, units.dic, words-my.dic,words.dic, mv them to `/config/mmseg`
2. go to [`https://github.com/medcl/elasticsearch-rtf/tree/master/plugins/analysis-mmseg`](https://github.com/medcl/elasticsearch-rtf/tree/master/plugins/analysis-mmseg), download the jar:
elasticsearch-analysis-mmseg-1.2.2.jar, mv them to `/plugins/analysis-mmseg`
3. add the following configuration to `elasticsearch.yml`:
"""
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 / rllab_gym_ddpg.py
Last active May 16, 2016 13:15
ddpg for openai gym
from __future__ import print_function
from __future__ import absolute_import
import os
os.environ['THEANO_FLAGS'] = 'device=cpu,mode=FAST_COMPILE,optimizer=None'
from rllab.algos.ddpg import DDPG
from rllab.envs.box2d.cartpole_env import CartpoleEnv
from rllab.policies.deterministic_mlp_policy import DeterministicMLPPolicy
from rllab.q_functions.continuous_mlp_q_function import ContinuousMLPQFunction
@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