From 7b405a421dbe030acc90fbcc8798ec1bd4244d8d Mon Sep 17 00:00:00 2001 From: PHYSBO Developers Date: Mon, 11 Mar 2024 02:02:02 +0000 Subject: [PATCH] Deploy docs to develop by GitHub Actions triggered by 307119c0aebeeb4eae3c1dda4401ee7a5791bde8 --- manual/develop/en/.buildinfo | 2 +- manual/develop/en/_modules/index.html | 20 +- .../en/_modules/physbo/blm/basis/fourier.html | 40 ++- .../en/_modules/physbo/blm/core/model.html | 65 +++- .../en/_modules/physbo/blm/inf/exact.html | 50 ++- .../en/_modules/physbo/blm/lik/gauss.html | 62 +++- .../en/_modules/physbo/blm/lik/linear.html | 45 ++- .../en/_modules/physbo/blm/predictor.html | 77 ++-- .../en/_modules/physbo/blm/prior/gauss.html | 65 +++- .../en/_modules/physbo/gp/core/learning.html | 91 +++-- .../en/_modules/physbo/gp/core/model.html | 107 ++++-- .../en/_modules/physbo/gp/core/prior.html | 77 ++-- .../en/_modules/physbo/gp/cov/gauss.html | 92 +++-- .../en/_modules/physbo/gp/inf/exact.html | 45 ++- .../en/_modules/physbo/gp/lik/gauss.html | 67 +++- .../en/_modules/physbo/gp/mean/const.html | 62 +++- .../en/_modules/physbo/gp/mean/zero.html | 42 ++- .../en/_modules/physbo/gp/predictor.html | 77 ++-- .../en/_modules/physbo/misc/centering.html | 25 +- .../en/_modules/physbo/misc/gauss_elim.html | 25 +- .../en/_modules/physbo/misc/set_config.html | 127 +++++-- .../develop/en/_modules/physbo/opt/adam.html | 40 ++- .../develop/en/_modules/physbo/predictor.html | 92 +++-- .../physbo/search/discrete/policy.html | 85 +++-- .../physbo/search/discrete/results.html | 52 ++- .../physbo/search/discrete_multi/policy.html | 85 +++-- .../physbo/search/discrete_multi/results.html | 47 ++- .../en/_modules/physbo/search/pareto.html | 72 +++- .../en/_modules/physbo/search/score.html | 40 ++- .../_modules/physbo/search/score_multi.html | 40 ++- .../en/_modules/physbo/search/utility.html | 50 ++- .../develop/en/_modules/physbo/variable.html | 82 +++-- .../_sphinx_javascript_frameworks_compat.js | 123 +++++++ manual/develop/en/_static/basic.css | 22 ++ manual/develop/en/_static/css/theme.css | 2 +- .../en/_static/documentation_options.js | 5 +- manual/develop/en/_static/jquery.js | 2 + .../en/_static/nbsphinx-code-cells.css | 14 +- manual/develop/en/_static/pygments.css | 1 + manual/develop/en/_static/searchtools.js | 26 +- manual/develop/en/_static/sphinx_highlight.js | 16 +- manual/develop/en/acknowledgement.html | 24 +- manual/develop/en/algorithm.html | 28 +- manual/develop/en/api/modules.html | 24 +- .../en/api/physbo.blm.basis.fourier.html | 36 +- manual/develop/en/api/physbo.blm.basis.html | 28 +- manual/develop/en/api/physbo.blm.core.html | 28 +- .../develop/en/api/physbo.blm.core.model.html | 52 +-- manual/develop/en/api/physbo.blm.html | 30 +- .../develop/en/api/physbo.blm.inf.exact.html | 36 +- manual/develop/en/api/physbo.blm.inf.html | 28 +- .../develop/en/api/physbo.blm.lik.gauss.html | 46 +-- manual/develop/en/api/physbo.blm.lik.html | 28 +- .../develop/en/api/physbo.blm.lik.linear.html | 42 ++- .../develop/en/api/physbo.blm.predictor.html | 50 +-- .../en/api/physbo.blm.prior.gauss.html | 52 +-- manual/develop/en/api/physbo.blm.prior.html | 28 +- manual/develop/en/api/physbo.gp.core.html | 28 +- .../en/api/physbo.gp.core.learning.html | 50 +-- .../develop/en/api/physbo.gp.core.model.html | 58 +-- .../develop/en/api/physbo.gp.core.prior.html | 46 +-- .../develop/en/api/physbo.gp.cov.gauss.html | 52 +-- manual/develop/en/api/physbo.gp.cov.html | 28 +- manual/develop/en/api/physbo.gp.html | 30 +- .../develop/en/api/physbo.gp.inf.exact.html | 34 +- manual/develop/en/api/physbo.gp.inf.html | 28 +- .../develop/en/api/physbo.gp.lik.gauss.html | 42 ++- manual/develop/en/api/physbo.gp.lik.html | 28 +- .../develop/en/api/physbo.gp.mean.const.html | 40 ++- manual/develop/en/api/physbo.gp.mean.html | 28 +- .../develop/en/api/physbo.gp.mean.zero.html | 32 +- .../develop/en/api/physbo.gp.predictor.html | 46 +-- manual/develop/en/api/physbo.html | 30 +- .../develop/en/api/physbo.misc.centering.html | 26 +- .../en/api/physbo.misc.gauss_elim.html | 26 +- manual/develop/en/api/physbo.misc.html | 28 +- .../en/api/physbo.misc.set_config.html | 62 ++-- manual/develop/en/api/physbo.opt.adam.html | 54 +-- manual/develop/en/api/physbo.opt.html | 28 +- manual/develop/en/api/physbo.predictor.html | 52 +-- .../en/api/physbo.search.discrete.html | 28 +- .../en/api/physbo.search.discrete.policy.html | 50 +-- .../api/physbo.search.discrete.results.html | 44 +-- .../en/api/physbo.search.discrete_multi.html | 28 +- .../physbo.search.discrete_multi.policy.html | 52 +-- .../physbo.search.discrete_multi.results.html | 42 ++- manual/develop/en/api/physbo.search.html | 30 +- .../develop/en/api/physbo.search.pareto.html | 44 +-- .../develop/en/api/physbo.search.score.html | 32 +- .../en/api/physbo.search.score_multi.html | 32 +- .../develop/en/api/physbo.search.utility.html | 36 +- manual/develop/en/api/physbo.variable.html | 48 +-- manual/develop/en/contact.html | 24 +- manual/develop/en/genindex.html | 20 +- manual/develop/en/index.html | 24 +- manual/develop/en/install.html | 36 +- manual/develop/en/introduction.html | 32 +- manual/develop/en/notebook/index.html | 24 +- .../notebook/tutorial_Gaussian_process.html | 34 +- .../develop/en/notebook/tutorial_basic.html | 50 +-- .../en/notebook/tutorial_basic_org.html | 44 +-- .../notebook/tutorial_interactive_mode.html | 34 +- .../en/notebook/tutorial_multi_objective.html | 74 ++-- .../en/notebook/tutorial_multi_probe.html | 34 +- .../en/notebook/tutorial_once_mode.html | 34 +- manual/develop/en/objects.inv | Bin 10450 -> 10450 bytes manual/develop/en/py-modindex.html | 20 +- manual/develop/en/search.html | 20 +- manual/develop/en/searchindex.js | 2 +- manual/develop/ja/.buildinfo | 2 +- manual/develop/ja/_modules/index.html | 22 +- .../ja/_modules/physbo/blm/basis/fourier.html | 42 ++- .../ja/_modules/physbo/blm/core/model.html | 67 +++- .../ja/_modules/physbo/blm/inf/exact.html | 52 ++- .../ja/_modules/physbo/blm/lik/gauss.html | 64 +++- .../ja/_modules/physbo/blm/lik/linear.html | 47 ++- .../ja/_modules/physbo/blm/predictor.html | 79 +++-- .../ja/_modules/physbo/blm/prior/gauss.html | 67 +++- .../ja/_modules/physbo/gp/core/learning.html | 93 +++-- .../ja/_modules/physbo/gp/core/model.html | 109 ++++-- .../ja/_modules/physbo/gp/core/prior.html | 79 +++-- .../ja/_modules/physbo/gp/cov/gauss.html | 94 +++-- .../ja/_modules/physbo/gp/inf/exact.html | 47 ++- .../ja/_modules/physbo/gp/lik/gauss.html | 69 +++- .../ja/_modules/physbo/gp/mean/const.html | 64 +++- .../ja/_modules/physbo/gp/mean/zero.html | 44 ++- .../ja/_modules/physbo/gp/predictor.html | 79 +++-- .../ja/_modules/physbo/misc/centering.html | 27 +- .../ja/_modules/physbo/misc/gauss_elim.html | 27 +- .../ja/_modules/physbo/misc/set_config.html | 129 +++++-- .../develop/ja/_modules/physbo/opt/adam.html | 42 ++- .../develop/ja/_modules/physbo/predictor.html | 94 +++-- .../physbo/search/discrete/policy.html | 87 +++-- .../physbo/search/discrete/results.html | 54 ++- .../physbo/search/discrete_multi/policy.html | 87 +++-- .../physbo/search/discrete_multi/results.html | 49 ++- .../ja/_modules/physbo/search/pareto.html | 74 ++-- .../ja/_modules/physbo/search/score.html | 42 ++- .../_modules/physbo/search/score_multi.html | 42 ++- .../ja/_modules/physbo/search/utility.html | 52 ++- .../develop/ja/_modules/physbo/variable.html | 84 +++-- .../_sphinx_javascript_frameworks_compat.js | 123 +++++++ manual/develop/ja/_static/basic.css | 22 ++ manual/develop/ja/_static/css/theme.css | 2 +- .../ja/_static/documentation_options.js | 5 +- manual/develop/ja/_static/jquery.js | 2 + .../ja/_static/nbsphinx-code-cells.css | 14 +- manual/develop/ja/_static/pygments.css | 1 + manual/develop/ja/_static/searchtools.js | 26 +- manual/develop/ja/_static/sphinx_highlight.js | 16 +- manual/develop/ja/_static/translations.js | 3 +- manual/develop/ja/acknowledgement.html | 26 +- manual/develop/ja/algorithm.html | 30 +- manual/develop/ja/api/modules.html | 26 +- .../ja/api/physbo.blm.basis.fourier.html | 38 +- manual/develop/ja/api/physbo.blm.basis.html | 30 +- manual/develop/ja/api/physbo.blm.core.html | 30 +- .../develop/ja/api/physbo.blm.core.model.html | 54 +-- manual/develop/ja/api/physbo.blm.html | 32 +- .../develop/ja/api/physbo.blm.inf.exact.html | 38 +- manual/develop/ja/api/physbo.blm.inf.html | 30 +- .../develop/ja/api/physbo.blm.lik.gauss.html | 48 +-- manual/develop/ja/api/physbo.blm.lik.html | 30 +- .../develop/ja/api/physbo.blm.lik.linear.html | 44 +-- .../develop/ja/api/physbo.blm.predictor.html | 52 +-- .../ja/api/physbo.blm.prior.gauss.html | 54 +-- manual/develop/ja/api/physbo.blm.prior.html | 30 +- manual/develop/ja/api/physbo.gp.core.html | 30 +- .../ja/api/physbo.gp.core.learning.html | 52 +-- .../develop/ja/api/physbo.gp.core.model.html | 60 ++-- .../develop/ja/api/physbo.gp.core.prior.html | 48 +-- .../develop/ja/api/physbo.gp.cov.gauss.html | 54 +-- manual/develop/ja/api/physbo.gp.cov.html | 30 +- manual/develop/ja/api/physbo.gp.html | 32 +- .../develop/ja/api/physbo.gp.inf.exact.html | 36 +- manual/develop/ja/api/physbo.gp.inf.html | 30 +- .../develop/ja/api/physbo.gp.lik.gauss.html | 44 +-- manual/develop/ja/api/physbo.gp.lik.html | 30 +- .../develop/ja/api/physbo.gp.mean.const.html | 42 ++- manual/develop/ja/api/physbo.gp.mean.html | 30 +- .../develop/ja/api/physbo.gp.mean.zero.html | 34 +- .../develop/ja/api/physbo.gp.predictor.html | 48 +-- manual/develop/ja/api/physbo.html | 32 +- .../develop/ja/api/physbo.misc.centering.html | 28 +- .../ja/api/physbo.misc.gauss_elim.html | 28 +- manual/develop/ja/api/physbo.misc.html | 30 +- .../ja/api/physbo.misc.set_config.html | 64 ++-- manual/develop/ja/api/physbo.opt.adam.html | 56 +-- manual/develop/ja/api/physbo.opt.html | 30 +- manual/develop/ja/api/physbo.predictor.html | 54 +-- .../ja/api/physbo.search.discrete.html | 30 +- .../ja/api/physbo.search.discrete.policy.html | 52 +-- .../api/physbo.search.discrete.results.html | 46 +-- .../ja/api/physbo.search.discrete_multi.html | 30 +- .../physbo.search.discrete_multi.policy.html | 54 +-- .../physbo.search.discrete_multi.results.html | 44 +-- manual/develop/ja/api/physbo.search.html | 32 +- .../develop/ja/api/physbo.search.pareto.html | 46 +-- .../develop/ja/api/physbo.search.score.html | 34 +- .../ja/api/physbo.search.score_multi.html | 34 +- .../develop/ja/api/physbo.search.utility.html | 38 +- manual/develop/ja/api/physbo.variable.html | 50 +-- manual/develop/ja/contact.html | 26 +- manual/develop/ja/genindex.html | 329 +++++++++--------- manual/develop/ja/index.html | 26 +- manual/develop/ja/install.html | 38 +- manual/develop/ja/introduction.html | 34 +- manual/develop/ja/notebook/index.html | 26 +- .../notebook/tutorial_Gaussian_process.html | 36 +- .../develop/ja/notebook/tutorial_basic.html | 52 +-- .../notebook/tutorial_interactive_mode.html | 36 +- .../ja/notebook/tutorial_multi_objective.html | 76 ++-- .../ja/notebook/tutorial_multi_probe.html | 36 +- .../ja/notebook/tutorial_once_mode.html | 36 +- .../ja/notebook/tutorial_simulator.html | 38 +- manual/develop/ja/objects.inv | Bin 10486 -> 10486 bytes manual/develop/ja/py-modindex.html | 22 +- manual/develop/ja/search.html | 22 +- manual/develop/ja/searchindex.js | 2 +- 219 files changed, 6137 insertions(+), 3493 deletions(-) create mode 100644 manual/develop/en/_static/_sphinx_javascript_frameworks_compat.js create mode 100644 manual/develop/en/_static/jquery.js create mode 100644 manual/develop/ja/_static/_sphinx_javascript_frameworks_compat.js create mode 100644 manual/develop/ja/_static/jquery.js diff --git a/manual/develop/en/.buildinfo b/manual/develop/en/.buildinfo index 9de48e36..13933b44 100644 --- a/manual/develop/en/.buildinfo +++ b/manual/develop/en/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e015b6dc9bfc7443fb19c91af7441403 +config: 3acbb30cac794629572a38a5d72c4acc tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/manual/develop/en/_modules/index.html b/manual/develop/en/_modules/index.html index bfb8bab6..b32c94d8 100644 --- a/manual/develop/en/_modules/index.html +++ b/manual/develop/en/_modules/index.html @@ -1,18 +1,22 @@ - + - Overview: module code — PHYSBO 1.2-dev documentation - - + Overview: module code — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
diff --git a/manual/develop/en/_modules/physbo/blm/basis/fourier.html b/manual/develop/en/_modules/physbo/blm/basis/fourier.html index 51f4d423..eb18c9af 100644 --- a/manual/develop/en/_modules/physbo/blm/basis/fourier.html +++ b/manual/develop/en/_modules/physbo/blm/basis/fourier.html @@ -1,18 +1,22 @@ - + - physbo.blm.basis.fourier — PHYSBO 1.2-dev documentation - - + physbo.blm.basis.fourier — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -81,7 +85,9 @@

