- Category:
- Other systems
- Tags:
-
- File Size:
- 1.41mb
- Update:
- 2017-12-07
- Downloads:
- 0 Times
- Uploaded by:
- 呜呜呜
Description: # Char-RNN-PyTorch
Use the character level RNN for text generation, using the PyTorch framework. [Gluon
## Requirements
- PyTorch 0.2
- numpy
## Basic Usage
If you want to train the network, use the following code
```bash
Python main.py \
--state train \
TXT text --txt'./data/poetry.txt'\ # for training
--batch 128, batch_size #
--epoch 1000 \
The length of the sequence --len 100 \ # input RNN
--max_vocab 5000, # maximum number of characters
--embed 512 \ # word vector dimension
The output dimension --hidden 512 \ # network
--n_layer 2 # \ RNN layers
--dropout 0.5
.
If you want to use a trained network for text generation, use the following code
```bash
Python main.py \
--state Eval \
I \ '--begin' # generated text, can be a character, can also be a paragraph
--pred_len 100, # want to generate text length
--checkpoint'./checkpoint/model_100.pth'# reading training model position
.
To Search:
File list (Check if you may need any files):
Filename | Size | Date |
---|
Char-RNN-PyTorch-master
|
Char-RNN-PyTorch-master\.gitignore | 37 | 2017-09-09
|
Char-RNN-PyTorch-master\CharRNN.py | 1236 | 2017-09-09
|
Char-RNN-PyTorch-master\README.md | 1827 | 2017-09-09
|
Char-RNN-PyTorch-master\data
|
Char-RNN-PyTorch-master\data\jay.txt | 183181 | 2017-09-09
|
Char-RNN-PyTorch-master\data\poetry.txt | 2683016 | 2017-09-09
|
Char-RNN-PyTorch-master\data_utils.py | 2627 | 2017-09-09
|
Char-RNN-PyTorch-master\main.py | 5298 | 2017-09-09 |