You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/ImprovedBraninFunction.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The Branin Function is commonly used as a test function for metamodelling in computer experiments, especially in the context of optimization.
4
4
5
-
# Modifications for Improved Branin Function:
5
+
##Modifications for Improved Branin Function:
6
6
7
7
To enhance the Branin function, changes were made to introduce irregularities, variability, and a dynamic aspect to its landscape. Here's an example:
8
8
@@ -27,7 +27,7 @@ end
27
27
28
28
This improved function now incorporates irregularities, variability, and a dynamic aspect. These changes aim to make the optimization landscape more challenging and realistic.
29
29
30
-
# Using the Improved Branin Function:
30
+
##Using the Improved Branin Function:
31
31
32
32
After defining the improved Branin function, you can proceed to test different surrogates and visualize their performance using the updated function. Here's an example of using the improved function with the Radial Basis surrogate:
Copy file name to clipboardexpand all lines: docs/src/InverseDistance.md
+31-32
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
# InverseDistance Surrogate Tutorial
2
+
1
3
The **Inverse Distance Surrogate** is an interpolating method, and in this method, the unknown points are calculated with a weighted average of the sampling points. This model uses the inverse distance between the unknown and training points to predict the unknown point. We do not need to fit this model because the response of an unknown point x is computed with respect to the distance between x and the training points.
2
4
3
5
Let's optimize the following function to use Inverse Distance Surrogate:
@@ -9,17 +11,16 @@ First of all, we have to import these two packages: `Surrogates` and `Plots`.
9
11
```@example Inverse_Distance1D
10
12
using Surrogates
11
13
using Plots
12
-
default()
13
14
```
14
15
15
16
### Sampling
16
17
17
-
We choose to sample f in 25 points between 0 and 10 using the `sample` function. The sampling points are chosen using a Low Discrepancy, this can be done by passing `HaltonSample()` to the `sample` function.
18
+
We choose to sample f in 1000 points between 0 and 10 using the `sample` function. The sampling points are chosen using a Low Discrepancy, this can be done by passing `HaltonSample()` to the `sample` function.
18
19
19
20
```@example Inverse_Distance1D
20
21
f(x) = sin(x) + sin(x)^2 + sin(x)^3
21
22
22
-
n_samples = 25
23
+
n_samples = 100
23
24
lower_bound = 0.0
24
25
upper_bound = 10.0
25
26
x = sample(n_samples, lower_bound, upper_bound, HaltonSample())
@@ -55,7 +54,7 @@ Having built a surrogate, we can now use it to search for minima in our original
55
54
To optimize using our surrogate we call `surrogate_optimize` method. We choose to use Stochastic RBF as the optimization technique and again Sobol sampling as the sampling technique.
First of all we will define the `Schaffer` function we are going to build a surrogate for. Notice, how its argument is a vector of numbers, one for each coordinate, and its output is a scalar.
Let's define our bounds, this time we are working in two dimensions. In particular we want our first dimension `x` to have bounds `-5, 10`, and `0, 15` for the second dimension. We are taking 60 samples of the space using Sobol Sequences. We then evaluate our function on all the sampling points.
85
+
Let's define our bounds, this time we are working in two dimensions. In particular we want our first dimension `x` to have bounds `-5, 10`, and `0, 15` for the second dimension. We are taking 100 samples of the space using Sobol Sequences. We then evaluate our function on all the sampling points.
Copy file name to clipboardexpand all lines: docs/src/LinearSurrogate.md
+31-34
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,15 @@ First of all we have to import these two packages: `Surrogates` and `Plots`.
9
9
```@example linear_surrogate1D
10
10
using Surrogates
11
11
using Plots
12
-
default()
13
12
```
14
13
15
14
### Sampling
16
15
17
-
We choose to sample f in 20 points between 0 and 10 using the `sample` function. The sampling points are chosen using a Sobol sequence, this can be done by passing `SobolSample()` to the `sample` function.
16
+
We choose to sample f in 100 points between 0 and 10 using the `sample` function. The sampling points are chosen using a Sobol sequence, this can be done by passing `SobolSample()` to the `sample` function.
18
17
19
18
```@example linear_surrogate1D
20
-
f(x) = sin(x) + log(x)
21
-
n_samples = 20
19
+
f(x) = 2 * x + 10.0
20
+
n_samples = 100
22
21
lower_bound = 5.2
23
22
upper_bound = 12.5
24
23
x = sample(n_samples, lower_bound, upper_bound, SobolSample())
@@ -35,8 +34,6 @@ We can simply calculate `linear_surrogate` for any value.
35
34
36
35
```@example linear_surrogate1D
37
36
my_linear_surr_1D = LinearSurrogate(x, y, lower_bound, upper_bound)
@@ -56,7 +53,7 @@ Having built a surrogate, we can now use it to search for minima in our original
56
53
To optimize using our surrogate we call `surrogate_optimize` method. We choose to use Stochastic RBF as the optimization technique and again Sobol sampling as the sampling technique.
First of all we will define the `Egg Holder` function we are going to build a surrogate for. Notice, one how its argument is a vector of numbers, one for each coordinate, and its output is a scalar.
Let's define our bounds, this time we are working in two dimensions. In particular we want our first dimension `x` to have bounds `-10, 5`, and `0, 15` for the second dimension. We are taking 50 samples of the space using Sobol Sequences. We then evaluate our function on all of the sampling points.
83
+
Let's define our bounds, this time we are working in two dimensions. In particular we want our first dimension `x` to have bounds `-10, 5`, and `0, 15` for the second dimension. We are taking 100 samples of the space using Sobol Sequences. We then evaluate our function on all of the sampling points.
0 commit comments