C1W3_Assignment state variables shapes question

In the week3 assignment it’s requested to implement a layer with this computation:
x^2 * a + x * b + c, where x is the input and (a,b,c) are the state variables of the layer.

After that, the state variables are defined with the following shapes:
for a,b: shape=(input_shape[-1], layer_units)
for c: shape=(layer_inputs,)

Since a,b are matrixs and c is a vector, how the computation of function above is possible?
Shouldn’t be c shape = (input_shape[0], layer_units) ?

Here python broadcasting is taking place:


Very helpful, thanks

1 Like