code: def update_theta(self, doc_ids, doc_cnt):
      loss = 0.0
      for vi in range(self.n_item):
          w = np.array(doc_ids[vi])
          word_beta = self.beta[w, :]
          phi = self.theta[vi, :] * word_beta + EPS  # W x K
          phi = phi / phi.sum(1)[:, np.newaxis]
          gamma = np.array(doc_cnt[vi])[:, np.newaxis] * phi
  
          self.theta[vi, :], lda_loss = _optimize_simplex(
              gamma=gamma,
              v=self.V[vi, :],
              opt_x=self.theta[vi, :],
              lambda_v=self.lambda_v,
              s=1,
          )
          loss += lda_loss
  
          self.phi_sum[w, :] += gamma
  
      return loss
  
file_path: cornac/cornac/models/ctr/ctr.py
imports: import numpy
  from ...utils import get_rng
label_desc: Use image node_id 4 for calling the Model obj's underlying member method code with example usage: obj.update_theta(doc_ids, doc_cnt) and returns: loss