{"action":"created","issue":{"url":"https://api.github.com/repos/rwth-i6/returnn/issues/102","repository_url":"https://api.github.com/repos/rwth-i6/returnn","labels_url":"https://api.github.com/repos/rwth-i6/returnn/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/rwth-i6/returnn/issues/102/comments","events_url":"https://api.github.com/repos/rwth-i6/returnn/issues/102/events","html_url":"https://github.com/rwth-i6/returnn/issues/102","id":393077113,"node_id":"MDU6SXNzdWUzOTMwNzcxMTM=","number":102,"title":"Factored Neural Machine Translation","user":{"login":"patrick-wilken","id":41630502,"node_id":"MDQ6VXNlcjQxNjMwNTAy","avatar_url":"https://avatars2.githubusercontent.com/u/41630502?v=4","gravatar_id":"","url":"https://api.github.com/users/patrick-wilken","html_url":"https://github.com/patrick-wilken","followers_url":"https://api.github.com/users/patrick-wilken/followers","following_url":"https://api.github.com/users/patrick-wilken/following{/other_user}","gists_url":"https://api.github.com/users/patrick-wilken/gists{/gist_id}","starred_url":"https://api.github.com/users/patrick-wilken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrick-wilken/subscriptions","organizations_url":"https://api.github.com/users/patrick-wilken/orgs","repos_url":"https://api.github.com/users/patrick-wilken/repos","events_url":"https://api.github.com/users/patrick-wilken/events{/privacy}","received_events_url":"https://api.github.com/users/patrick-wilken/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-20T14:46:47Z","updated_at":"2018-12-20T20:16:30Z","closed_at":null,"author_association":"NONE","body":"I am in the process of implementing (Target-)[Factored Neural Machine Translation](https://arxiv.org/abs/1609.04621). This is what I've got so far: https://github.com/patrick-wilken/returnn-examples/blob/master/factored-nmt\r\n\r\nI have problems creating a config that works for both training and search. I have to comment line 126 of https://github.com/patrick-wilken/returnn-examples/blob/master/factored-nmt/config to make it work in training (and uncomment it to make it work in search).\r\n\r\nThis has to do with the ChoiceLayer in line 124, which provides the true label In training instead of being evaluated. The true label seems to have a time axis, so a shape of `()` is invalid (as it should include the time axis).\r\nIn search however, the choice layer is evaluated in each step, so its output has no time dimension. Therefore `\"shape\": ()` should be correct. But by default it is set to `(None,)`, which causes the following error: https://gist.github.com/patrick-wilken/5eba7a3d209f7a1e470b6082fef2dd6d. Looking at `get_out_data_from_opts` of ChoiceLayer it looks like the time dimension is always included, as we're just getting the shape from data. Is this correct? What would be the proper way to fix it?"},"comment":{"url":"https://api.github.com/repos/rwth-i6/returnn/issues/comments/449122770","html_url":"https://github.com/rwth-i6/returnn/issues/102#issuecomment-449122770","issue_url":"https://api.github.com/repos/rwth-i6/returnn/issues/102","id":449122770,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTEyMjc3MA==","user":{"login":"albertz","id":59132,"node_id":"MDQ6VXNlcjU5MTMy","avatar_url":"https://avatars0.githubusercontent.com/u/59132?v=4","gravatar_id":"","url":"https://api.github.com/users/albertz","html_url":"https://github.com/albertz","followers_url":"https://api.github.com/users/albertz/followers","following_url":"https://api.github.com/users/albertz/following{/other_user}","gists_url":"https://api.github.com/users/albertz/gists{/gist_id}","starred_url":"https://api.github.com/users/albertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertz/subscriptions","organizations_url":"https://api.github.com/users/albertz/orgs","repos_url":"https://api.github.com/users/albertz/repos","events_url":"https://api.github.com/users/albertz/events{/privacy}","received_events_url":"https://api.github.com/users/albertz/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T20:16:30Z","updated_at":"2018-12-20T20:16:30Z","author_association":"MEMBER","body":"Setting `shape` explicitly is problematic for the reasons you describe.\r\nBut not setting `shape` should work I think in both cases, or maybe there is a bug somewhere. Not setting the shape should then by default take the shape from the first source layer (i.e. `output` here). And this is the right thing, right? I would debug where that goes wrong. Maybe you can create a reduced test case, and then fix it.\r\n\r\nAbout creating dedicated layers: Not sure if that really makes it simpler. Maybe you safe one line in your config, but then imagine someone else reading your config who is not familiar with your very special new layer. He would not understand what the config is doing without also looking at the code of your special layer. That is why I try to only have very generic layers which are more or less clear/straightforward about what they do. If you want to discuss further, maybe independent from the GitHub issue here. I talked with Julian today and we plan to have a meeting together early next year.\r\n"}}
{"actor":{"display_login":"albertz"}}