Error in Coffee Roasting Model Slide: Dimension Mismatch in Forward Propagation Example

Hi everyone,

I’m going through the forward propagation section in the coffee roasting model example, and I noticed what seems like a typo or error in one of the slides.

The activation vector a1 for the first hidden layer is defined as having 3 elements: a1 = np.array([a1_1, a1_2, a1_3]).

However, the weight vector w2_1 for the output layer is shown as np.array([-7, 8]), which only has 2 elements. The slide then attempts a dot product: z2_1 = np.dot(w2_1, a1) + b2_1.

This would cause a dimension mismatch error since you can’t dot product a 2-element vector with a 3-element vector. It looks like w2_1 might be missing a third value (perhaps it’s intended to be something like [-7, 8, some_value]).

Here’s the slide for reference.

Is this a known issue, or am I misunderstanding something? Thanks for any clarification!

Best,
Tejas Bhosale

Hi @Texus_783 ,

Not sure where you get your slide from. Below is a screenshot from the current version available on the Coursera platform where w2_1 is vector with 3 elements:

2 Likes

Hi @Kic

Thanks a lot for clarifying and sharing the screenshot—looks like the slide has been updated with w2.1 as a 3-element vector, which resolves the dimension mismatch. I must have been looking at an older version (perhaps from a downloaded PDF or cached course materials). I’ll check the latest on Coursera directly. Appreciate your help!