parameters: (self)
return_statement: return weight_sparsity_map
docstring: Returns the map of weight_name:sparsity parsed from the hparams.
docstring_summary: Returns the map of weight_name:sparsity parsed from the hparams.
docstring_tokens: Returns the map of weight_name : sparsity parsed from the hparams .
function: def _get_weight_sparsity_map(self):
      """Returns the map of weight_name:sparsity parsed from the hparams."""
      weight_sparsity_map = {}
      val_list = self._spec.weight_sparsity_map
      filtered_val_list = [l for l in val_list if l]
      for val in filtered_val_list:
        weight_name, sparsity = val.split(':')
        if float(sparsity) >= 1.0:
          raise ValueError('Weight sparsity can not exceed 1.0')
        weight_sparsity_map[re.compile(weight_name)] = float(sparsity)
  
      return weight_sparsity_map
function_tokens: def _get_weight_sparsity_map ( self ) : weight_sparsity_map = { } val_list = self . _spec . weight_sparsity_map filtered_val_list = [ l for l in val_list if l ] for val in filtered_val_list : weight_name , sparsity = val . split ( ':' ) if float ( sparsity ) >= 1.0 : raise ValueError ( 'Weight sparsity can not exceed 1.0' ) weight_sparsity_map [ re . compile ( weight_name ) ] = float ( sparsity ) return weight_sparsity_map