Module Import alias ImportFrom alias alias alias alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Assign SubscriptStore NameLoad Index Str Dict decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad If NameLoad body For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot CompareIn AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str NameLoad orelse For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad NameLoad Index Str For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot BoolOpOr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str Str NameLoad NameLoad Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A numpy nearpy.hashes LSHash RandomBinaryProjections PCABinaryProjections RandomBinaryProjectionTree nearpy.hashes.permutation Permutation HashPermutations N/A LSHash N/A N/A 
    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 separatly.

    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.

     __init__ N/A N/A self hash_name N/A N/A N/A  Just keeps the name.  N/A N/A N/A N/A super HashPermutations self __init__ hash_name N/A N/A self permutation N/A Permutation N/A N/A self child_hashes N/A N/A N/A self dim None N/A reset N/A N/A self dim N/A N/A N/A  Resets / Initializes the hash for the specified dimension.  N/A N/A self dim dim N/A child_hash N/A self child_hashes N/A N/A N/A N/A N/A child_hash N/A hash reset dim N/A N/A child_hash N/A bucket_keys N/A N/A hash_vector N/A N/A self v querying N/A False N/A N/A 
        Hashes the vector and returns the bucket key as string.
         N/A bucket_keys N/A N/A querying N/A N/A child_hash N/A self child_hashes N/A N/A lshash N/A child_hash N/A hash N/A N/A N/A N/A lshash hash_name N/A N/A self permutation permutedIndexs N/A N/A N/A AttributeError N/A Permuted index is not existing for hash with name %s N/A lshash hash_name N/A bucket_key N/A N/A lshash hash_vector v querying N/A N/A neighbour_keys N/A N/A N/A self permutation get_neighbour_keys N/A lshash hash_name bucket_key N/A n neighbour_keys N/A N/A N/A N/A bucket_keys append N/A N/A N/A lshash hash_name _ n N/A N/A child_hash N/A self child_hashes N/A N/A lshash N/A child_hash N/A hash N/A bucket_key N/A N/A lshash hash_vector v querying N/A N/A N/A N/A child_hash N/A bucket_keys N/A bucket_key bucket_key N/A N/A N/A bucket_keys append N/A N/A N/A lshash hash_name _ bucket_key N/A bucket_keys N/A get_config N/A N/A self N/A N/A N/A 
        Returns pickle-serializable configuration struct for storage.
         N/A N/A hash_name dim N/A self hash_name N/A self dim N/A apply_config N/A N/A self config N/A N/A N/A 
        Applies config
         N/A N/A self hash_name N/A config N/A hash_name N/A N/A self dim N/A config N/A dim N/A add_child_hash N/A N/A self child_hash permute_config N/A N/A N/A 
        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
                         }
         N/A N/A N/A N/A isinstance child_hash PCABinaryProjections N/A isinstance child_hash RandomBinaryProjections N/A isinstance child_hash RandomBinaryProjectionTree N/A N/A N/A ValueError Child hashes must generate binary keys N/A N/A N/A N/A self child_hashes append N/A hash config bucket_keys child_hash permute_config N/A N/A build_permuted_index N/A N/A self N/A N/A N/A 
        Build PermutedIndex for all your binary hashings.
        PermutedIndex would be used to find the neighbour bucket key
        in terms of Hamming distance. Permute_configs is nested dict
        in the following format:
        permuted_config = {"<hash_name>":
                           { "num_permutation":50,
                             "beam_size":10,
                             "num_neighbour":100 }
                          }
         N/A child_hash N/A self child_hashes N/A N/A config N/A child_hash N/A config N/A num_permutation N/A config N/A num_permutation N/A beam_size N/A config N/A beam_size N/A num_neighbour N/A config N/A num_neighbour N/A bucket_keys N/A N/A N/A child_hash N/A bucket_keys keys N/A lshash N/A child_hash N/A hash N/A N/A N/A N/A self permutation build_permuted_index lshash bucket_keys num_permutation beam_size num_neighbour N/A N/A