def project(self, x, coarse_codes, coarse_split=None):
        px = []

        if coarse_split is None:
            split_iter = iterate_splits(x, self.num_coarse_splits)
        else:
            split_iter = [(np.split(x, self.num_coarse_splits)[coarse_split], coarse_split)]

        for cx, split in split_iter:

            # Get product quantizer parameters for this split
            C, R, mu, _ = self.get_split_parameters(split)

            # Retrieve already computed coarse cluster
            cluster = coarse_codes[split]

            # Compute residual
            r = cx - C[cluster]

            # Project residual to local frame
            pr = np.dot(R[cluster], r - mu[cluster])
            px.append(pr)

        return np.concatenate(px)
Project this vector to its local residual space defined by the coarse codes.
dataset/ETHPy150Open yahoo/lopq/python/lopq/model.py/LOPQModel.project