def __init__(self, V=8, M=4, subquantizer_clusters=256, parameters=None):
        """
        Create an LOPQModel instance that encapsulates a complete LOPQ model with parameters and hyperparameters.

        :param int V:
            the number of clusters per a coarse split
        :param int M:
            the total number of subvectors (equivalent to the total number of subquantizers)
        :param int subquantizer_clusters:
            the number of clusters for each subquantizer
        :param tuple parameters:
            a tuple of parameters - missing parameters are allowed to be None

            the tuple will look like the following

            ((C1, C2), (Rs1, Rs2), (mu1, mu2), (subquantizers1, subquantizers2))

            where each element is itself a pair with one split of parameters for the each of the coarse splits.

            the parameters have the following data types (V and M have the meaning described above,
            D is the total dimension of the data, and S is the number of subquantizer clusters):

                C: VxD/2 ndarray of coarse centroids
                R: VxD/2xD/2 ndarray of fitted rotation matrices for each coarse cluster
                mu: VxD/2 ndarray of mean residuals for each coar cluster
                subquantizer: length M/2 list of SxD/M ndarrays of cluster centroids for each subvector
        """

        # If learned parameters are passed in explicitly, derive the model params by inspection.
        self.Cs, self.Rs, self.mus, self.subquantizers = parameters if parameters is not None else (None, None, None, None)

        if self.Cs is not None:
            self.V = self.Cs[0].shape[0]
            self.num_coarse_splits = len(self.Cs)
        else:
            self.V = V
            self.num_coarse_splits = 2

        if self.subquantizers is not None:
            self.num_fine_splits = len(self.subquantizers[0])
            self.M = self.num_fine_splits * self.num_coarse_splits
            self.subquantizer_clusters = self.subquantizers[0][0].shape[0]
        else:
            self.num_fine_splits = M / 2
            self.M = M
            self.subquantizer_clusters = subquantizer_clusters
dataset/ETHPy150Open yahoo/lopq/python/lopq/model.py/LOPQModel.__init__/original