{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/72437782","id":72437782,"diff_hunk":"@@ -201,26 +240,25 @@ def enet_coordinate_descent(np.ndarray[DOUBLE, ndim=1] w,\n \n                 if w_ii != 0.0:\n                     # R += w_ii * X[:,ii]\n-                    daxpy(n_samples, w_ii,\n-                          <DOUBLE*>(X.data + ii * n_samples * sizeof(DOUBLE)),\n-                          1, <DOUBLE*>R.data, 1)\n+                    axpy(n_samples, w_ii, &X_data[ii * n_samples], 1,\n+                         R_data, 1)\n \n                 # tmp = (X[:,ii]*R).sum()\n-                tmp = ddot(n_samples,\n-                           <DOUBLE*>(X.data + ii * n_samples * sizeof(DOUBLE)),\n-                           1, <DOUBLE*>R.data, 1)\n+                if floating is float:\n+                    tmp = dsdot(n_samples, &X_data[ii * n_samples], 1, R_data, 1)","path":"sklearn/linear_model/cd_fast.pyx","position":235,"original_position":235,"commit_id":"5fe3844a2217277170e7830025f3a34e56499085","original_commit_id":"dfaedcfa6374890580479e0cc9f927806af95179","user":{"login":"yenchenlin","id":7057863,"avatar_url":"https://avatars.githubusercontent.com/u/7057863?v=3","gravatar_id":"","url":"https://api.github.com/users/yenchenlin","html_url":"https://github.com/yenchenlin","followers_url":"https://api.github.com/users/yenchenlin/followers","following_url":"https://api.github.com/users/yenchenlin/following{/other_user}","gists_url":"https://api.github.com/users/yenchenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yenchenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenchenlin/subscriptions","organizations_url":"https://api.github.com/users/yenchenlin/orgs","repos_url":"https://api.github.com/users/yenchenlin/repos","events_url":"https://api.github.com/users/yenchenlin/events{/privacy}","received_events_url":"https://api.github.com/users/yenchenlin/received_events","type":"User","site_admin":false},"body":"Yeah it's because `tmp` won't be used to perform operation with other variables.\r\n\r\nActually, computation of `XtA` [here](https://github.com/scikit-learn/scikit-learn/pull/6913/files#diff-5d8b82d506a543bd684a1d403d5941e0R280) can use `dsdot` too.","created_at":"2016-07-27T13:25:05Z","updated_at":"2016-07-27T13:25:05Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/6913#discussion_r72437782","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/72437782"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/6913#discussion_r72437782"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913","id":74539276,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/6913","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/6913.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/6913.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6913","number":6913,"state":"open","locked":false,"title":"[WIP] Make CD use fused types","user":{"login":"yenchenlin","id":7057863,"avatar_url":"https://avatars.githubusercontent.com/u/7057863?v=3","gravatar_id":"","url":"https://api.github.com/users/yenchenlin","html_url":"https://github.com/yenchenlin","followers_url":"https://api.github.com/users/yenchenlin/followers","following_url":"https://api.github.com/users/yenchenlin/following{/other_user}","gists_url":"https://api.github.com/users/yenchenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yenchenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenchenlin/subscriptions","organizations_url":"https://api.github.com/users/yenchenlin/orgs","repos_url":"https://api.github.com/users/yenchenlin/repos","events_url":"https://api.github.com/users/yenchenlin/events{/privacy}","received_events_url":"https://api.github.com/users/yenchenlin/received_events","type":"User","site_admin":false},"body":"According to #5464, current implementation of **ElasticNet** and **Lasso** in scikit-learn constrain the input to be `np.float64`, which is a waste of space.\r\n\r\nThis PR try to make CD algorithms support fused types when fitting `np.float32` dense data and therefore reduce redundant data copy.\r\n\r\n- [x] Make inline helper functions support fused types\r\n- [x] Make dense CD ElasticNet support fused types\r\n- [x] Add warning when alpha close to zero and X is `np.float32`\r\n- [x] Add tests\r\n\r\n**\\*\\*UPDATE 7/7**\r\n\r\nHere is the memory profiling results when fitting `np.float32` data:\r\n\r\n- master\r\n\r\n![master](https://cloud.githubusercontent.com/assets/7057863/16658531/4fae265c-4499-11e6-98c2-2905f6a72c41.png)\r\n\r\n- this branch\r\n\r\n![float32](https://cloud.githubusercontent.com/assets/7057863/16658248/41bc5858-4498-11e6-8050-c1fa1a0c9004.png)\r\n\r\n**\\*\\*UPDATE 7/12**\r\n\r\nHere is the memory profiling results when fitting **sparse** `np.float32` data:\r\n\r\n- master\r\n\r\n![64](https://cloud.githubusercontent.com/assets/7057863/16752698/416bed74-4816-11e6-8d55-513cbf62f597.png)\r\n\r\n- this branch\r\n\r\n![32](https://cloud.githubusercontent.com/assets/7057863/16752696/3e2af95c-4816-11e6-95ed-2a5154267a6f.png)\r\n\r\n\r\n\r\n","created_at":"2016-06-21T01:34:06Z","updated_at":"2016-07-27T13:25:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f43c12837573b0bf22b5c6aefbb6faaaa5320008","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6913/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/5fe3844a2217277170e7830025f3a34e56499085","head":{"label":"yenchenlin:cd-fused-types","ref":"cd-fused-types","sha":"5fe3844a2217277170e7830025f3a34e56499085","user":{"login":"yenchenlin","id":7057863,"avatar_url":"https://avatars.githubusercontent.com/u/7057863?v=3","gravatar_id":"","url":"https://api.github.com/users/yenchenlin","html_url":"https://github.com/yenchenlin","followers_url":"https://api.github.com/users/yenchenlin/followers","following_url":"https://api.github.com/users/yenchenlin/following{/other_user}","gists_url":"https://api.github.com/users/yenchenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yenchenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenchenlin/subscriptions","organizations_url":"https://api.github.com/users/yenchenlin/orgs","repos_url":"https://api.github.com/users/yenchenlin/repos","events_url":"https://api.github.com/users/yenchenlin/events{/privacy}","received_events_url":"https://api.github.com/users/yenchenlin/received_events","type":"User","site_admin":false},"repo":{"id":50281797,"name":"scikit-learn","full_name":"yenchenlin/scikit-learn","owner":{"login":"yenchenlin","id":7057863,"avatar_url":"https://avatars.githubusercontent.com/u/7057863?v=3","gravatar_id":"","url":"https://api.github.com/users/yenchenlin","html_url":"https://github.com/yenchenlin","followers_url":"https://api.github.com/users/yenchenlin/followers","following_url":"https://api.github.com/users/yenchenlin/following{/other_user}","gists_url":"https://api.github.com/users/yenchenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yenchenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenchenlin/subscriptions","organizations_url":"https://api.github.com/users/yenchenlin/orgs","repos_url":"https://api.github.com/users/yenchenlin/repos","events_url":"https://api.github.com/users/yenchenlin/events{/privacy}","received_events_url":"https://api.github.com/users/yenchenlin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yenchenlin/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/yenchenlin/scikit-learn","forks_url":"https://api.github.com/repos/yenchenlin/scikit-learn/forks","keys_url":"https://api.github.com/repos/yenchenlin/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yenchenlin/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yenchenlin/scikit-learn/teams","hooks_url":"https://api.github.com/repos/yenchenlin/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/yenchenlin/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/yenchenlin/scikit-learn/events","assignees_url":"https://api.github.com/repos/yenchenlin/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/yenchenlin/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/yenchenlin/scikit-learn/tags","blobs_url":"https://api.github.com/repos/yenchenlin/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yenchenlin/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yenchenlin/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/yenchenlin/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yenchenlin/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/yenchenlin/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/yenchenlin/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/yenchenlin/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/yenchenlin/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/yenchenlin/scikit-learn/subscription","commits_url":"https://api.github.com/repos/yenchenlin/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/yenchenlin/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/yenchenlin/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/yenchenlin/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/yenchenlin/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/yenchenlin/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yenchenlin/scikit-learn/merges","archive_url":"https://api.github.com/repos/yenchenlin/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yenchenlin/scikit-learn/downloads","issues_url":"https://api.github.com/repos/yenchenlin/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/yenchenlin/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/yenchenlin/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/yenchenlin/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yenchenlin/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/yenchenlin/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/yenchenlin/scikit-learn/deployments","created_at":"2016-01-24T10:01:07Z","updated_at":"2016-01-24T10:01:14Z","pushed_at":"2016-07-27T12:26:42Z","git_url":"git://github.com/yenchenlin/scikit-learn.git","ssh_url":"git@github.com:yenchenlin/scikit-learn.git","clone_url":"https://github.com/yenchenlin/scikit-learn.git","svn_url":"https://github.com/yenchenlin/scikit-learn","homepage":"http://scikit-learn.org","size":73206,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"92853f99f2324609d6dd5504fdbe969f96da818d","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/deployments","created_at":"2010-08-17T09:43:38Z","updated_at":"2016-07-27T12:59:34Z","pushed_at":"2016-07-27T08:37:15Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":121915,"stargazers_count":12556,"watchers_count":12556,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7272,"mirror_url":null,"open_issues_count":1244,"forks":7272,"open_issues":1244,"watchers":12556,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/6913"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6913"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6913/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6913/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/5fe3844a2217277170e7830025f3a34e56499085"}}}}
{"actor":{"display_login":"yenchenlin"}}