How to use the rii.rii.Rii function in rii

To help you get started, we’ve selected a few rii examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matsui528 / rii / rii / rii.py View on Github external
"""Given another Rii instance (engine), merge its PQ-codes (engine.codes)
        to this instance. IDs for new PQ-codes are automatically assigned.
        For example, if self.N = 100, the IDs of the merged PQ-codes would be 100, 101, ...

        The original posting lists of this instance will be kept
        maintained; new PQ-codes will be simply added over that.
        Thus it might be better to call :func:`reconfigure` after many new codes are merged.

        Args:
            engine (rii.Rii): Rii instance. engine.fine_quantizer should be
                the same as self.fine_quantizer
            update_posting_lists (bool or str): True or False or 'auto'. If True, :attr:`posting_lists` will be updated.
                This should be True for usual cases.

        """
        assert isinstance(engine, Rii)
        assert self.fine_quantizer == engine.fine_quantizer, \
            "Two engines to be merged must have the same fine quantizer"

        if engine.N != 0:
            self.impl_cpp.add_codes(engine.codes,
                                    self._resolve_update_posting_lists_flag(update_posting_lists))

        if self.verbose:
            print("The number of codes: {}".format(self.N))

rii

Fast and memory-efficient ANN with a subset-search functionality

MIT
Latest version published 1 year ago

Package Health Score

47 / 100
Full package analysis

Popular rii functions

Similar packages