Skip to content

Add Piecewise Polynomial Kernel #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 9, 2020
Merged

Add Piecewise Polynomial Kernel #76

merged 19 commits into from
Apr 9, 2020

Conversation

sharanry
Copy link
Contributor

@sharanry sharanry commented Apr 1, 2020

Issue #44

Piecewise Polynomial Kernel

Piecewise Polynomial covariance function with compact support, v = 0,1,2,3.
The kernel functions are 2v times continuously differentiable and the corresponding
processes are hence v times mean-square differentiable. The kernel function is:

$$κ(x,y) = max(1-r,0)^(j+v) * f(r,j) with j = floor(D/2)+v+1$$

where r is the Mahalanobis distance sqrt(maha(x,z)).

References
https://github.com/alshedivat/gpml/blob/master/cov/covPP.m
www.gaussianprocess.org/gpml/code/matlab/doc/manual.pdf pg44

Issues
Currently the dimension D of the inputs x and y is not being taken properly to calculate j.

@sharanry sharanry changed the title [WIP]Add Piecewise Polynomial Kernel Add Piecewise Polynomial Kernel Apr 5, 2020
Copy link
Member

@willtebbutt willtebbutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review purely addresses style, in particular: 92 char lim on line length, consistent spacing between function arguments / operator arguments, and the use of semicolons to denote keyword arguments.

This quite possibly comes across as very pedantic, but it would be good to start getting this right. (Someone needs to go through the entire code base at some point, and to start enforcing this. We really need a linter that helps out our adhering to the Invenia style guide ).

@theogf
Copy link
Member

theogf commented Apr 8, 2020

@sharanry Note that if you use Juno, you can automatically format your code as @willtebbutt by using the shortcut ctrl+J -> ctrl+F

@sharanry
Copy link
Contributor Author

sharanry commented Apr 8, 2020

@theogf Thanks for the suggestion! I unfortunately use emacs or VS Code. I will check if there is any equivalent linter.

@willtebbutt
Copy link
Member

@sharanry Note that if you use Juno, you can automatically format your code as @willtebbutt by using the shortcut ctrl+J -> ctrl+F

I was not aware of this... do you know what it hooks into?

@theogf
Copy link
Member

theogf commented Apr 8, 2020

@willtebbutt Yes it is based on https://github.com/domluna/JuliaFormatter.jl

@sharanry
Copy link
Contributor Author

sharanry commented Apr 8, 2020

@willtebbutt Yes it is based on https://github.com/domluna/JuliaFormatter.jl

@theogf I guess we could format the whole of current codebase using this?

julia> using JuliaFormatter

# Recursively formats all Julia files in the current directory
julia> format(".")

@willtebbutt
Copy link
Member

Hmmm yeah, I'm wary of doing that without first understanding the style guide that it's implicitly imposing. I'm a big fan of Invenia's BlueStyle, and it's what I try to follow in my own packages and would like us to follow here.

@theogf
Copy link
Member

theogf commented Apr 8, 2020

Moreover that would break all the version history of the files at once...

@willtebbutt
Copy link
Member

Moreover that would break all the version history of the files at once...

Haha true. It's something that we can do incrementally in any case. We should definitely start being strict about style now that there are quite a few of us working on this though.

@willtebbutt
Copy link
Member

@sharanry are you happy with this now? I'm happy to merge if you are.

@sharanry
Copy link
Contributor Author

sharanry commented Apr 9, 2020

@willtebbutt LGTM Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants