{"action":"created","comment":{"url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments/193627694","pull_request_review_id":126635650,"id":193627694,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzYyNzY5NA==","diff_hunk":"@@ -197,21 +212,21 @@ class NormalMixture(Mixture):\n         the component standard deviations\n     tau : array of floats\n         the component precisions\n+    distshape : shape of the Normal component\n+        notice that it should be different than the shape\n+        of the mixture distribution, with one axis being\n+        the number of component.","path":"pymc3/distributions/mixture.py","position":48,"original_position":48,"commit_id":"d259df060751dccd2e1fb4d16c055745ba91a918","original_commit_id":"d259df060751dccd2e1fb4d16c055745ba91a918","user":{"login":"junpenglao","id":12952641,"node_id":"MDQ6VXNlcjEyOTUyNjQx","avatar_url":"https://avatars2.githubusercontent.com/u/12952641?v=4","gravatar_id":"","url":"https://api.github.com/users/junpenglao","html_url":"https://github.com/junpenglao","followers_url":"https://api.github.com/users/junpenglao/followers","following_url":"https://api.github.com/users/junpenglao/following{/other_user}","gists_url":"https://api.github.com/users/junpenglao/gists{/gist_id}","starred_url":"https://api.github.com/users/junpenglao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junpenglao/subscriptions","organizations_url":"https://api.github.com/users/junpenglao/orgs","repos_url":"https://api.github.com/users/junpenglao/repos","events_url":"https://api.github.com/users/junpenglao/events{/privacy}","received_events_url":"https://api.github.com/users/junpenglao/received_events","type":"User","site_admin":false},"body":"Yeah this is a tricky one.\r\n\"a mixture of three 2d normal distributions would have `shape=(3, 2)` and `dist_shape=(2,)`\" this is not correct. A mixture of three 2d normal distributions would have `shape=(..., 2)`, and `dist_shape=(2, 3)`. But I am not sure multi-D normal mixture actually works... \r\nIn practice, if you have a NormalMixture RV that is `shape=(a,b,c,...)`, the component shape get one more axis `comp_shape=(a,b,c,...,k)`, with `k` components. However, passing `comp_shape=(a,b,c,...,k)` (also what the previous code trying to do) break cases when you are using `theano.shared` observed and sample_ppc.","created_at":"2018-06-07T05:15:55Z","updated_at":"2018-06-07T05:15:55Z","html_url":"https://github.com/pymc-devs/pymc3/pull/3004#discussion_r193627694","pull_request_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments/193627694"},"html":{"href":"https://github.com/pymc-devs/pymc3/pull/3004#discussion_r193627694"},"pull_request":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004"}},"in_reply_to_id":193608829},"pull_request":{"url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004","id":192671578,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNjcxNTc4","html_url":"https://github.com/pymc-devs/pymc3/pull/3004","diff_url":"https://github.com/pymc-devs/pymc3/pull/3004.diff","patch_url":"https://github.com/pymc-devs/pymc3/pull/3004.patch","issue_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/3004","number":3004,"state":"open","locked":false,"title":"Fix random sampling in Mixture","user":{"login":"junpenglao","id":12952641,"node_id":"MDQ6VXNlcjEyOTUyNjQx","avatar_url":"https://avatars2.githubusercontent.com/u/12952641?v=4","gravatar_id":"","url":"https://api.github.com/users/junpenglao","html_url":"https://github.com/junpenglao","followers_url":"https://api.github.com/users/junpenglao/followers","following_url":"https://api.github.com/users/junpenglao/following{/other_user}","gists_url":"https://api.github.com/users/junpenglao/gists{/gist_id}","starred_url":"https://api.github.com/users/junpenglao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junpenglao/subscriptions","organizations_url":"https://api.github.com/users/junpenglao/orgs","repos_url":"https://api.github.com/users/junpenglao/repos","events_url":"https://api.github.com/users/junpenglao/events{/privacy}","received_events_url":"https://api.github.com/users/junpenglao/received_events","type":"User","site_admin":false},"body":"The output from sample_ppc does not equal to the shape of the observed sometimes, as the `distribution.shape` of ObservedRVs are `[]`. Initially, this PR adds the specific shape (i.e., shape of the data) to the ObservedRVs, so that generating random sample will have the correct shape, which makes working with random method easier (e.g., PR #2984). However, doing so turns out breaks a lot of examples when `theano.shared` observed is used, as updating the value via `set_values` change the shape.\r\n\r\nNow this PR just fix the mixture random error (close #2954).","created_at":"2018-06-05T11:14:24Z","updated_at":"2018-06-07T05:15:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b70588873ac0dd3446817ffe980bfcef28d6f5ad","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004/commits","review_comments_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004/comments","review_comment_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/3004/comments","statuses_url":"https://api.github.com/repos/pymc-devs/pymc3/statuses/d259df060751dccd2e1fb4d16c055745ba91a918","head":{"label":"junpenglao:fix_mixture_random","ref":"fix_mixture_random","sha":"d259df060751dccd2e1fb4d16c055745ba91a918","user":{"login":"junpenglao","id":12952641,"node_id":"MDQ6VXNlcjEyOTUyNjQx","avatar_url":"https://avatars2.githubusercontent.com/u/12952641?v=4","gravatar_id":"","url":"https://api.github.com/users/junpenglao","html_url":"https://github.com/junpenglao","followers_url":"https://api.github.com/users/junpenglao/followers","following_url":"https://api.github.com/users/junpenglao/following{/other_user}","gists_url":"https://api.github.com/users/junpenglao/gists{/gist_id}","starred_url":"https://api.github.com/users/junpenglao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junpenglao/subscriptions","organizations_url":"https://api.github.com/users/junpenglao/orgs","repos_url":"https://api.github.com/users/junpenglao/repos","events_url":"https://api.github.com/users/junpenglao/events{/privacy}","received_events_url":"https://api.github.com/users/junpenglao/received_events","type":"User","site_admin":false},"repo":{"id":89773565,"node_id":"MDEwOlJlcG9zaXRvcnk4OTc3MzU2NQ==","name":"pymc3","full_name":"junpenglao/pymc3","owner":{"login":"junpenglao","id":12952641,"node_id":"MDQ6VXNlcjEyOTUyNjQx","avatar_url":"https://avatars2.githubusercontent.com/u/12952641?v=4","gravatar_id":"","url":"https://api.github.com/users/junpenglao","html_url":"https://github.com/junpenglao","followers_url":"https://api.github.com/users/junpenglao/followers","following_url":"https://api.github.com/users/junpenglao/following{/other_user}","gists_url":"https://api.github.com/users/junpenglao/gists{/gist_id}","starred_url":"https://api.github.com/users/junpenglao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junpenglao/subscriptions","organizations_url":"https://api.github.com/users/junpenglao/orgs","repos_url":"https://api.github.com/users/junpenglao/repos","events_url":"https://api.github.com/users/junpenglao/events{/privacy}","received_events_url":"https://api.github.com/users/junpenglao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/junpenglao/pymc3","description":"Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano","fork":true,"url":"https://api.github.com/repos/junpenglao/pymc3","forks_url":"https://api.github.com/repos/junpenglao/pymc3/forks","keys_url":"https://api.github.com/repos/junpenglao/pymc3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/junpenglao/pymc3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/junpenglao/pymc3/teams","hooks_url":"https://api.github.com/repos/junpenglao/pymc3/hooks","issue_events_url":"https://api.github.com/repos/junpenglao/pymc3/issues/events{/number}","events_url":"https://api.github.com/repos/junpenglao/pymc3/events","assignees_url":"https://api.github.com/repos/junpenglao/pymc3/assignees{/user}","branches_url":"https://api.github.com/repos/junpenglao/pymc3/branches{/branch}","tags_url":"https://api.github.com/repos/junpenglao/pymc3/tags","blobs_url":"https://api.github.com/repos/junpenglao/pymc3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/junpenglao/pymc3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/junpenglao/pymc3/git/refs{/sha}","trees_url":"https://api.github.com/repos/junpenglao/pymc3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/junpenglao/pymc3/statuses/{sha}","languages_url":"https://api.github.com/repos/junpenglao/pymc3/languages","stargazers_url":"https://api.github.com/repos/junpenglao/pymc3/stargazers","contributors_url":"https://api.github.com/repos/junpenglao/pymc3/contributors","subscribers_url":"https://api.github.com/repos/junpenglao/pymc3/subscribers","subscription_url":"https://api.github.com/repos/junpenglao/pymc3/subscription","commits_url":"https://api.github.com/repos/junpenglao/pymc3/commits{/sha}","git_commits_url":"https://api.github.com/repos/junpenglao/pymc3/git/commits{/sha}","comments_url":"https://api.github.com/repos/junpenglao/pymc3/comments{/number}","issue_comment_url":"https://api.github.com/repos/junpenglao/pymc3/issues/comments{/number}","contents_url":"https://api.github.com/repos/junpenglao/pymc3/contents/{+path}","compare_url":"https://api.github.com/repos/junpenglao/pymc3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/junpenglao/pymc3/merges","archive_url":"https://api.github.com/repos/junpenglao/pymc3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/junpenglao/pymc3/downloads","issues_url":"https://api.github.com/repos/junpenglao/pymc3/issues{/number}","pulls_url":"https://api.github.com/repos/junpenglao/pymc3/pulls{/number}","milestones_url":"https://api.github.com/repos/junpenglao/pymc3/milestones{/number}","notifications_url":"https://api.github.com/repos/junpenglao/pymc3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/junpenglao/pymc3/labels{/name}","releases_url":"https://api.github.com/repos/junpenglao/pymc3/releases{/id}","deployments_url":"https://api.github.com/repos/junpenglao/pymc3/deployments","created_at":"2017-04-29T08:40:00Z","updated_at":"2017-04-29T08:40:03Z","pushed_at":"2018-06-06T09:29:16Z","git_url":"git://github.com/junpenglao/pymc3.git","ssh_url":"git@github.com:junpenglao/pymc3.git","clone_url":"https://github.com/junpenglao/pymc3.git","svn_url":"https://github.com/junpenglao/pymc3","homepage":"http://pymc-devs.github.io/pymc3/","size":304668,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pymc-devs:master","ref":"master","sha":"452be394c891ebc12e79b0ca6e4995dca4740912","user":{"login":"pymc-devs","id":81121,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMTIx","avatar_url":"https://avatars3.githubusercontent.com/u/81121?v=4","gravatar_id":"","url":"https://api.github.com/users/pymc-devs","html_url":"https://github.com/pymc-devs","followers_url":"https://api.github.com/users/pymc-devs/followers","following_url":"https://api.github.com/users/pymc-devs/following{/other_user}","gists_url":"https://api.github.com/users/pymc-devs/gists{/gist_id}","starred_url":"https://api.github.com/users/pymc-devs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymc-devs/subscriptions","organizations_url":"https://api.github.com/users/pymc-devs/orgs","repos_url":"https://api.github.com/users/pymc-devs/repos","events_url":"https://api.github.com/users/pymc-devs/events{/privacy}","received_events_url":"https://api.github.com/users/pymc-devs/received_events","type":"Organization","site_admin":false},"repo":{"id":192904,"node_id":"MDEwOlJlcG9zaXRvcnkxOTI5MDQ=","name":"pymc3","full_name":"pymc-devs/pymc3","owner":{"login":"pymc-devs","id":81121,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMTIx","avatar_url":"https://avatars3.githubusercontent.com/u/81121?v=4","gravatar_id":"","url":"https://api.github.com/users/pymc-devs","html_url":"https://github.com/pymc-devs","followers_url":"https://api.github.com/users/pymc-devs/followers","following_url":"https://api.github.com/users/pymc-devs/following{/other_user}","gists_url":"https://api.github.com/users/pymc-devs/gists{/gist_id}","starred_url":"https://api.github.com/users/pymc-devs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymc-devs/subscriptions","organizations_url":"https://api.github.com/users/pymc-devs/orgs","repos_url":"https://api.github.com/users/pymc-devs/repos","events_url":"https://api.github.com/users/pymc-devs/events{/privacy}","received_events_url":"https://api.github.com/users/pymc-devs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pymc-devs/pymc3","description":"Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano","fork":false,"url":"https://api.github.com/repos/pymc-devs/pymc3","forks_url":"https://api.github.com/repos/pymc-devs/pymc3/forks","keys_url":"https://api.github.com/repos/pymc-devs/pymc3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pymc-devs/pymc3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pymc-devs/pymc3/teams","hooks_url":"https://api.github.com/repos/pymc-devs/pymc3/hooks","issue_events_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/events{/number}","events_url":"https://api.github.com/repos/pymc-devs/pymc3/events","assignees_url":"https://api.github.com/repos/pymc-devs/pymc3/assignees{/user}","branches_url":"https://api.github.com/repos/pymc-devs/pymc3/branches{/branch}","tags_url":"https://api.github.com/repos/pymc-devs/pymc3/tags","blobs_url":"https://api.github.com/repos/pymc-devs/pymc3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pymc-devs/pymc3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pymc-devs/pymc3/git/refs{/sha}","trees_url":"https://api.github.com/repos/pymc-devs/pymc3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pymc-devs/pymc3/statuses/{sha}","languages_url":"https://api.github.com/repos/pymc-devs/pymc3/languages","stargazers_url":"https://api.github.com/repos/pymc-devs/pymc3/stargazers","contributors_url":"https://api.github.com/repos/pymc-devs/pymc3/contributors","subscribers_url":"https://api.github.com/repos/pymc-devs/pymc3/subscribers","subscription_url":"https://api.github.com/repos/pymc-devs/pymc3/subscription","commits_url":"https://api.github.com/repos/pymc-devs/pymc3/commits{/sha}","git_commits_url":"https://api.github.com/repos/pymc-devs/pymc3/git/commits{/sha}","comments_url":"https://api.github.com/repos/pymc-devs/pymc3/comments{/number}","issue_comment_url":"https://api.github.com/repos/pymc-devs/pymc3/issues/comments{/number}","contents_url":"https://api.github.com/repos/pymc-devs/pymc3/contents/{+path}","compare_url":"https://api.github.com/repos/pymc-devs/pymc3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pymc-devs/pymc3/merges","archive_url":"https://api.github.com/repos/pymc-devs/pymc3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pymc-devs/pymc3/downloads","issues_url":"https://api.github.com/repos/pymc-devs/pymc3/issues{/number}","pulls_url":"https://api.github.com/repos/pymc-devs/pymc3/pulls{/number}","milestones_url":"https://api.github.com/repos/pymc-devs/pymc3/milestones{/number}","notifications_url":"https://api.github.com/repos/pymc-devs/pymc3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pymc-devs/pymc3/labels{/name}","releases_url":"https://api.github.com/repos/pymc-devs/pymc3/releases{/id}","deployments_url":"https://api.github.com/repos/pymc-devs/pymc3/deployments","created_at":"2009-05-05T09:43:50Z","updated_at":"2018-06-07T04:54:28Z","pushed_at":"2018-06-06T22:17:03Z","git_url":"git://github.com/pymc-devs/pymc3.git","ssh_url":"git@github.com:pymc-devs/pymc3.git","clone_url":"https://github.com/pymc-devs/pymc3.git","svn_url":"https://github.com/pymc-devs/pymc3","homepage":"http://pymc-devs.github.io/pymc3/","size":229641,"stargazers_count":3319,"watchers_count":3319,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":822,"mirror_url":null,"archived":false,"open_issues_count":250,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":822,"open_issues":250,"watchers":3319,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004"},"html":{"href":"https://github.com/pymc-devs/pymc3/pull/3004"},"issue":{"href":"https://api.github.com/repos/pymc-devs/pymc3/issues/3004"},"comments":{"href":"https://api.github.com/repos/pymc-devs/pymc3/issues/3004/comments"},"review_comments":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004/comments"},"review_comment":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pymc-devs/pymc3/pulls/3004/commits"},"statuses":{"href":"https://api.github.com/repos/pymc-devs/pymc3/statuses/d259df060751dccd2e1fb4d16c055745ba91a918"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"junpenglao"}}