I know the basics of PyTorch and I understand neural nets.
I have a set of observations and they go through a NN and result in a single scalar. I want to maximise that scalar (i.e. perform gradient ascent so that the expectation is maximised). Is there a torch.nn.*Loss function for this? I can’t see it. One hack would be to define a number that is bigger that I can ever see in the output (yes, it’s bounded) and use torch.nn.L1Loss() but there should be a cleaner way to do this.  Maybe I shouldn’t be using a torch.nn.*Loss() function at all?