MLPKriging::copy

Description

Create a deep copy of an MLPKriging model.

Usage

  • Python

    # mk = MLPKriging(...)
    mk2 = mk.copy()
    
  • R

    # mk <- MLPKriging(...)
    mk2 <- mk$copy()
    
  • Matlab/Octave

    % mk = MLPKriging(...)
    mk2 = mk.copy()
    
  • Julia

    # mk = MLPKriging(...)
    mk2 = copy(mk)
    

Arguments

Argument

Description

None

copy() duplicates the current model object without additional arguments.

Details

The returned model is independent from the original one, including the fitted MLP parameters and GP hyper-parameters.

Value

A new independent MLPKriging object with the same fitted parameters.

Examples

f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
X <- as.matrix(seq(0.05, 0.95, length.out = 10))
y <- f(X)

mk <- MLPKriging(
  y, X,
  hidden_dims = c(4L),
  d_out = 1L,
  activation = "tanh",
  kernel = "gauss",
  parameters = list(max_iter_adam = "20", max_iter_bfgs = "10")
)
print(mk)
print(mk$copy())

Results

* MLPKriging
* data: 10x[0.05,0.95] -> 10x[0.163421,0.976851]
* trend constant (est.): -745.4
* variance (est.): 3.13668e+08
* covariance:
  * kernel: gauss
  * range (est.): 2.88992
  * warpings:
      joint: "mlp_joint(4,1,tanh)"    MLPJoint(1 -> 4 -> 1, 13 params)
  * total warp params: 13
  * fit:
    * objective: LL
    * optim: BFGS+Adam
* MLPKriging
* data: 10x[0.05,0.95] -> 10x[0.163421,0.976851]
* trend constant (est.): -745.4
* variance (est.): 3.13668e+08
* covariance:
  * kernel: gauss
  * range (est.): 2.88992
  * warpings:
      joint: "mlp_joint(4,1,tanh)"    MLPJoint(1 -> 4 -> 1, 13 params)
  * total warp params: 13
  * fit:
    * objective: LL
    * optim: BFGS+Adam