AdversarialNetsPapers https://github.com/soumith/cvpr2015 Code and data for a bunch of recent papers (special thanks to Jiwei Li and Alexander Miller): J. Weston. Dialog-based Language Learning. J. Li, A. H. Miller, S. Chopra, M.'A Ranzato, J. Weston. Dialogue Learning With Human-in-the-Loop. J. Li, A. H. Miller, S. Chopra, M.'A Ranzato, J. Weston. Learning through Dialogue Interactions. A. H. Miller, A. Fisch, J. Dodge, A. Karimi, A. Bordes, J. Weston. Key-Value Memory Networks for Directly Reading Documents. https://github.com/poolio/unrolled_gan https://github.com/liuzhuang13/DenseNet https://github.com/carpedm20/awesome-torch
The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations Monday, May 2nd - 2:00 – 5:00 pm Alternative structures for character-level RNNs Tuesday, May 3rd – 2:00 – 5:00 pm Stacked What-Where Auto-encoders Universum Prescription: Regularization using Unlabeled Data Wednesday, May 4th – 2:00 – 5:00 pm Evaluating Prerequisite Qualities for Learning End-to-End Dialog Systems Particular object retrieval with integral max-pooling of CNN activations Predicting distributions with Linearizing Belief Networks Sequence Level Training with Recurrent Neural Networks Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks Unifying distillation and privileged information Deep Multi Scale Video Prediction Beyond Mean Square Error Metric Learning with Adaptive Dentistry Discrimination Super-resolution with deep convolutional sufficient statistics Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks Better Computer Go Player with Neural Network and Long-term Prediction After the release of DCGAN (and code), which is a neural network that can generate natural images (collaboration between Alec Radford, Luke Metz and me), people from the community (Eugene Kogan and others) have generated their own manga characters, flowers and now their own letters from reading chinese books. Fun stuff. All these generations are the hallucinations of a neural network and are not real. Our paper: http://arxiv.org/abs/1511.06434 https://github.com/mattya/chainer-DCGAN (manga) Looking for more fun stuff from the community.
======================= require 'nn' foo = nn.TemporalConvolution(9,20,5) -- 9 is input dim, 20 is output dim (# of kernels), 5 is window width foo.weight:size() -- if input was 1 dimensional weights would be just 5*20, but because it has 9-d each d has its own weight. 20 45 input1 = torch.rand(100,9) foo:foward(input1) [torch.DoubleTensor of size 96x20] Usually followed by max pooling (usually with a 2x2 pooling window, although 4x4 can be necessary for large input images). ------------------------- tc1 = nn.TemporalConvolution(10,200,3) mp = nn.TemporalMaxPooling(2) relu1 = nn.ReLU() w1 = torch.rand(200,200) b1 = torch.rand(200) w2 = torch.rand(2,200) b2 = torch.rand(2) x = torch.Tensor(200,10) -- 10*200 tc1_out = tc1:forward(x) -- 198 * 200 mp_out = mp:forward(tc1_out) -- 99*200 relu1_out = relu1:forward(mp_out) -- 99*200 reshape_out = torch.select(max_out, 1, 1) -- 200 Returns a new Tensor which is a tensor slice at the given index in the dimension dimmax_out = torch.max(relu1_out,1) -- 1*200 fc1 = torch.tanh(w1 *reshape_out + b1) -- 200 a fully onnected fc2 = w2 * fc1 + b2 -- 2 ============================== ============================== ============================== ------------------------------ New architecture nn = require 'nn' -- define network w1 = torch.rand(200,200) b1 = torch.rand(200) w2 = torch.rand(2,200) b2 = torch.rand(2) ------------------------------- pass data through x = torch.Tensor(200,10) -- 200*10 tc1 = nn.TemporalConvolution(10, 200,3) tc1_out = tc1:forward(x); print('-----tc1_out') ; print(tc1_out:size()) -- 198 * 200 r1 = nn.ReLU() r1_out = r1:forward(tc1_out); print('-----r1_out') ; print(r1_out:size()) -- 99*200 temporalConvolutionDimLoss = math.floor(3/2) * 2 tc2 = nn.TemporalConvolution(200, 200 - temporalConvolutionDimLoss ,3) tc2_out = tc2:forward(r1_out); print('-----tc2_out') ; print(tc2_out:size()) -- 196 * 198 r2 = nn.ReLU() r2_out = r2:forward(tc2_out); print('-----r2_out') ; print(r2_out:size()) -- 196 * 198 dr = nn.Dropout(0.5) dr_out = dr:forward(r2_out); print('-----dr_out') ; print(dr_out:size()) -- 196 * 198 nnMax = nn.Max(2); nnMax_out = nnMax:forward(dr_out); print('-----max_out') ; print(max_out:size()) -- 196 nnReshape = nn.Reshape(200) nnReshape_out = nnReshape:forward(nnMax_out); print('-----nnReshape_out') ; print(nnReshape_out:size()) -- 196 max_out = torch.max(relu1_out,1) -- 1*200 reshape_out = torch.select(max_out, 1, 1) -- 200 Returns a new Tensor which is a tensor slice at the given index in the dimension dimfc1 = torch.tanh(w1 *reshape_out + b1) -- 200 a fully connected fc2 = w2 * fc1 + b2 -- 2
y=torch.rand(5,2,1) x = torch.Tensor(5,10, 200) [0m------ok1.[0m { backward : .[0;35mfunction: 0x7ffb5dcb7e90.[0m entry : .[0;35mfunction: 0x7ffb5dcb7ee0.[0m module : { gradBias : .[0;31mFloatTensor - size: 200.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m inputFrameSize : .[0;36m200.[0m weight : .[0;31mFloatTensor - size: 200x600.[0m bias : .[0;31mFloatTensor - size: 200.[0m dW : .[0;36m1.[0m kW : .[0;36m3.[0m gradWeight : .[0;31mFloatTensor - size: 200x600.[0m outputFrameSize : .[0;36m200.[0m output : .[0;31mFloatTensor - size: 5x8x200.[0m } forward : .[0;35mfunction: 0x7ffb5dcb7e00.[0m } .[0m------ok2.[0m { backward : .[0;35mfunction: 0x7ffb5dcb8470.[0m entry : .[0;35mfunction: 0x7ffb5dcb84b0.[0m module : { val : .[0;36m0.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m inplace : .[0;34mfalse.[0m output : .[0;31mFloatTensor - size: 5x8x200.[0m threshold : .[0;36m0.[0m } forward : .[0;35mfunction: 0x7ffb5dcb8410.[0m } .[0m------ok3.[0m { backward : .[0;35mfunction: 0x7ffb5dcb9450.[0m entry : .[0;35mfunction: 0x7ffb5dcb94a0.[0m module : { gradBias : .[0;31mFloatTensor - size: 200.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m inputFrameSize : .[0;36m200.[0m weight : .[0;31mFloatTensor - size: 200x600.[0m bias : .[0;31mFloatTensor - size: 200.[0m dW : .[0;36m1.[0m kW : .[0;36m3.[0m gradWeight : .[0;31mFloatTensor - size: 200x600.[0m outputFrameSize : .[0;36m200.[0m output : .[0;31mFloatTensor - size: 5x6x200.[0m } forward : .[0;35mfunction: 0x7ffb5dcb93c0.[0m } .[0m------ok4.[0m { backward : .[0;35mfunction: 0x7ffb5dcb9a10.[0m entry : .[0;35mfunction: 0x7ffb5dcb9a50.[0m module : { val : .[0;36m0.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m inplace : .[0;34mfalse.[0m output : .[0;31mFloatTensor - size: 5x6x200.[0m threshold : .[0;36m0.[0m } forward : .[0;35mfunction: 0x7ffb5dcb99b0.[0m } .[0m------ok5.[0m { backward : .[0;35mfunction: 0x7ffb5dcb9f90.[0m entry : .[0;35mfunction: 0x7ffb5dcb9fd0.[0m module : { noise : .[0;31mFloatTensor - size: 5x6x200.[0m v2 : .[0;34mtrue.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m train : .[0;34mtrue.[0m output : .[0;31mFloatTensor - size: 5x6x200.[0m p : .[0;36m0.5.[0m } forward : .[0;35mfunction: 0x7ffb5dcb9f30.[0m } .[0m------ok6.[0m { backward : .[0;35mfunction: 0x7ffb5dcba4a0.[0m entry : .[0;35mfunction: 0x7ffb5dcba4e0.[0m module : { _indices : .[0;31mLongTensor - size: 5x1x200.[0m _output : .[0;31mFloatTensor - size: 5x1x200.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m output : .[0;31mFloatTensor - size: 5x200.[0m dimension : .[0;36m2.[0m } forward : .[0;35mfunction: 0x7ffb5dcba440.[0m } .[0m------ok7.[0m { backward : .[0;35mfunction: 0x7ffb5dcbaab0.[0m entry : .[0;35mfunction: 0x7ffb5dcbaaf0.[0m module : { size : .[0;31mLongStorage - size: 1.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m output : .[0;31mFloatTensor - size: 5x200.[0m batchsize : .[0;31mLongStorage - size: 2.[0m nelement : .[0;36m200.[0m } forward : .[0;35mfunction: 0x7ffb5dcbaa50.[0m } .[0m------ok8.[0m { backward : .[0;35mfunction: 0x7ffb5dcbb640.[0m entry : .[0;35mfunction: 0x7ffb5dcbb690.[0m module : { gradBias : .[0;31mFloatTensor - size: 100.[0m addBuffer : .[0;31mFloatTensor - size: 5.[0m bias : .[0;31mFloatTensor - size: 100.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m gradWeight : .[0;31mFloatTensor - size: 100x200.[0m output : .[0;31mFloatTensor - size: 5x100.[0m weight : .[0;31mFloatTensor - size: 100x200.[0m } forward : .[0;35mfunction: 0x7ffb5dcbb5b0.[0m } .[0m------ok9.[0m { backward : .[0;35mfunction: 0x7ffb5dcbbc00.[0m entry : .[0;35mfunction: 0x7ffb5dcbbc40.[0m module : { val : .[0;36m0.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m inplace : .[0;34mfalse.[0m output : .[0;31mFloatTensor - size: 5x100.[0m threshold : .[0;36m0.[0m } forward : .[0;35mfunction: 0x7ffb5dcbbba0.[0m } .[0m------ok10.[0m { backward : .[0;35mfunction: 0x7ffb5dcbc180.[0m entry : .[0;35mfunction: 0x7ffb5dcbc1c0.[0m module : { noise : .[0;31mFloatTensor - size: 5x100.[0m v2 : .[0;34mtrue.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m train : .[0;34mtrue.[0m output : .[0;31mFloatTensor - size: 5x100.[0m p : .[0;36m0.5.[0m } forward : .[0;35mfunction: 0x7ffb5dcbc120.[0m } .[0m------ok11.[0m { backward : .[0;35mfunction: 0x7ffb5dcbd030.[0m entry : .[0;35mfunction: 0x7ffb5dcbd080.[0m module : { gradBias : .[0;31mFloatTensor - size: 2.[0m addBuffer : .[0;31mFloatTensor - size: 5.[0m bias : .[0;31mFloatTensor - size: 2.[0m gradInput : .[0;31mFloatTensor - empty.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m gradWeight : .[0;31mFloatTensor - size: 2x100.[0m output : .[0;31mFloatTensor - size: 5x2.[0m weight : .[0;31mFloatTensor - size: 2x100.[0m } forward : .[0;35mfunction: 0x7ffb5dcbcfa0.[0m } .[0m------ok12.[0m { backward : .[0;35mfunction: 0x7ffb5dcbd4f0.[0m entry : .[0;35mfunction: 0x7ffb5dcbd530.[0m module : { output : .[0;31mFloatTensor - size: 5x2.[0m _type : .[1;30m".[0m.[0;32mtorch.FloatTensor.[0m.[1;30m".[0m gradInput : .[0;31mFloatTensor - empty.[0m } forward : .[0;35mfunction: 0x7ffb5dcbd490.[0m } .[0m----loss calculated.[0m .[0;36m6.6006166040897.[0m ========= original torch example require "nn" mlp = nn.Sequential(); -- make a multi-layer perceptron inputs = 3; outputs = 1; HUs = 20; -- parameters mlp:add(nn.Linear(inputs, HUs)) mlp:add(nn.Tanh()) mlp:add(nn.Linear(HUs, outputs)) input= torch.randn(2); mlp:forward(input) =========== |