code: def init_count(self, docs):
      # Counter
      self.item_topic_cnt = np.zeros(
          shape=(self.n_item, self.k), dtype=int
      )  # given item, count number of time each topic occur
  
      self.word_topic_cnt = np.zeros(
          shape=(self.n_vocab, self.k), dtype=int
      )  # given word, count number of time each topic occur
  
      self.item_word = np.zeros(
          shape=(self.n_item, 1), dtype=int
      )  # number of word for each item
      self.topic_cnt = np.zeros(
          shape=(1, self.k), dtype=int
      )  # number of time topic occur
      self.total_word = 0  # total number word in corpus
      self.background_word = np.zeros(
          shape=(self.n_vocab, 1), dtype=float
      )  # background weights for each word [n_vocab, 1]
  
      self.topic_assignment = list()
  
      for di in range(len(docs)):
          doc = docs[di]
          doc_len = len(doc)
          topics = np.random.randint(self.k, size=doc_len)
          self.topic_assignment.append(topics)
          self.item_word[di] = doc_len
          self.total_word += doc_len
          for wi in range(doc_len):
              topic = topics[wi]
              word = doc[wi]
              self.word_topic_cnt[word, topic] += 1
              self.item_topic_cnt[di, topic] += 1
              self.background_word[word] += 1
              self.topic_cnt[0, topic] += 1
  
      self.background_word /= self.total_word
  
file_path: cornac/cornac/models/hft/hft.py
imports: import numpy
  import scipy.optimize
label_desc: Use image node_id 3 for calling the Model obj's underlying member method code with example usage: obj.init_count(docs) without return types