Source code for physbo.blm.basis.fourier

 import numpy as np
 
 
-
[docs]class fourier: +
+[docs] +class fourier: """ random feature maps ``Psi(X; W,b) = cos[X * Wt + b] * alpha`` @@ -124,7 +130,9 @@

Source code for physbo.blm.basis.fourier

         self.params = params
         self.nbasis = self.params[1].shape[0]
 
-
[docs] def get_basis(self, X, params=None): +
+[docs] + def get_basis(self, X, params=None): """ compute the value of basis @@ -153,7 +161,10 @@

Source code for physbo.blm.basis.fourier

 
         return np.cos(np.dot(X, params[0].transpose()) + params[1]) * params[2]
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ update basis parameters @@ -167,7 +178,10 @@

Source code for physbo.blm.basis.fourier

         self._check_len_params(params)
         self.params = params
-
[docs] def show(self): + +
+[docs] + def show(self): """ print parameters """ @@ -175,6 +189,7 @@

Source code for physbo.blm.basis.fourier

         print("b = ", self.params[1])
         print("alpha = ", self.params[2])
+ def _check_params(self, params): """ Parameters @@ -218,6 +233,7 @@

Source code for physbo.blm.basis.fourier

             else:
                 if isinstance(params[2], str):
                     raise ValueError("The third entry of <params> must be a scalar.")
+
diff --git a/manual/develop/en/_modules/physbo/blm/core/model.html b/manual/develop/en/_modules/physbo/blm/core/model.html index d96f6314..87010757 100644 --- a/manual/develop/en/_modules/physbo/blm/core/model.html +++ b/manual/develop/en/_modules/physbo/blm/core/model.html @@ -1,18 +1,22 @@ - + - physbo.blm.core.model — PHYSBO 1.2-dev documentation - - + physbo.blm.core.model — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -81,7 +85,9 @@

Source code for physbo.blm.core.model

 from .. import inf
 
 
-
[docs]class model: +
+[docs] +class model: """ Baysean Linear Model @@ -107,7 +113,9 @@

