I have tried to compute the cost, I can get correct type but not the correct value. What should I do?

*{Moderator Edit: Solution Code Removed}*

Hint: Inputs of tf.keras.losses.categorical_crossentropy are expected to be of shape **(number of examples, num_classes**)

Given that:

```
logits -- output of forward propagation (output of the last LINEAR unit), of shape (6, num_examples)
labels -- "true" labels vector, same shape as Z3
```

But, why you are dividing total loss by logits.shape?

1 Like

thank you, because I am thinking maybe taking the mean average will fit into the answer.