tree: bc4644edab480922cd176f9090b09e921e4012f3 [path history] [tgz]
  1. bucket_io.py
  2. get_ptb_data.sh
  3. readme.md
  4. rnn_cell_demo.py
example/rnn-time-major/readme.md

Time major data layout for RNN

This example demonstrates an RNN implementation with Time-major layout. This implementation shows 1.5x-2x speedups compared to Batch-major RNN.

As example of Batch-major RNN is available in MXNet RNN Bucketing example

Running the example

  • Prerequisite: an instance with GPU compute resources is required to run MXNet RNN

  • Make the shell script get_ptb_data.sh executable:

    chmod +x get_ptb_data.sh
    
  • Run get_ptb_data.sh to download the PTB dataset, and follow the instructions to review the license:

    ./get_ptb_data.sh
    

    The PTB data sets will be downloaded into ./data directory, and available for the example to train on.

  • Run the example:

    python python rnn_cell_demo.py
    

    If everything goes well, console will plot training speed and perplexity that you can compare to the batch major RNN.