The code for obtaining the loss values is as given below. It seems that the loss value when I print the train_loss_writer is increasing incrementally, from
train_loss_writer