class_docstr: Mixture Density Network - Recurrent Neural Network
code: def __init__(
      self,
      state_dim,
      action_dim,
      num_hiddens,
      num_hidden_layers,
      num_gaussians,
  ):
      super().__init__()
      self.state_dim = state_dim
      self.action_dim = action_dim
      self.num_hiddens = num_hiddens
      self.num_hidden_layers = num_hidden_layers
      self.rnn = nn.LSTM(
          input_size=state_dim + action_dim,
          hidden_size=num_hiddens,
          num_layers=num_hidden_layers,
      )
  
      self.num_gaussians = num_gaussians
      # outputs:
      # 1. mu, sigma, and pi for each gaussian
      # 2. non-terminal signal
      # 3. reward
      self.gmm_linear = nn.Linear(
          num_hiddens, (2 * state_dim + 1) * num_gaussians + 2
      )
  
imports: import logging
  from collections import deque
  from typing import NamedTuple
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from reagent.core import types
  from reagent.core.torch_utils import stack
  from torch.distributions.normal import Normal
label_desc: Use image node_id 1 to create a new MDNRNN object from inherited base classes: nn with example: obj = MDNRNN(state_dim, action_dim, num_hiddens, num_hidden_layers, num_gaussians)