-
Notifications
You must be signed in to change notification settings - Fork 36
Add Gabor Kernel #52
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
Add Gabor Kernel #52
Conversation
Actually, I think we do not need the length scale and could only keep the period, since if |
Can't we just define it as a product of a Squared exponential and cosine actually? |
Co-Authored-By: David Widmann <[email protected]>
@theogf I am not exactly sure to how to accommodate the the different scaling for inputs of |
I think this would look like |
@theogf Shouldn't it be this? |
|
I guess the |
I'm wondering, if we actually need a separate type for the Gabor kernel since it can be composed of function GaborKernel(; ell = nothing, p = nothing)
if ell === nothing
if p === nothing
return SqExponentialKernel() * CosineKernel()
else
return SqExponentialKernel() * transform(CosineKernel(), 1 ./ p)
end
elseif p === nothing
return transform(SqExponentialKernel(), 1 ./ ell) * CosineKernel()
else
return transform(SqExponentialKernel(), 1 ./ ell) * transform(CosineKernel(), 1 ./ p)
end
end |
IMO it would be good to be able to use the |
Isn't that "out of the box"? You just call
I haven't benchmarked it but I would assume that most of the time (in particular for higher dimensional inputs) is spent in evaluating the kernels and not in computing the transforms. It just felt a bit unnecessary to perform these additional computations if it's so easy to avoid them. |
@devmotion Sorry, I think I misinterpreted what you meant. If you mean to say that we construct just a function called |
I see @sharanry point, we could eventually write the GaborKernel as a wrapper around what you described : struct GaborKernel{K<:Kernel} <: Kernel
k::K
end And create the constructor as @devmotion described it. One can then create |
@theogf But would this also create problems if we intend to make the parameters learnable? |
No it would be fine as it would just be a wrapper, one would need to create the trainable function on |
@theogf @devmotion Can we merge this? |
Issue #44
Gabor kernel with length scale ell and period p. Given by
I don't think we can get rid of period and length scale using
ScaledKernel
like we did in #45. Please let me know if I am wrong or if there any other way.References: