I am required to compute my loss function as below:

image1395×225 18.4 KB

where “Theta” is the parameters of the network (i.e. weights) and “f(Theta)” is the output network and “y” is a real label and “x” is the input sample.
would you please give me a tip to do that, by sample code?
how can I compute this in Pytorch during the train of my network?
Thanks.