{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tfjs/issues/448","repository_url":"https://api.github.com/repos/tensorflow/tfjs","labels_url":"https://api.github.com/repos/tensorflow/tfjs/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tfjs/issues/448/comments","events_url":"https://api.github.com/repos/tensorflow/tfjs/issues/448/events","html_url":"https://github.com/tensorflow/tfjs/issues/448","id":333686499,"node_id":"MDU6SXNzdWUzMzM2ODY0OTk=","number":448,"title":"Fit gets slower and slower after each call","user":{"login":"MicheleLambertucci","id":15233143,"node_id":"MDQ6VXNlcjE1MjMzMTQz","avatar_url":"https://avatars0.githubusercontent.com/u/15233143?v=4","gravatar_id":"","url":"https://api.github.com/users/MicheleLambertucci","html_url":"https://github.com/MicheleLambertucci","followers_url":"https://api.github.com/users/MicheleLambertucci/followers","following_url":"https://api.github.com/users/MicheleLambertucci/following{/other_user}","gists_url":"https://api.github.com/users/MicheleLambertucci/gists{/gist_id}","starred_url":"https://api.github.com/users/MicheleLambertucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicheleLambertucci/subscriptions","organizations_url":"https://api.github.com/users/MicheleLambertucci/orgs","repos_url":"https://api.github.com/users/MicheleLambertucci/repos","events_url":"https://api.github.com/users/MicheleLambertucci/events{/privacy}","received_events_url":"https://api.github.com/users/MicheleLambertucci/received_events","type":"User","site_admin":false},"labels":[{"id":891379995,"node_id":"MDU6TGFiZWw4OTEzNzk5OTU=","url":"https://api.github.com/repos/tensorflow/tfjs/labels/perf","name":"perf","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-19T14:03:13Z","updated_at":"2018-06-19T15:08:05Z","closed_at":null,"author_association":"NONE","body":"I'm not sure if this is intended (like sgd gets computationally heavier over time or something), but since I wasn't able to find any information about this behaviour I decided to post it here.\r\n\r\n#### TensorFlow.js version\r\n\"@tensorflow/tfjs@0.11.6\":\r\nversion: \"0.11.6\"\r\n\r\n#### Browser version\r\nVersion 67.0.3396.87 (official build) (64 bit)\r\n\r\n#### Problem\r\nEach time model.fit is called, the computational time required for it to end increases.\r\n\r\n#### Code to reproduce the bug\r\nCode to reproduce:\r\n```\r\nasync function execute(){\r\n\tconst model = tf.sequential();\r\n\tmodel.add(tf.layers.dense({\r\n\t\tunits: 1,\r\n\t\tinputShape: [1]\r\n\t}));\r\n\tmodel.compile({\r\n\t\tloss: 'meanSquaredError',\r\n\t\toptimizer: 'sgd'\r\n\t});\r\n\tconst xs = tf.tensor2d([1, 2, 3, 4], [4, 1]);\r\n\tconst ys = tf.tensor2d([1, 3, 5, 7], [4, 1]);\r\n\r\n\tfor(let i = 0; i < 10000; i++){\r\n                var t0 = performance.now();\r\n\t\tconst h = await model.fit(xs, ys);\r\n\t\tvar t1 = performance.now();\r\n                console.log(t1-t0);\r\n\t}\t\r\n}\r\nexecute();\r\n```\r\n\r\nI also repeated this test with a slightly difference: I collected each deltaTime and pushed it in an array. Then I plotted the gathered values:\r\n![chrome_2018-06-19_15-57-27](https://user-images.githubusercontent.com/15233143/41601757-82a3b772-73d9-11e8-98fb-094fa0ccf1ea.png)\r\n\r\nI don't really know if it's related, but I have an AMD RX480 as GPU."},"comment":{"url":"https://api.github.com/repos/tensorflow/tfjs/issues/comments/398433958","html_url":"https://github.com/tensorflow/tfjs/issues/448#issuecomment-398433958","issue_url":"https://api.github.com/repos/tensorflow/tfjs/issues/448","id":398433958,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODQzMzk1OA==","user":{"login":"MicheleLambertucci","id":15233143,"node_id":"MDQ6VXNlcjE1MjMzMTQz","avatar_url":"https://avatars0.githubusercontent.com/u/15233143?v=4","gravatar_id":"","url":"https://api.github.com/users/MicheleLambertucci","html_url":"https://github.com/MicheleLambertucci","followers_url":"https://api.github.com/users/MicheleLambertucci/followers","following_url":"https://api.github.com/users/MicheleLambertucci/following{/other_user}","gists_url":"https://api.github.com/users/MicheleLambertucci/gists{/gist_id}","starred_url":"https://api.github.com/users/MicheleLambertucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicheleLambertucci/subscriptions","organizations_url":"https://api.github.com/users/MicheleLambertucci/orgs","repos_url":"https://api.github.com/users/MicheleLambertucci/repos","events_url":"https://api.github.com/users/MicheleLambertucci/events{/privacy}","received_events_url":"https://api.github.com/users/MicheleLambertucci/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T15:08:05Z","updated_at":"2018-06-19T15:08:05Z","author_association":"NONE","body":"@caisq Tried with 0.11.4.\r\nThe function duration seems to be **constant over time** in 0.11.4:\r\n![image](https://user-images.githubusercontent.com/15233143/41606057-1bc703ce-73e3-11e8-9908-c61068d5738e.png)\r\n\r\n\r\n"}}
{"actor":{"display_login":"MicheleLambertucci"}}