Source code for physbo.blm.core.model

         self._set_options(options)
         self.stats = ()
 
-
[docs] def prepare(self, X, t, Psi=None): +
+[docs] + def prepare(self, X, t, Psi=None): """ initializes model by using the first training dataset @@ -129,7 +137,10 @@

Source code for physbo.blm.core.model

         else:
             pass
-
[docs] def update_stats(self, x, t, psi=None): + +
+[docs] + def update_stats(self, x, t, psi=None): """ updates model by using another training data @@ -151,7 +162,10 @@

Source code for physbo.blm.core.model

         else:
             pass
-
[docs] def get_post_params_mean(self): + +
+[docs] + def get_post_params_mean(self): """ calculates posterior mean of weights @@ -166,7 +180,10 @@

Source code for physbo.blm.core.model

         if self.method == "exact":
             self.lik.linear.params = inf.exact.get_post_params_mean(blm=self)
-
[docs] def get_post_fmean(self, X, Psi=None, w=None): + +
+[docs] + def get_post_fmean(self, X, Psi=None, w=None): """ calculates posterior mean of model (function) @@ -189,7 +206,10 @@

Source code for physbo.blm.core.model

             pass
         return fmu
-
[docs] def sampling(self, w_mu=None, N=1, alpha=1.0): + +
+[docs] + def sampling(self, w_mu=None, N=1, alpha=1.0): """ draws samples of weights @@ -221,7 +241,10 @@

Source code for physbo.blm.core.model

             pass
         return w_hat
-
[docs] def post_sampling(self, Xtest, Psi=None, N=1, alpha=1.0): + +
+[docs] + def post_sampling(self, Xtest, Psi=None, N=1, alpha=1.0): """ draws samples of mean value of model @@ -247,7 +270,10 @@

Source code for physbo.blm.core.model

         w_hat = self.sampling(N=N, alpha=alpha)
         return Psi.dot(w_hat) + self.lik.linear.bias
-
[docs] def predict_sampling(self, Xtest, Psi=None, N=1): + +
+[docs] + def predict_sampling(self, Xtest, Psi=None, N=1): """ draws samples from model @@ -272,7 +298,10 @@

Source code for physbo.blm.core.model

         A = np.random.randn(Xtest.shape[0], N)
         return fmean + np.sqrt(self.lik.cov.sigma2) * A
-
[docs] def get_post_fcov(self, X, Psi=None, diag=True): + +
+[docs] + def get_post_fcov(self, X, Psi=None, diag=True): """ calculates posterior covariance of model @@ -301,6 +330,7 @@

Source code for physbo.blm.core.model

             pass
         return fcov
+ def _set_options(self, options): """ read options @@ -327,6 +357,7 @@

Source code for physbo.blm.core.model

         if prior is None:
             prior = prior.gauss(self.nbasis)
         self.prior = prior
+
diff --git a/manual/develop/en/_modules/physbo/blm/inf/exact.html b/manual/develop/en/_modules/physbo/blm/inf/exact.html index f6b6efd4..ea72d3ed 100644 --- a/manual/develop/en/_modules/physbo/blm/inf/exact.html +++ b/manual/develop/en/_modules/physbo/blm/inf/exact.html @@ -1,18 +1,22 @@ - + - physbo.blm.inf.exact — PHYSBO 1.2-dev documentation - - + physbo.blm.inf.exact — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -83,7 +87,9 @@

Source code for physbo.blm.inf.exact

 import physbo.misc as misc
 
 
-
[docs]def prepare(blm, X, t, Psi=None): +
+[docs] +def prepare(blm, X, t, Psi=None): """ initializes auxiaialy parameters for quick sampling @@ -111,7 +117,10 @@

Source code for physbo.blm.inf.exact

     blm.stats = (U, b, alpha)
-
[docs]def update_stats(blm, x, t, psi=None): + +
+[docs] +def update_stats(blm, x, t, psi=None): """ calculates new auxiaialy parameters for quick sampling by fast-update @@ -144,7 +153,10 @@

Source code for physbo.blm.inf.exact

     return (U, b, alpha)
-
[docs]def sampling(blm, w_mu=None, N=1, alpha=1.0): + +
+[docs] +def sampling(blm, w_mu=None, N=1, alpha=1.0): """ draws samples of weights @@ -180,7 +192,10 @@

Source code for physbo.blm.inf.exact

     return (invUz.transpose() + w_mu).transpose()
-
[docs]def get_post_params_mean(blm): + +
+[docs] +def get_post_params_mean(blm): """ calculates mean of weight @@ -195,7 +210,10 @@

Source code for physbo.blm.inf.exact

     return blm.stats[2] * blm.lik.cov.prec
-
[docs]def get_post_fmean(blm, X, Psi=None, w=None): + +
+[docs] +def get_post_fmean(blm, X, Psi=None, w=None): """ calculates posterior mean of model @@ -223,7 +241,10 @@

Source code for physbo.blm.inf.exact

     return Psi.dot(w) + blm.lik.linear.bias
-
[docs]def get_post_fcov(blm, X, Psi=None, diag=True): + +
+[docs] +def get_post_fcov(blm, X, Psi=None, diag=True): """ calculates posterior covariance of model @@ -262,6 +283,7 @@

Source code for physbo.blm.inf.exact

         fcov = np.dot(RT, R)
 
     return fcov
+
diff --git a/manual/develop/en/_modules/physbo/blm/lik/gauss.html b/manual/develop/en/_modules/physbo/blm/lik/gauss.html index 61240582..1e1f9ef3 100644 --- a/manual/develop/en/_modules/physbo/blm/lik/gauss.html +++ b/manual/develop/en/_modules/physbo/blm/lik/gauss.html @@ -1,18 +1,22 @@ - + - physbo.blm.lik.gauss — PHYSBO 1.2-dev documentation - - + physbo.blm.lik.gauss — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.blm.lik.gauss

 import numpy as np
 
 
-
[docs]class gauss: +
+[docs] +class gauss: """ Gaussian @@ -97,7 +103,9 @@

Source code for physbo.blm.lik.gauss

         self.cov = cov
         self.stats = ()
 
-
[docs] def get_cov(self, N, params=None): +
+[docs] + def get_cov(self, N, params=None): """ Returns covariance matrix @@ -119,7 +127,10 @@

Source code for physbo.blm.lik.gauss

 
         return self.cov.get_cov(N, params)
-
[docs] def get_prec(self, N, params=None): + +
+[docs] + def get_prec(self, N, params=None): """ Returns precision matrix @@ -142,7 +153,10 @@

Source code for physbo.blm.lik.gauss

 
         return self.cov.get_cov(N, params)
-
[docs] def get_basis(self, X): + +
+[docs] + def get_basis(self, X): """ calculates value of basis function at input @@ -157,7 +171,10 @@

Source code for physbo.blm.lik.gauss

         """
         return self.linear.basis.get_basis(X)
-
[docs] def get_mean(self, X, Psi=None, params=None, bias=None): + +
+[docs] + def get_mean(self, X, Psi=None, params=None, bias=None): """ calculates mean value @@ -178,19 +195,28 @@

Source code for physbo.blm.lik.gauss

         """
         return self.linear.get_mean(X, Psi, params, bias)
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ sets parameters """ self.linear.set_params(params)
-
[docs] def set_bias(self, bias): + +
+[docs] + def set_bias(self, bias): """ sets bias """ self.linear.set_bias(bias)
-
[docs] def sampling(self, fmean): + +
+[docs] + def sampling(self, fmean): """ draws samples @@ -205,7 +231,9 @@

