Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch
| Date | Stars |
|---|---|
| 2026-07-31 | 12085 |
| 2026-08-01 | 12085 |
| 2026-08-03 | 12086 |
| 2026-08-04 | 12086 |
| 2026-08-05 | 12087 |
| 2026-08-06 | 12087 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# char-rnn This code implements **multi-layer Recurrent Neural Network** (RNN, LSTM, and GRU) for training/sampling from character-level language models. In other words the model takes one text file as input and trains a Recurrent Neural Network that learns to predict the next character in a sequence. The RNN can then be used to generate text character by character that will look like the original training data. The context of this code base is described in detail in my [blog post](http://karpathy.github.io/2015/05/21/rnn-effectiveness/). If you are new to Torch/Lua/Neural Nets, it might be helpful to know that this code is really just a slightly more fancy version of this [100-line gist](https://gist.github.com/karpathy/d4dee566867f8291f086) that I wrote in Python/numpy. The code in this repo additionally: allows for multiple layers, uses an LSTM instead of a vanilla RNN, has more supporting code for model checkpointing, and is of course much more efficient since it uses mini-batches and can run on a GPU. ## Update: torch-rnn [Justin Johnson](http://cs.stanford.edu/people/jcjohns/) (@jcjohnson) recently re-implemented char-rnn from scratch with a much nicer/smaller/cleaner/faster Torch code base. It's under the name [torch-rnn](https://github.com/jcjohnson/torch-rnn). It uses Adam for optimization and hard-codes the RNN/LSTM forward/backward passes for space/time efficiency. This also avoids headaches with cloning models in this repo. In other words, torch-rnn should be the default char-rnn implemention to use now instead of the one in this code base. ## Requirements This code is written in Lua and requires [Torch](http://torch.ch/). If you're on Ubuntu, installing Torch in your home directory may look something like: ```bash $ curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash $ git clone https://github.com/torch/distro.git ~/torch --recursive $ cd ~/torch; $ ./install.sh # and enter "yes" at the end to modify your bashrc $ source ~/.bashrc ``` See the Torch installation documentation for more details. After Torch is installed we need to get a few more packages using [LuaRocks](https://luarocks.org/) (which already came with the Torch install). In particular: ```bash $ luarocks install nngraph $ luarocks install optim $ luarocks install nn ``` If you'd like to train on an NVIDIA GPU using CUDA (this can be to about 15x faster), you'll of course need the GPU, and you will have to install the [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit). Then get the `cutorch` and `cunn` packages: ```bash $ luarocks install cutorch $ luarocks install cunn ``` If you'd like to use OpenCL GPU instead (e.g. ATI cards), you will instead need to install the `cltorch` and `clnn` packages, and then use the option `-opencl 1` during training ([cltorch issues](https://github.com/hughperkins/cltorch/issues)): ```bash $ luarocks install cltorch $ luarocks install clnn ``` ## Usage ### Data All input data is stored inside the `data/` directory. You'll notice that there is an example dataset included in the repo (in folder `data/tinyshakespeare`) which consists of a subset of works of Shakespeare. I'm providing a few more datasets on [this page](http://cs.stanford.edu/people/karpathy/char-rnn/). **Your own data**: If you'd like to use your own data then create a single file `input.txt` and place it into a folder in the `data/` directory. For example, `data/some_folder/input.txt`. The first time you run the training script it will do some preprocessing and write two more convenience cache files into `data/some_folder`. **Dataset sizes**: Note that if your data is too small (1MB is already considered very small) the RNN won't learn very effectively. Remember that it has to learn everything completely from scratch. Conversely if your data is large (more than about 2MB), feel confident to increase `rnn_size` and train a bigger model (see details of training below). It will work *signific
Excerpt of 12,795 characters
Read on GitHubAndrej
46
7
Hugh Perkins
6
Ehud Ben-Reuven
2
1
1
Eric Zeiberg · Education First · Morocco
1
Yafah Edelman
1
King Chung (Johnny) Ho · UCLA · United States
1
1
1
1
1
Li Dong · Microsoft Research
1
1
Greg Brockman · United States
1
1
Ajinkya Kale
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:1044568ba101fde1, llm:Description: 'Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch' (language: Lua). No topics provided.
matched fp:1044568ba101fde1, llm:Description: 'Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch' (language: Lua). No topics provided.
matched fp:1044568ba101fde1, llm:Description: 'Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch' (language: Lua). No topics provided.