{"action":"closed","issue":{"url":"https://api.github.com/repos/karpathy/char-rnn/issues/78","labels_url":"https://api.github.com/repos/karpathy/char-rnn/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/karpathy/char-rnn/issues/78/comments","events_url":"https://api.github.com/repos/karpathy/char-rnn/issues/78/events","html_url":"https://github.com/karpathy/char-rnn/issues/78","id":99780085,"number":78,"title":"Question: why doesnt state get reset after each epoch?","user":{"login":"hughperkins","id":123560,"avatar_url":"https://avatars.githubusercontent.com/u/123560?v=3","gravatar_id":"","url":"https://api.github.com/users/hughperkins","html_url":"https://github.com/hughperkins","followers_url":"https://api.github.com/users/hughperkins/followers","following_url":"https://api.github.com/users/hughperkins/following{/other_user}","gists_url":"https://api.github.com/users/hughperkins/gists{/gist_id}","starred_url":"https://api.github.com/users/hughperkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughperkins/subscriptions","organizations_url":"https://api.github.com/users/hughperkins/orgs","repos_url":"https://api.github.com/users/hughperkins/repos","events_url":"https://api.github.com/users/hughperkins/events{/privacy}","received_events_url":"https://api.github.com/users/hughperkins/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-08T07:21:41Z","updated_at":"2015-11-11T14:37:05Z","closed_at":"2015-11-11T14:37:05Z","body":"Hi Andrej,\r\n\r\nI'm still gradually struggling to figure out how LSTM works, so please excuse the naivety of my question.  Looking at the state, it looks like:\r\n- it is zero'd at the start of training, https://github.com/karpathy/char-rnn/blob/master/train.lua#L152\r\n- then gets updated after each `seq_length` sequence https://github.com/karpathy/char-rnn/blob/master/train.lua#L276\r\n- ... and, I think that each character in each mini-batch, eg the first character in each mini-batch, walks over a contiguous set of `input_length / batch_size` characters from the input?\r\n- and so, it seems to make sense to me that whilst the training is walking over these `input_length / batch_size` characters, that the state is persistent, as it is\r\n- but it seems like, at the end of these characters, which corresponds to the end of each epoch, I think?, either the state should be zerod, or else each of the `batch_size` states should be rotated by one place, ie init_state[1][n] becomes init_state[1][b+1], for each b in `batch_size`?  What is missing from my understanding of how this works?\r\n"}}