• Stars
    star
    197
  • Rank 196,519 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PyTorch implementation of char-rnn (character-level language model)

char-rnn.pytorch

A PyTorch implementation of char-rnn for character-level text generation. This is copied from the Practical PyTorch series.

Training

Download this Shakespeare dataset (from the original char-rnn) as shakespeare.txt. Or bring your own dataset — it should be a plain text file (preferably ASCII).

Run train.py with the dataset filename to train and save the network:

> python train.py shakespeare.txt

Training for 2000 epochs...
(... 10 minutes later ...)
Saved as shakespeare.pt

After training the model will be saved as [filename].pt.

Training options

Usage: train.py [filename] [options]

Options:
--model            Whether to use LSTM or GRU units    gru
--n_epochs         Number of epochs to train           2000
--print_every      Log learning rate at this interval  100
--hidden_size      Hidden size of GRU                  50
--n_layers         Number of GRU layers                2
--learning_rate    Learning rate                       0.01
--chunk_len        Length of training chunks           200
--batch_size       Number of examples per batch        100
--cuda             Use CUDA

Generation

Run generate.py with the saved model from training, and a "priming string" to start the text with.

> python generate.py shakespeare.pt --prime_str "Where"

Where, you, and if to our with his drid's
Weasteria nobrand this by then.

AUTENES:
It his zersit at he

Generation options

Usage: generate.py [filename] [options]

Options:
-p, --prime_str      String to prime generation with
-l, --predict_len    Length of prediction
-t, --temperature    Temperature (higher is more chaotic)
--cuda               Use CUDA

More Repositories

1

practical-pytorch

Go to https://github.com/pytorch/tutorials - this repo is deprecated and no longer maintained
Jupyter Notebook
4,512
star
2

pytorch-seq2seq-intent-parsing

Intent parsing and slot filling in PyTorch with seq2seq + attention
Python
159
star
3

torch-seq2seq-attention

Torch implementation of seq2seq machine translation with GRU RNN and attention
Lua
78
star
4

simon

Dynamic routing/vhosts with nginx + Lua + Redis
Lua
73
star
5

RARNN

Recursive application of recurrent neural networks, for hierarchical intent parsing
Jupyter Notebook
59
star
6

nalgene

Natural language generation language
Python
55
star
7

torch-seq2seq-intent-parsing

Intent parsing and slot filling in Torch with seq2seq + attention
Lua
49
star
8

TwitterProfileClone

Swift clone of Twitter's iOS profile view with a stretchy header
Swift
44
star
9

pytorch-text-vae

Python
33
star
10

sconce-python

Python
16
star
11

lit

Literate programming for any language. It's 🔥.
Shell
16
star
12

nextjs-boilerplate

Next.js Boilerplate with TypeScript, TailwindCSS, and Redux-Saga
TypeScript
12
star
13

torch-seq2seq

Word-level sequence to sequence RNN for translation
Lua
11
star
14

torch-rnn-word-classifier

Learns to classify names by country of origin with a LSTM RNN in Torch
Lua
9
star
15

blinkinch

Square inch clone of the blink(1) indicator light with ATTiny85 and V-USB.
Assembly
7
star
16

nalgene-js

Natural language generation language
CoffeeScript
6
star
17

hashpipe

Bash-like language and shell with parallel pipes and JSON support
CoffeeScript
5
star
18

Vector

The Edge Whisperer
Java
5
star
19

comfyui-mirror

Python
4
star
20

readme2tex-test

4
star
21

learning-avrc

Simple AVR C projects with the ATMega328p and ATTiny85
C
4
star
22

knobbox

USB knob with ATTiny85 (as HID keyboard) and ATMega328P (multi-modal with OS X driver)
4
star
23

knobbox-megaknob

Modal USB volume, brightness, and more knob with ATMega328 and V-USB
C
4
star
24

knobbox-tinyknob

USB HID volume knob with ATTiny85 and V-USB
C
4
star
25

dotfiles

Slices of configuration happiness
Lua
3
star
26

node-arxiv

CoffeeScript
3
star
27

tinymidi

One button USB MIDI controller on ATTiny85 with V-USB
C
2
star
28

mini

A minimalistic text editor, made with Electron.
CoffeeScript
1
star
29

soundcloud-widget

CoffeeScript
1
star
30

tug

tug at the heart of your deployment process
JavaScript
1
star
31

ismystartupideagood

CoffeeScript
1
star
32

upordown

Slack bot to tell you if the price of Bitcoin is going up or down
CoffeeScript
1
star
33

qwyp

miniature encrypted peer-to-peer chat.
1
star
34

shades

an experiment with auto-generated color schemes
CoffeeScript
1
star
35

croppit

Small but durable image cropping web service
CoffeeScript
1
star
36

hjklist

A hierarchical list maker.
JavaScript
1
star
37

chinook

Hipache config tool for quickly assigning local ports and docker containers
JavaScript
1
star
38

most-bus

A pushable, pluggable stream for Most.js
CoffeeScript
1
star