Source code for physbo.blm.lik.gauss

         """
         num_data = fmean.shape[0]
         eps = np.sqrt(self.cov.sigma2) * np.random.randn(num_data)
-        return fmean + eps
+ return fmean + eps
+
+
diff --git a/manual/develop/en/_modules/physbo/blm/lik/linear.html b/manual/develop/en/_modules/physbo/blm/lik/linear.html index 236aecdd..0d3e5f14 100644 --- a/manual/develop/en/_modules/physbo/blm/lik/linear.html +++ b/manual/develop/en/_modules/physbo/blm/lik/linear.html @@ -1,18 +1,22 @@ - + - physbo.blm.lik.linear — PHYSBO 1.2-dev documentation - - + physbo.blm.lik.linear — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.blm.lik.linear

 import numpy as np
 
 
-
[docs]class linear: +
+[docs] +class linear: """ Attributes @@ -106,7 +112,9 @@

Source code for physbo.blm.lik.linear

             self.params = np.zeros(self.nbasis)
         self.nparams = self.nbasis
 
-
[docs] def get_mean(self, X, Psi=None, params=None, bias=None): +
+[docs] + def get_mean(self, X, Psi=None, params=None, bias=None): """ calculate mean values @@ -140,7 +148,10 @@

Source code for physbo.blm.lik.linear

 
         return Psi.dot(params) + bias
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ set parameters @@ -150,7 +161,10 @@

Source code for physbo.blm.lik.linear

         """
         self.params = params
-
[docs] def set_bias(self, bias): + +
+[docs] + def set_bias(self, bias): """ set bias @@ -160,7 +174,10 @@

Source code for physbo.blm.lik.linear

         """
         self.bias = bias
-
[docs] def _init_params(self, params): + +
+[docs] + def _init_params(self, params): """ initialize parameters @@ -174,6 +191,7 @@

Source code for physbo.blm.lik.linear

 
         self.params = params
+ def _init_bias(self, bias): """ initialize bias @@ -187,6 +205,7 @@

Source code for physbo.blm.lik.linear

             self.bias = 0
 
         self.bias = bias
+
diff --git a/manual/develop/en/_modules/physbo/blm/predictor.html b/manual/develop/en/_modules/physbo/blm/predictor.html index fad0b2b5..a03a2b7a 100644 --- a/manual/develop/en/_modules/physbo/blm/predictor.html +++ b/manual/develop/en/_modules/physbo/blm/predictor.html @@ -1,18 +1,22 @@ - + - physbo.blm.predictor — PHYSBO 1.2-dev documentation - - + physbo.blm.predictor — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.blm.predictor

 import physbo.predictor
 
 
-
[docs]class predictor(physbo.predictor.base_predictor): +
+[docs] +class predictor(physbo.predictor.base_predictor): """Predictor using Baysean linear model Attributes @@ -106,7 +112,9 @@

Source code for physbo.blm.predictor

         super(predictor, self).__init__(config, model)
         self.blm = None
 
-
[docs] def fit(self, training, num_basis=None): +
+[docs] + def fit(self, training, num_basis=None): """ fit model to training dataset @@ -126,7 +134,10 @@

Source code for physbo.blm.predictor

         self.blm = self.model.export_blm(num_basis)
         self.delete_stats()
-
[docs] def prepare(self, training): + +
+[docs] + def prepare(self, training): """ initializes model by using training data set @@ -137,13 +148,19 @@

Source code for physbo.blm.predictor

         """
         self.blm.prepare(training.X, training.t, training.Z)
-
[docs] def delete_stats(self): + +
+[docs] + def delete_stats(self): """ resets model """ self.blm.stats = None
-
[docs] def get_basis(self, X): + +
+[docs] + def get_basis(self, X): """ calculates feature maps Psi(X) @@ -159,7 +176,10 @@

Source code for physbo.blm.predictor

         """
         return self.blm.lik.get_basis(X)
-
[docs] def get_post_fmean(self, training, test): + +
+[docs] + def get_post_fmean(self, training, test): """ calculates posterior mean value of model @@ -178,7 +198,10 @@

Source code for physbo.blm.predictor

             self.prepare(training)
         return self.blm.get_post_fmean(test.X, test.Z)
-
[docs] def get_post_fcov(self, training, test): + +
+[docs] + def get_post_fcov(self, training, test): """ calculates posterior variance-covariance matrix of model @@ -197,7 +220,10 @@

Source code for physbo.blm.predictor

             self.prepare(training)
         return self.blm.get_post_fcov(test.X, test.Z)
-
[docs] def get_post_params(self, training, test): + +
+[docs] + def get_post_params(self, training, test): """ calculates posterior weights @@ -216,7 +242,10 @@

Source code for physbo.blm.predictor

             self.prepare(training)
         return self.blm.get_post_params_mean()
-
[docs] def get_post_samples(self, training, test, N=1, alpha=1.0): + +
+[docs] + def get_post_samples(self, training, test, N=1, alpha=1.0): """ draws samples of mean values of model @@ -241,7 +270,10 @@

Source code for physbo.blm.predictor

             self.prepare(training)
         return self.blm.post_sampling(test.X, Psi=test.Z, N=N, alpha=alpha)
-
[docs] def get_predict_samples(self, training, test, N=1): + +
+[docs] + def get_predict_samples(self, training, test, N=1): """ draws samples of values of model @@ -266,7 +298,10 @@

Source code for physbo.blm.predictor

             self.prepare(training)
         return self.blm.predict_sampling(test.X, Psi=test.Z, N=N).transpose()
-
[docs] def update(self, training, test): + +
+[docs] + def update(self, training, test): """ updates the model. @@ -307,7 +342,9 @@

Source code for physbo.blm.predictor

                 if test.Z is None:
                     self.blm.update_stats(test.X[n, :], test.t[n])
                 else:
-                    self.blm.update_stats(test.X[n, :], test.t[n], psi=test.Z[n, :])
+ self.blm.update_stats(test.X[n, :], test.t[n], psi=test.Z[n, :])
+
+
diff --git a/manual/develop/en/_modules/physbo/blm/prior/gauss.html b/manual/develop/en/_modules/physbo/blm/prior/gauss.html index 5f8eb159..4414208a 100644 --- a/manual/develop/en/_modules/physbo/blm/prior/gauss.html +++ b/manual/develop/en/_modules/physbo/blm/prior/gauss.html @@ -1,18 +1,22 @@ - + - physbo.blm.prior.gauss — PHYSBO 1.2-dev documentation - - + physbo.blm.prior.gauss — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.blm.prior.gauss

 import numpy as np
 
 
-
[docs]class cov_const: +
+[docs] +class cov_const: """ isotropic variance-covariance @@ -108,7 +114,9 @@

Source code for physbo.blm.prior.gauss

             self.params = np.log(1)
         self.sigma2, self.prec = self._trans_params(params)
 
-
[docs] def get_cov(self, nbasis, params=None): +
+[docs] + def get_cov(self, nbasis, params=None): """ computes the covariance @@ -130,7 +138,10 @@

Source code for physbo.blm.prior.gauss

         sigma2, prec = self._trans_params(params)
         return np.identity(nbasis) * sigma2
-
[docs] def get_prec(self, nbasis, params=None): + +
+[docs] + def get_prec(self, nbasis, params=None): """ computes the precision @@ -152,7 +163,10 @@

Source code for physbo.blm.prior.gauss

         sigma2, prec = self._trans_params(params)
         return np.identity(nbasis) * prec
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ sets params @@ -164,6 +178,7 @@

Source code for physbo.blm.prior.gauss

         self.params = params
         self.sigma2, self.prec = self._trans_params(params)
+ def _trans_params(self, params=None): """ calculates variance and precise from params @@ -190,7 +205,10 @@

Source code for physbo.blm.prior.gauss

         return sigma2, prec
-
[docs]class gauss: + +
+[docs] +class gauss: """ Gaussian prior @@ -214,7 +232,9 @@

Source code for physbo.blm.prior.gauss

         self._init_cov(cov)
         self.nbasis = nbasis
 
-
[docs] def get_mean(self, params=None): +
+[docs] + def get_mean(self, params=None): """ calculates the mean value of priors @@ -230,7 +250,10 @@

Source code for physbo.blm.prior.gauss

         """
         return np.zeros(self.nbasis)
-
[docs] def get_cov(self, params=None): + +
+[docs] + def get_cov(self, params=None): """ calculates the variance-covariance matrix of priors @@ -246,7 +269,10 @@

Source code for physbo.blm.prior.gauss

         """
         return self.cov.get_cov(self.nbasis, params)
-
[docs] def get_prec(self, params=None): + +
+[docs] + def get_prec(self, params=None): """ calculates the precise matrix of priors @@ -262,7 +288,10 @@

