This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nn' | |
require 'torch' | |
require 'rnn' | |
require 'gnuplot' | |
require 'optim' | |
--debugger = require('fb.debugger') | |
no_param = 1 -- number of parameters in one element. In case of x->sin(x) this is 1. | |
seq_length = 50 -- length of the sequence (number of Tensors in the table fed to nn.Sequencer()) | |
batch_size = 10 -- size of the batches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nn' | |
require 'torch' | |
require 'rnn' | |
require 'gnuplot' | |
-- the input data is: x[i]=i (i=1..1000) | |
data = torch.Tensor(1001):range(1,1001):apply(math.rad):apply(math.sin) | |
lstm = torch.load('rnn_sine.t7') | |
local N = 50 -- number of steps to sample |