{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/150","labels_url":"https://api.github.com/repos/Theano/Theano/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/150/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/150/events","html_url":"https://github.com/Theano/Theano/issues/150","id":2035053,"number":150,"title":"Op/optimization TODO: log determinant","user":{"login":"dwf","id":60206,"avatar_url":"https://avatars.githubusercontent.com/u/60206?v=3","gravatar_id":"","url":"https://api.github.com/users/dwf","html_url":"https://github.com/dwf","followers_url":"https://api.github.com/users/dwf/followers","following_url":"https://api.github.com/users/dwf/following{/other_user}","gists_url":"https://api.github.com/users/dwf/gists{/gist_id}","starred_url":"https://api.github.com/users/dwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwf/subscriptions","organizations_url":"https://api.github.com/users/dwf/orgs","repos_url":"https://api.github.com/users/dwf/repos","events_url":"https://api.github.com/users/dwf/events{/privacy}","received_events_url":"https://api.github.com/users/dwf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Theano/Theano/labels/Enhancement","name":"Enhancement","color":"02d7e1"},{"url":"https://api.github.com/repos/Theano/Theano/labels/Stability","name":"Stability","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2011-10-24T15:46:19Z","updated_at":"2016-01-28T08:25:19Z","closed_at":null,"body":"Now that we have a determinant Op we should probably look into this.\r\n\r\nThere are numerically stable ways to compute the natural logarithm of the determinant, a quantity which is often needed in evaluating the log probability of a multivariate Gaussian distribution. NumPy provides this as [`numpy.slogdet`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.slogdet.html) for \"sign log determinant\" (it computes `log(abs(det(X))`) and also returns the sign of the determinant).\r\n\r\nThe derivative of the log determinant also has a particularly simple form as `inv(X).T == inv(X.T)`."},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/176049166","html_url":"https://github.com/Theano/Theano/issues/150#issuecomment-176049166","issue_url":"https://api.github.com/repos/Theano/Theano/issues/150","id":176049166,"user":{"login":"harpone","id":5112840,"avatar_url":"https://avatars.githubusercontent.com/u/5112840?v=3","gravatar_id":"","url":"https://api.github.com/users/harpone","html_url":"https://github.com/harpone","followers_url":"https://api.github.com/users/harpone/followers","following_url":"https://api.github.com/users/harpone/following{/other_user}","gists_url":"https://api.github.com/users/harpone/gists{/gist_id}","starred_url":"https://api.github.com/users/harpone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harpone/subscriptions","organizations_url":"https://api.github.com/users/harpone/orgs","repos_url":"https://api.github.com/users/harpone/repos","events_url":"https://api.github.com/users/harpone/events{/privacy}","received_events_url":"https://api.github.com/users/harpone/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T08:25:19Z","updated_at":"2016-01-28T08:25:19Z","body":"Found a couple of implementations on Github. [This one](https://github.com/FlorianSeidel/GOL/blob/9f7716e78a78fbdd7ae8ecac5a58b701f6a4da41/gol/goal/constraints.py) does an SVD first and takes the log of the diagonal (not sure why it's diagonal squared... need to check the math; also has a funny expression for the gradient... it's correct but computationally expensive).\r\n\r\n[This one](https://github.com/kolia/subunits/blob/05f40cbc45214d80567b132c95f16913ca2a0cc7/kolia_theano.py#L12) uses numpy's slogdet.\r\n\r\nAny preferences? SVD on GPU should be a simple copy/paste job I think, but I haven't found any CUDA/PyCUDA/gnumpy code for the slogdet..."}}