Is there a numpy function that could do this without looping like that?
for i in range(784):
for j in range(128):
w[i, j] = x[i] * d[j]
Is there a numpy function that could do this without looping like that?
for i in range(784):
for j in range(128):
w[i, j] = x[i] * d[j]
I would try this
x = np.expand_dims(x,1)
y = np.expand_dims(y,0)
result = np.matmul(x,y)