Skip to content

Commit a363b12

Browse files
committed
Updated jupter notebooks
1 parent c630a15 commit a363b12

29 files changed

+5708
-45
lines changed

books/.ipynb_checkpoints/krg-checkpoint.ipynb

Lines changed: 455 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Basic Surrogate Models
2+
3+
This section provides implementation for concepts related to basic surrogate models. As discussed in the lecture, one of the ways to create a model of $y(x)$ is by considering a linearly weighted combination of basis functions. Mathematically, this can be represented as:
4+
5+
$$
6+
y(x) \sim \hat{y}(x) = \mathbf{w}^T\pmb{\psi} = \sum w_i \psi_i(x)
7+
$$
8+
9+
where $\mathbf{\pmb{\psi}}$ is the vector of basis functions and $\mathbf{w}$ is the vector of weights. The model is linear in terms of weights $w_i$ but basis function $\psi_i(x)$ can be non-linear. For example, the basis functions vector $\pmb{\psi}$ can be $[1 \text{ } x \text{ } x^2 \text{ } \sin(x) \text{ } e^{x}]^T$. The weights $w_i$ are determined by minimizing the sum of squared differences between the predictions and actual values. The weights obtained after minimization are given by (refer lecture notes for derivation):
10+
11+
$$
12+
\mathbf{w} = (\Psi^T\Psi)^{-1}\Psi^T\mathbf{y} = \Psi^{\dagger}\mathbf{y}
13+
$$
14+
15+
where $\mathbf{y}$ is the vector of target values and $\Psi^{\dagger}$ is the (Moore-Penrose) pseudo-inverse of $\Psi$ matrix. The pseudo-inverse will be regular inverse if $\Psi$ is invertible. The performance of the model can be evaluated using the mean squared error (MSE) which is given by:
16+
17+
$$
18+
\text{RMSE} = \sqrt{ \frac{1}{N}\sum_{i=1}^{N} (y_i - \hat{y}_i)^2 }
19+
$$
20+
21+
where $N$ is the number of data points, $y_i$ and $\hat{y}_i$ are the true and predicted values respectively.
22+
23+
In this section, following models are covered:
24+
25+
1. Linear model
26+
2. Polynomial model
27+
3. Radial basis function model

books/basic_sm/.ipynb_checkpoints/ls_regression-checkpoint.ipynb

Lines changed: 241 additions & 0 deletions
Large diffs are not rendered by default.

books/basic_sm/.ipynb_checkpoints/poly-checkpoint.ipynb

Lines changed: 672 additions & 0 deletions
Large diffs are not rendered by default.

books/basic_sm/.ipynb_checkpoints/rbf-checkpoint.ipynb

Lines changed: 532 additions & 0 deletions
Large diffs are not rendered by default.

books/basic_sm/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Basic Surrogate Models
22

3-
This section provides implementation for the concepts covered in the class for basic surrogate models. As discussed in the lecture, one of the ways to create a model of $y(x)$ is by considering a linearly weighted combination of basis functions. Mathematically, this can be represented as:
3+
This section provides implementation for concepts related to basic surrogate models. As discussed in the lecture, one of the ways to create a model of $y(x)$ is by considering a linearly weighted combination of basis functions. Mathematically, this can be represented as:
44

55
$$
66
y(x) \sim \hat{y}(x) = \mathbf{w}^T\pmb{\psi} = \sum w_i \psi_i(x)

books/basic_sm/poly.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Polynomial Model\n",
88
"\n",
9-
"This section supports material covered in the class for polynomial models. Below block of code imports required packages."
9+
"This section provides implementation for concepts related to polynomial models. Below block of code imports required packages."
1010
]
1111
},
1212
{
@@ -650,7 +650,7 @@
650650
],
651651
"metadata": {
652652
"kernelspec": {
653-
"display_name": "sm",
653+
"display_name": "Python 3 (ipykernel)",
654654
"language": "python",
655655
"name": "python3"
656656
},
@@ -664,9 +664,9 @@
664664
"name": "python",
665665
"nbconvert_exporter": "python",
666666
"pygments_lexer": "ipython3",
667-
"version": "3.12.0"
667+
"version": "3.9.19"
668668
}
669669
},
670670
"nbformat": 4,
671-
"nbformat_minor": 2
671+
"nbformat_minor": 4
672672
}

books/basic_sm/rbf.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Radial Basis Function Model\n",
88
"\n",
9-
"This section supports material covered in the class for radial basis function (RBF) model. In these models, a specific type of basis functions is used which computes similarity between inputs and a set of reference points in the design space. Let $\\mathbf{x}$ be the input vector, $\\mathbf{c}_i$ be the $i^{th}$ reference point vector, and $r_i$ be the euclidean distance between $\\mathbf{x}$ and $\\mathbf{c}_i$ i.e. $|| \\mathbf{x} - \\mathbf{c}_i ||_2$. Then, the basis function vector will be:\n",
9+
"This section provides implementation for concepts related to radial basis function (RBF) model. In these models, a specific type of basis functions is used which computes similarity between inputs and a set of reference points in the design space. Let $\\mathbf{x}$ be the input vector, $\\mathbf{c}_i$ be the $i^{th}$ reference point vector, and $r_i$ be the euclidean distance between $\\mathbf{x}$ and $\\mathbf{c}_i$ i.e. $|| \\mathbf{x} - \\mathbf{c}_i ||_2$. Then, the basis function vector will be:\n",
1010
"\n",
1111
"$$\n",
1212
" \\pmb{\\psi} = [ \\psi_1(r_1) \\quad \\cdots \\quad \\psi_i(r_i) \\quad \\cdots \\quad \\psi_n(r_n)]^T\n",
@@ -510,7 +510,7 @@
510510
],
511511
"metadata": {
512512
"kernelspec": {
513-
"display_name": "sm",
513+
"display_name": "Python 3 (ipykernel)",
514514
"language": "python",
515515
"name": "python3"
516516
},
@@ -524,9 +524,9 @@
524524
"name": "python",
525525
"nbconvert_exporter": "python",
526526
"pygments_lexer": "ipython3",
527-
"version": "3.12.0"
527+
"version": "3.9.19"
528528
}
529529
},
530530
"nbformat": 4,
531-
"nbformat_minor": 2
531+
"nbformat_minor": 4
532532
}

books/const_seq_sampling/.ipynb_checkpoints/const_ei-checkpoint.ipynb

Lines changed: 445 additions & 0 deletions
Large diffs are not rendered by default.

books/const_seq_sampling/.ipynb_checkpoints/const_exploit-checkpoint.ipynb

Lines changed: 427 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)