class_docstr: Stochastic Variational Video Prediction From Basic Model!
class_docstr_tok: ["Stochastic","Variational","Video","Prediction","From","Basic","Model","!"]
docstr: Builds a reward prediction network from intermediate layers.
docstr_tok: ["Builds","a","reward","prediction","network","from","intermediate","layers","."]
code: def reward_prediction_mid(
      self, input_images, input_reward, action, latent, mid_outputs
  ):
      """Builds a reward prediction network from intermediate layers."""
      encoded = []
      for i, output in enumerate(mid_outputs):
          enc = output
          enc = tfl.conv2d(
              enc, 64, [3, 3], strides=(1, 1), activation=tf.nn.relu
          )
          enc = tfl.conv2d(
              enc, 32, [3, 3], strides=(2, 2), activation=tf.nn.relu
          )
          enc = tfl.conv2d(
              enc, 16, [3, 3], strides=(2, 2), activation=tf.nn.relu
          )
          enc = tfl.flatten(enc)
          enc = tfl.dense(
              enc, 64, activation=tf.nn.relu, name="rew_enc_%d" % i
          )
          encoded.append(enc)
      x = encoded
      x = tf.stack(x, axis=1)
      x = tfl.flatten(x)
      x = tfl.dense(x, 256, activation=tf.nn.relu, name="rew_dense1")
      x = tfl.dense(x, 128, activation=tf.nn.relu, name="rew_dense2")
      return x
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.layers import discretization
  from tensor2tensor.models.video import base
  from tensor2tensor.models.video import base_vae
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling the NextFrameSv2p obj's underlying member method code with example usage: obj.reward_prediction_mid(input_images, input_reward, action, latent, mid_outputs) and returns: x