Source code for physbo.blm.prior.gauss

         """
         return self.cov.get_prec(self.nbasis, params)
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ sets params @@ -273,6 +302,7 @@

Source code for physbo.blm.prior.gauss

         """
         self.cov.set_params(params)
+ def _init_cov(self, cov): """ initialize covariance @@ -285,6 +315,7 @@

Source code for physbo.blm.prior.gauss

         self.cov = cov
         if cov is None:
             self.cov = cov_const()
+
diff --git a/manual/develop/en/_modules/physbo/gp/core/learning.html b/manual/develop/en/_modules/physbo/gp/core/learning.html index a019d708..3d6c5cef 100644 --- a/manual/develop/en/_modules/physbo/gp/core/learning.html +++ b/manual/develop/en/_modules/physbo/gp/core/learning.html @@ -1,18 +1,22 @@ - + - physbo.gp.core.learning — PHYSBO 1.2-dev documentation - - + physbo.gp.core.learning — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -82,7 +86,9 @@

Source code for physbo.gp.core.learning

 import scipy.optimize
 
 
-
[docs]class batch(object): +
+[docs] +class batch(object): """ basis class for batch learning """ @@ -99,7 +105,9 @@

Source code for physbo.gp.core.learning

         self.gp = gp
         self.config = config
 
-
[docs] def run(self, X, t): +
+[docs] + def run(self, X, t): """ Performing optimization using the L-BFGS-B algorithm @@ -130,7 +138,10 @@

Source code for physbo.gp.core.learning

         params = self.one_run(params, sub_X, sub_t)
         return params
-
[docs] def one_run(self, params, X, t, max_iter=None): + +
+[docs] + def one_run(self, params, X, t, max_iter=None): """ Parameters @@ -172,7 +183,10 @@

Source code for physbo.gp.core.learning

 
         return res.x
- +
-
[docs]class online(object): + +
+[docs] +class online(object): """ base class for online learning """ @@ -222,7 +240,9 @@

Source code for physbo.gp.core.learning

         self.config = config
         self.num_iter = 0
 
-
[docs] def run(self, X, t): +
+[docs] + def run(self, X, t): """ Run initial search and hyper parameter running. @@ -262,7 +282,10 @@

Source code for physbo.gp.core.learning

 
         return params
-
[docs] def one_run(self, params, X, t, max_epoch=None, is_disp=False): + +
+[docs] + def one_run(self, params, X, t, max_epoch=None, is_disp=False): """ Parameters @@ -319,7 +342,10 @@

Source code for physbo.gp.core.learning

         self.reset()
         return params
-
[docs] def disp_marlik(self, params, eval_X, eval_t, num_epoch=None): + +
+[docs] + def disp_marlik(self, params, eval_X, eval_t, num_epoch=None): """ Displaying marginal likelihood @@ -346,7 +372,10 @@

Source code for physbo.gp.core.learning

 
         print("marginal likelihood", marlik)
- + -
[docs]class adam(online): +
+[docs] +class adam(online): """default""" def __init__(self, gp, config): @@ -407,12 +443,17 @@

Source code for physbo.gp.core.learning

         self.m = np.zeros(self.gp.num_params)
         self.v = np.zeros(self.gp.num_params)
 
-
[docs] def reset(self): +
+[docs] + def reset(self): self.m = np.zeros(self.gp.num_params) self.v = np.zeros(self.gp.num_params) self.num_iter = 0
-
[docs] def get_one_update(self, params, X, t): + +
+[docs] + def get_one_update(self, params, X, t): """ Parameters @@ -433,7 +474,9 @@

Source code for physbo.gp.core.learning

         self.v = self.v * self.gamma + grad**2 * (1 - self.gamma)
         hat_m = self.m / (1 - self.beta ** (self.num_iter))
         hat_v = self.v / (1 - self.gamma ** (self.num_iter))
-        return -self.alpha * hat_m / (np.sqrt(hat_v) + self.epsilon)
+ return -self.alpha * hat_m / (np.sqrt(hat_v) + self.epsilon)
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/core/model.html b/manual/develop/en/_modules/physbo/gp/core/model.html index eb653bc6..5a9b13ce 100644 --- a/manual/develop/en/_modules/physbo/gp/core/model.html +++ b/manual/develop/en/_modules/physbo/gp/core/model.html @@ -1,18 +1,22 @@ - + - physbo.gp.core.model — PHYSBO 1.2-dev documentation - - + physbo.gp.core.model — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -85,7 +89,9 @@

Source code for physbo.gp.core.model

 from physbo.gp.core.prior import prior
 
 
-
[docs]class model: +
+[docs] +class model: def __init__(self, lik, mean, cov, inf="exact"): """ @@ -103,7 +109,9 @@

Source code for physbo.gp.core.model

         self.params = self.cat_params(self.lik.params, self.prior.params)
         self.stats = ()
 
-
[docs] def cat_params(self, lik_params, prior_params): +
+[docs] + def cat_params(self, lik_params, prior_params): """ Concatinate the likelihood and prior parameters @@ -121,7 +129,10 @@

Source code for physbo.gp.core.model

         params = np.append(lik_params, prior_params)
         return params
-
[docs] def decomp_params(self, params=None): + +
+[docs] + def decomp_params(self, params=None): """ decomposing the parameters to those of likelifood and priors @@ -142,7 +153,10 @@

Source code for physbo.gp.core.model

         prior_params = params[self.lik.num_params :]
         return lik_params, prior_params
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ Setting parameters @@ -156,7 +170,10 @@

Source code for physbo.gp.core.model

         self.lik.set_params(lik_params)
         self.prior.set_params(prior_params)
-
[docs] def sub_sampling(self, X, t, N): + +
+[docs] + def sub_sampling(self, X, t, N): """ Make subset for sampling @@ -184,7 +201,10 @@

Source code for physbo.gp.core.model

             subt = t
         return subX, subt
-
[docs] def export_blm(self, num_basis): + +
+[docs] + def export_blm(self, num_basis): """ Exporting the blm(Baysean linear model) predictor @@ -210,7 +230,10 @@

Source code for physbo.gp.core.model

 
         return blr
-
[docs] def eval_marlik(self, params, X, t, N=None): + +
+[docs] + def eval_marlik(self, params, X, t, N=None): """ Evaluating marginal likelihood. @@ -238,7 +261,10 @@

Source code for physbo.gp.core.model

 
         return marlik
-
[docs] def get_grad_marlik(self, params, X, t, N=None): + +
+[docs] + def get_grad_marlik(self, params, X, t, N=None): """ Evaluating gradiant of marginal likelihood. @@ -264,7 +290,10 @@

Source code for physbo.gp.core.model

             grad_marlik = inf.exact.get_grad_marlik(self, subX, subt, params=params)
         return grad_marlik
-
[docs] def get_params_bound(self): + +
+[docs] + def get_params_bound(self): """ Getting boundary of the parameters. @@ -283,7 +312,10 @@

Source code for physbo.gp.core.model

             bound.extend(self.prior.cov.get_params_bound())
         return bound
-
[docs] def prepare(self, X, t, params=None): + +
+[docs] + def prepare(self, X, t, params=None): """ Parameters @@ -304,7 +336,10 @@

Source code for physbo.gp.core.model

         else:
             pass
-
[docs] def get_post_fmean(self, X, Z, params=None): + +
+[docs] + def get_post_fmean(self, X, Z, params=None): """ Calculating posterior mean of model (function) @@ -328,7 +363,10 @@

Source code for physbo.gp.core.model

 
         return post_fmu
-
[docs] def get_post_fcov(self, X, Z, params=None, diag=True): + +
+[docs] + def get_post_fcov(self, X, Z, params=None, diag=True): """ Calculating posterior covariance matrix of model (function) @@ -356,7 +394,10 @@

Source code for physbo.gp.core.model

 
         return post_fcov
-
[docs] def post_sampling(self, X, Z, params=None, N=1, alpha=1): + +
+[docs] + def post_sampling(self, X, Z, params=None, N=1, alpha=1): """ draws samples of mean value of model @@ -382,7 +423,10 @@

Source code for physbo.gp.core.model

         fcov = self.get_post_fcov(X, Z, params=None, diag=False)
         return np.random.multivariate_normal(fmean, fcov * alpha**2, N)
-
[docs] def predict_sampling(self, X, Z, params=None, N=1): + +
+[docs] + def predict_sampling(self, X, Z, params=None, N=1): """ Parameters @@ -415,7 +459,10 @@

