Skip to content

Commit a6d10a5

Browse files
committed
Update README for Word Language Model example
1 parent f56fb9c commit a6d10a5

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

word_language_model/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This example trains a multi-layer RNN (Elman, GRU, or LSTM) or Transformer on a
44
The trained model can then be used by the generate script to generate new text.
55

66
```bash
7-
python main.py --cuda --epochs 6 # Train a LSTM on Wikitext-2 with CUDA.
8-
python main.py --cuda --epochs 6 --tied # Train a tied LSTM on Wikitext-2 with CUDA.
9-
python main.py --cuda --tied # Train a tied LSTM on Wikitext-2 with CUDA for 40 epochs.
10-
python main.py --cuda --epochs 6 --model Transformer --lr 5
7+
python main.py --accel --epochs 6 # Train a LSTM on Wikitext-2 with CUDA.
8+
python main.py --accel --epochs 6 --tied # Train a tied LSTM on Wikitext-2 with CUDA.
9+
python main.py --accel --tied # Train a tied LSTM on Wikitext-2 with CUDA for 40 epochs.
10+
python main.py --accel --epochs 6 --model Transformer --lr 5
1111
# Train a Transformer model on Wikitext-2 with CUDA.
1212

13-
python generate.py # Generate samples from the default model checkpoint.
13+
python generate.py --accel # Generate samples from the default model checkpoint.
1414
```
1515

1616
The model uses the `nn.RNN` module (and its sister modules `nn.GRU` and `nn.LSTM`) or Transformer module (`nn.TransformerEncoder` and `nn.TransformerEncoderLayer`) which will automatically use the cuDNN backend if run on CUDA with cuDNN installed.
@@ -35,8 +35,7 @@ optional arguments:
3535
--dropout DROPOUT dropout applied to layers (0 = no dropout)
3636
--tied tie the word embedding and softmax weights
3737
--seed SEED random seed
38-
--cuda use CUDA
39-
--mps enable GPU on macOS
38+
--accel activate support for an accelerator card
4039
--log-interval N report interval
4140
--save SAVE path to save the final model
4241
--onnx-export ONNX_EXPORT
@@ -49,8 +48,8 @@ With these arguments, a variety of models can be tested.
4948
As an example, the following arguments produce slower but better models:
5049

5150
```bash
52-
python main.py --cuda --emsize 650 --nhid 650 --dropout 0.5 --epochs 40
53-
python main.py --cuda --emsize 650 --nhid 650 --dropout 0.5 --epochs 40 --tied
54-
python main.py --cuda --emsize 1500 --nhid 1500 --dropout 0.65 --epochs 40
55-
python main.py --cuda --emsize 1500 --nhid 1500 --dropout 0.65 --epochs 40 --tied
51+
python main.py --accel --emsize 650 --nhid 650 --dropout 0.5 --epochs 40
52+
python main.py --accel --emsize 650 --nhid 650 --dropout 0.5 --epochs 40 --tied
53+
python main.py --accel --emsize 1500 --nhid 1500 --dropout 0.65 --epochs 40
54+
python main.py --accel --emsize 1500 --nhid 1500 --dropout 0.65 --epochs 40 --tied
5655
```

0 commit comments

Comments
 (0)