class_docstr: Profile HMM.
  
  This model consists of a constant distribution (a delta function) over the
  regressor sequence, plus a MuE observation distribution. The priors
  are all Normal distributions, and are pushed through a softmax function
  onto the simplex.
  
  :param int latent_seq_length: Length of the latent regressor sequence M.
      Must be greater than or equal to 1.
  :param int alphabet_length: Length of the sequence alphabet (e.g. 20 for
      amino acids).
  :param float prior_scale: Standard deviation of the prior distribution.
  :param float indel_prior_bias: Mean of the prior distribution over the
      log probability of an indel not occurring. Higher values lead to lower
      probability of indels.
  :param bool cuda: Transfer data onto the GPU during training.
  :param bool pin_memory: Pin memory for faster GPU transfer.
class_docstr_tok: ["Profile","HMM",".","This","model","consists","of","a","constant","distribution","(","a","delta","function",")","over","the","regressor","sequence",",","plus","a","MuE","observation","distribution",".","The","priors","are","all","Normal","distributions",",","and","are","pushed","through","a","softmax","function","onto","the","simplex",".",":","param","int","latent_seq_length",":","Length","of","the","latent","regressor","sequence","M.","Must","be","greater","than","or","equal","to","1.",":","param","int","alphabet_length",":","Length","of","the","sequence","alphabet","(","e.g",".","20","for","amino","acids",")",".",":","param","float","prior_scale",":","Standard","deviation","of","the","prior","distribution",".",":","param","float","indel_prior_bias",":","Mean","of","the","prior","distribution","over","the","log","probability","of","an","indel","not","occurring",".","Higher","values","lead","to","lower","probability","of","indels",".",":","param","bool","cuda",":","Transfer","data","onto","the","GPU","during","training",".",":","param","bool","pin_memory",":","Pin","memory","for","faster","GPU","transfer","."]
code: def model(self, seq_data, local_scale):
      # Latent sequence.
      precursor_seq = pyro.sample(
          "precursor_seq",
          dist.Normal(
              torch.zeros(self.precursor_seq_shape),
              self.prior_scale * torch.ones(self.precursor_seq_shape),
          ).to_event(2),
      )
      precursor_seq_logits = precursor_seq - precursor_seq.logsumexp(
          -1, True
      )
      insert_seq = pyro.sample(
          "insert_seq",
          dist.Normal(
              torch.zeros(self.insert_seq_shape),
              self.prior_scale * torch.ones(self.insert_seq_shape),
          ).to_event(2),
      )
      insert_seq_logits = insert_seq - insert_seq.logsumexp(-1, True)
  
      # Indel probabilities.
      insert = pyro.sample(
          "insert",
          dist.Normal(
              self.indel_prior * torch.ones(self.indel_shape),
              self.prior_scale * torch.ones(self.indel_shape),
          ).to_event(3),
      )
      insert_logits = insert - insert.logsumexp(-1, True)
      delete = pyro.sample(
          "delete",
          dist.Normal(
              self.indel_prior * torch.ones(self.indel_shape),
              self.prior_scale * torch.ones(self.indel_shape),
          ).to_event(3),
      )
      delete_logits = delete - delete.logsumexp(-1, True)
  
      # Construct HMM parameters.
      (
          initial_logits,
          transition_logits,
          observation_logits,
      ) = self.statearrange(
          precursor_seq_logits,
          insert_seq_logits,
          insert_logits,
          delete_logits,
      )
  
      with pyro.plate("batch", seq_data.shape[0]):
          with poutine.scale(scale=local_scale):
              # Observations.
              pyro.sample(
                  "obs_seq",
                  MissingDataDiscreteHMM(
                      initial_logits,
                      transition_logits,
                      observation_logits,
                  ),
                  obs=seq_data,
              )
  
imports: import datetime
  import numpy
  import torch
  import torch.nn
  from torch.nn.functional import softplus
  from torch.optim import Adam
  from torch.utils.data import DataLoader
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.contrib.mue.missingdatahmm import MissingDataDiscreteHMM
  from pyro.contrib.mue.statearrangers import Profile
  from pyro.infer import SVI, JitTrace_ELBO, Trace_ELBO
  from pyro.optim import MultiStepLR
label_desc: Use image node_id 2 for calling the ProfileHMM obj's underlying member method code with example usage: obj.model(seq_data, local_scale) without return types