{"action":"created","issue":{"url":"https://api.github.com/repos/trthatcher/MLKernels.jl/issues/2","labels_url":"https://api.github.com/repos/trthatcher/MLKernels.jl/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/trthatcher/MLKernels.jl/issues/2/comments","events_url":"https://api.github.com/repos/trthatcher/MLKernels.jl/issues/2/events","html_url":"https://github.com/trthatcher/MLKernels.jl/issues/2","id":70175248,"number":2,"title":"Derivatives (wrt parameters and input values)","user":{"login":"st--","id":5763727,"avatar_url":"https://avatars.githubusercontent.com/u/5763727?v=3","gravatar_id":"","url":"https://api.github.com/users/st--","html_url":"https://github.com/st--","followers_url":"https://api.github.com/users/st--/followers","following_url":"https://api.github.com/users/st--/following{/other_user}","gists_url":"https://api.github.com/users/st--/gists{/gist_id}","starred_url":"https://api.github.com/users/st--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/st--/subscriptions","organizations_url":"https://api.github.com/users/st--/orgs","repos_url":"https://api.github.com/users/st--/repos","events_url":"https://api.github.com/users/st--/events{/privacy}","received_events_url":"https://api.github.com/users/st--/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"trthatcher","id":4790109,"avatar_url":"https://avatars.githubusercontent.com/u/4790109?v=3","gravatar_id":"","url":"https://api.github.com/users/trthatcher","html_url":"https://github.com/trthatcher","followers_url":"https://api.github.com/users/trthatcher/followers","following_url":"https://api.github.com/users/trthatcher/following{/other_user}","gists_url":"https://api.github.com/users/trthatcher/gists{/gist_id}","starred_url":"https://api.github.com/users/trthatcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trthatcher/subscriptions","organizations_url":"https://api.github.com/users/trthatcher/orgs","repos_url":"https://api.github.com/users/trthatcher/repos","events_url":"https://api.github.com/users/trthatcher/events{/privacy}","received_events_url":"https://api.github.com/users/trthatcher/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-04-22T16:34:16Z","updated_at":"2015-04-28T18:15:29Z","closed_at":null,"body":"Hi,\r\n\r\nto be able to use this kernel module in my Gaussian Process regression code - instead of rolling my own covariance kernels, which do basically the same, just not as fancy as your code - I will need the derivatives of kernels, both with respect to the parameters (for optimizing log marginal likelihoods) and with respect to input values (for training from and prediction of derivatives of function values, not just the function values themselves). What are your thoughts (if any) on the interface for that ?\r\n\r\nHave a look at https://github.com/st--/juliagp/blob/master/covariances.jl for how I've implemented it so far...\r\n\r\n-ST"},"comment":{"url":"https://api.github.com/repos/trthatcher/MLKernels.jl/issues/comments/97159954","html_url":"https://github.com/trthatcher/MLKernels.jl/issues/2#issuecomment-97159954","issue_url":"https://api.github.com/repos/trthatcher/MLKernels.jl/issues/2","id":97159954,"user":{"login":"trthatcher","id":4790109,"avatar_url":"https://avatars.githubusercontent.com/u/4790109?v=3","gravatar_id":"","url":"https://api.github.com/users/trthatcher","html_url":"https://github.com/trthatcher","followers_url":"https://api.github.com/users/trthatcher/followers","following_url":"https://api.github.com/users/trthatcher/following{/other_user}","gists_url":"https://api.github.com/users/trthatcher/gists{/gist_id}","starred_url":"https://api.github.com/users/trthatcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trthatcher/subscriptions","organizations_url":"https://api.github.com/users/trthatcher/orgs","repos_url":"https://api.github.com/users/trthatcher/repos","events_url":"https://api.github.com/users/trthatcher/events{/privacy}","received_events_url":"https://api.github.com/users/trthatcher/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T18:15:29Z","updated_at":"2015-04-28T18:15:29Z","body":"I am in no way attached to the names/labels of anything. If you have alternatives, please do make a suggestion. \r\n\r\nAlso, I have not used Leibniz notation in forever... I totally switched up the order in the differential... I thought it was ∂²x for some reason. \r\n\r\nI'll just give you a quick overview of how things were intended to work and the story behind kernelize. Scanning through a data matrix and computing the covariance function/kernels gets really slow. However, I saw that the majority of kernels that I had come across were either an element-wise function of the scalar product or squared euclidean distance. I could compute the gramian quickly using BLAS. Similarly, transforming the gramian so that each ij element represented the norm squared of the lag (or error) between two vectors xi and xj was straight forward. This form the gramian I named \"lagged_gramian\". Separable kernels are similar story where the transformation is element wise on the vectors themselves (not their dot product or euclidean distance).\r\n\r\nBasically, if X is your vectors and G is your gramian, Gl is your lagged gramian, and f is your kernelize function (returns matrix) then:\r\n\r\nScalar Product K = f(G)\r\nEuclidean Distance K = f(Gl)\r\nSeparable K = f(X)*f(X)'\r\n\r\nDoes that make sense? If you have a better descriptor for this function, let me know.\r\n\r\nAs for the dots/norm calculation. I haven't had a chance to look too deeply into them... up until now I was just concerned about calculating the kernel matrix for something else I was working on. Element wise, the gramian returned by BLAS is a squared norm or dot product which was why I initially designed it to take in a dot(ϵ,ϵ) or dot(x,y). I would prefer to continue to use something like ϵ=x-y;dot(ϵ,ϵ).\r\n\r\nLong story short, I'd like to stick with squared norm but I'm indifferent on how it's defined/named.\r\n\r\nfunction sqnorm(x,y) \r\nϵ=x-y;\r\ndot(ϵ,ϵ)\r\nend\r\n\r\nDoes that sound good?"}}