-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathgabor.jl
25 lines (22 loc) · 876 Bytes
/
gabor.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
gaborkernel(;
sqexponential_transform=IdentityTransform(), cosine_tranform=IdentityTransform()
)
Construct a Gabor kernel with transformations `sqexponential_transform` and
`cosine_transform` of the inputs of the underlying squared exponential and cosine kernel,
respectively.
# Definition
For inputs ``x, x' \\in \\mathbb{R}^d``, the Gabor kernel with transformations ``f``
and ``g`` of the inputs to the squared exponential and cosine kernel, respectively,
is defined as
```math
k(x, x'; f, g) = \\exp\\bigg(- \\frac{\\| f(x) - f(x')\\|_2^2}{2}\\bigg)
\\cos\\big(\\pi \\|g(x) - g(x')\\|_2 \\big).
```
"""
function gaborkernel(;
sqexponential_transform=IdentityTransform(), cosine_transform=IdentityTransform()
)
return (SqExponentialKernel() ∘ sqexponential_transform) *
(CosineKernel() ∘ cosine_transform)
end