class_docstr: Parameterizes the gaussian latent transition probability `p(z_t | z_{t-1})`
  See section 5 in the reference for comparison.
class_docstr_tok: ["Parameterizes","the","gaussian","latent","transition","probability","`","p","(","z_t","|","z_","{","t-1","}",")","`","See","section","5","in","the","reference","for","comparison","."]
docstr: Given the latent `z_{t-1}` corresponding to the time step t-1
  we return the mean and scale vectors that parameterize the
  (diagonal) gaussian distribution `p(z_t | z_{t-1})`
docstr_tok: ["Given","the","latent","`","z_","{","t-1","}","`","corresponding","to","the","time","step","t-1","we","return","the","mean","and","scale","vectors","that","parameterize","the","(","diagonal",")","gaussian","distribution","`","p","(","z_t","|","z_","{","t-1","}",")","`"]
code: def forward(self, z_t_1):
      """
      Given the latent `z_{t-1}` corresponding to the time step t-1
      we return the mean and scale vectors that parameterize the
      (diagonal) gaussian distribution `p(z_t | z_{t-1})`
      """
      # compute the gating function
      _gate = self.relu(self.lin_gate_z_to_hidden(z_t_1))
      gate = torch.sigmoid(self.lin_gate_hidden_to_z(_gate))
      # compute the 'proposed mean'
      _proposed_mean = self.relu(
          self.lin_proposed_mean_z_to_hidden(z_t_1)
      )
      proposed_mean = self.lin_proposed_mean_hidden_to_z(_proposed_mean)
      # assemble the actual mean used to sample z_t, which mixes a linear transformation
      # of z_{t-1} with the proposed mean modulated by the gating function
      loc = (1 - gate) * self.lin_z_to_loc(z_t_1) + gate * proposed_mean
      # compute the scale used to sample z_t, using the proposed mean from
      # above as input the softplus ensures that scale is positive
      scale = self.softplus(self.lin_sig(self.relu(proposed_mean)))
      # return loc, scale which can be fed into Normal
      return loc, scale
  
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 2 for calling the GatedTransition obj's underlying member method code with example usage: obj.forward(z_t_1) and returns: loc,  scale