Skip to content

Instantly share code, notes, and snippets.

View waterzxj's full-sized avatar

Ramos waterzxj

  • BUPT
  • beijing
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):
@waterzxj
waterzxj / min-char-rnn.py
Created December 6, 2017 01:08 — 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)
http://naotu.baidu.com/file/c90df0f4d68f0a41ba51d411aecc44b7?token=ae40969380395a73