I have used the line:
{Moderator Edit: Solution Code Removed}
output : tf.Tensor(0.17102128, shape=(), dtype=float32)
expected output: tf.Tensor(0.810287, shape=(), dtype=float32)
the shapes of labels and logits are the same (6,2) and (6,2). What is wrong with the code?
It is given that:
logits β β¦ of shape (6, num_examples) and labels β β¦ same shape as Z3
Also given that
βItβs important to note that the βy_pred
β and βy_true
β inputs of tf.keras.losses.categorical_crossentropy are expected to be of shape (number of examples, num_classes).β
The bold parts are the hint for you to solve the error. One more hint: Transpose.
PS: I am deleting your code as posting your code is not allowedβ¦
1 Like