Source code for physbo.gp.core.model

 
         return np.random.multivariate_normal(fmean, fcov, N)
-
[docs] def print_params(self): + +
+[docs] + def print_params(self): """ Printing parameters """ @@ -429,7 +476,10 @@

Source code for physbo.gp.core.model

         print("covariance parameter in GP prior: ", self.prior.cov.params)
         print("\n")
-
[docs] def get_cand_params(self, X, t): + +
+[docs] + def get_cand_params(self, X, t): """ Getting candidate for parameters @@ -464,7 +514,10 @@

Source code for physbo.gp.core.model

 
         return params
-
[docs] def fit(self, X, t, config): + +
+[docs] + def fit(self, X, t, config): """ Fitting function (update parameters) @@ -489,7 +542,9 @@

Source code for physbo.gp.core.model

             bfgs = learning.batch(self, config)
             params = bfgs.run(X, t)
 
-        self.set_params(params)
+ self.set_params(params)
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/core/prior.html b/manual/develop/en/_modules/physbo/gp/core/prior.html index 5527fbe3..c65007b3 100644 --- a/manual/develop/en/_modules/physbo/gp/core/prior.html +++ b/manual/develop/en/_modules/physbo/gp/core/prior.html @@ -1,18 +1,22 @@ - + - physbo.gp.core.prior — PHYSBO 1.2-dev documentation - - + physbo.gp.core.prior — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -81,7 +85,9 @@

Source code for physbo.gp.core.prior

 import scipy
 
 
-
[docs]class prior: +
+[docs] +class prior: """prior of gaussian process""" def __init__(self, mean, cov): @@ -99,7 +105,9 @@

Source code for physbo.gp.core.prior

         self.num_params = self.cov.num_params + self.mean.num_params
         self.params = self.cat_params(self.mean.params, self.cov.params)
 
-
[docs] def cat_params(self, mean_params, cov_params): +
+[docs] + def cat_params(self, mean_params, cov_params): """ Parameters @@ -114,7 +122,10 @@

Source code for physbo.gp.core.prior

         """
         return np.append(mean_params, cov_params)
-
[docs] def decomp_params(self, params): + +
+[docs] + def decomp_params(self, params): """ decomposing the parameters to those of mean values and covariance matrix for priors @@ -135,7 +146,10 @@

Source code for physbo.gp.core.prior

         cov_params = params[self.mean.num_params :]
         return mean_params, cov_params
-
[docs] def get_mean(self, num_data, params=None): + +
+[docs] + def get_mean(self, num_data, params=None): """ Calculating the mean value of priors @@ -153,7 +167,10 @@

Source code for physbo.gp.core.prior

             params = np.copy(self.params)
         return self.mean.get_mean(num_data, params[0 : self.mean.num_params])
-
[docs] def get_cov(self, X, Z=None, params=None, diag=False): + +
+[docs] + def get_cov(self, X, Z=None, params=None, diag=False): """ Calculating the variance-covariance matrix of priors @@ -176,7 +193,10 @@

Source code for physbo.gp.core.prior

 
         return self.cov.get_cov(X, Z, params=params[self.mean.num_params :], diag=diag)
-
[docs] def get_grad_mean(self, num_data, params=None): + +
+[docs] + def get_grad_mean(self, num_data, params=None): """ Calculating the gradiant of mean values of priors @@ -198,7 +218,10 @@

Source code for physbo.gp.core.prior

         mean_params, cov_params = self.decomp_params(params)
         return self.mean.get_grad(num_data, params=mean_params)
-
[docs] def get_grad_cov(self, X, params=None): + +
+[docs] + def get_grad_cov(self, X, params=None): """ Calculating the covariance matrix priors @@ -219,7 +242,10 @@

Source code for physbo.gp.core.prior

         mean_params, cov_params = self.decomp_params(params)
         return self.cov.get_grad(X, params=cov_params)
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ Setting parameters @@ -232,7 +258,10 @@

Source code for physbo.gp.core.prior

         self.set_mean_params(mean_params)
         self.set_cov_params(cov_params)
-
[docs] def set_mean_params(self, params): + +
+[docs] + def set_mean_params(self, params): """ Setting parameters for mean values of priors @@ -245,7 +274,10 @@

Source code for physbo.gp.core.prior

             self.params[0 : self.mean.num_params] = params
             self.mean.set_params(params)
-
[docs] def set_cov_params(self, params): + +
+[docs] + def set_cov_params(self, params): """ Setting parameters for covariance matrix of priors @@ -257,7 +289,10 @@

Source code for physbo.gp.core.prior

         self.params[self.mean.num_params :] = params
         self.cov.set_params(params)
-
[docs] def sampling(self, X, N=1): + +
+[docs] + def sampling(self, X, N=1): """ Sampling from GP prior @@ -276,7 +311,9 @@

Source code for physbo.gp.core.prior

         G = self.get_cov(X) + 1e-8 * np.identity(num_data)
         U = scipy.linalg.cholesky(G, check_finite=False)
         Z = np.random.randn(N, num_data)
-        return np.dot(Z, U) + self.get_mean(num_data)
+ return np.dot(Z, U) + self.get_mean(num_data)
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/cov/gauss.html b/manual/develop/en/_modules/physbo/gp/cov/gauss.html index d45319c4..30cfbbff 100644 --- a/manual/develop/en/_modules/physbo/gp/cov/gauss.html +++ b/manual/develop/en/_modules/physbo/gp/cov/gauss.html @@ -1,18 +1,22 @@ - + - physbo.gp.cov.gauss — PHYSBO 1.2-dev documentation - - + physbo.gp.cov.gauss — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -83,7 +87,9 @@

Source code for physbo.gp.cov.gauss

 from ._src.enhance_gauss import grad_width64
 
 
