Skip to content

Extend lengthscale tip #476

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 5 commits into from
Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/src/userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For example, a squared exponential kernel is created by
k = SqExponentialKernel()
```

!!! tip "How do I set the lengthscale?"
!!! tip "How do I set the lengthscale(s)?"
Instead of having lengthscale(s) for each kernel we use [`Transform`](@ref) objects which act on the inputs before passing them to the kernel. Note that the transforms such as [`ScaleTransform`](@ref) and [`ARDTransform`](@ref) _multiply_ the input by a scale factor, which corresponds to the _inverse_ of the lengthscale.
For example, a lengthscale of 0.5 is equivalent to premultiplying the input by 2.0, and you can create the corresponding kernel in either of the following equivalent ways:
```julia
Expand All @@ -19,7 +19,12 @@ For example, a squared exponential kernel is created by
```julia
k = with_lengthscale(SqExponentialKernel(), 0.5)
```
[`with_lengthscale`](@ref) also works with vector-valued lengthscales for ARD.
[`with_lengthscale`](@ref) also works with vector-valued lengthscales for multiple-dimensional inputs, and is equivalent to pre-composing with an [`ARDTransform`](@ref):
```julia
length_scales = [1.0, 2.0]
k = with_lengthscale(SqExponentialKernel(), length_scales)
k = SqExponentialKernel() ∘ ARDTransform(1 ./ length_scales)
```
Check the [Input Transforms](@ref input_transforms) page for more details.

!!! tip "How do I set the kernel variance?"
Expand Down