class_docstr: Evaluator base class.
docstr: Update accumulated log-likelihoods.
  
  Note: the shape of `lls` and the range of `d` depends on the "number of
  variables per time step" `dd`, which is the number of instruments if
  instruments if instruments are separated or the number of pitches otherwise.
  
  Args:
    lls: (tt, dd)-shaped array of unit log-likelihoods.
    x: the pianoroll being evaluated, shape (B, tt, P, I).
    pxhat: the probabilities output by the model, shape (B, tt, P, I).
    t: the batch of time indices being evaluated, shape (B,).
    d: the batch of variable indices being evaluated, shape (B,).
docstr_tok: ["Update","accumulated","log-likelihoods",".","Note",":","the","shape","of","`","lls","`","and","the","range","of","`","d","`","depends","on","the","``","number","of","variables","per","time","step","''","`","dd","`",",","which","is","the","number","of","instruments","if","instruments","if","instruments","are","separated","or","the","number","of","pitches","otherwise",".","Args",":","lls",":","(","tt",",","dd",")","-shaped","array","of","unit","log-likelihoods",".","x",":","the","pianoroll","being","evaluated",",","shape","(","B",",","tt",",","P",",","I",")",".","pxhat",":","the","probabilities","output","by","the","model",",","shape","(","B",",","tt",",","P",",","I",")",".","t",":","the","batch","of","time","indices","being","evaluated",",","shape","(","B",",",")",".","d",":","the","batch","of","variable","indices","being","evaluated",",","shape","(","B",",",")","."]
code: def _update_lls(self, lls, x, pxhat, t, d):
      """Update accumulated log-likelihoods.
  
      Note: the shape of `lls` and the range of `d` depends on the "number of
      variables per time step" `dd`, which is the number of instruments if
      instruments if instruments are separated or the number of pitches otherwise.
  
      Args:
        lls: (tt, dd)-shaped array of unit log-likelihoods.
        x: the pianoroll being evaluated, shape (B, tt, P, I).
        pxhat: the probabilities output by the model, shape (B, tt, P, I).
        t: the batch of time indices being evaluated, shape (B,).
        d: the batch of variable indices being evaluated, shape (B,).
      """
      # The code below assumes x is binary, so instead of x * log(px) which is
      # inconveniently NaN if both x and log(px) are zero, we can use
      # where(x, log(px), 0).
      assert np.array_equal(x, x.astype(bool))
      if self.separate_instruments:
          index = (np.arange(x.shape[0]), t, slice(None), d)
      else:
          index = (np.arange(x.shape[0]), t, d, slice(None))
      lls[t, d] = np.log(np.where(x[index], pxhat[index], 1)).sum(
          axis=1
      )
  
imports: import time
  from magenta.models.coconet import lib_tfutil
  from magenta.models.coconet import lib_util
  import numpy
  from scipy.misc import logsumexp
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the BaseEvaluator obj's underlying member method code with example usage: obj._update_lls(lls, x, pxhat, t, d) without return types