def optimize_parameters(self):
    'Calculate gradients and update network weights.\n        '
    self.loss_segmentation.backward()
    self.optimizer.step()
    self.optimizer.zero_grad()
    torch.cuda.empty_cache()
Calculate gradients and update network weights.
def optimize_parameters(self):
    '\n        '
    self.loss_segmentation.backward()
    self.optimizer.step()
    self.optimizer.zero_grad()
    torch.cuda.empty_cache()