chapter
int64
1
14
question_number
stringlengths
3
5
difficulty
stringclasses
3 values
question_text
stringlengths
64
8.24k
answer
stringlengths
56
16.5k
answer_length
int64
14
16.6k
3
3.11
medium
- 3.11 (\*\*) We have seen that, as the size of a data set increases, the uncertainty associated with the posterior distribution over model parameters decreases. Make use of the matrix identity (Appendix C) $$\left(\mathbf{M} + \mathbf{v}\mathbf{v}^{\mathrm{T}}\right)^{-1} = \mathbf{M}^{-1} - \frac{\left(\mathbf{M}^{-...
We need to use the result obtained in Prob.3.8. In Prob.3.8, we have derived a formula for $\mathbf{S}_{N+1}^{-1}$ : $$S_{N+1}^{-1} = S_N^{-1} + \beta \, \phi(x_{N+1}) \, \phi(x_{N+1})^T$$ And then using $\left(\mathbf{M} + \mathbf{v}\mathbf{v}^{\mathrm{T}}\right)^{-1} = \mathbf{M}^{-1} - \frac{\left(\mathbf{M}^{-1...
1,746
3
3.12
medium
We saw in Section 2.3.6 that the conjugate prior for a Gaussian distribution with unknown mean and unknown precision (inverse variance) is a normal-gamma distribution. This property also holds for the case of the conditional Gaussian distribution $p(t|\mathbf{x}, \mathbf{w}, \beta)$ of the linear regression model. If...
Let's begin by writing down the prior PDF $p(\mathbf{w}, \beta)$ : $$p(\boldsymbol{w}, \beta) = \mathcal{N}(\boldsymbol{w} | \boldsymbol{m_0}, \beta^{-1} \boldsymbol{S_0}) \operatorname{Gam}(\beta | a_0, b_0) \quad (*)$$ $$\propto \left(\frac{\beta}{|\boldsymbol{S_0}|}\right)^2 exp\left(-\frac{1}{2}(\boldsymbol{w} -...
3,411
3
3.13
medium
Show that the predictive distribution $p(t|\mathbf{x}, \mathbf{t})$ for the model discussed in Exercise 3.12 is given by a Student's t-distribution of the form $$p(t|\mathbf{x}, \mathbf{t}) = \operatorname{St}(t|\mu, \lambda, \nu) \tag{3.114}$$ and obtain expressions for $\mu$ , $\lambda$ and $\nu$ .
Similar to $p(t|\mathbf{t},\alpha,\beta) = \int p(t|\mathbf{w},\beta)p(\mathbf{w}|\mathbf{t},\alpha,\beta) \,d\mathbf{w}$, we write down the expression of the predictive distribution $p(t|\mathbf{X},\mathbf{t})$ : $$p(t|\mathbf{X},\mathbf{t}) = \int \int p(t|\mathbf{w},\beta) \, p(\mathbf{w},\beta|\mathbf{X},\mathbf{...
3,355
3
3.15
easy
- 3.15 (\*) Consider a linear basis function model for regression in which the parameters $\alpha$ and $\beta$ are set using the evidence framework. Show that the function $E(\mathbf{m}_N)$ defined by $E(\mathbf{m}_N) = \frac{\beta}{2} \|\mathbf{t} - \mathbf{\Phi} \mathbf{m}_N\|^2 + \frac{\alpha}{2} \mathbf{m}_N...
It is quite obvious if we substitute $\alpha = \frac{\gamma}{\mathbf{m}_N^{\mathrm{T}} \mathbf{m}_N}.$ and $\frac{1}{\beta} = \frac{1}{N - \gamma} \sum_{n=1}^{N} \left\{ t_n - \mathbf{m}_N^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}_n) \right\}^2.$ into $E(\mathbf{m}_N) = \frac{\beta}{2} \|\mathbf{t} - \mathbf{\Phi} \mat...
1,514
3
3.17
easy
Show that the evidence function for the Bayesian linear regression model can be written in the form $p(\mathbf{t}|\alpha,\beta) = \left(\frac{\beta}{2\pi}\right)^{N/2} \left(\frac{\alpha}{2\pi}\right)^{M/2} \int \exp\left\{-E(\mathbf{w})\right\} d\mathbf{w}$ in which $E(\mathbf{w})$ is defined by $= \frac{\beta}{2} \...
We know that: $$p(\mathbf{t}|\mathbf{w}, \beta) = \prod_{n=1}^{N} \mathcal{N}(\phi(\mathbf{x}_{n})^{T}\mathbf{w}, \beta^{-1})$$ $$= \prod_{n=1}^{N} \frac{1}{(2\pi\beta^{-1})^{1/2}} exp\{-\frac{1}{2\beta^{-1}} (t_{n} - \phi(\mathbf{x}_{n})^{T}\mathbf{w})^{2}\}$$ $$= (\frac{\beta}{2\pi})^{N/2} exp\{\sum_{n=1}^{N} -\fr...
1,032
3
3.18
medium
By completing the square over w, show that the error function $= \frac{\beta}{2} \|\mathbf{t} - \mathbf{\Phi} \mathbf{w}\|^2 + \frac{\alpha}{2} \mathbf{w}^{\mathrm{T}} \mathbf{w}.$ in Bayesian linear regression can be written in the form $E(\mathbf{w}) = E(\mathbf{m}_N) + \frac{1}{2}(\mathbf{w} - \mathbf{m}_N)^{\mathrm...
We expand $= \frac{\beta}{2} \|\mathbf{t} - \mathbf{\Phi} \mathbf{w}\|^2 + \frac{\alpha}{2} \mathbf{w}^{\mathrm{T}} \mathbf{w}.$ as follows: $$E(\boldsymbol{w}) = \frac{\beta}{2} ||\mathbf{t} - \boldsymbol{\Phi} \boldsymbol{w}||^2 + \frac{\alpha}{2} \boldsymbol{w}^T \boldsymbol{w}$$ $$= \frac{\beta}{2} (\mathbf{t}^T ...
3,565
3
3.19
medium
Show that the integration over w in the Bayesian linear regression model gives the result $= \exp\left\{-E(\mathbf{m}_N)\right\} (2\pi)^{M/2} |\mathbf{A}|^{-1/2}.$. Hence show that the log marginal likelihood is given by $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alpha + \frac{N}{2} \ln \beta - E(\mathbf{m}_N) ...
Based on the standard form of a multivariate normal distribution, we know that $$\int \frac{1}{(2\pi)^{M/2}} \frac{1}{|\mathbf{A}|^{1/2}} exp\left\{-\frac{1}{2}(\mathbf{w} - \mathbf{m}_{N})^{T} \mathbf{A}(\mathbf{w} - \mathbf{m}_{N})\right\} d\mathbf{w} = 1$$ Hence, $$\int exp\left\{-\frac{1}{2}(\boldsymbol{w}-\bold...
1,067
3
3.2
medium
$ Show that the matrix $$\mathbf{\Phi}(\mathbf{\Phi}^{\mathrm{T}}\mathbf{\Phi})^{-1}\mathbf{\Phi}^{\mathrm{T}} \tag{3.103}$$ takes any vector $\mathbf{v}$ and projects it onto the space spanned by the columns of $\mathbf{\Phi}$ . Use this result to show that the least-squares solution $\mathbf{w}_{\mathrm{ML}} = ...
To begin with, if we denote $\mathbf{v}^* = (\mathbf{\Phi}^T \mathbf{\Phi})^{-1} \mathbf{\Phi}^T \mathbf{v}$ . Then we have: $$\mathbf{\Phi}(\mathbf{\Phi}^T\mathbf{\Phi})^{-1}\mathbf{\Phi}^T\mathbf{v} = \mathbf{\Phi}\mathbf{v}^* \tag{1}$$ By definition, $\Phi v^*$ is in the column space of $\Phi$ . In other words...
1,269
3
3.20
medium
Starting from $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alpha + \frac{N}{2} \ln \beta - E(\mathbf{m}_N) - \frac{1}{2} \ln |\mathbf{A}| - \frac{N}{2} \ln(2\pi)$ verify all of the steps needed to show that maximization of the log marginal likelihood function $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alp...
You can just follow the steps from $(\beta \mathbf{\Phi}^{\mathrm{T}} \mathbf{\Phi}) \mathbf{u}_i = \lambda_i \mathbf{u}_i.$ to $\alpha = \frac{\gamma}{\mathbf{m}_N^{\mathrm{T}} \mathbf{m}_N}.$, which is already very clear.
239
3
3.21
medium
An alternative way to derive the result $\alpha = \frac{\gamma}{\mathbf{m}_N^{\mathrm{T}} \mathbf{m}_N}.$ for the optimal value of $\alpha$ in the evidence framework is to make use of the identity $$\frac{d}{d\alpha}\ln|\mathbf{A}| = \operatorname{Tr}\left(\mathbf{A}^{-1}\frac{d}{d\alpha}\mathbf{A}\right). \tag{3.11...
Let's first prove $\frac{d}{d\alpha}\ln|\mathbf{A}| = \operatorname{Tr}\left(\mathbf{A}^{-1}\frac{d}{d\alpha}\mathbf{A}\right).$. According to (C.47) and (C.48), we know that if **A** is a $M \times M$ real symmetric matrix, with eigenvalues $\lambda_i$ , i = 1, 2, ..., M, $|\mathbf{A}|$ and $\text{Tr}(\mathbf{A}...
1,515
3
3.22
medium
Starting from $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alpha + \frac{N}{2} \ln \beta - E(\mathbf{m}_N) - \frac{1}{2} \ln |\mathbf{A}| - \frac{N}{2} \ln(2\pi)$ verify all of the steps needed to show that maximization of the log marginal likelihood function $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alp...
Let's derive $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alpha + \frac{N}{2} \ln \beta - E(\mathbf{m}_N) - \frac{1}{2} \ln |\mathbf{A}| - \frac{N}{2} \ln(2\pi)$ with regard to $\beta$ . The first term dependent on $\beta$ in $\ln p(\mathbf{t}|\alpha,\beta) = \frac{M}{2} \ln \alpha + \frac{N}{2} \ln \beta - E(...
2,993
3
3.23
medium
Show that the marginal probability of the data, in other words the model evidence, for the model described in Exercise 3.12 is given by $$p(\mathbf{t}) = \frac{1}{(2\pi)^{N/2}} \frac{b_0^{a_0}}{b_N^{a_N}} \frac{\Gamma(a_N)}{\Gamma(a_0)} \frac{|\mathbf{S}_N|^{1/2}}{|\mathbf{S}_0|^{1/2}}$$ $p(\mathbf{t}) = \frac{1}{(2\p...
First, according to $p(\mathbf{t}|\mathbf{X}, \mathbf{w}, \beta) = \prod_{n=1}^{N} \mathcal{N}(t_n | \mathbf{w}^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}_n), \beta^{-1})$, we know that $p(\mathbf{t}|\mathbf{X}, \boldsymbol{w}, \beta)$ can be further written as $p(\mathbf{t}|\mathbf{X}, \boldsymbol{w}, \beta) = \math...
3,362
3
3.24
medium
$ Repeat the previous exercise but now use Bayes' theorem in the form $$p(\mathbf{t}) = \frac{p(\mathbf{t}|\mathbf{w}, \beta)p(\mathbf{w}, \beta)}{p(\mathbf{w}, \beta|\mathbf{t})}$$ $p(\mathbf{t}) = \frac{p(\mathbf{t}|\mathbf{w}, \beta)p(\mathbf{w}, \beta)}{p(\mathbf{w}, \beta|\mathbf{t})}$ and then substitute for t...
Let's just follow the hint and we begin by writing down expression for the likelihood, prior and posterior PDF. We know that $p(\mathbf{t}|\boldsymbol{w},\beta) = \mathcal{N}(\mathbf{t}|\boldsymbol{\Phi}\boldsymbol{w},\beta^{-1}\mathbf{I})$ . What's more, the form of the prior and posterior are quite similar: $$p(\bo...
4,987
3
3.3
easy
Consider a data set in which each data point $t_n$ is associated with a weighting factor $r_n > 0$ , so that the sum-of-squares error function becomes $$E_D(\mathbf{w}) = \frac{1}{2} \sum_{n=1}^{N} r_n \left\{ t_n - \mathbf{w}^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}_n) \right\}^2.$$ $E_D(\mathbf{w}) = \frac{1}{2...
Let's calculate the derivative of $E_D(\mathbf{w}) = \frac{1}{2} \sum_{n=1}^{N} r_n \left\{ t_n - \mathbf{w}^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}_n) \right\}^2.$ with respect to $\boldsymbol{w}$ . $$\nabla E_D(\boldsymbol{w}) = \sum_{n=1}^{N} r_n \left\{ t_n - \boldsymbol{w}^T \boldsymbol{\Phi}(\boldsymbol{x_n})...
2,003
3
3.4
easy
Consider a linear model of the form $$y(x, \mathbf{w}) = w_0 + \sum_{i=1}^{D} w_i x_i$$ $y(x, \mathbf{w}) = w_0 + \sum_{i=1}^{D} w_i x_i$ together with a sum-of-squares error function of the form $$E_D(\mathbf{w}) = \frac{1}{2} \sum_{n=1}^{N} \{y(x_n, \mathbf{w}) - t_n\}^2.$$ $E_D(\mathbf{w}) = \frac{1}{2} \sum_{n...
Firstly, we rearrange $E_D(\boldsymbol{w})$ . $$\begin{split} E_{D}(\boldsymbol{w}) &= \frac{1}{2} \sum_{n=1}^{N} \left\{ \left[ w_{0} + \sum_{i=1}^{D} w_{i}(x_{i} + \epsilon_{i}) \right] - t_{n} \right\}^{2} \\ &= \frac{1}{2} \sum_{n=1}^{N} \left\{ \left( w_{0} + \sum_{i=1}^{D} w_{i}x_{i} \right) - t_{n} + \sum_{i=1...
1,964
3
3.5
easy
Using the technique of Lagrange multipliers, discussed in Appendix E, show that minimization of the regularized error function $\frac{1}{2} \sum_{n=1}^{N} \{t_n - \mathbf{w}^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}_n)\}^2 + \frac{\lambda}{2} \sum_{j=1}^{M} |w_j|^q$ is equivalent to minimizing the unregularized sum-of-...
We can firstly rewrite the constraint $\sum_{j=1}^{M} |w_j|^q \leqslant \eta$ as: $$\frac{1}{2} \left( \sum_{j=1}^{M} |w_j|^q - \eta \right) \le 0$$ Where we deliberately introduce scaling factor 1/2 for convenience. Then it is straightforward to obtain the Lagrange function. $$L(\boldsymbol{w}, \lambda) = \frac{1}{...
937
3
3.6
easy
Consider a linear basis function regression model for a multivariate target variable t having a Gaussian distribution of the form $$p(\mathbf{t}|\mathbf{W}, \mathbf{\Sigma}) = \mathcal{N}(\mathbf{t}|\mathbf{y}(\mathbf{x}, \mathbf{W}), \mathbf{\Sigma})$$ $p(\mathbf{t}|\mathbf{W}, \mathbf{\Sigma}) = \mathcal{N}(\mathbf...
Firstly, we write down the log likelihood function. $$lnp(\boldsymbol{T}|\boldsymbol{X}, \boldsymbol{W}, \boldsymbol{\beta}) = -\frac{N}{2}ln|\boldsymbol{\Sigma}| - \frac{1}{2}\sum_{n=1}^{N} \left[\boldsymbol{t_n} - \boldsymbol{W}^T \boldsymbol{\phi}(\boldsymbol{x_n})\right]^T \boldsymbol{\Sigma}^{-1} \left[\boldsymbo...
1,591
3
3.7
easy
By using the technique of completing the square, verify the result (3.49) for the posterior distribution of the parameters w in the linear basis function model in which $\mathbf{m}_N$ and $\mathbf{S}_N$ are defined by $\mathbf{m}_{N} = \mathbf{S}_{N} \left( \mathbf{S}_{0}^{-1} \mathbf{m}_{0} + \beta \mathbf{\Phi}^{...
Let's begin by writing down the prior distribution p(w) and likelihood function $p(t|X, w, \beta)$ . $$p(\boldsymbol{w}) = \mathcal{N}(\boldsymbol{w}|\boldsymbol{m}_0, \boldsymbol{S}_0) , \quad p(\boldsymbol{t}|\boldsymbol{X}, \boldsymbol{w}, \boldsymbol{\beta}) = \prod_{n=1}^{N} \mathcal{N}(t_n|\boldsymbol{w}^T \bol...
1,934
3
3.8
medium
Consider the linear basis function model in Section 3.1, and suppose that we have already observed N data points, so that the posterior distribution over w is given by (3.49). This posterior can be regarded as the prior for the next observation. By considering an additional data point $(\mathbf{x}_{N+1}, t_{N+1})$ , a...
Firstly, we write down the prior: $$p(\boldsymbol{w}) = \mathcal{N}(\boldsymbol{m}_{N}, \boldsymbol{S}_{N})$$ Where $m_N$ , $S_N$ are given by $\mathbf{m}_{N} = \mathbf{S}_{N} \left( \mathbf{S}_{0}^{-1} \mathbf{m}_{0} + \beta \mathbf{\Phi}^{\mathrm{T}} \mathbf{t} \right)$ and $\mathbf{S}_N^{-1} = \mathbf{S}_0^{-1}...
1,513
3
3.9
medium
Repeat the previous exercise but instead of completing the square by hand, make use of the general result for linear-Gaussian models given by $p(\mathbf{x}|\mathbf{y}) = \mathcal{N}(\mathbf{x}|\mathbf{\Sigma}\{\mathbf{A}^{\mathrm{T}}\mathbf{L}(\mathbf{y}-\mathbf{b}) + \mathbf{\Lambda}\boldsymbol{\mu}\}, \mathbf{\Sigma}...
We know that the prior $p(\mathbf{w})$ can be written as: $$p(\boldsymbol{w}) = \mathcal{N}(\boldsymbol{m}_{N}, \boldsymbol{S}_{N})$$ And the likelihood function $p(t_{N+1}|\boldsymbol{x_{N+1}},\boldsymbol{w})$ can be written as: $$p(t_{N+1}|x_{N+1}, w) = \mathcal{N}(t_{N+1}|y(x_{N+1}, w), \beta^{-1})$$ Accordi...
1,406
4
4.1
medium
$ Given a set of data points $\{\mathbf{x}_n\}$ , we can define the *convex hull* to be the set of all points $\mathbf{x}$ given by $$\mathbf{x} = \sum_{n} \alpha_n \mathbf{x}_n \tag{4.156}$$ where $\alpha_n \geqslant 0$ and $\sum_n \alpha_n = 1$ . Consider a second set of points $\{\mathbf{y}_n\}$ together ...
If the convex hull of $\{\mathbf{x_n}\}$ and $\{\mathbf{y_n}\}$ intersects, we know that there will be a point $\mathbf{z}$ which can be written as $\mathbf{z} = \sum_n \alpha_n \mathbf{x_n}$ and also $\mathbf{z} = \sum_n \beta_n \mathbf{y_n}$ . Hence we can obtain: $$\widehat{\mathbf{w}}^T \mathbf{z} + w_0 =...
1,703
4
4.11
medium
Consider a classification problem with K classes for which the feature vector $\phi$ has M components each of which can take L discrete states. Let the values of the components be represented by a 1-of-L binary coding scheme. Further suppose that, conditioned on the class $\mathcal{C}_k$ , the M components of $\phi...
Based on definition, we can write down $$p(\boldsymbol{\phi}|C_k) = \prod_{m=1}^{M} \prod_{l=1}^{L} \mu_{kml}^{\phi_{ml}}$$ Note that here only one of the value among $\phi_{m1}$ , $\phi_{m2}$ , ... $\phi_{mL}$ is 1, and the others are all 0 because we have used a 1-of-L binary coding scheme, and also we have tak...
723
4
4.12
easy
Verify the relation $\frac{d\sigma}{da} = \sigma(1 - \sigma).$ for the derivative of the logistic sigmoid function defined by $\sigma(a) = \frac{1}{1 + \exp(-a)}$.
Based on definition, i.e., $\sigma(a) = \frac{1}{1 + \exp(-a)}$, we know that logistic sigmoid has the form: $$\sigma(a) = \frac{1}{1 + exp(-a)}$$ Now, we calculate its derivative with regard to a. $$\frac{d\sigma(a)}{da} = \frac{exp(a)}{[1+exp(-a)]^2} = \frac{exp(a)}{1+exp(-a)} \cdot \frac{1}{1+exp(-a)} = [1-\sigma...
369
4
4.13
easy
By making use of the result $\frac{d\sigma}{da} = \sigma(1 - \sigma).$ for the derivative of the logistic sigmoid, show that the derivative of the error function $E(\mathbf{w}) = -\ln p(\mathbf{t}|\mathbf{w}) = -\sum_{n=1}^{N} \{t_n \ln y_n + (1 - t_n) \ln(1 - y_n)\}$ for the logistic regression model is given by $\nab...
Let's follow the hint. $$\nabla E(\mathbf{w}) = -\nabla \sum_{n=1}^{N} \{t_n \ln y_n + (1 - t_n) \ln(1 - y_n)\}$$ $$= -\sum_{n=1}^{N} \nabla \{t_n \ln y_n + (1 - t_n) \ln(1 - y_n)\}$$ $$= -\sum_{n=1}^{N} \frac{d\{t_n \ln y_n + (1 - t_n) \ln(1 - y_n)\}}{dy_n} \frac{dy_n}{da_n} \frac{da_n}{d\mathbf{w}}$$ $$= -\sum_{n...
736
4
4.14
easy
Show that for a linearly separable data set, the maximum likelihood solution for the logistic regression model is obtained by finding a vector $\mathbf{w}$ whose decision boundary $\mathbf{w}^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}) = 0$ separates the classes and then taking the magnitude of $\mathbf{w}$ to inf...
According to definition, we know that if a dataset is linearly separable, we can find $\mathbf{w}$ , for some points $\mathbf{x_n}$ , we have $\mathbf{w}^T \boldsymbol{\phi}(\mathbf{x_n}) > 0$ , and the others $\mathbf{w}^T \boldsymbol{\phi}(\mathbf{x_m}) < 0$ . Then the boundary is given by $\mathbf{w}^T \boldsym...
3,587
4
4.16
easy
Consider a binary classification problem in which each observation $\mathbf{x}_n$ is known to belong to one of two classes, corresponding to t=0 and t=1, and suppose that the procedure for collecting training data is imperfect, so that training points are sometimes mislabelled. For every data point $\mathbf{x}_n$ , ...
We still denote $y_n = p(t = 1 | \phi_n)$ , and then we can write down the log likelihood by replacing $t_n$ with $\pi_n$ in $p(\mathbf{t}|\mathbf{w}) = \prod_{n=1}^{N} y_n^{t_n} \left\{ 1 - y_n \right\}^{1 - t_n}$ and $E(\mathbf{w}) = -\ln p(\mathbf{t}|\mathbf{w}) = -\sum_{n=1}^{N} \{t_n \ln y_n + (1 - t_n) \ln(1...
445
4
4.17
easy
Show that the derivatives of the softmax activation function $p(\mathcal{C}_k|\phi) = y_k(\phi) = \frac{\exp(a_k)}{\sum_j \exp(a_j)}$, where the $a_k$ are defined by $a_k = \mathbf{w}_k^{\mathrm{T}} \boldsymbol{\phi}.$, are given by $\frac{\partial y_k}{\partial a_j} = y_k (I_{kj} - y_j)$.
We should discuss in two situations separately, namely j = k and $j \neq k$ . When $j \neq k$ , we have: $$\frac{\partial y_k}{\partial a_j} = \frac{-exp(a_k) \cdot exp(a_j)}{[\sum_j exp(a_j)]^2} = -y_k \cdot y_j$$ And when j = k, we have: $$\frac{\partial y_k}{\partial a_k} = \frac{exp(a_k)\sum_j exp(a_j) - exp(a...
528
4
4.18
easy
Using the result $\nabla E(\mathbf{w}) = \sum_{n=1}^{N} (y_n - t_n) \phi_n$ for the derivatives of the softmax activation function, show that the gradients of the cross-entropy error $E(\mathbf{w}_1, \dots, \mathbf{w}_K) = -\ln p(\mathbf{T}|\mathbf{w}_1, \dots, \mathbf{w}_K) = -\sum_{n=1}^{N} \sum_{k=1}^{K} t_{nk} \ln ...
We derive every term $t_{nk} \ln y_{nk}$ with regard to $a_j$ . $$\begin{array}{lll} \frac{\partial t_{nk} \ln y_{nk}}{\partial \mathbf{w_j}} & = & \frac{\partial t_{nk} \ln y_{nk}}{\partial y_{nk}} \frac{\partial y_{nk}}{\partial a_j} \frac{\partial a_j}{\partial \mathbf{w_j}} \\ & = & t_{nk} \frac{1}{y_{nk}} \cdo...
6,125
4
4.19
easy
Write down expressions for the gradient of the log likelihood, as well as the corresponding Hessian matrix, for the probit regression model defined in Section 4.3.5. These are the quantities that would be required to train such a model using IRLS.
Using the cross-entropy error function $E(\mathbf{w}) = -\ln p(\mathbf{t}|\mathbf{w}) = -\sum_{n=1}^{N} \{t_n \ln y_n + (1 - t_n) \ln(1 - y_n)\}$, and following Exercise 4.13, we have $$\frac{\partial E}{\partial y_n} = \frac{y_n - t_n}{y_n (1 - y_n)}. (108)$$ Also $$\nabla a_n = \phi_n. \tag{109}$$ From $\operator...
1,741
4
4.2
medium
$ Consider the minimization of a sum-of-squares error function $E_D(\widetilde{\mathbf{W}}) = \frac{1}{2} \text{Tr} \left\{ (\widetilde{\mathbf{X}} \widetilde{\mathbf{W}} - \mathbf{T})^{\mathrm{T}} (\widetilde{\mathbf{X}} \widetilde{\mathbf{W}} - \mathbf{T}) \right\}.$, and suppose that all of the target vectors in t...
Let's make the dependency of $E_D(\widetilde{\mathbf{W}})$ on $w_0$ explicitly: $$E_D(\widetilde{\mathbf{W}}) = \frac{1}{2} \text{Tr} \{ (\mathbf{X} \mathbf{W} + \mathbf{1} \mathbf{w_0}^T - \mathbf{T})^T (\mathbf{X} \mathbf{W} + \mathbf{1} \mathbf{w_0}^T - \mathbf{T}) \}$$ Then we calculate the derivative of $E_...
3,167
4
4.21
easy
Show that the probit function $\Phi(a) = \int_{-\infty}^{a} \mathcal{N}(\theta|0,1) \,\mathrm{d}\theta$ and the erf function $\operatorname{erf}(a) = \frac{2}{\sqrt{\pi}} \int_0^a \exp(-\theta^2/2) \, \mathrm{d}\theta$ are related by $\Phi(a) = \frac{1}{2} \left\{ 1 + \frac{1}{\sqrt{2}} \operatorname{erf}(a) \right\}.$...
It is quite obvious. $$\begin{split} \Phi(a) &= \int_{-\infty}^{a} \mathcal{N}(\theta|0,1) d\theta \\ &= \frac{1}{2} + \int_{0}^{a} \mathcal{N}(\theta|0,1) d\theta \\ &= \frac{1}{2} + \int_{0}^{a} \mathcal{N}(\theta|0,1) d\theta \\ &= \frac{1}{2} + \frac{1}{\sqrt{2\pi}} \int_{0}^{a} exp(-\theta^{2}/2) d\theta \\ &= \f...
695
4
4.22
easy
Using the result $= f(\mathbf{z}_0) \frac{(2\pi)^{M/2}}{|\mathbf{A}|^{1/2}}$, derive the expression $\ln p(\mathcal{D}) \simeq \ln p(\mathcal{D}|\boldsymbol{\theta}_{\text{MAP}}) + \underbrace{\ln p(\boldsymbol{\theta}_{\text{MAP}}) + \frac{M}{2}\ln(2\pi) - \frac{1}{2}\ln|\mathbf{A}|}_{\text{Occam factor}}$ for the log...
If we denote $f(\theta) = p(D|\theta)p(\theta)$ , we can write: $$p(D) = \int p(D|\boldsymbol{\theta})p(\boldsymbol{\theta})d\boldsymbol{\theta} = \int f(\boldsymbol{\theta})d\boldsymbol{\theta}$$ $$= f(\boldsymbol{\theta}_{MAP})\frac{(2\pi)^{M/2}}{|\mathbf{A}|^{1/2}}$$ $$= p(D|\boldsymbol{\theta}_{MAP})p(\boldsymbol...
769
4
4.23
medium
In this exercise, we derive the BIC result $\ln p(\mathcal{D}) \simeq \ln p(\mathcal{D}|\boldsymbol{\theta}_{\text{MAP}}) - \frac{1}{2}M \ln N$ starting from the Laplace approximation to the model evidence given by $\ln p(\mathcal{D}) \simeq \ln p(\mathcal{D}|\boldsymbol{\theta}_{\text{MAP}}) + \underbrace{\ln p(\bolds...
According to $\ln p(\mathcal{D}) \simeq \ln p(\mathcal{D}|\boldsymbol{\theta}_{\text{MAP}}) + \underbrace{\ln p(\boldsymbol{\theta}_{\text{MAP}}) + \frac{M}{2}\ln(2\pi) - \frac{1}{2}\ln|\mathbf{A}|}_{\text{Occam factor}}$, we can write: $$\ln p(D) = \ln p(D|\boldsymbol{\theta}_{MAP}) + \ln p(\boldsymbol{\theta}_{MAP})...
4,100
4
4.25
medium
Suppose we wish to approximate the logistic sigmoid $\sigma(a)$ defined by $\sigma(a) = \frac{1}{1 + \exp(-a)}$ by a scaled probit function $\Phi(\lambda a)$ , where $\Phi(a)$ is defined by $\Phi(a) = \int_{-\infty}^{a} \mathcal{N}(\theta|0,1) \,\mathrm{d}\theta$. Show that if $\lambda$ is chosen so that the der...
We first need to obtain the expression for the first derivative of probit function $\Phi(\lambda a)$ with regard to a. According to $\Phi(a) = \int_{-\infty}^{a} \mathcal{N}(\theta|0,1) \,\mathrm{d}\theta$, we can write down: $$\frac{d}{da}\Phi(\lambda a) = \frac{d\Phi(\lambda a)}{d(\lambda a)} \cdot \frac{d\lambda ...
913
4
4.26
medium
In this exercise, we prove the relation (4.152) for the convolution of a probit function with a Gaussian distribution. To do this, show that the derivative of the left-hand side with respect to $\mu$ is equal to the derivative of the right-hand side, and then integrate both sides with respect to $\mu$ and then show...
We will prove (4.152) in a more simple and intuitive way. But firstly, we need to prove a trivial yet useful statement: Suppose we have a random variable satisfied normal distribution denoted as $X \sim \mathcal{N}(X|\mu,\sigma^2)$ , the probability of $X \leq x$ is $P(X \leq x) = \Phi(\frac{x-\mu}{\sigma})$ , and ...
2,001
4
4.3
medium
Extend the result of Exercise 4.2 to show that if multiple linear constraints are satisfied simultaneously by the target vectors, then the same constraints will also be satisfied by the least-squares prediction of a linear model.
Suppose there are Q constraints in total. We can write $\mathbf{a_q}^T \mathbf{t_n} + b_q = 0$ , q = 1, 2, ..., Q for all the target vector $\mathbf{t_n}$ , n = 1, 2, ..., N. Or alternatively, we can group them together: $$\mathbf{A}^T \mathbf{t_n} + \mathbf{b} = \mathbf{0}$$ Where **A** is a $Q \times Q$ matrix,...
759
4
4.4
easy
Show that maximization of the class separation criterion given by $m_k = \mathbf{w}^{\mathrm{T}} \mathbf{m}_k$ with respect to $\mathbf{w}$ , using a Lagrange multiplier to enforce the constraint $\mathbf{w}^T\mathbf{w}=1$ , leads to the result that $\mathbf{w} \propto (\mathbf{m}_2 \mathbf{m}_1)$ .
We use Lagrange multiplier to enforce the constraint $\mathbf{w}^T\mathbf{w} = 1$ . We now need to maximize: $$L(\lambda, \mathbf{w}) = \mathbf{w}^T (\mathbf{m}_2 - \mathbf{m}_1) + \lambda (\mathbf{w}^T \mathbf{w} - 1)$$ We calculate the derivatives: $$\frac{\partial L(\lambda, \mathbf{w})}{\partial \lambda} = \mat...
628
4
4.5
easy
By making use of $y = \mathbf{w}^{\mathrm{T}} \mathbf{x}.$, $m_k = \mathbf{w}^{\mathrm{T}} \mathbf{m}_k$, and $s_k^2 = \sum_{n \in \mathcal{C}_k} (y_n - m_k)^2$, show that the Fisher criterion $J(\mathbf{w}) = \frac{(m_2 - m_1)^2}{s_1^2 + s_2^2}.$ can be written in the form $J(\mathbf{w}) = \frac{\mathbf{w}^{\mathrm{T}...
We expand $J(\mathbf{w}) = \frac{(m_2 - m_1)^2}{s_1^2 + s_2^2}.$ using $m_2 - m_1 = \mathbf{w}^{\mathrm{T}}(\mathbf{m}_2 - \mathbf{m}_1)$, $m_k = \mathbf{w}^{\mathrm{T}} \mathbf{m}_k$ and $s_k^2 = \sum_{n \in \mathcal{C}_k} (y_n - m_k)^2$. $$J(\mathbf{w}) = \frac{(m_2 - m_1)^2}{s_1^2 + s_2^2}$$ $$= \frac{||\mathbf{w}...
1,354
4
4.6
easy
Using the definitions of the between-class and within-class covariance matrices given by $\mathbf{S}_{\mathrm{B}} = (\mathbf{m}_2 - \mathbf{m}_1)(\mathbf{m}_2 - \mathbf{m}_1)^{\mathrm{T}}$ and $\mathbf{S}_{W} = \sum_{n \in \mathcal{C}_{1}} (\mathbf{x}_{n} - \mathbf{m}_{1})(\mathbf{x}_{n} - \mathbf{m}_{1})^{\mathrm{T}} ...
Let's follow the hint, beginning by expanding $\sum_{n=1}^{N} \left( \mathbf{w}^{\mathrm{T}} \mathbf{x}_n + w_0 - t_n \right) \mathbf{x}_n = 0.$. $$(4.33) = \sum_{n=1}^{N} \mathbf{w}^{T} \mathbf{x}_{n} \mathbf{x}_{n} + w_{0} \sum_{n=1}^{N} \mathbf{x}_{n} - \sum_{n=1}^{N} t_{n} \mathbf{x}_{n}$$ $$= \sum_{n=1}^{N} \mat...
3,750
4
4.7
easy
Show that the logistic sigmoid function $\sigma(a) = \frac{1}{1 + \exp(-a)}$ satisfies the property $\sigma(-a) = 1 \sigma(a)$ and that its inverse is given by $\sigma^{-1}(y) = \ln \{y/(1-y)\}$ .
This problem is quite simple. We can solve it by definition. We know that logistic sigmoid function has the form: $$\sigma(a) = \frac{1}{1 + exp(-a)}$$ Therefore, we can obtain: $$\sigma(a) + \sigma(-a) = \frac{1}{1 + exp(-a)} + \frac{1}{1 + exp(a)}$$ $$= \frac{2 + exp(a) + exp(-a)}{[1 + exp(-a)][1 + exp(a)]}$$ $$...
680
4
4.8
easy
Using $= \frac{1}{1 + \exp(-a)} = \sigma(a)$ and $a = \ln \frac{p(\mathbf{x}|\mathcal{C}_1)p(\mathcal{C}_1)}{p(\mathbf{x}|\mathcal{C}_2)p(\mathcal{C}_2)}$, derive the result $p(\mathcal{C}_1|\mathbf{x}) = \sigma(\mathbf{w}^{\mathrm{T}}\mathbf{x} + w_0)$ for the posterior class probability in the two-class generative mo...
According to $a = \ln \frac{p(\mathbf{x}|\mathcal{C}_1)p(\mathcal{C}_1)}{p(\mathbf{x}|\mathcal{C}_2)p(\mathcal{C}_2)}$ and $p(\mathbf{x}|\mathcal{C}_k) = \frac{1}{(2\pi)^{D/2}} \frac{1}{|\mathbf{\Sigma}|^{1/2}} \exp\left\{-\frac{1}{2} (\mathbf{x} - \boldsymbol{\mu}_k)^{\mathrm{T}} \mathbf{\Sigma}^{-1} (\mathbf{x} - \bo...
1,705
4
4.9
easy
Consider a generative classification model for K classes defined by prior class probabilities $p(\mathcal{C}_k) = \pi_k$ and general class-conditional densities $p(\phi|\mathcal{C}_k)$ where $\phi$ is the input feature vector. Suppose we are given a training data set $\{\phi_n, \mathbf{t}_n\}$ where $n=1,\ldot...
We begin by writing down the likelihood function. $$p(\{\phi_{\mathbf{n}}, t_n\} | \pi_1, \pi_2, ..., \pi_K) = \prod_{n=1}^{N} \prod_{k=1}^{K} [p(\phi_{\mathbf{n}} | C_k) p(C_k)]^{t_{nk}}$$ $$= \prod_{n=1}^{N} \prod_{k=1}^{K} [\pi_k p(\phi_{\mathbf{n}} | C_k)]^{t_{nk}}$$ Hence we can obtain the expression for the log...
3,903
5
5.1
medium
$ Consider a two-layer network function of the form $y_k(\mathbf{x}, \mathbf{w}) = \sigma \left( \sum_{j=1}^M w_{kj}^{(2)} h \left( \sum_{i=1}^D w_{ji}^{(1)} x_i + w_{j0}^{(1)} \right) + w_{k0}^{(2)} \right)$ in which the hiddenunit nonlinear activation functions $g(\cdot)$ are given by logistic sigmoid functions of...
Based on definition of $tanh(\cdot)$ , we can obtain: $$tanh(a) = \frac{e^{a} - e^{-a}}{e^{a} + e^{-a}}$$ $$= -1 + \frac{2e^{a}}{e^{a} + e^{-a}}$$ $$= -1 + 2\frac{1}{1 + e^{-2a}}$$ $$= 2\sigma(2a) - 1$$ If we have parameters $w_{ji}^{(1s)}$ , $w_{j0}^{(1s)}$ and $w_{kj}^{(2s)}$ , $w_{k0}^{(2s)}$ for a network ...
1,484
5
5.10
easy
Consider a Hessian matrix $\mathbf{H}$ with eigenvector equation $\mathbf{H}\mathbf{u}_i = \lambda_i \mathbf{u}_i$. By setting the vector $\mathbf{v}$ in $\mathbf{v}^{\mathrm{T}}\mathbf{H}\mathbf{v} = \sum_{i} c_{i}^{2} \lambda_{i}$ equal to each of the eigenvectors $\mathbf{u}_i$ in turn, show that $\mathbf{H}$...
It is obvious. Suppose **H** is positive definite, i.e., (5.37) holds. We set **v** equals to the eigenvector of **H**, i.e., $\mathbf{v} = \mathbf{u_i}$ which gives: $$\mathbf{v}^T \mathbf{H} \mathbf{v} = \mathbf{v}^T (\mathbf{H} \mathbf{v}) = \mathbf{u_i}^T \lambda_i \mathbf{u_i} = \lambda_i ||\mathbf{u_i}||^2$$ ...
627
5
5.11
medium
Consider a quadratic error function defined by $E(\mathbf{w}) = E(\mathbf{w}^*) + \frac{1}{2}(\mathbf{w} - \mathbf{w}^*)^{\mathrm{T}}\mathbf{H}(\mathbf{w} - \mathbf{w}^*)$, in which the Hessian matrix **H** has an eigenvalue equation given by $\mathbf{H}\mathbf{u}_i = \lambda_i \mathbf{u}_i$. Show that the contours of ...
It is obvious. We follow $\mathbf{w} - \mathbf{w}^* = \sum_i \alpha_i \mathbf{u}_i.$ and then write the error function in the form of $E(\mathbf{w}) = E(\mathbf{w}^*) + \frac{1}{2} \sum_{i} \lambda_i \alpha_i^2.$. To obtain the contour, we enforce $E(\mathbf{w})$ to equal to a constant C. $$E(\mathbf{w}) = E(\mathbf...
936
5
5.12
medium
By considering the local Taylor expansion $E(\mathbf{w}) = E(\mathbf{w}^*) + \frac{1}{2}(\mathbf{w} - \mathbf{w}^*)^{\mathrm{T}}\mathbf{H}(\mathbf{w} - \mathbf{w}^*)$ of an error function about a stationary point $\mathbf{w}^*$ , show that the necessary and sufficient condition for the stationary point to be a local m...
If **H** is positive definite, we know the second term on the right side of $E(\mathbf{w}) = E(\mathbf{w}^*) + \frac{1}{2}(\mathbf{w} - \mathbf{w}^*)^{\mathrm{T}}\mathbf{H}(\mathbf{w} - \mathbf{w}^*)$ will be positive for arbitrary **w**. Therefore, $E(\mathbf{w}^*)$ is a local minimum. On the other hand, if $\mathb...
708
5
5.13
easy
Show that as a consequence of the symmetry of the Hessian matrix $\mathbf{H}$ , the number of independent elements in the quadratic error function $E(\mathbf{w}) \simeq E(\widehat{\mathbf{w}}) + (\mathbf{w} - \widehat{\mathbf{w}})^{\mathrm{T}} \mathbf{b} + \frac{1}{2} (\mathbf{w} - \widehat{\mathbf{w}})^{\mathrm{T}} \...
It is obvious. Suppose that there are W adaptive parameters in the network. Therefore, **b** has W independent parameters. Since **H** is symmetric, there should be W(W+1)/2 independent parameters in it. Therefore, there are W + W(W+1)/2 = W(W+3)/2 parameters in total.
269
5
5.14
easy
By making a Taylor expansion, verify that the terms that are $O(\epsilon)$ cancel on the right-hand side of $\frac{\partial E_n}{\partial w_{ji}} = \frac{E_n(w_{ji} + \epsilon) - E_n(w_{ji} - \epsilon)}{2\epsilon} + O(\epsilon^2).$.
It is obvious. Since we have $$E_n(w_{ji} + \epsilon) = E_n(w_{ji}) + \epsilon E'_n(w_{ji}) + \frac{\epsilon^2}{2} E''_n(w_{ji}) + O(\epsilon^3)$$ And $$E_n(w_{ji} - \epsilon) = E_n(w_{ji}) - \epsilon E'_n(w_{ji}) + \frac{\epsilon^2}{2} E''_n(w_{ji}) + O(\epsilon^3)$$ We combine those two equations, which gives, $...
476
5
5.15
medium
In Section 5.3.4, we derived a procedure for evaluating the Jacobian matrix of a neural network using a backpropagation procedure. Derive an alternative formalism for finding the Jacobian based on *forward propagation* equations.
It is obvious. The back propagation formalism starts from performing summation near the input, as shown in $= \sum_j w_{ji} \frac{\partial y_k}{\partial a_j}$. By symmetry, the forward propagation formalism should start near the output. $$J_{ki} = \frac{\partial y_k}{\partial x_i} = \frac{\partial h(\alpha_k)}{\partia...
1,199
5
5.16
easy
The outer product approximation to the Hessian matrix for a neural network using a sum-of-squares error function is given by $\mathbf{H} \simeq \sum_{n=1}^{N} \mathbf{b}_n \mathbf{b}_n^{\mathrm{T}}$. Extend this result to the case of multiple outputs.
It is obvious. We begin by writing down the error function. $$E = \frac{1}{2} \sum_{n=1}^{N} ||\mathbf{y_n} - \mathbf{t_n}||^2 = \frac{1}{2} \sum_{n=1}^{N} \sum_{m=1}^{M} (y_{n,m} - t_{n,m})^2$$ Where the subscript *m* denotes the *m*the element of the vector. Then we can write down the Hessian Matrix as before. $$\...
738
5
5.17
easy
Consider a squared loss function of the form $$E = \frac{1}{2} \iint \left\{ y(\mathbf{x}, \mathbf{w}) - t \right\}^2 p(\mathbf{x}, t) \, d\mathbf{x} \, dt$$ $E = \frac{1}{2} \iint \left\{ y(\mathbf{x}, \mathbf{w}) - t \right\}^2 p(\mathbf{x}, t) \, d\mathbf{x} \, dt$ where $y(\mathbf{x}, \mathbf{w})$ is a paramet...
It is obvious. $$\frac{\partial^{2} E}{\partial w_{r} \partial w_{s}} = \frac{\partial}{\partial w_{r}} \frac{1}{2} \int \int 2(y-t) \frac{\partial y}{\partial w_{s}} p(\mathbf{x}, t) d\mathbf{x} dt = \int \int \left[ (y-t) \frac{\partial y^{2}}{\partial w_{r} \partial w_{s}} + \frac{\partial y}{\partial w_{s}} \frac...
1,169
5
5.18
easy
Consider a two-layer network of the form shown in Figure 5.1 with the addition of extra parameters corresponding to skip-layer connections that go directly from the inputs to the outputs. By extending the discussion of Section 5.3.2, write down the equations for the derivatives of the error function with respect to the...
By analogy with section 5.3.2, we denote $w_{ki}^{\rm skip}$ as those parameters corresponding to skip-layer connections, i.e., it connects the input unit i with the output unit k. Note that the discussion in section 5.3.2 is still correct and now we only need to obtain the derivative of the error function with respe...
908
5
5.19
easy
Derive the expression $\mathbf{H} \simeq \sum_{n=1}^{N} y_n (1 - y_n) \mathbf{b}_n \mathbf{b}_n^{\mathrm{T}}.$ for the outer product approximation to the Hessian matrix for a network having a single output with a logistic sigmoid output-unit activation function and a cross-entropy error function, corresponding to the r...
The error function is given by $E(\mathbf{w}) = -\sum_{n=1}^{N} \left\{ t_n \ln y_n + (1 - t_n) \ln(1 - y_n) \right\}$. Therefore, we can obtain: $$\begin{split} \nabla E(\mathbf{w}) &= \sum_{n=1}^{N} \frac{\partial E}{\partial a_n} \nabla a_n \\ &= -\sum_{n=1}^{N} \frac{\partial}{\partial a_n} \big[ t_n \ln y_n + (1-...
2,970
5
5.2
easy
Show that maximizing the likelihood function under the conditional distribution $p(\mathbf{t}|\mathbf{x}, \mathbf{w}) = \mathcal{N}\left(\mathbf{t}|\mathbf{y}(\mathbf{x}, \mathbf{w}), \beta^{-1}\mathbf{I}\right).$ for a multioutput neural network is equivalent to minimizing the sum-of-squares error function $E(\mathbf{...
It is obvious. We write down the likelihood. $$p(\mathbf{T}|\mathbf{X}, \mathbf{w}) = \prod_{n=1}^{N} \mathcal{N}(\mathbf{t_n}|\mathbf{y}(\mathbf{x_n}, \mathbf{w}), \beta^{-1}\mathbf{I})$$ Taking the negative logarithm, we can obtain: $$E(\mathbf{w},\beta) = -\ln p(\mathbf{T}|\mathbf{X},\mathbf{w}) = \frac{\beta}{2}...
1,416
5
5.21
hard
$ Extend the expression $\mathbf{H}_N = \sum_{n=1}^N \mathbf{b}_n \mathbf{b}_n^{\mathrm{T}}$ for the outer product approximation of the Hessian matrix to the case of K > 1 output units. Hence, derive a recursive expression analogous to $\mathbf{H}_{L+1} = \mathbf{H}_L + \mathbf{b}_{L+1} \mathbf{b}_{L+1}^{\mathrm{T}}....
We first write down the expression of Hessian Matrix in the case of K outputs. $$\mathbf{H}_{N,K} = \sum_{n=1}^{N} \sum_{k=1}^{K} \mathbf{b}_{n,k} \mathbf{b}_{n,k}^{T}$$ Where $\mathbf{b}_{n,k} = \nabla_{\mathbf{w}} \mathbf{a}_{n,k}$ . Therefore, we have: $$\mathbf{H}_{N+1,K} = \mathbf{H}_{N,K} + \sum_{k=1}^{K} \ma...
1,657
5
5.22
medium
Derive the results $\frac{\partial^2 E_n}{\partial w_{kj}^{(2)} \partial w_{k'j'}^{(2)}} = z_j z_{j'} M_{kk'}.$, (5.94), and $\frac{\partial^2 E_n}{\partial w_{ji}^{(1)} \partial w_{kj'}^{(2)}} = x_i h'(a_{j'}) \left\{ \delta_k I_{jj'} + z_j \sum_{k'} w_{k'j'}^{(2)} H_{kk'} \right\}.$ for the elements of the Hessian ma...
We begin by handling the first case. $$\begin{split} \frac{\partial^2 E_n}{\partial w_{kj}^{(2)} \partial w_{k'j'}^{(2)}} &= \frac{\partial}{\partial w_{kj}^{(2)}} (\frac{\partial E_n}{\partial w_{k'j'}^{(2)}}) \\ &= \frac{\partial}{\partial w_{kj}^{(2)}} (\frac{\partial E_n}{\partial a_{k'}} \frac{\partial a_{k'}}{\p...
6,181
5
5.23
medium
Extend the results of Section 5.4.5 for the exact Hessian of a two-layer network to include skip-layer connections that go directly from inputs to outputs.
It is similar to the previous problem. $$\begin{split} \frac{\partial^2 E_n}{\partial w_{k'i'} \partial w_{kj}} &= \frac{\partial}{\partial w_{k'i'}} (\frac{\partial E_n}{\partial w_{kj}}) \\ &= \frac{\partial}{\partial w_{k'i'}} (\frac{\partial E_n}{\partial a_k} z_j) \\ &= z_j \frac{\partial w_{k'i'}}{\partial a_{k'...
2,974
5
5.25
hard
$ Consider a quadratic error function of the form $$E = E_0 + \frac{1}{2} (\mathbf{w} - \mathbf{w}^*)^{\mathrm{T}} \mathbf{H} (\mathbf{w} - \mathbf{w}^*)$$ $E = E_0 + \frac{1}{2} (\mathbf{w} - \mathbf{w}^*)^{\mathrm{T}} \mathbf{H} (\mathbf{w} - \mathbf{w}^*)$ where $\mathbf{w}^*$ represents the minimum, and the H...
Since we know the gradient of the error function with respect to $\mathbf{w}$ is: $$\nabla E = \mathbf{H}(\mathbf{w} - \mathbf{w}^*)$$ Together with $\mathbf{w}^{(\tau)} = \mathbf{w}^{(\tau-1)} - \rho \nabla E$, we can obtain: $$\mathbf{w}^{(\tau)} = \mathbf{w}^{(\tau-1)} - \rho \nabla E$$ $$= \mathbf{w}^{(\tau-1)...
2,543
5
5.26
medium
Consider a multilayer perceptron with arbitrary feed-forward topology, which is to be trained by minimizing the *tangent propagation* error function $\widetilde{E} = E + \lambda \Omega$ in which the regularizing function is given by $\Omega = \frac{1}{2} \sum_{n} \sum_{k} \left( \frac{\partial y_{nk}}{\partial \xi} \Bi...
Based on definition or by analogy with $\Omega = \frac{1}{2} \sum_{n} \sum_{k} \left( \frac{\partial y_{nk}}{\partial \xi} \Big|_{\xi=0} \right)^2 = \frac{1}{2} \sum_{n} \sum_{k} \left( \sum_{i=1}^{D} J_{nki} \tau_{ni} \right)^2.$, we have: $$\Omega_n = \frac{1}{2} \sum_{k} \left( \frac{\partial y_{nk}}{\partial \xi} ...
3,876
5
5.27
medium
Consider the framework for training with transformed data in the special case in which the transformation consists simply of the addition of random noise $x \to x + \xi$ where $\xi$ has a Gaussian distribution with zero mean and unit covariance. By following an argument analogous to that of Section 5.5.5, show that...
Following the procedure in section 5.5.5, we can obtain: $$\Omega = \frac{1}{2} \int (\boldsymbol{\tau}^T \nabla y(\mathbf{x}))^2 p(\mathbf{x}) d\mathbf{x}$$ Since we have $\tau = \partial \mathbf{s}(\mathbf{x}, \boldsymbol{\xi}) / \partial \boldsymbol{\xi}$ and $\mathbf{s} = \mathbf{x} + \boldsymbol{\xi}$ , so we...
522
5
5.28
easy
- 5.28 (\*) Consider a neural network, such as the convolutional network discussed in Section 5.5.6, in which multiple weights are constrained to have the same value. Discuss how the standard backpropagation algorithm must be modified in order to ensure that such constraints are satisfied when evaluating the derivativ...
The modifications only affect derivatives with respect to the weights in the convolutional layer. The units within a feature map (indexed m) have different inputs, but all share a common weight vector, $\mathbf{w}^{(m)}$ . Therefore, we can write: $$\frac{\partial E_n}{\partial w_i^{(m)}} = \sum_j \frac{\partial E_n}...
777
5
5.29
easy
Verify the result $\frac{\partial \widetilde{E}}{\partial w_i} = \frac{\partial E}{\partial w_i} + \lambda \sum_j \gamma_j(w_i) \frac{(w_i - \mu_j)}{\sigma_j^2}.$.
It is obvious. Firstly, we know that: $$\frac{\partial}{\partial w_i} \left\{ \pi_j \mathcal{N}(w_i | \mu_j, \sigma_j^2) \right\} = -\pi_j \frac{w_i - \mu_j}{\sigma_j^2} \mathcal{N}(w_i | \mu_j, \sigma_j^2)$$ We now derive the error function with respect to $w_i$ : $$\begin{split} \frac{\partial \widetilde{E}}{\par...
2,181
5
5.3
medium
Consider a regression problem involving multiple target variables in which it is assumed that the distribution of the targets, conditioned on the input vector $\mathbf{x}$ , is a Gaussian of the form $$p(\mathbf{t}|\mathbf{x}, \mathbf{w}) = \mathcal{N}(\mathbf{t}|\mathbf{y}(\mathbf{x}, \mathbf{w}), \mathbf{\Sigma})$$...
Following the process in the previous question, we first write down the negative logarithm of the likelihood function. $$E(\mathbf{w}, \mathbf{\Sigma}) = \frac{1}{2} \sum_{n=1}^{N} \left\{ [\mathbf{y}(\mathbf{x}_n, \mathbf{w}) - \mathbf{t}_n]^T \mathbf{\Sigma}^{-1} [\mathbf{y}(\mathbf{x}_n, \mathbf{w}) - \mathbf{t}_n]...
1,293
5
5.30
easy
Verify the result $\frac{\partial \widetilde{E}}{\partial \mu_j} = \lambda \sum_i \gamma_j(w_i) \frac{(\mu_i - w_j)}{\sigma_j^2}$.
Is is similar to the previous problem. Since we know that: $$\frac{\partial}{\partial \mu_j} \left\{ \pi_j \mathcal{N}(w_i | \mu_j, \sigma_j^2) \right\} = \pi_j \frac{w_i - \mu_j}{\sigma_j^2} \mathcal{N}(w_i | \mu_j, \sigma_j^2)$$ We can derive: $$\begin{split} \frac{\partial \widetilde{E}}{\partial \mu_{j}} &= \fra...
1,851
5
5.31
easy
Verify the result $\frac{\partial \widetilde{E}}{\partial \sigma_j} = \lambda \sum_{i} \gamma_j(w_i) \left( \frac{1}{\sigma_j} - \frac{(w_i - \mu_j)^2}{\sigma_j^3} \right)$.
It is similar to the previous problem. Since we know that: $$\frac{\partial}{\partial \sigma_j} \left\{ \pi_j \mathcal{N}(w_i | \mu_j, \sigma_j^2) \right\} = \left( -\frac{1}{\sigma_j} + \frac{(w_i - \mu_j)^2}{\sigma_j^3} \right) \pi_j \mathcal{N}(w_i | \mu_j, \sigma_j^2)$$ We can derive: $$\begin{split} \frac{\part...
1,818
5
5.32
medium
Show that the derivatives of the mixing coefficients $\{\pi_k\}$ , defined by $\pi_j = \frac{\exp(\eta_j)}{\sum_{k=1}^{M} \exp(\eta_k)}.$, with respect to the auxiliary parameters $\{\eta_i\}$ are given by $$\frac{\partial \pi_k}{\partial \eta_i} = \delta_{jk} \pi_j - \pi_j \pi_k. \tag{5.208}$$ Hence, by making us...
It is trivial. We begin by verifying $\frac{\partial \pi_k}{\partial \eta_i} = \delta_{jk} \pi_j - \pi_j \pi_k.$ when $j \neq k$ . $$\begin{array}{ll} \frac{\partial \pi_k}{\partial \eta_j} & = & \frac{\partial}{\partial \eta_j} \left\{ \frac{exp(\eta_k)}{\sum_k exp(\eta_k)} \right\} \\ & = & \frac{-exp(\eta_k) exp(\...
3,140
5
5.33
easy
Write down a pair of equations that express the Cartesian coordinates $(x_1, x_2)$ for the robot arm shown in Figure 5.18 in terms of the joint angles $\theta_1$ and $\theta_2$ and the lengths $L_1$ and $L_2$ of the links. Assume the origin of the coordinate system is given by the attachment point of the lowe...
It is trivial. We set the attachment point of the lower arm with the ground as the origin of the coordinate. We first aim to find the vertical distance from the origin to the target point, and this is also the value of $x_2$ . $$x_2 = L_1 \sin(\pi - \theta_1) + L_2 \sin(\theta_2 - (\pi - \theta_1))$$ = $L_1 \sin ...
673
5
5.34
easy
Derive the result $\frac{\partial E_n}{\partial a_k^{\pi}} = \pi_k - \gamma_k.$ for the derivative of the error function with respect to the network output activations controlling the mixing coefficients in the mixture density network.
By analogy with $\frac{\partial \pi_k}{\partial \eta_i} = \delta_{jk} \pi_j - \pi_j \pi_k.$, we can write: $$\frac{\partial \pi_k(\mathbf{x})}{\partial \alpha_j^\pi} = \delta_{jk} \pi_j(\mathbf{x}) - \pi_j(\mathbf{x}) \pi_k(\mathbf{x})$$ Using $E(\mathbf{w}) = -\sum_{n=1}^{N} \ln \left\{ \sum_{k=1}^{k} \pi_k(\mathbf{...
4,455
5
5.36
easy
Derive the result $\frac{\partial E_n}{\partial a_k^{\sigma}} = -\gamma_k \left\{ \frac{\|\mathbf{t} - \boldsymbol{\mu}_k\|^2}{\sigma_k^3} - \frac{1}{\sigma_k} \right\}.$ for the derivative of the error function with respect to the network output activations controlling the component variances in the mixture density ne...
Similarly, we know that: $$\frac{\partial}{\partial \sigma_k} \left\{ \pi_k \mathcal{N}(\mathbf{t}_n | \boldsymbol{\mu}_k, \sigma_k^2) \right\} = \left\{ -\frac{D}{\sigma_k} + \frac{||\mathbf{t}_n - \boldsymbol{\mu}_k||^2}{\sigma_k^3} \right\} \pi_k \mathcal{N}(\mathbf{t}_n | \boldsymbol{\mu}_k, \sigma_k^2)$$ Therefo...
1,433
5
5.37
easy
Verify the results $\mathbb{E}\left[\mathbf{t}|\mathbf{x}\right] = \int \mathbf{t}p(\mathbf{t}|\mathbf{x}) \, d\mathbf{t} = \sum_{k=1}^{K} \pi_k(\mathbf{x}) \boldsymbol{\mu}_k(\mathbf{x})$ and $= \sum_{k=1}^{K} \pi_{k}(\mathbf{x}) \left\{ \sigma_{k}^{2}(\mathbf{x}) + \left\|\boldsymbol{\mu}_{k}(\mathbf{x}) - \sum_{l=1}...
First we know two properties for the Gaussian distribution $\mathcal{N}(\mathbf{t}|\boldsymbol{\mu}, \sigma^2 \mathbf{I})$ : $$\mathbb{E}[\mathbf{t}] = \int \mathbf{t} \mathcal{N}(\mathbf{t}|\boldsymbol{\mu}, \sigma^2 \mathbf{I}) d\mathbf{t} = \boldsymbol{\mu}$$ And $$\mathbb{E}[||\mathbf{t}||^2] = \int ||\mathbf{t...
4,146
5
5.38
easy
Using the general result $p(\mathbf{y}) = \mathcal{N}(\mathbf{y}|\mathbf{A}\boldsymbol{\mu} + \mathbf{b}, \mathbf{L}^{-1} + \mathbf{A}\boldsymbol{\Lambda}^{-1}\mathbf{A}^{\mathrm{T}})$, derive the predictive distribution $p(t|\mathbf{x}, \mathcal{D}, \alpha, \beta) = \mathcal{N}\left(t|y(\mathbf{x}, \mathbf{w}_{\text{M...
From $q(\mathbf{w}|\mathcal{D}) = \mathcal{N}(\mathbf{w}|\mathbf{w}_{\text{MAP}}, \mathbf{A}^{-1}).$ and $p(t|\mathbf{x}, \mathbf{w}, \beta) \simeq \mathcal{N}\left(t|y(\mathbf{x}, \mathbf{w}_{\text{MAP}}) + \mathbf{g}^{\mathbf{T}}(\mathbf{w} - \mathbf{w}_{\text{MAP}}), \beta^{-1}\right).$, we can write down the expres...
1,826
5
5.39
easy
Make use of the Laplace approximation result $= f(\mathbf{z}_0) \frac{(2\pi)^{M/2}}{|\mathbf{A}|^{1/2}}$ to show that the evidence function for the hyperparameters $\alpha$ and $\beta$ in the Bayesian neural network model can be approximated by $\ln p(\mathcal{D}|\alpha,\beta) \simeq -E(\mathbf{w}_{\text{MAP}}) - \...
Using Laplace Approximation, we can obtain: $$p(D|\mathbf{w},\beta)p(\mathbf{w}|\alpha) = p(D|\mathbf{w}_{\text{MAP}},\beta)p(\mathbf{w}_{\text{MAP}}|\alpha)\exp\left\{-(\mathbf{w}-\mathbf{w}_{\text{MAP}})^T\mathbf{A}(\mathbf{w}-\mathbf{w}_{\text{MAP}})\right\}$$ Then using $p(\mathcal{D}|\alpha,\beta) = \int p(\math...
1,469
5
5.4
medium
Consider a binary classification problem in which the target values are $t \in \{0,1\}$ , with a network output $y(\mathbf{x},\mathbf{w})$ that represents $p(t=1|\mathbf{x})$ , and suppose that there is a probability $\epsilon$ that the class label on a training data point has been incorrectly set. Assuming indep...
Based on $p(t|\mathbf{x}, \mathbf{w}) = y(\mathbf{x}, \mathbf{w})^t \left\{ 1 - y(\mathbf{x}, \mathbf{w}) \right\}^{1-t}.$, the current conditional distribution of targets, considering mislabel, given input $\mathbf{x}$ and weight $\mathbf{w}$ is: $$p(t = 1|\mathbf{x}, \mathbf{w}) = (1 - \epsilon) \cdot p(t_r = 1|...
1,624
5
5.40
easy
Outline the modifications needed to the framework for Bayesian neural networks, discussed in Section 5.7.3, to handle multiclass problems using networks having softmax output-unit activation functions.
For a k-class classification problem, we need to use softmax activation function and also the error function is now given by $E(\mathbf{w}) = -\sum_{n=1}^{N} \sum_{k=1}^{K} t_{kn} \ln y_k(\mathbf{x}_n, \mathbf{w}).$. Therefore, the Hessian matrix should be derived from $E(\mathbf{w}) = -\sum_{n=1}^{N} \sum_{k=1}^{K} t...
702
5
5.41
medium
By following analogous steps to those given in Section 5.7.1 for regression networks, derive the result $\ln p(\mathcal{D}|\alpha) \simeq -E(\mathbf{w}_{\text{MAP}}) - \frac{1}{2} \ln |\mathbf{A}| + \frac{W}{2} \ln \alpha + \text{const}$ for the marginal likelihood in the case of a network having a cross-entropy error ...
By analogy to Prob.5.39, we can write: $$p(D|\alpha) = p(D|\mathbf{w}_{\text{MAP}})p(\mathbf{w}_{\text{MAP}}|\alpha) \frac{(2\pi)^{W/2}}{|\mathbf{A}|^{1/2}}$$ Since we know that the prior $p(\mathbf{w}|\alpha)$ follows a Gaussian distribution, i.e., $p(\mathbf{w}|\alpha) = \mathcal{N}(\mathbf{w}|\mathbf{0}, \alpha^...
863
5
5.5
easy
Show that maximizing likelihood for a multiclass neural network model in which the network outputs have the interpretation $y_k(\mathbf{x}, \mathbf{w}) = p(t_k = 1|\mathbf{x})$ is equivalent to the minimization of the cross-entropy error function $E(\mathbf{w}) = -\sum_{n=1}^{N} \sum_{k=1}^{K} t_{kn} \ln y_k(\mathbf{...
It is obvious by using $p(\mathbf{t}|\mathbf{x}, \mathbf{w}) = \prod_{k=1}^{K} y_k(\mathbf{x}, \mathbf{w})^{t_k} \left[ 1 - y_k(\mathbf{x}, \mathbf{w}) \right]^{1 - t_k}.$. $$E(\mathbf{w}) = -\ln \prod_{n=1}^{N} p(\mathbf{t}|\mathbf{x_n}, \mathbf{w})$$ $$= -\ln \prod_{n=1}^{N} \prod_{k=1}^{K} y_k(\mathbf{x_n}, \mathb...
774
5
5.6
easy
Show the derivative of the error function $E(\mathbf{w}) = -\sum_{n=1}^{N} \left\{ t_n \ln y_n + (1 - t_n) \ln(1 - y_n) \right\}$ with respect to the activation $a_k$ for an output unit having a logistic sigmoid activation function satisfies $\frac{\partial E}{\partial a_k} = y_k - t_k$.
We know that $y_k = \sigma(a_k)$ , where $\sigma(\cdot)$ represents the logistic sigmoid function. Moreover, $$\frac{d\sigma}{da} = \sigma(1 - \sigma)$$ $$\frac{dE(\mathbf{w})}{da_k} = -t_k \frac{1}{y_k} [y_k (1 - y_k)] + (1 - t_k) \frac{1}{1 - y_k} [y_k (1 - y_k)]$$ $$= [y_k (1 - y_k)] [\frac{1 - t_k}{1 - y_k} -...
412
5
5.7
easy
Show the derivative of the error function $E(\mathbf{w}) = -\sum_{n=1}^{N} \sum_{k=1}^{K} t_{kn} \ln y_k(\mathbf{x}_n, \mathbf{w}).$ with respect to the activation $a_k$ for output units having a softmax activation function satisfies $\frac{\partial E}{\partial a_k} = y_k - t_k$.
It is similar to the previous problem. First we denote $y_{kn} = y_k(\mathbf{x_n}, \mathbf{w})$ . If we use softmax function as activation for the output unit, according to $\frac{\partial y_k}{\partial a_j} = y_k (I_{kj} - y_j)$, we have: $$\frac{dy_{kn}}{da_j} = y_{kn}(I_{kj} - y_{jn})$$ Therefore, $$\frac{dE(\ma...
994
5
5.8
easy
We saw in $\frac{d\sigma}{da} = \sigma(1 - \sigma).$ that the derivative of the logistic sigmoid activation function can be expressed in terms of the function value itself. Derive the corresponding result for the 'tanh' activation function defined by $\tanh(a) = \frac{e^a - e^{-a}}{e^a + e^{-a}}.$.
It is obvious based on definition of 'tanh', i.e., $\tanh(a) = \frac{e^a - e^{-a}}{e^a + e^{-a}}.$. $$\frac{d}{da}tanh(a) = \frac{(e^a + e^{-a})(e^a + e^{-a}) - (e^a - e^{-a})(e^a - e^{-a})}{(e^a + e^{-a})^2}$$ $$= 1 - \frac{(e^a - e^{-a})^2}{(e^a + e^{-a})^2}$$ $$= 1 - tanh(a)^2$$
293
5
5.9
easy
The error function $E(\mathbf{w}) = -\sum_{n=1}^{N} \left\{ t_n \ln y_n + (1 - t_n) \ln(1 - y_n) \right\}$ for binary classification problems was derived for a network having a logistic-sigmoid output activation function, so that $0 \le y(\mathbf{x}, \mathbf{w}) \le 1$ , and data having target values $t \in \{0, 1\}$...
We know that the logistic sigmoid function $\sigma(a) \in [0,1]$ , therefore if we perform a linear transformation $h(a) = 2\sigma(a) - 1$ , we can find a mapping function h(a) from $(-\infty, +\infty)$ to [-1,1]. In this case, the conditional distribution of targets given inputs can be similarly written as: $$p(t...
978
6
6.1
medium
Consider the dual formulation of the least squares linear regression problem given in Section 6.1. Show that the solution for the components $a_n$ of the vector $\mathbf{a}$ can be expressed as a linear combination of the elements of the vector $\phi(\mathbf{x}_n)$ . Denoting these coefficients by the vector $\ma...
Recall that in section.6.1, $a_n$ can be written as $a_n = -\frac{1}{\lambda} \left\{ \mathbf{w}^{\mathrm{T}} \phi(\mathbf{x}_n) - t_n \right\}.$. We can derive: $$a_n = -\frac{1}{\lambda} \{ \mathbf{w}^T \boldsymbol{\phi}(\mathbf{x}_n) - t_n \}$$ $$= -\frac{1}{\lambda} \{ w_1 \phi_1(\mathbf{x}_n) + w_2 \phi_2(\mat...
2,582
6
6.10
easy
Show that an excellent choice of kernel for learning a function $f(\mathbf{x})$ is given by $k(\mathbf{x}, \mathbf{x}') = f(\mathbf{x}) f(\mathbf{x}')$ by showing that a linear learning machine based on this kernel will always find a solution proportional to $f(\mathbf{x})$ .
According to $y(\mathbf{x}) = \mathbf{w}^{\mathrm{T}} \phi(\mathbf{x}) = \mathbf{a}^{\mathrm{T}} \Phi \phi(\mathbf{x}) = \mathbf{k}(\mathbf{x})^{\mathrm{T}} (\mathbf{K} + \lambda \mathbf{I}_{N})^{-1} \mathbf{t}$, we have: $$y(\mathbf{x}) = \mathbf{k}(\mathbf{x})^T (\mathbf{K} + \lambda \mathbf{I}_N)^{-1} \mathbf{t} = ...
666
6
6.11
easy
By making use of the expansion $k(\mathbf{x}, \mathbf{x}') = \exp\left(-\mathbf{x}^{\mathrm{T}}\mathbf{x}/2\sigma^{2}\right) \exp\left(\mathbf{x}^{\mathrm{T}}\mathbf{x}'/\sigma^{2}\right) \exp\left(-(\mathbf{x}')^{\mathrm{T}}\mathbf{x}'/2\sigma^{2}\right)$, and then expanding the middle factor as a power series, show t...
We follow the hint. $$k(\mathbf{x}, \mathbf{x}') = \exp(-\mathbf{x}^T \mathbf{x}/2\sigma^2) \cdot \exp(\mathbf{x}^T \mathbf{x}'/\sigma^2) \cdot \exp(-(\mathbf{x}')^T \mathbf{x}'/2\sigma^2)$$ $$= \exp(-\mathbf{x}^T \mathbf{x}/2\sigma^2) \cdot \left(1 + \frac{\mathbf{x}^T \mathbf{x}'}{\sigma^2} + \frac{(\frac{\mathbf{x...
1,052
6
6.12
medium
Consider the space of all possible subsets A of a given fixed set D. Show that the kernel function $k(A_1, A_2) = 2^{|A_1 \cap A_2|}$ corresponds to an inner product in a feature space of dimensionality $2^{|D|}$ defined by the mapping $\phi(A)$ where A is a subset of D and the element $\phi_U(A)$ , indexed by the...
First, let's explain the problem a little bit. According to $k(A_1, A_2) = 2^{|A_1 \cap A_2|}$, what we need to prove here is: $$k(A_1, A_2) = 2^{|A_1 \cap A_2|} = \phi(A_1)^T \phi(A_2)$$ The biggest difference from the previous problem is that $\phi(A)$ is a $2^{|D|} \times 1$ column vector and instead of indexe...
1,313
6
6.14
easy
Write down the form of the Fisher kernel, defined by $k(\mathbf{x}, \mathbf{x}') = \mathbf{g}(\boldsymbol{\theta}, \mathbf{x})^{\mathrm{T}} \mathbf{F}^{-1} \mathbf{g}(\boldsymbol{\theta}, \mathbf{x}').$, for the case of a distribution $p(\mathbf{x}|\boldsymbol{\mu}) = \mathcal{N}(\mathbf{x}|\boldsymbol{\mu}, \mathbf{S...
Since the covariance matrix S is fixed, according to $\mathbf{g}(\boldsymbol{\theta}, \mathbf{x}) = \nabla_{\boldsymbol{\theta}} \ln p(\mathbf{x}|\boldsymbol{\theta})$ we can obtain: $$\mathbf{g}(\boldsymbol{\mu}, \mathbf{x}) = \nabla_{\boldsymbol{\mu}} \ln p(\mathbf{x}|\boldsymbol{\mu}) = \frac{\partial}{\partial \bo...
1,652
6
6.15
easy
By considering the determinant of a $2 \times 2$ Gram matrix, show that a positive-definite kernel function k(x, x') satisfies the Cauchy-Schwartz inequality $$k(x_1, x_2)^2 \le k(x_1, x_1)k(x_2, x_2).$$ $k(x_1, x_2)^2 \le k(x_1, x_1)k(x_2, x_2).$
We rewrite the problem. What we are required to prove is that the Gram matrix $\mathbf{K}$ : $$\mathbf{K} = \left[ \begin{array}{cc} k_{11} & k_{12} \\ k_{21} & k_{22} \end{array} \right],$$ where $k_{ij}$ (i,j = 1,2) is short for $k(x_i,x_j)$ , should be positive semidefinite. A positive semidefinite matrix shou...
495
6
6.16
medium
Consider a parametric model governed by the parameter vector w together with a data set of input values $\mathbf{x}_1, \dots, \mathbf{x}_N$ and a nonlinear feature mapping $\phi(\mathbf{x})$ . Suppose that the dependence of the error function on w takes the form $$J(\mathbf{w}) = f(\mathbf{w}^{\mathrm{T}} \boldsymb...
Based on the total derivative of function f, we have: $$f\left[(\mathbf{w} + \Delta \mathbf{w})^T \boldsymbol{\phi}_1, (\mathbf{w} + \Delta \mathbf{w})^T \boldsymbol{\phi}_2, ..., (\mathbf{w} + \Delta \mathbf{w})^T \boldsymbol{\phi}_N\right] = \sum_{n=1}^N \frac{\partial f}{\partial (\mathbf{w}^T \boldsymbol{\phi}_n)}...
1,935
6
6.17
medium
Consider the sum-of-squares error function $E = \frac{1}{2} \sum_{n=1}^{N} \int \{y(\mathbf{x}_n + \boldsymbol{\xi}) - t_n\}^2 \nu(\boldsymbol{\xi}) \,d\boldsymbol{\xi}.$ for data having noisy inputs, where $\nu(\xi)$ is the distribution of the noise. Use the calculus of variations to minimize this error function wit...
We consider a variation in the function $y(\mathbf{x})$ of the form: $$y(\mathbf{x}) \to y(\mathbf{x}) + \epsilon \eta(\mathbf{x})$$ Substituting it into $E = \frac{1}{2} \sum_{n=1}^{N} \int \{y(\mathbf{x}_n + \boldsymbol{\xi}) - t_n\}^2 \nu(\boldsymbol{\xi}) \,d\boldsymbol{\xi}.$ yields: $$\begin{split} E[y+\epsi...
2,249
6
6.18
easy
Consider a Nadaraya-Watson model with one input variable x and one target variable t having Gaussian components with isotropic covariances, so that the covariance matrix is given by $\sigma^2 \mathbf{I}$ where $\mathbf{I}$ is the unit matrix. Write down expressions for the conditional density p(t|x) and for the con...
According to the main text below Eq $p(t|\mathbf{x}) = \frac{p(t,\mathbf{x})}{\int p(t,\mathbf{x}) dt} = \frac{\sum_{n} f(\mathbf{x} - \mathbf{x}_{n}, t - t_{n})}{\sum_{m} \int f(\mathbf{x} - \mathbf{x}_{m}, t - t_{m}) dt}$, we know that f(x,t), i.e., $f(\mathbf{z})$ , follows a zero-mean isotropic Gaussian: $$f(\mat...
3,127
6
6.19
medium
- 6.19 (\*\*) Another viewpoint on kernel regression comes from a consideration of regression problems in which the input variables as well as the target variables are corrupted with additive noise. Suppose each target value t<sub>n</sub> is generated as usual by taking a function y(z<sub>n</sub>) evaluated at a point ...
Similar to Prob.6.17, it is straightforward to show that: $$y(\mathbf{x}) = \sum_{n} t_n \, k(\mathbf{x}, \mathbf{x}_n)$$ Where we have defined: $$k(\mathbf{x}, \mathbf{x}_n) = \frac{g(\mathbf{x}_n - \mathbf{x})}{\sum_n g(\mathbf{x}_n - \mathbf{x})}$$
254
6
6.2
medium
In this exercise, we develop a dual formulation of the perceptron learning algorithm. Using the perceptron learning rule $\mathbf{w}^{(\tau+1)} = \mathbf{w}^{(\tau)} - \eta \nabla E_{P}(\mathbf{w}) = \mathbf{w}^{(\tau)} + \eta \phi_n t_n$, show that the learned weight vector $\mathbf{w}$ can be written as a linear co...
If we set $\mathbf{w}^{(0)} = \mathbf{0}$ in $\mathbf{w}^{(\tau+1)} = \mathbf{w}^{(\tau)} - \eta \nabla E_{P}(\mathbf{w}) = \mathbf{w}^{(\tau)} + \eta \phi_n t_n$, we can obtain: $$\mathbf{w}^{(\tau+1)} = \sum_{n=1}^{N} \eta c_n t_n \boldsymbol{\phi}_n$$ where N is the total number of samples and $c_n$ is the tim...
1,331
6
6.20
medium
Verify the results $\sigma^{2}(\mathbf{x}_{N+1}) = c - \mathbf{k}^{\mathrm{T}} \mathbf{C}_{N}^{-1} \mathbf{k}.$ and $\sigma^{2}(\mathbf{x}_{N+1}) = c - \mathbf{k}^{\mathrm{T}} \mathbf{C}_{N}^{-1} \mathbf{k}.$.
Since we know that $\mathbf{t}_{N+1} = (t_1, t_2, ..., t_N, t_{N+1})^T$ follows a Gaussian distribution, i.e., $\mathbf{t}_{N+1} \sim \mathcal{N}(\mathbf{t}_{N+1}|\mathbf{0}, \mathbf{C}_{N+1})$ given in Eq (6.64), if we rearrange its order by putting the last element (i.e., $t_{N+1}$ ) to the first position, deno...
2,726
6
6.21
medium
- 6.21 (\*\*) Consider a Gaussian process regression model in which the kernel function is defined in terms of a fixed set of nonlinear basis functions. Show that the predictive distribution is identical to the result $p(t|\mathbf{x}, \mathbf{t}, \alpha, \beta) = \mathcal{N}(t|\mathbf{m}_N^{\mathrm{T}} \boldsymbol{\ph...
We follow the hint beginning by verifying the mean. We write Eq $C(\mathbf{x}_n, \mathbf{x}_m) = k(\mathbf{x}_n, \mathbf{x}_m) + \beta^{-1} \delta_{nm}.$ in a matrix form: $$\mathbf{C}_N = \frac{1}{\alpha} \mathbf{\Phi} \mathbf{\Phi}^T + \beta^{-1} \mathbf{I}_N$$ Where we have used Eq $K_{nm} = k(\mathbf{x}_n, \mathb...
3,001
6
6.22
medium
Consider a regression problem with N training set input vectors $\mathbf{x}_1, \dots, \mathbf{x}_N$ and L test set input vectors $\mathbf{x}_{N+1}, \dots, \mathbf{x}_{N+L}$ , and suppose we define a Gaussian process prior over functions $t(\mathbf{x})$ . Derive an expression for the joint predictive distribution fo...
Based on Eq (6.64) and $\mathbf{C}_{N+1} = \begin{pmatrix} \mathbf{C}_N & \mathbf{k} \\ \mathbf{k}^{\mathrm{T}} & c \end{pmatrix}$, We first write down the joint distribution for $\mathbf{t}_{N+L} = [t_1(\mathbf{x}), t_2(\mathbf{x}), ..., t_{N+L}(\mathbf{x})]^T$ : $$p(\mathbf{t}_{N+L}) = \mathcal{N}(\mathbf{t}_{N+L}|...
2,471
6
6.24
easy
Show that a diagonal matrix W whose elements satisfy $0 < W_{ii} < 1$ is positive definite. Show that the sum of two positive definite matrices is itself positive definite.
By definition, we only need to prove that for arbitrary vector $\mathbf{x} \neq \mathbf{0}$ , $\mathbf{x}^T \mathbf{W} \mathbf{x}$ is positive. Here suppose that $\mathbf{W}$ is a $M \times M$ matrix. We expand the multiplication: $$\mathbf{x}^T \mathbf{W} \mathbf{x} = \sum_{i=1}^M \sum_{j=1}^M W_{ij} \cdot x_i...
943
6
6.25
easy
Using the Newton-Raphson formula (4.92), derive the iterative update formula $\mathbf{a}_N^{\text{new}} = \mathbf{C}_N (\mathbf{I} + \mathbf{W}_N \mathbf{C}_N)^{-1} \left\{ \mathbf{t}_N - \boldsymbol{\sigma}_N + \mathbf{W}_N \mathbf{a}_N \right\}.$ for finding the mode $\mathbf{a}_N^{}$ of the posterior distribution ...
Based on Newton-Raphson formula, Eq(6.81) and Eq(6.82), we have: $$\mathbf{a}_{N}^{new} = \mathbf{a}_{N} - (-\mathbf{W}_{N} - \mathbf{C}_{N}^{-1})^{-1} (\mathbf{t}_{N} - \sigma_{N} - \mathbf{C}_{N}^{-1} \mathbf{a}_{N})$$ $$= \mathbf{a}_{N} + (\mathbf{W}_{N} + \mathbf{C}_{N}^{-1})^{-1} (\mathbf{t}_{N} - \sigma_{N} - \...
3,626
6
6.3
easy
The nearest-neighbour classifier (Section 2.5.2) assigns a new input vector $\mathbf{x}$ to the same class as that of the nearest input vector $\mathbf{x}_n$ from the training set, where in the simplest case, the distance is defined by the Euclidean metric $\|\mathbf{x} \mathbf{x}_n\|^2$ . By expressing this rule ...
We begin by expanding the Euclidean metric. $$||\mathbf{x} - \mathbf{x}_n||^2 = (\mathbf{x} - \mathbf{x}_n)^T (\mathbf{x} - \mathbf{x}_n)$$ $$= (\mathbf{x}^T - \mathbf{x}_n^T)(\mathbf{x} - \mathbf{x}_n)$$ $$= \mathbf{x}^T \mathbf{x} - 2\mathbf{x}_n^T \mathbf{x} + \mathbf{x}_n^T \mathbf{x}_n$$ Similar to (6.24)-(6.2...
608
6
6.4
easy
In Appendix C, we give an example of a matrix that has positive elements but that has a negative eigenvalue and hence that is not positive definite. Find an example of the converse property, namely a 2 × 2 matrix with positive eigenvalues yet that has at least one negative element.
To construct such a matrix, let us suppose the two eigenvalues are 1 and 2, and the matrix has form: $$\left[ egin{array}{cc} a & b \\ c & d \end{array} \right]$$ Therefore, based on the definition of eigenvalue, we have two equations: $$\begin{cases} (a-2)(d-2) = bc & (1) \\ (a-1)(d-1) = bc & (2) \end{cases}$$ (2)...
573
6
6.5
easy
Verify the results $k(\mathbf{x}, \mathbf{x}') = ck_1(\mathbf{x}, \mathbf{x}')$ and $k(\mathbf{x}, \mathbf{x}') = f(\mathbf{x})k_1(\mathbf{x}, \mathbf{x}')f(\mathbf{x}')$ for constructing valid kernels.
Since $k_1(\mathbf{x}, \mathbf{x}')$ is a valid kernel, it can be written as: $$k_1(\mathbf{x}, \mathbf{x}') = \phi(\mathbf{x})^T \phi(\mathbf{x}')$$ We can obtain: $$k(\mathbf{x}, \mathbf{x}') = c k_1(\mathbf{x}, \mathbf{x}') = \left[\sqrt{c}\phi(\mathbf{x})\right]^T \left[\sqrt{c}\phi(\mathbf{x}')\right]$$ Ther...
619
6
6.6
easy
Verify the results $k(\mathbf{x}, \mathbf{x}') = q(k_1(\mathbf{x}, \mathbf{x}'))$ and $k(\mathbf{x}, \mathbf{x}') = \exp(k_1(\mathbf{x}, \mathbf{x}'))$ for constructing valid kernels.
We suppose q(x) can be written as: $$q(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0$$ We now obtain: $$k(\mathbf{x}, \mathbf{x}') = a_n k_1(\mathbf{x}, \mathbf{x}')^n + a_{n-1} k_1(\mathbf{x}, \mathbf{x}')^{n-1} + \dots + a_1 k_1(\mathbf{x}, \mathbf{x}') + a_0$$ By repeatedly using $k(\mathbf{x}, \mathbf{x}...
845