Hw 3 predict function

Hw 3 predict function

by Julien Malka -
Number of replies: 1

Hi,

I don't understand why in the hw3 the assignment tells us that the prediction performed by the perception is defined by

Predict

but this multiplication doesnt seem to be well defined, and in the correction xW is computed instead of what told above.

I don't understand this inconsistency.

Can you please explain ?

Best,

Julien

In reply to Julien Malka

Re: Hw 3 predict function

by Sena Kiciroglu -
Hi Julien, 

When we are talking about a single data sample we use x_n or in this case x. We express single data samples as column vectors of shape (D x 1). Our weights w is also a column vector of shape (D x 1). When we are multiplying a single data sample with the weights, we have to take the transpose of w.

When we talk about the whole dataset we use the notation XThis is a matrix of size (N x D). 

The function we implement takes the whole data X of shape (N, D) (this is what the .shape would actually return in python) and multiplies it by the weights vector of shape (D,). Therefore we do Xw.

I hope this is clear. 

Best, 

Sena