Help needed on my code

That was all explained and demonstrated on the thread that I linked earlier. If you missed that the first time around, it is worth a look. :laughing:

But it fundamentally comes down to understanding what the operations mean. It will be clear why y^T \cdot log(a) is not the same thing as y \cdot log(a)^T if you examine the examples given on that thread.