Skip to content

Commit

Permalink
Merge pull request #203 from relf/fix-mfkpls-bug
Browse files Browse the repository at this point in the history
Fix mfkpls bug
  • Loading branch information
relf authored Jun 3, 2020
2 parents 312a032 + 28f2c95 commit fcea73e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion smt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.5.1"
3 changes: 2 additions & 1 deletion smt/applications/mfkpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def _new_train_iteration(self, lvl):
"n_samples=%d must be greater than the regression"
" model size p+q=%d."
)
% (n_samples[i], self.p_all[lvl] + self.q_all[lvl])
% (n_samples_F_i, self.p_all[lvl] + self.q_all[lvl])
)

# Determine Gaussian Process model parameters
Expand All @@ -238,6 +238,7 @@ def _new_train_iteration(self, lvl):

def _new_train_finalize(self, lvl):
if self.options["eval_noise"] and self.options["optim_var"]:
X = self.X
for lvl in range(self.nlvl - 1):
self.set_training_values(
X[lvl], self._predict_intermediate_values(X[lvl], lvl + 1), name=lvl
Expand Down
4 changes: 4 additions & 0 deletions smt/applications/tests/test_mfkpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def test_mfkpls(self):
sm.options["xlimits"] = prob.xlimits
sm.options["print_global"] = False

# to test some options
sm.options["eval_noise"] = True
sm.options["optim_var"] = True

# modif MM
sm.options["n_comp"] = self.n_comp
sm.options["theta0"] = [1e-2] * self.n_comp
Expand Down
3 changes: 3 additions & 0 deletions smt/applications/tests/test_mfkplsk.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def test_mfkplsk_derivs(self):
sm.options["xlimits"] = prob.xlimits
sm.options["print_global"] = False

# to test some options
sm.options["eval_noise"] = False

# modif MM
sm.options["n_comp"] = self.n_comp
sm.options["theta0"] = [1e-2] * self.n_comp
Expand Down

0 comments on commit fcea73e

Please sign in to comment.