Skip to content

Commit 018913a

Browse files
theogfdevmotion
andauthored
Apply suggestions from code review
Co-authored-by: David Widmann <[email protected]>
1 parent 2315bfe commit 018913a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/create_kernel.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Here are a few ways depending on how complicated your kernel is :
88

99
If your kernel function is of the form `k(x, y) = f(d(x, y))` where `d(x, y)` is a `PreMetric`,
1010
you can construct your custom kernel by defining `kappa` and `metric` for your kernel.
11-
Here is for example how one can define the `SqExponentialKernel` again :
11+
Here is for example how one can define the `SqExponentialKernel` again:
1212

1313
```julia
1414
struct MyKernel <: KernelFunctions.SimpleKernel end
@@ -28,15 +28,15 @@ struct MyKernel <: KernelFunctions.Kernel end
2828
(::MyKernel)(x, y) = asin(dot(x, y) / sqrt((1 + sum(abs2, x)) * (1 + sum(abs2, y))))
2929
```
3030

31-
Note that `BaseKernel` do not use `Distances.jl` and can therefore be a bit slower.
31+
Note that `Kernel` do not use `Distances.jl` and can therefore be a bit slower.
3232

3333
### Additional Options
3434

35-
Finally there are additional functions you can define to bring in more features :
35+
Finally there are additional functions you can define to bring in more features:
3636
- Define the trainable parameters of your kernel with `KernelFunctions.trainable(k)` which should return a `Tuple` of your parameters.
3737
This parameters will be then passed to `Flux.params` function
3838
- `KernelFunctions.iskroncompatible(k)`, if your kernel factorizes in the dimensions. You can declare your kernel as `iskroncompatible(k) = true`
3939
- `KernelFunctions.dim`: by default the dimension of the inputs will only be checked for vectors of `AbstractVector{<:Real}`.
4040
If you want to check the dimensions of your inputs, dispatch the `dim` function on your kernel. Note that `0` is the default.
41-
- You can also redefine the `kernelmatrix(k, x, y)...` functions for your kernel to eventually optimize the computations of your kernel.
42-
- `Base.print(io::IO, k::Kernel)`, if you want to specialize the printing of your kernel
41+
- You can also redefine the `kernelmatrix(k, x, y)` functions for your kernel to eventually optimize the computations of your kernel.
42+
- `Base.show(io::IO, k::Kernel)`, if you want to specialize the printing of your kernel

0 commit comments

Comments
 (0)