def project(self, x, coarse_codes, coarse_split=None):
        """
        Project this vector to its local residual space defined by the coarse codes.

        :param ndarray x:
            the point to project
        :param ndarray coarse_codes:
            the coarse codes defining the local space
        :param int coarse_split:
            index of the coarse split to get distances for - if None then all splits
            are computed

        :returns ndarray:
            the projected vector
        """
        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)
dataset/ETHPy150Open yahoo/lopq/python/lopq/model.py/LOPQModel.project/operator `-` -> `*`