-
[docs]class gauss: +
+[docs] +class gauss: """gaussian kernel""" def __init__( @@ -138,7 +144,9 @@

Source code for physbo.gp.cov.gauss

         params = self.cat_params(self.width, self.scale)
         self.set_params(params)
 
-
[docs] def print_params(self): +
+[docs] + def print_params(self): """ show the current kernel parameters @@ -150,7 +158,10 @@

Source code for physbo.gp.cov.gauss

         print(" scale2 = ", +self.scale**2)
         print(" \n")
-
[docs] def prepare(self, params=None): + +
+[docs] + def prepare(self, params=None): """ Setting parameters @@ -176,7 +187,10 @@

Source code for physbo.gp.cov.gauss

 
         return params, width, scale
-
[docs] def get_grad(self, X, params=None): + +
+[docs] + def get_grad(self, X, params=None): """ Getting gradiant values of X @@ -206,7 +220,10 @@

Source code for physbo.gp.cov.gauss

         grad[-1, :, :] = 2 * G
         return grad
-
[docs] def get_cov(self, X, Z=None, params=None, diag=False): + +
+[docs] + def get_cov(self, X, Z=None, params=None, diag=False): """ compute the covariant matrix Parameters @@ -247,7 +264,10 @@

Source code for physbo.gp.cov.gauss

 
         return G
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ set kernel parameters @@ -261,7 +281,10 @@

Source code for physbo.gp.cov.gauss

         self.params = params
         self.width, self.scale = self.decomp_params(params)
-
[docs] def supp_params(self, params): + +
+[docs] + def supp_params(self, params): """ Set maximum (minimum) values for parameters when the parameter is greater(less) than this value. @@ -290,7 +313,10 @@

Source code for physbo.gp.cov.gauss

 
         return params
-
[docs] def decomp_params(self, params): + +
+[docs] + def decomp_params(self, params): """ decompose the parameters defined on the log region into width and scale parameters @@ -310,7 +336,10 @@

Source code for physbo.gp.cov.gauss

         scale = np.exp(params[-1])
         return width, scale
-
[docs] def save(self, file_name): + +
+[docs] + def save(self, file_name): """ save the gaussian kernel @@ -334,7 +363,10 @@

Source code for physbo.gp.cov.gauss

         with open(file_name, "wb") as f:
             np.savez(f, **kwarg)
-
[docs] def load(self, file_name): + +
+[docs] + def load(self, file_name): """ Recovering the Gaussian kernel from file Parameters @@ -354,7 +386,10 @@

Source code for physbo.gp.cov.gauss

         params = temp["params"]
         self.set_params(params)
-
[docs] def get_params_bound(self): + +
+[docs] + def get_params_bound(self): """ Getting boundary array. @@ -375,7 +410,10 @@

Source code for physbo.gp.cov.gauss

         bound.append((self.min_ln_scale, self.max_ln_scale))
         return bound
-
[docs] def cat_params(self, width, scale): + +
+[docs] + def cat_params(self, width, scale): """ Taking the logarithm of width and scale parameters and concatinate them into one ndarray @@ -395,7 +433,10 @@

Source code for physbo.gp.cov.gauss

         params[-1] = np.log(scale)
         return params
-
[docs] def rand_expans(self, num_basis, params=None): + +
+[docs] + def rand_expans(self, num_basis, params=None): """ Kernel Expansion @@ -417,7 +458,10 @@

Source code for physbo.gp.cov.gauss

         b = np.random.rand(num_basis) * 2 * np.pi
         return (W, b, amp)
-
[docs] def get_cand_params(self, X, t): + +
+[docs] + def get_cand_params(self, X, t): """ Getting candidate parameters. @@ -462,7 +506,9 @@

Source code for physbo.gp.cov.gauss

             width = dist[(2 * n + 1) * tmp]
             scale = np.std(t)
             params = np.append(np.log(width + 1e-8), np.log(scale))
-        return params
+ return params
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/inf/exact.html b/manual/develop/en/_modules/physbo/gp/inf/exact.html index b218a240..d165545f 100644 --- a/manual/develop/en/_modules/physbo/gp/inf/exact.html +++ b/manual/develop/en/_modules/physbo/gp/inf/exact.html @@ -1,18 +1,22 @@ - + - physbo.gp.inf.exact — PHYSBO 1.2-dev documentation - - + physbo.gp.inf.exact — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -83,7 +87,9 @@

Source code for physbo.gp.inf.exact

 from copy import deepcopy
 
 
-
[docs]def eval_marlik(gp, X, t, params=None): +
+[docs] +def eval_marlik(gp, X, t, params=None): """ Evaluating marginal likelihood. @@ -125,7 +131,10 @@

Source code for physbo.gp.inf.exact

     return marlik
-
[docs]def get_grad_marlik(gp, X, t, params=None): + +
+[docs] +def get_grad_marlik(gp, X, t, params=None): """ Evaluating gradiant of marginal likelihood. @@ -189,7 +198,10 @@

Source code for physbo.gp.inf.exact

     return grad_marlik
-
[docs]def prepare(gp, X, t, params=None): + +
+[docs] +def prepare(gp, X, t, params=None): """ Parameters @@ -228,7 +240,10 @@

Source code for physbo.gp.inf.exact

     return stats
-
[docs]def get_post_fmean(gp, X, Z, params=None): + +
+[docs] +def get_post_fmean(gp, X, Z, params=None): """ Calculating the mean of posterior @@ -261,7 +276,10 @@

Source code for physbo.gp.inf.exact

     return G.dot(alpha) + fmu
-
[docs]def get_post_fcov(gp, X, Z, params=None, diag=True): + +
+[docs] +def get_post_fcov(gp, X, Z, params=None, diag=True): """ Calculating the covariance of posterior @@ -301,6 +319,7 @@

Source code for physbo.gp.inf.exact

         post_cov = K - np.dot(invUG.transpose(), invUG)
 
     return post_cov
+
diff --git a/manual/develop/en/_modules/physbo/gp/lik/gauss.html b/manual/develop/en/_modules/physbo/gp/lik/gauss.html index 17780110..2d0c0a0b 100644 --- a/manual/develop/en/_modules/physbo/gp/lik/gauss.html +++ b/manual/develop/en/_modules/physbo/gp/lik/gauss.html @@ -1,18 +1,22 @@ - + - physbo.gp.lik.gauss — PHYSBO 1.2-dev documentation - - + physbo.gp.lik.gauss — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -81,7 +85,9 @@

Source code for physbo.gp.lik.gauss

 import numpy as np
 
 
-
[docs]class gauss: +
+[docs] +class gauss: """Gaussian likelihood function""" def __init__(self, std=1, max_params=1e6, min_params=1e-6): @@ -105,7 +111,9 @@

Source code for physbo.gp.lik.gauss

         self.params = np.log(std)
         self.set_params(self.params)
 
-
[docs] def supp_params(self, params=None): +
+[docs] + def supp_params(self, params=None): """ Set maximum (minimum) values for parameters when the parameter is greater(less) than this value. @@ -129,7 +137,10 @@

Source code for physbo.gp.lik.gauss

 
         return params
-
[docs] def trans_params(self, params=None): + +
+[docs] + def trans_params(self, params=None): """ Get exp[params]. @@ -149,7 +160,10 @@

Source code for physbo.gp.lik.gauss

         std = np.exp(params)
         return std
-
[docs] def get_params_bound(self): + +
+[docs] + def get_params_bound(self): """ Get boundary array. @@ -161,7 +175,10 @@

Source code for physbo.gp.lik.gauss

         bound = [(self.min_params, self.max_params) for i in range(0, self.num_params)]
         return bound
-
[docs] def get_cov(self, num_data, params=None): + +
+[docs] + def get_cov(self, num_data, params=None): """ Get a covariance matrix @@ -181,7 +198,10 @@

Source code for physbo.gp.lik.gauss

         var = std**2
         return var * np.identity(num_data)
-
[docs] def get_grad(self, num_data, params=None): + +
+[docs] + def get_grad(self, num_data, params=None): """ Get a gradient matrix @@ -201,7 +221,10 @@

Source code for physbo.gp.lik.gauss

         var = std**2
         return var * np.identity(num_data) * 2
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ Set parameters. @@ -218,7 +241,10 @@

Source code for physbo.gp.lik.gauss

         self.params = self.supp_params(params)
         self.std = self.trans_params(params)
-
[docs] def get_cand_params(self, t): + +
+[docs] + def get_cand_params(self, t): """ Getting candidate parameters. @@ -234,8 +260,11 @@

Source code for physbo.gp.lik.gauss

         """
         return np.log(np.std(t) / 10)
+ # [TODO] Check: This function seems not to be used. -
[docs] def sampling(self, fmean): +
+[docs] + def sampling(self, fmean): """ Sampling by adding noise @@ -249,7 +278,9 @@

Source code for physbo.gp.lik.gauss

         """
         num_data = fmean.shape[0]
         eps = self.std * np.random.randn(num_data)
-        return fmean + eps
+ return fmean + eps
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/mean/const.html b/manual/develop/en/_modules/physbo/gp/mean/const.html index 30a3e3b2..8c78f0a1 100644 --- a/manual/develop/en/_modules/physbo/gp/mean/const.html +++ b/manual/develop/en/_modules/physbo/gp/mean/const.html @@ -1,18 +1,22 @@ - + - physbo.gp.mean.const — PHYSBO 1.2-dev documentation - - + physbo.gp.mean.const — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.gp.mean.const

 import numpy as np
 
 
-
[docs]class const: +
+[docs] +class const: """constant""" def __init__(self, params=None, max_params=1e12, min_params=-1e12): @@ -101,7 +107,9 @@

Source code for physbo.gp.mean.const

         self.init_params(params)
         self.num_params = 1
 
-
[docs] def supp_params(self, params): +
+[docs] + def supp_params(self, params): """ Setting maximum and minimum value of parameters. @@ -122,7 +130,10 @@

Source code for physbo.gp.mean.const

 
         return params
-
[docs] def get_params_bound(self): + +
+[docs] + def get_params_bound(self): """ Getting the boundary list for parameters @@ -135,7 +146,10 @@

Source code for physbo.gp.mean.const

         bound = [(self.min_params, self.max_params) for i in range(0, self.num_params)]
         return bound
-
[docs] def get_mean(self, num_data, params=None): + +
+[docs] + def get_mean(self, num_data, params=None): """ Parameters @@ -153,7 +167,10 @@

Source code for physbo.gp.mean.const

             params = np.copy(self.params)
         return params * np.ones(num_data)
-
[docs] def get_grad(self, num_data, params=None): + +
+[docs] + def get_grad(self, num_data, params=None): """ Returning a new array of (num_data), filled with ones. @@ -170,7 +187,10 @@

Source code for physbo.gp.mean.const

         """
         return np.ones(num_data)
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ Setting parameters defined in const class. @@ -185,7 +205,10 @@

Source code for physbo.gp.mean.const

         """
         self.params = params
-
[docs] def init_params(self, params): + +
+[docs] + def init_params(self, params): """ Initializing parameters @@ -204,7 +227,10 @@

Source code for physbo.gp.mean.const

         else:
             self.params = self.supp_params(params)
-
[docs] def get_cand_params(self, t): + +
+[docs] + def get_cand_params(self, t): """ Getting the median array of candidates. @@ -219,7 +245,9 @@

Source code for physbo.gp.mean.const

             A new array holding the result.
 
         """
-        return np.median(t)
+ return np.median(t)
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/mean/zero.html b/manual/develop/en/_modules/physbo/gp/mean/zero.html index fd294b63..31bda1de 100644 --- a/manual/develop/en/_modules/physbo/gp/mean/zero.html +++ b/manual/develop/en/_modules/physbo/gp/mean/zero.html @@ -1,18 +1,22 @@ - + - physbo.gp.mean.zero — PHYSBO 1.2-dev documentation - - + physbo.gp.mean.zero — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,14 +84,18 @@

Source code for physbo.gp.mean.zero

 import numpy as np
 
 
-
[docs]class zero: +
+[docs] +class zero: """zero""" def __init__(self): self.num_params = 0 self.params = np.array([]) -
[docs] def get_mean(self, num_data, params=None): +
+[docs] + def get_mean(self, num_data, params=None): """ Returning numpy.zeros(num_data) @@ -105,7 +113,10 @@

Source code for physbo.gp.mean.zero

         """
         return np.zeros(num_data)
-
[docs] def get_grad(self, num_data, params=None): + +
+[docs] + def get_grad(self, num_data, params=None): """ Returning empty numpy.ndarray @@ -123,7 +134,10 @@

Source code for physbo.gp.mean.zero

         """
         return np.array([])
-
[docs] def set_params(self, params): + +
+[docs] + def set_params(self, params): """ Not defined @@ -135,7 +149,9 @@

Source code for physbo.gp.mean.zero

         -------
 
         """
-        pass
+ pass
+
+
diff --git a/manual/develop/en/_modules/physbo/gp/predictor.html b/manual/develop/en/_modules/physbo/gp/predictor.html index a8da2f95..1ad9d88b 100644 --- a/manual/develop/en/_modules/physbo/gp/predictor.html +++ b/manual/develop/en/_modules/physbo/gp/predictor.html @@ -1,18 +1,22 @@ - + - physbo.gp.predictor — PHYSBO 1.2-dev documentation - - + physbo.gp.predictor — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.gp.predictor

 import physbo.predictor
 
 
-
[docs]class predictor(physbo.predictor.base_predictor): +
+[docs] +class predictor(physbo.predictor.base_predictor): """predictor""" def __init__(self, config, model=None): @@ -94,7 +100,9 @@

Source code for physbo.gp.predictor

         """
         super(predictor, self).__init__(config, model)
 
-
[docs] def fit(self, training, num_basis=None): +
+[docs] + def fit(self, training, num_basis=None): """ Fitting model to training dataset @@ -110,7 +118,10 @@

Source code for physbo.gp.predictor

         self.model.fit(training.X, training.t, self.config)
         self.delete_stats()
-
[docs] def get_basis(self, *args, **kwds): + +
+[docs] + def get_basis(self, *args, **kwds): """ Parameters @@ -124,7 +135,10 @@

Source code for physbo.gp.predictor

         """
         pass
-
[docs] def get_post_params(self, *args, **kwds): + +
+[docs] + def get_post_params(self, *args, **kwds): """ Parameters @@ -138,10 +152,16 @@

Source code for physbo.gp.predictor

         """
         pass
-
[docs] def update(self, training, test): + +
+[docs] + def update(self, training, test): self.prepare(training)
-
[docs] def prepare(self, training): + +
+[docs] + def prepare(self, training): """ Initializing model by using training data set @@ -153,10 +173,16 @@

Source code for physbo.gp.predictor

         """
         self.model.prepare(training.X, training.t)
-
[docs] def delete_stats(self): + +
+[docs] + def delete_stats(self): self.model.stats = None
-
[docs] def get_post_fmean(self, training, test): + +
+[docs] + def get_post_fmean(self, training, test): """ Calculating posterior mean value of model @@ -176,7 +202,10 @@

Source code for physbo.gp.predictor

             self.prepare(training)
         return self.model.get_post_fmean(training.X, test.X)
-
[docs] def get_post_fcov(self, training, test, diag=True): + +
+[docs] + def get_post_fcov(self, training, test, diag=True): """ Calculating posterior variance-covariance matrix of model @@ -197,7 +226,10 @@

Source code for physbo.gp.predictor

             self.prepare(training)
         return self.model.get_post_fcov(training.X, test.X, diag=diag)
-
[docs] def get_post_samples(self, training, test, alpha=1): + +
+[docs] + def get_post_samples(self, training, test, alpha=1): """ Drawing samples of mean values of model @@ -218,7 +250,10 @@

Source code for physbo.gp.predictor

             self.prepare(training)
         return self.model.post_sampling(training.X, test.X, alpha=alpha)
-
[docs] def get_predict_samples(self, training, test, N=1): + +
+[docs] + def get_predict_samples(self, training, test, N=1): """ Drawing samples of values of model @@ -239,7 +274,9 @@

Source code for physbo.gp.predictor

         """
         if self.model.stats is None:
             self.prepare(training)
-        return self.model.predict_sampling(training.X, test.X, N=N)
+ return self.model.predict_sampling(training.X, test.X, N=N)
+
+
diff --git a/manual/develop/en/_modules/physbo/misc/centering.html b/manual/develop/en/_modules/physbo/misc/centering.html index 0966b1b2..ae1d90c7 100644 --- a/manual/develop/en/_modules/physbo/misc/centering.html +++ b/manual/develop/en/_modules/physbo/misc/centering.html @@ -1,18 +1,22 @@ - + - physbo.misc.centering — PHYSBO 1.2-dev documentation - - + physbo.misc.centering — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -80,7 +84,9 @@

Source code for physbo.misc.centering

 import numpy as np
 
 
-
[docs]def centering(X): +
+[docs] +def centering(X): """ Normalize the mean and standard deviation along the each column of X to 0 and 1, respectively @@ -98,6 +104,7 @@

Source code for physbo.misc.centering

     index = np.where(stdX != 0)
     X_normalized = (X[:, index[0]] - np.mean(X[:, index[0]], 0)) / stdX[index[0]]
     return X_normalized
+
diff --git a/manual/develop/en/_modules/physbo/misc/gauss_elim.html b/manual/develop/en/_modules/physbo/misc/gauss_elim.html index 6b4ef53a..7e2976cd 100644 --- a/manual/develop/en/_modules/physbo/misc/gauss_elim.html +++ b/manual/develop/en/_modules/physbo/misc/gauss_elim.html @@ -1,18 +1,22 @@ - + - physbo.misc.gauss_elim — PHYSBO 1.2-dev documentation - - + physbo.misc.gauss_elim — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -81,7 +85,9 @@

Source code for physbo.misc.gauss_elim

 import scipy
 
 
-
[docs]def gauss_elim(U, t): +
+[docs] +def gauss_elim(U, t): """ Calculate alpha using scipy.linalg.solve_triangular. alpha = (U^T U)^-1 t = U^-1 [(U^T)-1 t] @@ -105,6 +111,7 @@

Source code for physbo.misc.gauss_elim

         U, alpha, lower=False, overwrite_b=False, check_finite=False
     )
     return alpha
