docstr: Calculate losses, gradients, and update network weights; called in every training iteration
docstr_tok: ["Calculate","losses",",","gradients",",","and","update","network","weights",";","called","in","every","training","iteration"]
code: def backward(self):
      """Calculate losses, gradients, and update network weights; called in every training iteration"""
      # caculate the intermediate results if necessary; here self.output has been computed during function <forward>
      # calculate loss given the input and intermediate results
      self.loss_reg.backward()
  
imports: import logging
  import torch
  import torch.nn.functional
  from typing import Any
  from torch_points3d.datasets.multiscale_data import MultiScaleBatch
  from torch_points3d.models.base_architectures import BackboneBasedModel
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.core.common_modules.dense_modules import Conv1D
  from torch_points3d.core.common_modules.base_modules import Seq
label_desc: Use image node_id 6 for calling the PatchSiamese obj's underlying member method code with example usage: obj.backward() without return types