class_docstr: A wrapper around a pretrained CREPE model, for pitch prediction.
  
  Enables predicting pitch and confidence entirely in TF for running in batch
  on accelerators. For [full,large,small,tiny] crepe models, reads h5 models
  from installed pip package. Other saved models
class_docstr_tok: ["A","wrapper","around","a","pretrained","CREPE","model",",","for","pitch","prediction",".","Enables","predicting","pitch","and","confidence","entirely","in","TF","for","running","in","batch","on","accelerators",".","For","[","full",",","large",",","small",",","tiny","]","crepe","models",",","reads","h5","models","from","installed","pip","package",".","Other","saved","models"]
docstr: Same as the original CREPE viterbi decdoding, but in TF.
docstr_tok: ["Same","as","the","original","CREPE","viterbi","decdoding",",","but","in","TF","."]
code: def create_hmm(self, num_steps):
      """Same as the original CREPE viterbi decdoding, but in TF."""
      # Initial distribution is uniform.
      initial_distribution = tfp.distributions.Categorical(
          probs=tf.ones([360]) / 360
      )
  
      # Transition probabilities inducing continuous pitch.
      bins = tf.range(360, dtype=tf.float32)
      xx, yy = tf.meshgrid(bins, bins)
      min_transition = 1e-5  # For training stabiity.
      transition = tf.maximum(12 - abs(xx - yy), min_transition)
      transition = (
          transition / tf.reduce_sum(transition, axis=1)[:, None]
      )
      transition = tf.cast(transition, tf.float32)
      transition_distribution = tfp.distributions.Categorical(
          probs=transition
      )
  
      # Emission probability = fixed probability for self, evenly distribute the
      # others.
      self_emission = 0.1
      emission = tf.eye(360) * self_emission + tf.ones(
          shape=(360, 360)
      ) * ((1 - self_emission) / 360.0)
      emission = tf.cast(emission, tf.float32)[None, ...]
      observation_distribution = tfp.distributions.Multinomial(
          total_count=1, probs=emission
      )
  
      return tfp.distributions.HiddenMarkovModel(
          initial_distribution=initial_distribution,
          transition_distribution=transition_distribution,
          observation_distribution=observation_distribution,
          num_steps=num_steps,
      )
  
imports: import crepe
  from ddsp import core
  from ddsp.core import safe_log
  from ddsp.core import tf_float32
  import gin
  import librosa
  import numpy
  import tensorflow.compat.v2
  import tensorflow_probability
label_desc: Use image node_id 6 for calling the PretrainedCREPE obj's underlying member method code with example usage: obj.create_hmm(num_steps) and returns: tfp