+
diff --git a/manual/develop/en/_modules/physbo/misc/set_config.html b/manual/develop/en/_modules/physbo/misc/set_config.html index be3dea07..cd94bb5b 100644 --- a/manual/develop/en/_modules/physbo/misc/set_config.html +++ b/manual/develop/en/_modules/physbo/misc/set_config.html @@ -1,18 +1,22 @@ - + - physbo.misc.set_config — PHYSBO 1.2-dev documentation - - + physbo.misc.set_config — PHYSBO 1.1.1 documentation + + + + - - - + + + + + @@ -31,7 +35,7 @@ PHYSBO
- 1.2 + 1.1
@@ -81,7 +85,9 @@

Source code for physbo.misc.set_config

 import configparser
 
 
-
[docs]class set_config: +
+[docs] +class set_config: def __init__(self, search_config=None, learning_config=None): """ Setting configuration for search and learning. @@ -100,7 +106,9 @@

Source code for physbo.misc.set_config

             learning_config = adam()
         self.learning = learning_config
 
-
[docs] def show(self): +
+[docs] + def show(self): """ Showing information of search and learning objects. @@ -111,7 +119,10 @@

Source code for physbo.misc.set_config

         self.search.show()
         self.learning.show()
-
[docs] def load(self, file_name="config.ini"): + +
+[docs] + def load(self, file_name="config.ini"): """ Loading information of configuration. @@ -141,15 +152,21 @@

Source code for physbo.misc.set_config

         if method in ("bfgs", "batch"):
             learning_config = batch()
             self.learning = learning_config
-            self.learning.load(config)
+ self.learning.load(config)
+
+ -