From 0b1984f74568c65a6aac78ceafc5396dffaa869f Mon Sep 17 00:00:00 2001 From: Vikram Date: Mon, 27 Jun 2022 20:00:16 +0530 Subject: [PATCH] remove unnecessary variables and comments --- src/GEKPLS.jl | 7 ++----- test/GEKPLS.jl | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/GEKPLS.jl b/src/GEKPLS.jl index facd34a9b..48e1e801a 100644 --- a/src/GEKPLS.jl +++ b/src/GEKPLS.jl @@ -73,7 +73,7 @@ function GEKPLS(X, y, grads, n_comp, delta_x, xlimits, extra_points, θ) y_mean, y_std, ) - println("struct created") + end @@ -140,6 +140,7 @@ function _ge_compute_pls(X, y, n_comp, grads, delta_x, xlimits, extra_points) # this function is equivalent to a combination of # https://github.com/SMTorg/smt/blob/f124c01ffa78c04b80221dded278a20123dac742/smt/utils/kriging_utils.py#L1036 # and https://github.com/SMTorg/smt/blob/f124c01ffa78c04b80221dded278a20123dac742/smt/surrogate_models/gekpls.py#L48 + nt, dim = size(X) XX = zeros(0, dim) yy = zeros(0, size(y)[2]) @@ -167,10 +168,6 @@ function _ge_compute_pls(X, y, n_comp, grads, delta_x, xlimits, extra_points) _X = X[i, :]' .+ bb_vals 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. - coeff_pls[:, :, i] = _modified_pls(_X, _y, n_comp) #_modified_pls returns the equivalent of SKLearn's _pls.x_rotations_ if extra_points != 0 start_index = max(1, length(coeff_pls[:, 1, i]) - extra_points + 1) diff --git a/test/GEKPLS.jl b/test/GEKPLS.jl index d3e91f366..fcda8b58b 100644 --- a/test/GEKPLS.jl +++ b/test/GEKPLS.jl @@ -44,7 +44,6 @@ function water_flow(x) end n = 1000 -d = 8 lb = [0.05, 100, 63070, 990, 63.1, 700, 1120, 9855] ub = [0.15, 50000, 115600, 1110, 116, 820, 1680, 12045] x = sample(n, lb, ub, SobolSample()) @@ -103,7 +102,6 @@ function welded_beam(x) end n = 1000 -d = 3 lb = [0.125, 5.0, 5.0] ub = [1.0, 10.0, 10.0] x = sample(n, lb, ub, SobolSample()) @@ -157,7 +155,6 @@ end ## 3D n = 100 -d = 3 lb = [-5.0, -5.0, -5.0] ub = [5.0, 5.0, 5.0] x = sample(n, lb, ub, SobolSample()) @@ -183,7 +180,6 @@ end ## 2D n = 50 -d = 2 lb = [-10.0, -10.0] ub = [10.0, 10.0] x = sample(n, lb, ub, SobolSample())