{"action":"created","issue":{"url":"https://api.github.com/repos/Dobiasd/frugally-deep/issues/56","repository_url":"https://api.github.com/repos/Dobiasd/frugally-deep","labels_url":"https://api.github.com/repos/Dobiasd/frugally-deep/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/Dobiasd/frugally-deep/issues/56/comments","events_url":"https://api.github.com/repos/Dobiasd/frugally-deep/issues/56/events","html_url":"https://github.com/Dobiasd/frugally-deep/issues/56","id":330183357,"node_id":"MDU6SXNzdWUzMzAxODMzNTc=","number":56,"title":"How to predict input shape of (depth*N, width, channel)?","user":{"login":"gajop","id":64901,"node_id":"MDQ6VXNlcjY0OTAx","avatar_url":"https://avatars1.githubusercontent.com/u/64901?v=4","gravatar_id":"","url":"https://api.github.com/users/gajop","html_url":"https://github.com/gajop","followers_url":"https://api.github.com/users/gajop/followers","following_url":"https://api.github.com/users/gajop/following{/other_user}","gists_url":"https://api.github.com/users/gajop/gists{/gist_id}","starred_url":"https://api.github.com/users/gajop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajop/subscriptions","organizations_url":"https://api.github.com/users/gajop/orgs","repos_url":"https://api.github.com/users/gajop/repos","events_url":"https://api.github.com/users/gajop/events{/privacy}","received_events_url":"https://api.github.com/users/gajop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-07T09:11:02Z","updated_at":"2018-06-08T05:31:06Z","closed_at":null,"author_association":"NONE","body":"In my use case, I have a tensor with `(depth*N, width, channel)` shape and I would like to use `predict` or `predict_multi` and get `(d_out*N, ...)` shape of output. Right now I need to do a lot of reshaping which makes for quite ugly code (shown below).\r\nI was a bit surprised with how fdeep::tensor3_to_depth_slices works. \r\n\r\nAny suggestions how this code could be simplified?\r\n\r\n```c++\r\nauto vec_of_tensors = fdeep::tensor3_to_depth_slices(\r\n\tfdeep::internal::reshape_tensor3(t, std::vector<int>({ 1, 128, 64 }))\r\n);\r\nstd::vector<fdeep::tensor3s> input(vec_of_tensors.size());\r\nstd::transform(vec_of_tensors.begin(), vec_of_tensors.end(), input.begin(),\r\n\t[] (const fdeep::tensor3& ts) -> fdeep::tensor3s { return fdeep::tensor3s({ ts }); });\r\n```"},"comment":{"url":"https://api.github.com/repos/Dobiasd/frugally-deep/issues/comments/395652122","html_url":"https://github.com/Dobiasd/frugally-deep/issues/56#issuecomment-395652122","issue_url":"https://api.github.com/repos/Dobiasd/frugally-deep/issues/56","id":395652122,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTY1MjEyMg==","user":{"login":"gajop","id":64901,"node_id":"MDQ6VXNlcjY0OTAx","avatar_url":"https://avatars1.githubusercontent.com/u/64901?v=4","gravatar_id":"","url":"https://api.github.com/users/gajop","html_url":"https://github.com/gajop","followers_url":"https://api.github.com/users/gajop/followers","following_url":"https://api.github.com/users/gajop/following{/other_user}","gists_url":"https://api.github.com/users/gajop/gists{/gist_id}","starred_url":"https://api.github.com/users/gajop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajop/subscriptions","organizations_url":"https://api.github.com/users/gajop/orgs","repos_url":"https://api.github.com/users/gajop/repos","events_url":"https://api.github.com/users/gajop/events{/privacy}","received_events_url":"https://api.github.com/users/gajop/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T05:31:06Z","updated_at":"2018-06-08T05:31:06Z","author_association":"NONE","body":"I don't think `keras.layers.Reshape` is of exact use here, as the network is already properly accepting shapes like `(c: ?, w: 128, h: 1)` (at least in Python Keras it works). What I am trying to do is convert my `(c: 1, w: 128 * num_of_instances, h: 1)` into `(c: num_of_instances, w: 128, h: 1)`. \r\n\r\nRegarding the functions you proposed, as I understand it, `fdeep::tensor3s unstack_tensor3s` would work exactly the same as `fdeep::tensor3_to_depth_slices` for the special case where `depth = 1` (which is also my case)? While it would be useful, it still essentially produces a tensor3s, where I need a vector of tensor3s. \r\n\r\nThe ugliest part of code in my previous examples is the below excerpt, where I am wrapping each of the tensor elements in a one-element vector (due to there being only one input):\r\n```\r\nstd::transform(vec_of_tensors.begin(), vec_of_tensors.end(), input.begin(),\r\n\t[] (const fdeep::tensor3& ts) -> fdeep::tensor3s { return fdeep::tensor3s({ ts }); });\r\n```\r\nIt is required because the functional API can take a variable number of inputs (which I use in Model1 quite well). \r\n\r\n> Mhh, perhaps there is another misunderstanding. In general frugally-deep does not support batch processing.\r\n\r\nMaybe I'm misunderstanding something indeed, but isn't `model::predict_multi` essentially \"batch processing\"?"}}
{"actor":{"display_login":"gajop"}}