{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/176","labels_url":"https://api.github.com/repos/fchollet/keras/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/176/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/176/events","html_url":"https://github.com/fchollet/keras/issues/176","id":82874513,"number":176,"title":"Masks for RNNs","user":{"login":"elanmart","id":10772830,"avatar_url":"https://avatars.githubusercontent.com/u/10772830?v=3","gravatar_id":"","url":"https://api.github.com/users/elanmart","html_url":"https://github.com/elanmart","followers_url":"https://api.github.com/users/elanmart/followers","following_url":"https://api.github.com/users/elanmart/following{/other_user}","gists_url":"https://api.github.com/users/elanmart/gists{/gist_id}","starred_url":"https://api.github.com/users/elanmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elanmart/subscriptions","organizations_url":"https://api.github.com/users/elanmart/orgs","repos_url":"https://api.github.com/users/elanmart/repos","events_url":"https://api.github.com/users/elanmart/events{/privacy}","received_events_url":"https://api.github.com/users/elanmart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-30T18:03:20Z","updated_at":"2015-06-17T23:52:00Z","closed_at":null,"body":"Hey,\r\n\r\nI think it would be cool if we could specify when the recurrent network should stop updating its hidden state. For example if my sequences have max length 100, and a particular example has length of only 10, the network will update its hidden state 90 times before returning the final vector, which is not neccesarly desireable."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/112981956","html_url":"https://github.com/fchollet/keras/issues/176#issuecomment-112981956","issue_url":"https://api.github.com/repos/fchollet/keras/issues/176","id":112981956,"user":{"login":"wxs","id":326559,"avatar_url":"https://avatars.githubusercontent.com/u/326559?v=3","gravatar_id":"","url":"https://api.github.com/users/wxs","html_url":"https://github.com/wxs","followers_url":"https://api.github.com/users/wxs/followers","following_url":"https://api.github.com/users/wxs/following{/other_user}","gists_url":"https://api.github.com/users/wxs/gists{/gist_id}","starred_url":"https://api.github.com/users/wxs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wxs/subscriptions","organizations_url":"https://api.github.com/users/wxs/orgs","repos_url":"https://api.github.com/users/wxs/repos","events_url":"https://api.github.com/users/wxs/events{/privacy}","received_events_url":"https://api.github.com/users/wxs/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T23:52:00Z","updated_at":"2015-06-17T23:52:00Z","body":"> how would masking work with Embedding layers in the case of a separate mask parameter?\r\n\r\nI was thinking of either modifying Embedding to optionally pass-through a mask (following the convention that masks are always concatenated along the time dimension), or else using a Merge to concatenate the embedding with the mask.\r\n\r\n> It would be very easy to rectify the Embedding layer to output all-0 feature vectors for 0-inputs\r\n\r\nHmm, doesn't this introduce a small probability that, for instance, an all 0 vector is learned by the embedding layer which then gets \"stuck\"? I suppose for high-dimensional vectors that's pretty unlikely. But this could happen at any stage of the network. If a value ever \"happens\" to hit 0 suddenly its properties change.\r\n\r\nPerhaps safer to use, e.g. NaN or -Inf but I don't know how those interact with the GPU."}}