Solved by InnovArul in post #2 
              
              
                If I understand correctly, you want to optimize the network to maximize a loss function? 
If so, you can just minimize the negative of that loss function, which in turn will maximize the loss. 
i.e., 
loss = -Loss(...)
loss.backward()
optim.step()