{"action":"closed","issue":{"url":"https://api.github.com/repos/rstudio/keras/issues/548","repository_url":"https://api.github.com/repos/rstudio/keras","labels_url":"https://api.github.com/repos/rstudio/keras/issues/548/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/keras/issues/548/comments","events_url":"https://api.github.com/repos/rstudio/keras/issues/548/events","html_url":"https://github.com/rstudio/keras/issues/548","id":364441969,"node_id":"MDU6SXNzdWUzNjQ0NDE5Njk=","number":548,"title":"Training multi output model with option 'sample_weight'","user":{"login":"faltinl","id":22592465,"node_id":"MDQ6VXNlcjIyNTkyNDY1","avatar_url":"https://avatars2.githubusercontent.com/u/22592465?v=4","gravatar_id":"","url":"https://api.github.com/users/faltinl","html_url":"https://github.com/faltinl","followers_url":"https://api.github.com/users/faltinl/followers","following_url":"https://api.github.com/users/faltinl/following{/other_user}","gists_url":"https://api.github.com/users/faltinl/gists{/gist_id}","starred_url":"https://api.github.com/users/faltinl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faltinl/subscriptions","organizations_url":"https://api.github.com/users/faltinl/orgs","repos_url":"https://api.github.com/users/faltinl/repos","events_url":"https://api.github.com/users/faltinl/events{/privacy}","received_events_url":"https://api.github.com/users/faltinl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-09-27T12:02:48Z","updated_at":"2018-09-29T16:14:04Z","closed_at":"2018-09-29T16:14:04Z","author_association":"NONE","body":"I want to use the option `sample_weight` of `fit()` to influence the weight of particular samples - depending on class in the first place but later on depending on additional different criteria (e.g. reliability of particular data etc.). My multi output model is running under Keras Functional API with fixed data (i.e. not using a data generator).\r\n\r\nA first try (`samplweights` being `num [1:3000, 1] 0.4617 0.0683 0.0683 ...`, corresponding to a training length of 3000)  using the expression \r\n\r\n`sample_weight = samplweights`\r\n\r\nin the parameter list of `fit(...)` produces the error message:\r\n\r\nError in py_call_impl(callable, dots$args, dots$keywords) : \r\n  TypeError: The model has multiple outputs, so `sample_weight` should be either a list or a dict. Provided `sample_weight` type not understood: [[0.46175535]\r\n [0.06826814]\r\n [0.06826814]\r\n ...\r\n [0.06826814]\r\n [0.06826814]\r\n [0.46175535]]   \r\n\r\nSo I changed the expression (again, `samplweights` being `num [1:3000, 1] ...`, as above)   to\r\n\r\n` sample_weight = list(\"outpt3\"=samplweights, \"outpt4\"=samplweights, ...)`\r\n\r\njust to produce the next error message:\r\n\r\nError in py_call_impl(callable, dots$args, dots$keywords) : \r\n  Matrix type cannot be converted to python (only integer, numeric, complex, logical, and character matrixes can be converted \r\n\r\n**And this error message remains exactly the same** when `samplweights` converted to a numerical vector, i.e. as `num [1:3000] ...`, or, by means of `array_reshape()`, `num [1:3000(1d)] ...` is being used. Now I am at a loss what to do. \r\n\r\nAny idea and/or suggestion would be welcome - tnx in advance."}}
{"actor":{"display_login":"skeydan"}}