DL#104 Feed-Forward Neural Network Generic class Weight Matrix shape

class FFSNNetwork :
inside init :
self.sizes = [self.nx] + hidden_units + [self.ny]

for i in range(self.nh+1):
self.W[i+1] = np.random.randn(self.sizes[i], self.sizes[i+1])
self.B[i+1] = np.zeros((1, self.sizes[i+1]))

this code means it is being defined of shape (n_features x hidden_units)

but shouldn’t the weight matrix be of size ( hidden_units x n_features )

Hi @Siddhant_Jain,
We can do it either way, and later use transpose of the matrix to match the required shape.

1 Like