(X, W1, b1, W2, b2)
| 24 | return expA / expA.sum(axis=1, keepdims=True) |
| 25 | |
| 26 | def forward(X, W1, b1, W2, b2): |
| 27 | Z = np.tanh(X.dot(W1) + b1) |
| 28 | return softmax(Z.dot(W2) + b2) |
| 29 | |
| 30 | P_Y_given_X = forward(X, W1, b1, W2, b2) |
| 31 | print("P_Y_given_X.shape:", P_Y_given_X.shape) |