rasbt / machine-learning-book

Code Repository for Machine Learning with PyTorch and Scikit-Learn
https://sebastianraschka.com/books/#machine-learning-with-pytorch-and-scikit-learn
MIT License
3.64k stars 1.31k forks source link

P. 361 missing i in the first summation in MSE Loss equation #71

Closed hongsoog closed 2 years ago

hongsoog commented 2 years ago

In page 361, MSE Loss equation missing index i in the first summation.

$$ L \big ( \mathbf{W}, \mathbf{b} \big ) = \frac{1}{n} \sum{1}^{n} \frac{1}{t} \sum{j=1}^{t} \big( y{j}^{[i]} - a{j}^{(out)[i]} \big )^{2} $$

sould be corrected as follows:

$$ L \big ( \mathbf{W}, \mathbf{b} \big ) = \frac{1}{n} \sum{i=1}^{n} \frac{1}{t} \sum{j=1}^{t} \big( y{j}^{[i]} - a{j}^{(out)[i]} \big )^{2} $$

and

superscript $[i]$ is the index of a particular example in our training dataset

the bracket superscript usage is somewhat inconsistent with the parenthesis superscript convention presented in page 338.

rasbt commented 2 years ago

For consistency with earlier chapters (2, 3, etc.) it would be better to use parentheses () for training example indices and square brackets [ ] for the layer indices. (This would affect lots of places, like figure 11.2, pages 340-342, 361-363, Figure 11.11, 11.12, and others). So it might be easier to change it on page 338 like you suggested.

Thanks for the note on the missing index as well! Added both to the errata.