{"action":"created","issue":{"url":"https://api.github.com/repos/accord-net/framework/issues/68","labels_url":"https://api.github.com/repos/accord-net/framework/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/accord-net/framework/issues/68/comments","events_url":"https://api.github.com/repos/accord-net/framework/issues/68/events","html_url":"https://github.com/accord-net/framework/pull/68","id":65667782,"number":68,"title":"Bug in Kernels","user":{"login":"NikolasMarkou","id":1175820,"avatar_url":"https://avatars.githubusercontent.com/u/1175820?v=3","gravatar_id":"","url":"https://api.github.com/users/NikolasMarkou","html_url":"https://github.com/NikolasMarkou","followers_url":"https://api.github.com/users/NikolasMarkou/followers","following_url":"https://api.github.com/users/NikolasMarkou/following{/other_user}","gists_url":"https://api.github.com/users/NikolasMarkou/gists{/gist_id}","starred_url":"https://api.github.com/users/NikolasMarkou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikolasMarkou/subscriptions","organizations_url":"https://api.github.com/users/NikolasMarkou/orgs","repos_url":"https://api.github.com/users/NikolasMarkou/repos","events_url":"https://api.github.com/users/NikolasMarkou/events{/privacy}","received_events_url":"https://api.github.com/users/NikolasMarkou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-01T12:03:56Z","updated_at":"2015-04-02T21:19:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/accord-net/framework/pulls/68","html_url":"https://github.com/accord-net/framework/pull/68","diff_url":"https://github.com/accord-net/framework/pull/68.diff","patch_url":"https://github.com/accord-net/framework/pull/68.patch"},"body":"Gaussian Distribution is -e^(-x^2/2)*x * constant\r\nsince x is assumed to be always squared the correct\r\nderivative is -e^(x*0.5)*Math.Sqrt(x) * constant,\r\n"},"comment":{"url":"https://api.github.com/repos/accord-net/framework/issues/comments/89047200","html_url":"https://github.com/accord-net/framework/pull/68#issuecomment-89047200","issue_url":"https://api.github.com/repos/accord-net/framework/issues/68","id":89047200,"user":{"login":"cesarsouza","id":528455,"avatar_url":"https://avatars.githubusercontent.com/u/528455?v=3","gravatar_id":"","url":"https://api.github.com/users/cesarsouza","html_url":"https://github.com/cesarsouza","followers_url":"https://api.github.com/users/cesarsouza/followers","following_url":"https://api.github.com/users/cesarsouza/following{/other_user}","gists_url":"https://api.github.com/users/cesarsouza/gists{/gist_id}","starred_url":"https://api.github.com/users/cesarsouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesarsouza/subscriptions","organizations_url":"https://api.github.com/users/cesarsouza/orgs","repos_url":"https://api.github.com/users/cesarsouza/repos","events_url":"https://api.github.com/users/cesarsouza/events{/privacy}","received_events_url":"https://api.github.com/users/cesarsouza/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T21:19:17Z","updated_at":"2015-04-02T21:19:17Z","body":"Hi Nikolas,\r\n\r\nI got some time to look more carefully into this issue. The framework was supposed to be using the definitions given in:\r\nhttps://courses.csail.mit.edu/6.869/handouts/PAMIMeanshift.pdf and http://www.serc.iisc.ernet.in/~venky/SE263/slides/Mean-Shift-Theory.pdf\r\n\r\nIn the first paper, the Gaussian kernel profile is being defined in equation 9 as ```exp(0.5 * x)``` (without squares). As such, it's derivative should have been ```-0.5 * exp(0.5 * x)```. I agree that the current framework implementation (as of version 2.14) is wrong, but I think the correction should be to set the profile as ```-0.5 * exp(0.5 * x)``` rather than ``` -e^(x0.5)*Math.Sqrt(x) * constant```. I will also check the other usages in MeanShift to see if they all agree with those definitions.\r\n\r\nPS: As you correctly guessed, yes the framework is dropping many constants because they are not needed by the Mean-Shift algorithm. Mean-Shift normalizes the kernel profile derivatives, so any common multiplicative constants would have been normalized at the end. Are you trying to use the kernel profiles and derivatives for something else than Mean-Shift? In this case I agree that it could be better to offer also the complete implementation with the constants as you initially suggested.\r\n\r\nBest regards,\r\nCesar"}}