Question about batch size and loss function

First of all, check your model, optimizer function, and type of loss function.
Then specify what is your prediction shape and even your output shape. Perhaps , the loss function would be changed for the task you are working on. For example, with respect to classification, we use cross entropy loss while for regression we need to apply MSE loss or L1 loss or …
After that you are ready to go for this link to grasp how loss is computed.
Interpreting loss value - PyTorch Forums