Skip to content

Commit ba7b37c

Browse files
authored
Extend lengthscale tip (JuliaGaussianProcesses#476)
* Extend lengthscale tip * Tweak docstring * Pluralise title of tip
1 parent e42d89d commit ba7b37c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/src/userguide.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For example, a squared exponential kernel is created by
88
k = SqExponentialKernel()
99
```
1010

11-
!!! tip "How do I set the lengthscale?"
11+
!!! tip "How do I set the lengthscale(s)?"
1212
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.
1313
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:
1414
```julia
@@ -19,7 +19,12 @@ For example, a squared exponential kernel is created by
1919
```julia
2020
k = with_lengthscale(SqExponentialKernel(), 0.5)
2121
```
22-
[`with_lengthscale`](@ref) also works with vector-valued lengthscales for ARD.
22+
[`with_lengthscale`](@ref) also works with vector-valued lengthscales for multiple-dimensional inputs, and is equivalent to pre-composing with an [`ARDTransform`](@ref):
23+
```julia
24+
length_scales = [1.0, 2.0]
25+
k = with_lengthscale(SqExponentialKernel(), length_scales)
26+
k = SqExponentialKernel() ∘ ARDTransform(1 ./ length_scales)
27+
```
2328
Check the [Input Transforms](@ref input_transforms) page for more details.
2429

2530
!!! tip "How do I set the kernel variance?"

0 commit comments

Comments
 (0)