{"action":"created","issue":{"url":"https://api.github.com/repos/pluskid/Mocha.jl/issues/204","repository_url":"https://api.github.com/repos/pluskid/Mocha.jl","labels_url":"https://api.github.com/repos/pluskid/Mocha.jl/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/pluskid/Mocha.jl/issues/204/comments","events_url":"https://api.github.com/repos/pluskid/Mocha.jl/issues/204/events","html_url":"https://github.com/pluskid/Mocha.jl/issues/204","id":157845832,"number":204,"title":"How can I implement a network with multiple datalayers in Mocha?","user":{"login":"AStupidBear","id":16422976,"avatar_url":"https://avatars.githubusercontent.com/u/16422976?v=3","gravatar_id":"","url":"https://api.github.com/users/AStupidBear","html_url":"https://github.com/AStupidBear","followers_url":"https://api.github.com/users/AStupidBear/followers","following_url":"https://api.github.com/users/AStupidBear/following{/other_user}","gists_url":"https://api.github.com/users/AStupidBear/gists{/gist_id}","starred_url":"https://api.github.com/users/AStupidBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AStupidBear/subscriptions","organizations_url":"https://api.github.com/users/AStupidBear/orgs","repos_url":"https://api.github.com/users/AStupidBear/repos","events_url":"https://api.github.com/users/AStupidBear/events{/privacy}","received_events_url":"https://api.github.com/users/AStupidBear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-06-01T08:01:06Z","updated_at":"2016-06-04T08:48:51Z","closed_at":null,"body":"Here is a toy model of my project. Since there's no such a kind of examples in Mocha, I don't know how to deal with the input data.\r\n![net](https://cloud.githubusercontent.com/assets/16422976/15714685/12ac586c-284e-11e6-9a15-2119c017d426.jpg)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pluskid/Mocha.jl/issues/comments/223744728","html_url":"https://github.com/pluskid/Mocha.jl/issues/204#issuecomment-223744728","issue_url":"https://api.github.com/repos/pluskid/Mocha.jl/issues/204","id":223744728,"user":{"login":"AStupidBear","id":16422976,"avatar_url":"https://avatars.githubusercontent.com/u/16422976?v=3","gravatar_id":"","url":"https://api.github.com/users/AStupidBear","html_url":"https://github.com/AStupidBear","followers_url":"https://api.github.com/users/AStupidBear/followers","following_url":"https://api.github.com/users/AStupidBear/following{/other_user}","gists_url":"https://api.github.com/users/AStupidBear/gists{/gist_id}","starred_url":"https://api.github.com/users/AStupidBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AStupidBear/subscriptions","organizations_url":"https://api.github.com/users/AStupidBear/orgs","repos_url":"https://api.github.com/users/AStupidBear/repos","events_url":"https://api.github.com/users/AStupidBear/events{/privacy}","received_events_url":"https://api.github.com/users/AStupidBear/received_events","type":"User","site_admin":false},"created_at":"2016-06-04T08:48:51Z","updated_at":"2016-06-04T08:48:51Z","body":"```julia\r\nfunction dataProvider()\r\n    x=shuffle([linspace(-5,5,10000);])'\r\n    inputBase=x\r\n    outputBase=1./(1+x.^2)\r\n  return inputBase,outputBase\r\nend \r\n```\r\n\r\n```julia\r\ninputBase,outputBase=dataProvider();\r\nLayerSize = 1000\r\n# create the network\r\nd1 = MemoryDataLayer(batch_size=50, data=Array[inputBase,outputBase],tops=[:data1,:label1])\r\nd2 = MemoryDataLayer(batch_size=50, data=Array[inputBase,outputBase],tops=[:data2,:label2])\r\nip1 = InnerProductLayer(name=\"ip1\",neuron=Neurons.ReLU(), output_dim=LayerSize, tops=[:ip1], bottoms=[:data1])\r\nip1_split=SplitLayer(bottoms=[:ip1],tops=[:ip1_ip2,:ip1_o1])\r\nip2 = InnerProductLayer(name=\"ip2\",neuron=Neurons.ReLU(), output_dim=LayerSize, tops=[:ip2], bottoms=[:ip1_ip2,:data2])\r\no1 = InnerProductLayer(name=\"o1\", output_dim=1, tops=[:o1], bottoms=[:ip1_o1] )\r\no2= InnerProductLayer(name=\"o2\", output_dim=1, tops=[:o2], bottoms=[:ip2] )\r\nl1 = SquareLossLayer(name=\"loss\", bottoms=[:o1, :label1])\r\nl2 = SquareLossLayer(name=\"loss\", bottoms=[:o2, :label2])\r\nnet = Net(\"rnn-train\", backend, [d1,ip1,ip1_split,o1,l1,d2,ip2,o2,l2])\r\n```\r\n\r\nGet the following error:\r\n```julia\r\njulia> ip2 = InnerProductLayer(name=\"ip2\",neuron=Neurons.ReLU(), output_dim=LayerSize, tops=[:ip2], bottoms=[:ip1_ip2,:data2])\r\nERROR: AssertionError: length(bottoms) == length(tops)\r\n in __InnerProductLayer#16__ at no file\r\n```"}}
{"actor":{"display_login":"AStupidBear"}}