TensorFlow model question

Yes, this is a bit confusing. The issue is that TensorFlow always uses “samples” as the first dimension, which is why the “batch” function divides along that axis. But Prof Ng all the way through DLS C1 and up to this point has used the features x samples orientation for the input data and that’s how he does it here in the forward_propagation function. Because of that, we need to do transposes when we get to using TF to compute the loss values.

Here’s another thread which discusses this point a bit more.

1 Like