forked from SMTorg/smt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Hwang
authored and
John Hwang
committed
Aug 7, 2017
1 parent
b729770
commit bc75cc2
Showing
25 changed files
with
1,914 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = SMT | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
python preprocess.py | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Methods | ||
======= | ||
|
||
Placeholder text. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
methods/rbf | ||
methods/idw | ||
methods/rmtb | ||
methods/rmtc | ||
methods/ls | ||
methods/pa2 | ||
methods/krg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
Inverse-distance weighting | ||
========================== | ||
|
||
.. code-block:: python | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from smt.methods import IDW | ||
xt = np.array([0., 1., 2., 3., 4.]) | ||
yt = np.array([0., 1., 1.5, 0.5, 1.0]) | ||
sm = IDW(p=2) | ||
sm.set_training_values(xt, yt) | ||
sm.train() | ||
num = 100 | ||
x = np.linspace(0., 4., num) | ||
y = sm.predict_values(x) | ||
plt.plot(xt, yt, 'o') | ||
plt.plot(x, y) | ||
plt.xlabel('x') | ||
plt.ylabel('x') | ||
plt.legend(['Training data', 'Prediction']) | ||
plt.show() | ||
.. plot:: | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
from smt.methods import IDW | ||
|
||
xt = np.array([0., 1., 2., 3., 4.]) | ||
yt = np.array([0., 1., 1.5, 0.5, 1.0]) | ||
|
||
sm = IDW(p=2) | ||
sm.set_training_values(xt, yt) | ||
sm.train() | ||
|
||
num = 100 | ||
x = np.linspace(0., 4., num) | ||
y = sm.predict_values(x) | ||
|
||
plt.plot(xt, yt, 'o') | ||
plt.plot(x, y) | ||
plt.xlabel('x') | ||
plt.ylabel('x') | ||
plt.legend(['Training data', 'Prediction']) | ||
plt.show() | ||
|
||
:: | ||
|
||
___________________________________________________________________________ | ||
IDW | ||
___________________________________________________________________________ | ||
Problem size | ||
# training points. : 5 | ||
___________________________________________________________________________ | ||
Training | ||
Training ... | ||
Training - done. Time (sec): 0.0001831 | ||
___________________________________________________________________________ | ||
Evaluation | ||
# eval points. : 100 | ||
Predicting ... | ||
Predicting - done. Time (sec): 0.0000508 | ||
Prediction time/pt. (sec) : 0.0000005 | ||
|
||
.. list-table:: List of options | ||
:header-rows: 1 | ||
:widths: 15, 10, 20, 20, 30 | ||
:stub-columns: 0 | ||
|
||
* - Option | ||
- Default | ||
- Acceptable values | ||
- Acceptable values | ||
- Description | ||
* - print_global | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Global print toggle. If False, all printing is suppressed | ||
* - print_training | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print training information | ||
* - print_prediction | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print prediction information | ||
* - print_problem | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print problem information | ||
* - print_solver | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print solver information | ||
* - p | ||
- 2.5 | ||
- [None] | ||
- ['int', 'float'] | ||
- order of distance norm | ||
* - data_dir | ||
- None | ||
- [None] | ||
- ['str'] | ||
- Directory for loading / saving cached data; None means do not save or load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Inverse-distance weighting | ||
========================== | ||
|
||
.. embed-test-plot-print :: _src_docs/methods/test_simple.py , Test , test_idw | ||
|
||
.. embed-options-table :: IDW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
Kriging | ||
======= | ||
|
||
.. code-block:: python | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from smt.methods import KRG | ||
xt = np.array([0., 1., 2., 3., 4.]) | ||
yt = np.array([0., 1., 1.5, 0.5, 1.0]) | ||
sm = KRG(theta0=[1e-2]) | ||
sm.set_training_values(xt, yt) | ||
sm.train() | ||
num = 100 | ||
x = np.linspace(0., 4., num) | ||
y = sm.predict_values(x) | ||
plt.plot(xt, yt, 'o') | ||
plt.plot(x, y) | ||
plt.xlabel('x') | ||
plt.ylabel('x') | ||
plt.legend(['Training data', 'Prediction']) | ||
plt.show() | ||
.. plot:: | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
from smt.methods import KRG | ||
|
||
xt = np.array([0., 1., 2., 3., 4.]) | ||
yt = np.array([0., 1., 1.5, 0.5, 1.0]) | ||
|
||
sm = KRG(theta0=[1e-2]) | ||
sm.set_training_values(xt, yt) | ||
sm.train() | ||
|
||
num = 100 | ||
x = np.linspace(0., 4., num) | ||
y = sm.predict_values(x) | ||
|
||
plt.plot(xt, yt, 'o') | ||
plt.plot(x, y) | ||
plt.xlabel('x') | ||
plt.ylabel('x') | ||
plt.legend(['Training data', 'Prediction']) | ||
plt.show() | ||
|
||
:: | ||
|
||
___________________________________________________________________________ | ||
Kriging | ||
___________________________________________________________________________ | ||
Problem size | ||
# training points. : 5 | ||
___________________________________________________________________________ | ||
Training | ||
Training ... | ||
Training - done. Time (sec): 0.0056038 | ||
___________________________________________________________________________ | ||
Evaluation | ||
# eval points. : 100 | ||
Predicting ... | ||
Predicting - done. Time (sec): 0.0001500 | ||
Prediction time/pt. (sec) : 0.0000015 | ||
|
||
.. list-table:: List of options | ||
:header-rows: 1 | ||
:widths: 15, 10, 20, 20, 30 | ||
:stub-columns: 0 | ||
|
||
* - Option | ||
- Default | ||
- Acceptable values | ||
- Acceptable values | ||
- Description | ||
* - print_global | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Global print toggle. If False, all printing is suppressed | ||
* - print_training | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print training information | ||
* - print_prediction | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print prediction information | ||
* - print_problem | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print problem information | ||
* - print_solver | ||
- True | ||
- [None] | ||
- ['bool'] | ||
- Whether to print solver information | ||
* - theta0 | ||
- None | ||
- [None] | ||
- ['list', 'ndarray'] | ||
- Initial hyperparameters | ||
* - poly | ||
- constant | ||
- ['constant', 'linear', 'quadratic'] | ||
- ['function'] | ||
- regr. term | ||
* - corr | ||
- squar_exp | ||
- ['abs_exp', 'squar_exp'] | ||
- ['function'] | ||
- type of corr. func. | ||
* - data_dir | ||
- None | ||
- [None] | ||
- ['str'] | ||
- Directory for loading / saving cached data; None means do not save or load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Kriging | ||
======= | ||
|
||
.. embed-test-plot-print :: _src_docs/methods/test_simple.py , Test , test_krg | ||
|
||
.. embed-options-table :: KRG |
Oops, something went wrong.