class_docstr: This PyTorch Module encapsulates the model as well as the
  variational distribution (the guide) for the Deep Markov Model
class_docstr_tok: ["This","PyTorch","Module","encapsulates","the","model","as","well","as","the","variational","distribution","(","the","guide",")","for","the","Deep","Markov","Model"]
code: def __init__(
      self,
      input_dim=88,
      z_dim=100,
      emission_dim=100,
      transition_dim=200,
      rnn_dim=600,
      num_layers=1,
      rnn_dropout_rate=0.0,
      num_iafs=0,
      iaf_dim=50,
      use_cuda=False,
  ):
      super().__init__()
      # instantiate PyTorch modules used in the model and guide below
      self.emitter = Emitter(input_dim, z_dim, emission_dim)
      self.trans = GatedTransition(z_dim, transition_dim)
      self.combiner = Combiner(z_dim, rnn_dim)
      # dropout just takes effect on inner layers of rnn
      rnn_dropout_rate = 0.0 if num_layers == 1 else rnn_dropout_rate
      self.rnn = nn.RNN(
          input_size=input_dim,
          hidden_size=rnn_dim,
          nonlinearity="relu",
          batch_first=True,
          bidirectional=False,
          num_layers=num_layers,
          dropout=rnn_dropout_rate,
      )
  
      # if we're using normalizing flows, instantiate those too
      self.iafs = [
          affine_autoregressive(z_dim, hidden_dims=[iaf_dim])
          for _ in range(num_iafs)
      ]
      self.iafs_modules = nn.ModuleList(self.iafs)
  
      # define a (trainable) parameters z_0 and z_q_0 that help define the probability
      # distributions p(z_1) and q(z_1)
      # (since for t = 1 there are no previous latents to condition on)
      self.z_0 = nn.Parameter(torch.zeros(z_dim))
      self.z_q_0 = nn.Parameter(torch.zeros(z_dim))
      # define a (trainable) parameter for the initial hidden state of the rnn
      self.h_0 = nn.Parameter(torch.zeros(1, 1, rnn_dim))
  
      self.use_cuda = use_cuda
      # if on gpu cuda-ize all PyTorch (sub)modules
      if use_cuda:
          self.cuda()
  
imports: import argparse
  import logging
  import time
  from os.path import exists
  import numpy
  import torch
  import torch.nn
  import pyro
  import pyro.contrib.examples.polyphonic_data_loader
  import pyro.distributions
  import pyro.poutine
  from pyro.distributions import TransformedDistribution
  from pyro.distributions.transforms import affine_autoregressive
  from pyro.infer import SVI, JitTrace_ELBO, Trace_ELBO, TraceEnum_ELBO, TraceTMC_ELBO, config_enumerate
  from pyro.optim import ClippedAdam
label_desc: Use image node_id 1 to create a new DMM object from inherited base classes: nn with example: obj = DMM(input_dim, z_dim, emission_dim, transition_dim, rnn_dim, num_layers, rnn_dropout_rate, num_iafs, iaf_dim, use_cuda)