mscdit

mscdit

Programming Machine Learning - Dimension numbers correct? (page 118)

Hi @nusco,

I have a question regarding the dimension numbers of the matrices shown in the picture on page 118. What I am currently struggling with is, node “h_0” is used for bias purpose (which means constant value 1). So if weight vector w_1 has 201 columns, this implies that all hidden nodes h_0, h_1, … h_200 are calculated via w_1 … but looking in the code-snipets on page 122,

h = sigmoid(np.matmul(prepend_bias(X), w1))

vector h should have 202 entries, if w1 has 201, which doesn’t fit into the picture of page 118, or?

Thanks a lot,
Mscdit

1 250 1

First Post!

nusco

nusco

Author of Metaprogramming Ruby & Programming Machine Learning

Here I am, at long last! Sorry for the slow reply, @mscdit . I was knocked out by the flu.

This looks indeed like a mistake in that diagram (that is even repeated in two consecutive chapters). w1 should be (785, 200), not (785, 201). Then the hidden layer is (M, 200), and it becomes (M, 201) when you prepend the biases.

Thank you for spotting it! I’ll add to the errata for future editions.

Where Next?

Popular Pragmatic Bookshelf topics Top

ianwillie
Hello Brian, I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
0 1500 3
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
5 1083 2
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
10 1451 5
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
0 1297 3
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
0 1696 3
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
3 1966 5
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
0 1225 4
New
a.zampa
@mfazio23 I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
1 3360 6
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
1 3040 5
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
0 1125 2
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
193 4510 82
New
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
24 3679 24
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
14 6073 7
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
166 7775 69
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
66 21694 24
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
49 4462 14
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
5 8045 3
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
0 2183 2
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
14 5193 10
New

Sub Categories: