class_docstr: By: Xing Shi (xingshi@usc.edu)
  
  This meta-hash performs hash permutations on binary bucket keys.
  You use this just like every other LSHash implementation and
  add the actual binary hashes you want to use via the add_child_hash
  method. Each child hash will be used separately.
  
  After all vectors have been indexed you have to call build_permuted_index
  to generate the permuted index.
  
  So to use this you have to do the following steps:
  
  1. Create HashPermutations instance and use it in the Engine constructor
  2. Add your binary hashes as child hashes by calling add_child_hash()
  3. Store your vectors using the Engine
  4. Build the permuted index by calling build_permuted_index()
  5. Now when you query the permuted index is used
  
  If you are adding more vectors afterwards you can update the permuted index
  by calling build_permuted_index() again and again.
class_docstr_tok: ["By",":","Xing","Shi","(","xingshi","@","usc.edu",")","This","meta-hash","performs","hash","permutations","on","binary","bucket","keys",".","You","use","this","just","like","every","other","LSHash","implementation","and","add","the","actual","binary","hashes","you","want","to","use","via","the","add_child_hash","method",".","Each","child","hash","will","be","used","separately",".","After","all","vectors","have","been","indexed","you","have","to","call","build_permuted_index","to","generate","the","permuted","index",".","So","to","use","this","you","have","to","do","the","following","steps",":","1",".","Create","HashPermutations","instance","and","use","it","in","the","Engine","constructor","2",".","Add","your","binary","hashes","as","child","hashes","by","calling","add_child_hash","(",")","3",".","Store","your","vectors","using","the","Engine","4",".","Build","the","permuted","index","by","calling","build_permuted_index","(",")","5",".","Now","when","you","query","the","permuted","index","is","used","If","you","are","adding","more","vectors","afterwards","you","can","update","the","permuted","index","by","calling","build_permuted_index","(",")","again","and","again","."]
docstr: Adds specified child hash with specified configuration.
  The hash must be one of the binary types.
  
  permute_config is a dict in the following format:
  permute_config = { "num_permutation":50,
                     "beam_size":10,
                     "num_neighbour":100
                   }
docstr_tok: ["Adds","specified","child","hash","with","specified","configuration",".","The","hash","must","be","one","of","the","binary","types",".","permute_config","is","a","dict","in","the","following","format",":","permute_config","=","{","``","num_permutation","''",":50",",","``","beam_size","''",":10",",","``","num_neighbour","''",":100","}"]
code: def add_child_hash(self, child_hash, permute_config):
      """
      Adds specified child hash with specified configuration.
      The hash must be one of the binary types.
  
      permute_config is a dict in the following format:
      permute_config = { "num_permutation":50,
                         "beam_size":10,
                         "num_neighbour":100
                       }
      """
  
      # Hash must generate binary keys
      if not (
          isinstance(child_hash, PCABinaryProjections)
          or isinstance(child_hash, RandomBinaryProjections)
          or isinstance(child_hash, RandomBinaryProjectionTree)
      ):
          raise ValueError("Child hashes must generate binary keys")
  
      # Add both hash and config to array of child hashes. Also we are going to
      # accumulate used bucket keys for every hash in order to build the permuted index
      self.child_hashes.append(
          {
              "hash": child_hash,
              "config": permute_config,
              "bucket_keys": {},
          }
      )
  
file_path: NearPy/nearpy/hashes/permutation/hashpermutations.py
imports: import numpy
  from nearpy.hashes import LSHash, RandomBinaryProjections, PCABinaryProjections, RandomBinaryProjectionTree
  from nearpy.hashes.permutation import Permutation
label_desc: Use image node_id 6 for calling the HashPermutations obj's underlying member method code with example usage: obj.add_child_hash(child_hash, permute_config) without return types