Skip to content

Commit

Permalink
remove unnecessary variables and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram-s-narayan committed Jun 28, 2022
1 parent bb14ca4 commit 0b1984f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 2 additions & 5 deletions src/GEKPLS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function GEKPLS(X, y, grads, n_comp, delta_x, xlimits, extra_points, θ)
y_mean,
y_std,
)
println("struct created")

end


Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions test/GEKPLS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand Down

0 comments on commit 0b1984f

Please sign in to comment.