original_docstring: compute the potential of active features in a specified boundary 
          
             Args:
                 w: weight vector (numpy vector)
                 active_features: dictionary of activated features in a specified boundary
          
docstring: compute the potential of active features in a specified boundary
docstring_tokens: compute the potential of active features in a specified boundary
code: def compute_fpotential(self, w, active_features):
          """compute the potential of active features in a specified boundary 
          
             Args:
                 w: weight vector (numpy vector)
                 active_features: dictionary of activated features in a specified boundary
          """
          model = self.model
          pky_codebook = model.pky_codebook
          z_pky_map = model.z_pky_map
          f_potential = numpy.zeros(len(pky_codebook))
  
          # to consider caching the w_indx and fval as in cached_pf
          for z in active_features:
              w_indx, f_val = active_features[z]
              potential = numpy.dot(w[w_indx], f_val)
              # get all pky's in coded format where z maintains a suffix relation with them
              pky_c_list = z_pky_map[z]
              f_potential[pky_c_list] += potential
  
          return f_potential
code_tokens: def compute_fpotential ( self , w , active_features ) : model = self . model pky_codebook = model . pky_codebook z_pky_map = model . z_pky_map f_potential = numpy . zeros ( len ( pky_codebook ) ) for z in active_features : w_indx , f_val = active_features [ z ] potential = numpy . dot ( w [ w_indx ] , f_val ) pky_c_list = z_pky_map [ z ] f_potential [ pky_c_list ] += potential return f_potential
short_docstring: compute the potential of active features in a specified boundary
short_docstring_tokens: compute the potential of active features in a specified boundary
comment: """compute the potential of active features in a specified boundary 
          
             Args:
                 w: weight vector (numpy vector)
                 active_features: dictionary of activated features in a specified boundary
          """$SEP$# to consider caching the w_indx and fval as in cached_pf$SEP$# get all pky's in coded format where z maintains a suffix relation with them