From 4d6b8a94a2f12a963ba68f1ca31b309c2d44ec0f Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Sat, 28 Oct 2023 08:03:49 +0000 Subject: [PATCH 1/4] CompatHelper: add new compat entry for Statistics at version 1, (keep existing compat) --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 37edbe32..f4071d0b 100644 --- a/Project.toml +++ b/Project.toml @@ -22,6 +22,7 @@ GLM = "1.3" IterativeSolvers = "0.9" PolyChaos = "0.2" QuasiMonteCarlo = "=0.2.16" +Statistics = "1" Zygote = "0.4, 0.5, 0.6" julia = "1.6" From 0f09233195c031e9d0b1f0ce7fd81c82e1c8265f Mon Sep 17 00:00:00 2001 From: ErikQQY <2283984853@qq.com> Date: Mon, 27 Nov 2023 00:52:39 +0800 Subject: [PATCH 2/4] Fix equations displaying in benchmarks Signed-off-by: ErikQQY <2283984853@qq.com> --- docs/src/Salustowicz.md | 2 +- docs/src/ackley.md | 6 +++--- docs/src/gramacylee.md | 2 +- docs/src/tensor_prod.md | 2 +- docs/src/water_flow.md | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/Salustowicz.md b/docs/src/Salustowicz.md index 3f32b47c..c89d7316 100644 --- a/docs/src/Salustowicz.md +++ b/docs/src/Salustowicz.md @@ -5,7 +5,7 @@ The true underlying function HyGP had to approximate is the 1D Salustowicz funct The Salustowicz benchmark function is as follows: -``f(x) = e^{(-x)} x^3 cos(x) sin(x) (cos(x) sin^2(x) - 1)`` +``f(x) = e^{-x} x^3 \cos(x) \sin(x) (\cos(x) \sin^2(x) - 1)`` Let's import these two packages `Surrogates` and `Plots`: diff --git a/docs/src/ackley.md b/docs/src/ackley.md index db94c639..de312e6e 100644 --- a/docs/src/ackley.md +++ b/docs/src/ackley.md @@ -1,7 +1,7 @@ # Ackley Function The Ackley function is defined as: -``f(x) = -a*exp(-b\sqrt{\frac{1}{d}\sum_{i=1}^d x_i^2}) - exp(\frac{1}{d} \sum_{i=1}^d cos(cx_i)) + a + exp(1)`` +``f(x) = -a*\exp(-b\sqrt{\frac{1}{d}\sum_{i=1}^d x_i^2}) - \exp(\frac{1}{d} \sum_{i=1}^d \cos(cx_i)) + a + \exp(1)`` Usually the recommended values are: ``a = 20``, ``b = 0.2`` and ``c = 2\pi`` Let's see the 1D case. @@ -16,7 +16,7 @@ Now, let's define the `Ackley` function: ```@example ackley function ackley(x) - a, b, c = 20.0, -0.2, 2.0*π + a, b, c = 20.0, 0.2, 2.0*π len_recip = inv(length(x)) sum_sqrs = zero(eltype(x)) sum_cos = sum_sqrs @@ -24,7 +24,7 @@ function ackley(x) sum_cos += cos(c*i) sum_sqrs += i^2 end - return (-a * exp(b * sqrt(len_recip*sum_sqrs)) - + return (-a * exp(-b * sqrt(len_recip*sum_sqrs)) - exp(len_recip*sum_cos) + a + 2.71) end ``` diff --git a/docs/src/gramacylee.md b/docs/src/gramacylee.md index cdc6810a..1221673f 100644 --- a/docs/src/gramacylee.md +++ b/docs/src/gramacylee.md @@ -4,7 +4,7 @@ Gramacy & Lee Function is a continuous function. It is not convex. The function ``x \in [-0.5, 2.5]``. The Gramacy & Lee is as follows: -``f(x) = \frac{sin(10\pi x)}{2x} + (x-1)^4``. +``f(x) = \frac{\sin(10\pi x)}{2x} + (x-1)^4``. Let's import these two packages `Surrogates` and `Plots`: diff --git a/docs/src/tensor_prod.md b/docs/src/tensor_prod.md index afc6c414..832603cc 100644 --- a/docs/src/tensor_prod.md +++ b/docs/src/tensor_prod.md @@ -1,6 +1,6 @@ # Tensor product function The tensor product function is defined as: -``f(x) = \prod_{i=1}^d cos(a\pi x_i)`` +``f(x) = \prod_{i=1}^d \cos(a\pi x_i)`` Let's import Surrogates and Plots: ```@example tensor diff --git a/docs/src/water_flow.md b/docs/src/water_flow.md index ed98f9e1..88565097 100644 --- a/docs/src/water_flow.md +++ b/docs/src/water_flow.md @@ -1,9 +1,9 @@ # Water flow function The water flow function is defined as: -``f(r_w,r,T_u,H_u,T_l,H_l,L,K_w) = \frac{2*\pi*T_u(H_u - H_l)}{log(\frac{r}{r_w})*[1 + \frac{2LT_u}{log(\frac{r}{r_w})*r_w^2*K_w}+ \frac{T_u}{T_l} ]}`` +``f(r_w,r,T_u,H_u,T_l,H_l,L,K_w) = \frac{2*\pi*T_u(H_u - H_l)}{\log(\frac{r}{r_w})*[1 + \frac{2LT_u}{\log(\frac{r}{r_w})*r_w^2*K_w}+ \frac{T_u}{T_l} ]}`` -It has 8 dimension. +It has 8 dimensions. ```@example water using Surrogates From 69911a6a0dc314ea8e2aebc36a7e51427a7258f8 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Mon, 11 Dec 2023 20:55:48 +0100 Subject: [PATCH 3/4] typos CI --- .github/dependabot.yml | 3 +++ .github/workflows/SpellCheck.yml | 13 +++++++++++++ .typos.toml | 2 ++ docs/src/optimizations.md | 2 +- docs/src/randomforest.md | 2 +- docs/src/surrogate.md | 2 +- src/GEK.jl | 2 +- src/GEKPLS.jl | 6 +++--- src/Kriging.jl | 2 +- src/Optimization.jl | 2 +- 10 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/SpellCheck.yml create mode 100644 .typos.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 700707ce..1e8a051e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,3 +5,6 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + ignore: + - dependency-name: "crate-ci/typos" + update-types: ["version-update:semver-patch"] diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml new file mode 100644 index 00000000..599253c8 --- /dev/null +++ b/.github/workflows/SpellCheck.yml @@ -0,0 +1,13 @@ +name: Spell Check + +on: [pull_request] + +jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Check spelling + uses: crate-ci/typos@v1.16.23 \ No newline at end of file diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..9a032fd3 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,2 @@ +[default.extend-words] +ND = "ND" \ No newline at end of file diff --git a/docs/src/optimizations.md b/docs/src/optimizations.md index 8a248e06..90b51786 100644 --- a/docs/src/optimizations.md +++ b/docs/src/optimizations.md @@ -28,5 +28,5 @@ surrogate_optimize(obj::Function,sop1::SOP,lb::Number,ub::Number,surrSOP::Abstra To add another optimization method, you just need to define a new SurrogateOptimizationAlgorithm and write its corresponding algorithm, overloading the following: ``` -surrogate_optimize(obj::Function,::NewOptimizatonType,lb,ub,surr::AbstractSurrogate,sample_type::SamplingAlgorithm;maxiters=100,num_new_samples=100) +surrogate_optimize(obj::Function,::NewOptimizationType,lb,ub,surr::AbstractSurrogate,sample_type::SamplingAlgorithm;maxiters=100,num_new_samples=100) ``` diff --git a/docs/src/randomforest.md b/docs/src/randomforest.md index bd336a19..8609bb85 100644 --- a/docs/src/randomforest.md +++ b/docs/src/randomforest.md @@ -32,7 +32,7 @@ plot!(f, label="True function", xlims=(lower_bound, upper_bound), legend=:top) With our sampled points we can build the Random forests surrogate using the `RandomForestSurrogate` function. -`randomforest_surrogate` behaves like an ordinary function which we can simply plot. Addtionally you can specify the number of trees created +`randomforest_surrogate` behaves like an ordinary function which we can simply plot. Additionally you can specify the number of trees created using the parameter num_round ```@example RandomForestSurrogate_tutorial diff --git a/docs/src/surrogate.md b/docs/src/surrogate.md index 5af888fd..0260fc78 100644 --- a/docs/src/surrogate.md +++ b/docs/src/surrogate.md @@ -48,7 +48,7 @@ It's great that you want to add another surrogate to the library! You will need to: 1. Define a new mutable struct and a constructor function -2. Define add\_point!(your\_surrogate::AbstactSurrogate,x\_new,y\_new) +2. Define add\_point!(your\_surrogate::AbstractSurrogate,x\_new,y\_new) 3. Define your\_surrogate(value) for the approximation **Example** diff --git a/src/GEK.jl b/src/GEK.jl index d3f1f704..75da4ca3 100644 --- a/src/GEK.jl +++ b/src/GEK.jl @@ -93,7 +93,7 @@ end function GEK(x, y, lb::Number, ub::Number; p = 1.0, theta = 1.0) if length(x) != length(unique(x)) - println("There exists a repetion in the samples, cannot build Kriging.") + println("There exists a repetition in the samples, cannot build Kriging.") return end mu, b, sigma, inverse_of_R = _calc_gek_coeffs(x, y, p, theta) diff --git a/src/GEKPLS.jl b/src/GEKPLS.jl index 33dc2242..3d3246ac 100644 --- a/src/GEKPLS.jl +++ b/src/GEKPLS.jl @@ -201,8 +201,8 @@ function _ge_compute_pls(X, y, n_comp, grads, delta_x, xlimits, extra_points) bb_vals = bb_vals .* grads[i, :]' _y = y[i, :] .+ sum(bb_vals, dims = 2) - #_pls.fit(_X, _y) # relic from sklearn versiom; retained for future reference. - #coeff_pls[:, :, i] = _pls.x_rotations_ #relic from sklearn versiom; retained for future reference. + #_pls.fit(_X, _y) # relic from sklearn version; retained for future reference. + #coeff_pls[:, :, i] = _pls.x_rotations_ #relic from sklearn version; retained for future reference. coeff_pls[:, :, i] = _modified_pls(_X, _y, n_comp) #_modified_pls returns the equivalent of SKLearn's _pls.x_rotations_ if extra_points != 0 @@ -304,7 +304,7 @@ end ######end of bb design###### """ -We substract the mean from each variable. Then, we divide the values of each +We subtract the mean from each variable. Then, we divide the values of each variable by its standard deviation. Parameters diff --git a/src/Kriging.jl b/src/Kriging.jl index e0b3a367..57500a62 100644 --- a/src/Kriging.jl +++ b/src/Kriging.jl @@ -104,7 +104,7 @@ Constructor for type Kriging. function Kriging(x, y, lb::Number, ub::Number; p = 2.0, theta = 0.5 / max(1e-6 * abs(ub - lb), std(x))^p) if length(x) != length(unique(x)) - println("There exists a repetion in the samples, cannot build Kriging.") + println("There exists a repetition in the samples, cannot build Kriging.") return end diff --git a/src/Optimization.jl b/src/Optimization.jl index 81e8e352..c8839c87 100755 --- a/src/Optimization.jl +++ b/src/Optimization.jl @@ -1701,7 +1701,7 @@ function surrogate_optimize(obj::Function, sopd::SOP, lb, ub, surrSOPD::Abstract new_points_y[i] = y_best end - #new_points[i] is splitted in new_points_x and new_points_y now contains: + #new_points[i] is split in new_points_x and new_points_y now contains: #[x_1,y_1; x_2,y_2,...,x_{num_new_samples},y_{num_new_samples}] #2.4 Adaptive learning and tabu archive From de57a28f82d74a5014a0f12374aaf0124a5d5202 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:37:45 +0000 Subject: [PATCH 4/4] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/SpellCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml index 599253c8..74af4eff 100644 --- a/.github/workflows/SpellCheck.yml +++ b/.github/workflows/SpellCheck.yml @@ -8,6 +8,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check spelling uses: crate-ci/typos@v1.16.23 \ No newline at end of file