@drscotthawley here’s the code to generate a sequence from a trained network:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Sample from an LSTM network to generate a time series.
'''

import argparse
import time
import math

import torch
import torch.nn as nn
from torch.autograd import Variable
from train import RNNModel

def read_arguments():
    parser = argparse.ArgumentParser(description='Sample from a recurrent network to generate a signal.')
    parser.add_argument('--checkpoint', type=str, default='./model.pt',
                        help='model checkpoint to use')
    parser.add_argument('--outf', type=str, default='generated.txt',
                        help='output file for generated signal')    
    parser.add_argument('--length', type=int,  default='12500',
                        help='length of the output signal')
    args = parser.parse_args()
    return args


def main():
    args = read_arguments()
    print("Loading model...")
    with open(args.checkpoint, 'rb') as f:
        model = torch.load(f)
    if torch.cuda.is_available():
        model.cuda()
    else:
        model.cpu()

    print('Sampling...')
    try:
        hidden = model.init_hidden(1)
        output = Variable(torch.zeros(1,1,1), volatile=True)
        # output.data[0] = 0.0
        if torch.cuda.is_available():
            output.data = output.data.cuda()
        with open(args.outf, 'w') as outf:
            for _ in range(args.length):
                output, hidden = model(output, hidden)
                outf.write('{:.5f}\n'.format(output.squeeze().data.cpu()[0]))
    except KeyboardInterrupt:
        pass

if __name__ == '__main__':
    main()