'Implementing loss function in MatConvNet

I am trying to implement code for this loss function for a classification task for a subset image data using several pre-trained models provided by MatConvNet but not sure how to implement it.

average cross-entropy loss formula



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source