Created
May 14, 2014 18:05
-
-
Save soumith/ff18530894829d1443a2 to your computer and use it in GitHub Desktop.
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 'torch' | |
require 'nn' | |
torch.setdefaulttensortype('torch.FloatTensor') | |
frameSize = 4 -- each input frame has 4 numbers | |
hiddenSize = 5 -- each hidden layer has 5 units | |
outputSize = 1 -- each output layer has 1 output | |
-------------- Model ------------------------- | |
mlp = nn.Sequential() | |
mlp:add(nn.TemporalConvolution(frameSize,hiddenSize,1,1)) | |
mlp:add(nn.TemporalConvolution(hiddenSize,outputSize,1,1)) | |
mlp:add(nn.Sum(1)) -- sum up all the outputs | |
-------------- End of Model ------------------------- | |
input = torch.rand(8,frameSize) -- 8 frames of 4 numbers each = 32 numbers in total | |
print(mlp:forward(input)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment