class_docstr: The class implements Infinite Gaussian Mixture model
  or Dirichlet Process Mixture model.
  This is simply a generalization of Bayesian Gaussian Mixture Models
  with an unknown number of classes.
class_docstr_tok: ["The","class","implements","Infinite","Gaussian","Mixture","model","or","Dirichlet","Process","Mixture","model",".","This","is","simply","a","generalization","of","Bayesian","Gaussian","Mixture","Models","with","an","unknown","number","of","classes","."]
docstr: Given the allocation vector z, resmaple the weights parameter
  
  Parameters
  ----------
  z array of shape (n_samples), type = np.int_
    the allocation variable
docstr_tok: ["Given","the","allocation","vector","z",",","resmaple","the","weights","parameter","Parameters","--","--","--","--","--","z","array","of","shape","(","n_samples",")",",","type","=","np.int_","the","allocation","variable"]
code: def update_weights(self, z):
      """
      Given the allocation vector z, resmaple the weights parameter
  
      Parameters
      ----------
      z array of shape (n_samples), type = np.int_
        the allocation variable
      """
      pop = np.hstack((self.pop(z), 0))
      self.weights = pop + self.prior_weights
      self.weights /= self.weights.sum()
  
imports: import math
  import numpy
  from scipy.special import gammaln
  from .bgmm import BGMM, detsh
label_desc: Use image node_id 9 for calling the IMM obj's underlying member method code with example usage: obj.update_weights(z) without return types