{"action":"opened","issue":{"url":"https://api.github.com/repos/nicholas-leonard/dp/issues/192","repository_url":"https://api.github.com/repos/nicholas-leonard/dp","labels_url":"https://api.github.com/repos/nicholas-leonard/dp/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/nicholas-leonard/dp/issues/192/comments","events_url":"https://api.github.com/repos/nicholas-leonard/dp/issues/192/events","html_url":"https://github.com/nicholas-leonard/dp/issues/192","id":142126527,"number":192,"title":"textsampler.lua:38: bad argument #3","user":{"login":"ThorJonsson","id":5082461,"avatar_url":"https://avatars.githubusercontent.com/u/5082461?v=3","gravatar_id":"","url":"https://api.github.com/users/ThorJonsson","html_url":"https://github.com/ThorJonsson","followers_url":"https://api.github.com/users/ThorJonsson/followers","following_url":"https://api.github.com/users/ThorJonsson/following{/other_user}","gists_url":"https://api.github.com/users/ThorJonsson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThorJonsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThorJonsson/subscriptions","organizations_url":"https://api.github.com/users/ThorJonsson/orgs","repos_url":"https://api.github.com/users/ThorJonsson/repos","events_url":"https://api.github.com/users/ThorJonsson/events{/privacy}","received_events_url":"https://api.github.com/users/ThorJonsson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-20T04:00:54Z","updated_at":"2016-03-20T04:00:54Z","closed_at":null,"body":"Hi! I'm getting the following error running the recurrentlanguagemodel code.\r\n```lua\r\n`FileLogger: log will be written to /home/user/save/comp:1458431781:1/log    \r\n==> epoch # 1 for optimizer :   \r\n [======================================== 4000/4000 ==================================>]  Tot: 12s48ms | Step: 4ms     \r\n==> example speed = 216.87828023852 examples/s  \r\n [======================================== 24000/24000 ================================>]  Tot: 2m49s | Step: 7ms       \r\n/home/user/torch/install/bin/luajit: ...2/torch/install/share/lua/5.1/dp/sampler/textsampler.lua:38: bad argument #3 to 'narrow' (out of range at /home/user/torch/pkg/torch/lib/TH/generic/THTensor.c:351)\r\nstack traceback:\r\n        [C]: in function 'narrow'\r\n        ...2/torch/install/share/lua/5.1/dp/sampler/textsampler.lua:38: in function 'sampler'\r\n        ...torch/install/share/lua/5.1/dp/propagator/propagator.lua:117: in function 'propagateEpoch'\r\n        ...torch/install/share/lua/5.1/dp/propagator/experiment.lua:116: in function 'run'\r\n        lstm_lm_example.lua:360: in main chunk\r\n        [C]: in function 'dofile'\r\n        ...hj92/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk\r\n        [C]: at 0x00405d70\r\n```\r\n\r\nI can get around this error by setting \r\n```lua \r\ntrainOnly = true`\r\n```\r\n\r\nThis is the model:\r\n```lua\r\n{\r\n   accUpdate : false\r\n   batchSize : 64\r\n   bidirectional : true\r\n   cuda : false\r\n   cutoffNorm : -1\r\n   dataPath : \"/home/user/data\"\r\n   dataset : \"PennTreeBank\"\r\n   decayFactor : 0.001\r\n   dropout : true\r\n   dropoutProb : 0.5\r\n   evalSize : 100\r\n   forestGaterSize : \"{}\"\r\n   hiddenSize : {200,200}\r\n   learningRate : 0.1\r\n   lrDecay : \"linear\"\r\n   lstm : true\r\n   maxEpoch : 400\r\n   maxOutNorm : 2\r\n   maxTries : 30\r\n   maxWait : 4\r\n   minLR : 1e-05\r\n   momentum : 0\r\n   progress : true\r\n   rho : 20\r\n   saturateEpoch : 300\r\n   schedule : {}\r\n   silent : false\r\n   small : false\r\n   softmaxforest : false\r\n   softmaxtree : false\r\n   testFile : \"test.txt\"\r\n   tiny : false\r\n   trainEpochSize : 4000\r\n   trainFile : \"train.txt\"\r\n   trainOnly : false\r\n   uniform : -1\r\n   useDevice : 1\r\n   validEpochSize : 24000\r\n   validFile : \"valid.txt\"\r\n   xpPath : \"\"\r\n   zeroFirst : false\r\n}       \r\nWarning : the Perplexity of a bidirectional RNN/LSTM isn't necessarily mathematically valid as it uses P(x_t|x_{/neq t}) instead of P(x_t|x_{<t}), which is used for unidirectional RNN/LSTMs. You can however still use predictions to measure pseudo-likelihood.      \r\nLanguage Model :        \r\nnn.Sequential {\r\n  [input -> (1) -> (2) -> (3) -> (4) -> (5) -> output]\r\n  (1): nn.LookupTable\r\n  (2): nn.Dropout(0.5, busy)\r\n  (3): nn.SplitTable\r\n  (4): nn.BiSequencerLM {\r\n    (  fwd  ): nn.Sequential {\r\n      |      [input -> (1) -> (2) -> (3) -> (4) -> output]\r\n      |      (1): nn.Sequencer @ nn.FastLSTM(200 -> 200)\r\n      |      (2): nn.Sequencer @ nn.Recursor @ nn.Dropout(0.5, busy)                                                                                                03:55\r\n      |      (3): nn.Sequencer @ nn.FastLSTM(200 -> 200)                                                                                                            03:58\r\n      |      (4): nn.Sequencer @ nn.Recursor @ nn.Dropout(0.5, busy)\r\n      |    }\r\n    (  bwd  ): nn.Sequential {\r\n      |      [input -> (1) -> (2) -> (3) -> output]\r\n      |      (1): nn.ReverseTable\r\n      |      (2): nn.Sequential {\r\n      |        [input -> (1) -> (2) -> (3) -> (4) -> output]\r\n      |        (1): nn.Sequencer @ nn.FastLSTM(200 -> 200)\r\n      |        (2): nn.Sequencer @ nn.Recursor @ nn.Dropout(0.5, busy)\r\n      |        (3): nn.Sequencer @ nn.FastLSTM(200 -> 200)\r\n      |        (4): nn.Sequencer @ nn.Recursor @ nn.Dropout(0.5, busy)\r\n      |      }\r\n      |      (3): nn.ReverseTable\r\n      |    }\r\n    ( merge ): nn.Sequential {\r\n      |      [input -> (1) -> (2) -> output]\r\n      |      (1): nn.ZipTable\r\n      |      (2): nn.Sequencer @ nn.Recursor @ nn.JoinTable\r\n      |    }\r\n  }\r\n  (5): nn.Sequencer @ nn.Recursor @ nn.Sequential {\r\n    [input -> (1) -> (2) -> output]\r\n    (1): nn.Linear(400 -> 9663)\r\n    (2): nn.LogSoftMax\r\n  }\r\n}\r\n```\r\n\r\nI would be very thankful for any help you can provide to solve this issue."}}