parameters: (self, cb_params)
docstring: Collect histogram data, contain the parameter weight and bias.
docstring_summary: Collect histogram data, contain the parameter weight and bias.
docstring_tokens: Collect histogram data contain the parameter weight and bias .
function: def _collect_histogram(self, cb_params):
          """Collect histogram data, contain the parameter weight and bias."""
          # Note: if there is not a key named `histogram_regular` in `self._collect_specified_data`,
          # it means we will not collect histogram data.
          if 'histogram_regular' not in self._collect_specified_data:
              return
  
          optimizer = self._get_optimizer(cb_params)
          if optimizer is None:
              return
  
          parameters = optimizer.parameters
          regular = self._collect_specified_data.get('histogram_regular')
          if regular is not None:
              for parameter in parameters:
                  if re.match(regular, parameter.name):
                      self._record.add_value(PluginEnum.HISTOGRAM.value, parameter.name+'/auto', parameter.data)
              return
  
          # Note: If `histogram_regular` in `self._collect_specified_data` and the value is None,
          # we will collect the first five parameters.
          default_parameter_count = 5
          for parameter in parameters[:default_parameter_count]:
              self._record.add_value(PluginEnum.HISTOGRAM.value, parameter.name+'/auto', parameter.data)
function_tokens: def _collect_histogram ( self , cb_params ) : # Note: if there is not a key named `histogram_regular` in `self._collect_specified_data`, # it means we will not collect histogram data. if 'histogram_regular' not in self . _collect_specified_data : return optimizer = self . _get_optimizer ( cb_params ) if optimizer is None : return parameters = optimizer . parameters regular = self . _collect_specified_data . get ( 'histogram_regular' ) if regular is not None : for parameter in parameters : if re . match ( regular , parameter . name ) : self . _record . add_value ( PluginEnum . HISTOGRAM . value , parameter . name + '/auto' , parameter . data ) return # Note: If `histogram_regular` in `self._collect_specified_data` and the value is None, # we will collect the first five parameters. default_parameter_count = 5 for parameter in parameters [ : default_parameter_count ] : self . _record . add_value ( PluginEnum . HISTOGRAM . value , parameter . name + '/auto' , parameter . data )