class_docstr: Probabilistic encoder for the time-invariant latent variable `f`.
  
  The conditional distribution `q(f | x_{1:T})` is a multivariate
  normal distribution on `R^{latent_size}` at each timestep `t`,
  conditioned on intermediate representations of `x_{1:T}` from the
  convolutional encoder. The parameters are computed by passing the
  inputs through a bidirectional LSTM function, then passing the final
  output to an affine function to yield normal parameters for
  `q(f | x_{1:T})`.
  
  Together with the EncoderDynamicFactorized class, we can formulate the
  factorized approximate latent posterior `q` inference ("encoder")
  model as
  
  ```none
  q(z_{1:T}, f | x_{1:T}) = q(f | x_{1:T}) prod_{t=1}^T q(z_t | x_t).
  ```
  
  Together with the EncoderDynamicFull class, we can formulate the full
  approximate latent posterior `q` inference ("encoder") model as
  
  ```none
  q(z_{1:T}, f | x_{1:T}) = q(f | x_{1:T}) q(z_{1:T} | f, x_{1:T}).
  ```
class_docstr_tok: ["Probabilistic","encoder","for","the","time-invariant","latent","variable","`","f","`",".","The","conditional","distribution","`","q","(","f","|","x_","{","1",":","T","}",")","`","is","a","multivariate","normal","distribution","on","`","R^","{","latent_size","}","`","at","each","timestep","`","t","`",",","conditioned","on","intermediate","representations","of","`","x_","{","1",":","T","}","`","from","the","convolutional","encoder",".","The","parameters","are","computed","by","passing","the","inputs","through","a","bidirectional","LSTM","function",",","then","passing","the","final","output","to","an","affine","function","to","yield","normal","parameters","for","`","q","(","f","|","x_","{","1",":","T","}",")","`",".","Together","with","the","EncoderDynamicFactorized","class",",","we","can","formulate","the","factorized","approximate","latent","posterior","`","q","`","inference","(","``","encoder","''",")","model","as","``","`","none","q","(","z_","{","1",":","T","}",",","f","|","x_","{","1",":","T","}",")","=","q","(","f","|","x_","{","1",":","T","}",")","prod_","{","t=1","}","^T","q","(","z_t","|","x_t",")",".","``","`","Together","with","the","EncoderDynamicFull","class",",","we","can","formulate","the","full","approximate","latent","posterior","`","q","`","inference","(","``","encoder","''",")","model","as","``","`","none","q","(","z_","{","1",":","T","}",",","f","|","x_","{","1",":","T","}",")","=","q","(","f","|","x_","{","1",":","T","}",")","q","(","z_","{","1",":","T","}","|","f",",","x_","{","1",":","T","}",")",".","``","`"]
docstr: Constructs an encoder for `f`.
  
  Args:
    latent_size: An integer corresponding to the dimensionality of the
      distribution.
    hidden_size: Dimensionality of the LSTM, RNN, and affine function
      parameters.
code: def __init__(self, latent_size, hidden_size):
      """Constructs an encoder for `f`.
  
      Args:
        latent_size: An integer corresponding to the dimensionality of the
          distribution.
        hidden_size: Dimensionality of the LSTM, RNN, and affine function
          parameters.
      """
      super(EncoderStatic, self).__init__()
      self.latent_size = latent_size
      self.hidden_size = hidden_size
      self.bilstm = tf_keras.v1.layers.Bidirectional(
          tf_keras.v1.layers.LSTM(hidden_size), merge_mode="sum"
      )
      self.output_layer = tf_keras.v1.layers.Dense(2 * latent_size)
  
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 EncoderStatic object from inherited base classes: tf_keras.v1 with example: obj = EncoderStatic(latent_size, hidden_size)