docstr: proximal_term = None
  if prev_round_weights is not None:
      proximal_term = self.__add_proximal(model_weights, prev_round_weights)
docstr_tok: ["proximal_term","=","None","if","prev_round_weights","is","not","None",":","proximal_term","=","self.__add_proximal","(","model_weights",",","prev_round_weights",")"]
code: def loss_norm(self, model_weights, prev_round_weights=None):
      """
      proximal_term = None
      if prev_round_weights is not None:
          proximal_term = self.__add_proximal(model_weights, prev_round_weights)
      """
  
      if self.l1_penalty:
          loss_norm_value = self.__l1_loss_norm(model_weights)
      elif self.l2_penalty:
          loss_norm_value = self.__l2_loss_norm(model_weights)
      else:
          loss_norm_value = None
  
      """# additional proximal term
          if loss_norm_value is None:
              loss_norm_value = proximal_term
          elif proximal_term is not None:
              loss_norm_value += proximal_term"""
      return loss_norm_value
  
imports: import logging
  import numpy
  import torch
label_desc: Use image node_id 14 for calling the Optimizer obj's underlying member method code with example usage: obj.loss_norm(model_weights, prev_round_weights) and returns: loss_norm_value