class_docstr: Probabilistic decoder for `p(x_t | z_t, f)`.
  
  The decoder generates a sequence of image frames `x_{1:T}` from
  dynamic and static latent variables `z_{1:T}` and `f`, respectively,
  for timesteps `1:T`.
class_docstr_tok: ["Probabilistic","decoder","for","`","p","(","x_t","|","z_t",",","f",")","`",".","The","decoder","generates","a","sequence","of","image","frames","`","x_","{","1",":","T","}","`","from","dynamic","and","static","latent","variables","`","z_","{","1",":","T","}","`","and","`","f","`",",","respectively",",","for","timesteps","`","1",":","T","`","."]
docstr: Constructs a probabilistic decoder.
  
  For each timestep, this model takes as input a concatenation of the
  dynamic and static latent variables `z_t` and `f`, respectively,
  outputs an intermediate representation via an affine function (i.e.,
  a one hidden layer MLP), then transforms this with four transpose
  convolution layers and up-sampling to the spatial shape of `x_t`.
  
  Together with the priors, this allows us to specify a generative
  model
  
  ```none
  p(x_{1:T}, z_{1:T}, f) = p(f) prod_{t=1}^T p(z_t | z_{<t}) p(x_t | z_t, f).
  ```
  
  Args:
    hidden_size: Dimensionality of the intermediate representations.
    channels: The depth of the output tensor.
code: def __init__(self, hidden_size, channels=3):
      """Constructs a probabilistic decoder.
  
      For each timestep, this model takes as input a concatenation of the
      dynamic and static latent variables `z_t` and `f`, respectively,
      outputs an intermediate representation via an affine function (i.e.,
      a one hidden layer MLP), then transforms this with four transpose
      convolution layers and up-sampling to the spatial shape of `x_t`.
  
      Together with the priors, this allows us to specify a generative
      model
  
      ```none
      p(x_{1:T}, z_{1:T}, f) = p(f) prod_{t=1}^T p(z_t | z_{<t}) p(x_t | z_t, f).
      ```
  
      Args:
        hidden_size: Dimensionality of the intermediate representations.
        channels: The depth of the output tensor.
      """
      super(Decoder, self).__init__()
      self.hidden_size = hidden_size
      activation = tf1.nn.leaky_relu
      self.dense = tf_keras.v1.layers.Dense(
          hidden_size, activation=activation
      )
      # Spatial sizes: (1,1) -> (8,8) -> (16,16) -> (32,32) -> (64,64).
      conv_transpose = functools.partial(
          tf_keras.v1.layers.Conv2DTranspose,
          padding="SAME",
          activation=activation,
      )
      self.conv_transpose1 = conv_transpose(256, 8, 1, padding="VALID")
      self.conv_transpose2 = conv_transpose(256, 3, 2)
      self.conv_transpose3 = conv_transpose(256, 3, 2)
      self.conv_transpose4 = conv_transpose(
          channels, 3, 2, activation=None
      )
  
imports: from datetime import datetime
  import functools
  from absl import app
  from absl import flags
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow_probability.examples import sprites_dataset
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 1 to create a new Decoder object from inherited base classes: tf_keras.v1 with example: obj = Decoder(hidden_size, channels)