How can a layer with 3 units can have 6 weights

So, in the optional lab there’s a hidden layer with three units:

Dense(3, activation='sigmoid', name = 'layer1'),

But I don’t understand how it can have 6 weights (2 2x3 matrices)

W1 = np.array([
    [-8.94,  0.29, 12.89],
    [-0.17, -7.34, 10.79]] )

Shouldn’t it have only 3 weights?

Hello @gerytch

Because each unit receives two features.

At once?

Yes, at once. Just like an unit that does 3x_1 + 4x_2, we need both x_1 and x_2 to compute the result.

1 Like

Now it makes sense. Thank you very much!! :smile:

1 Like