Sha256: a0000d99608b93a5b2a63d0d7d3f21b2cd29c5c53a894ddc5b36de8bdc00af47

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

module Hanny
  class LSHIndex
    attr_reader code_length: Integer
    attr_reader n_samples: Integer
    attr_reader n_features: Integer
    attr_reader n_keys: Integer
    attr_reader hash_table: Hash[Symbol, Array[Integer]]
    attr_reader hash_codes: Numo::Bit
    attr_reader random_seed: untyped
    attr_reader rng: Random

    def initialize: (?code_length: Integer code_length, ?random_seed: Integer? random_seed) -> void
    def hash_function: (Numo::DFloat x) -> Numo::Bit
    def build_index: (Numo::DFloat x) -> LSHIndex
    def append_data: (Numo::DFloat x) -> Array[Integer]
    def remove_data: (Array[Integer] data_ids) -> Array[Integer]
    def search_knn: (Numo::DFloat q, ?n_neighbors: Integer n_neighbors) -> Array[Array[Integer]]
    def search_radius: (Numo::DFloat q, ?radius: Float radius) -> Array[Array[Integer]]

    private

    def symbolized_hash_key: (Numo::Bit bin_code) -> Symbol
    def distances_to_hash_codes: (Numo::Bit bin_code) -> Array[Float]
    def sort_with_index: (Array[Float] arr) -> Array[[Float, Integer]]
    def decoded_hash_key: (Symbol hash_key) -> Numo::Bit
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanny-0.2.2 sig/hanny/lsh_index.rbs
hanny-0.2.1 sig/hanny/lsh_index.rbs
hanny-0.2.0 sig/hanny/lsh_index.rbs