class_docstr: Base class for next_frame models.
  
  This is the base class for the models that given the previous frames
  can predict the next frame. They may also support reward prediction
  and action condition prediction which enables them to be run as
  a world model in model-based RL pipeline.
  
  The API supports both recurrent and stacked frames models. Please look
  at the documents for next_frame function for the API.
  
  If you are implementing a next frame prediction model consider
  following the API presented in this class. But if the API
  is too limiting for your models, feel free to override lower level
  functions and/or inheret from T2TModel directly.
class_docstr_tok: ["Base","class","for","next_frame","models",".","This","is","the","base","class","for","the","models","that","given","the","previous","frames","can","predict","the","next","frame",".","They","may","also","support","reward","prediction","and","action","condition","prediction","which","enables","them","to","be","run","as","a","world","model","in","model-based","RL","pipeline",".","The","API","supports","both","recurrent","and","stacked","frames","models",".","Please","look","at","the","documents","for","next_frame","function","for","the","API",".","If","you","are","implementing","a","next","frame","prediction","model","consider","following","the","API","presented","in","this","class",".","But","if","the","API","is","too","limiting","for","your","models",",","feel","free","to","override","lower","level","functions","and\/or","inheret","from","T2TModel","directly","."]
docstr: The main prediction function of next frame models.
  
    This is the main function that should be overridden to implement models.
  
  Args:
    frames: The list of input frames.
            Only previous frame in case of recurrent models.
    actions: The list of input actions.
            Only previous action in case of recurrent models.
    rewards: The list of input rewards.
            Only previous reward in case of recurrent models.
    target_frame: The target frame.
            Usually required for approximating the posterior.
    internal_states: Internal model states. Only useful for recurrent models
            to keep the state from the previous time index.
            internal_states is None at the first frame and should be
            initialized properly.
    video_features: video wide features. None by default.
            Please refer to video_features function for description.
  
  Returns:
    pred_frame: predicted frame BSxWxHxC
            where C is 3 for L1/L2 modality and 3*256 for Softmax.
    pred_reward: the same size as input reward.
            None if the model does not detect rewards.
    pred_action: predicted action logits
    pred_value: predicted value
    extra_loss: any extra loss other than predicted frame and reward.
            e.g. KL loss in case of VAE models.
    internal_states: updated internal models states.
docstr_tok: ["The","main","prediction","function","of","next","frame","models",".","This","is","the","main","function","that","should","be","overridden","to","implement","models",".","Args",":","frames",":","The","list","of","input","frames",".","Only","previous","frame","in","case","of","recurrent","models",".","actions",":","The","list","of","input","actions",".","Only","previous","action","in","case","of","recurrent","models",".","rewards",":","The","list","of","input","rewards",".","Only","previous","reward","in","case","of","recurrent","models",".","target_frame",":","The","target","frame",".","Usually","required","for","approximating","the","posterior",".","internal_states",":","Internal","model","states",".","Only","useful","for","recurrent","models","to","keep","the","state","from","the","previous","time","index",".","internal_states","is","None","at","the","first","frame","and","should","be","initialized","properly",".","video_features",":","video","wide","features",".","None","by","default",".","Please","refer","to","video_features","function","for","description",".","Returns",":","pred_frame",":","predicted","frame","BSxWxHxC","where","C","is","3","for","L1\/L2","modality","and","3","*","256","for","Softmax",".","pred_reward",":","the","same","size","as","input","reward",".","None","if","the","model","does","not","detect","rewards",".","pred_action",":","predicted","action","logits","pred_value",":","predicted","value","extra_loss",":","any","extra","loss","other","than","predicted","frame","and","reward",".","e.g",".","KL","loss","in","case","of","VAE","models",".","internal_states",":","updated","internal","models","states","."]
code: def next_frame(
      self,
      frames,
      actions,
      rewards,
      target_frame,
      internal_states,
      video_features,
  ):
      """The main prediction function of next frame models.
  
        This is the main function that should be overridden to implement models.
  
      Args:
        frames: The list of input frames.
                Only previous frame in case of recurrent models.
        actions: The list of input actions.
                Only previous action in case of recurrent models.
        rewards: The list of input rewards.
                Only previous reward in case of recurrent models.
        target_frame: The target frame.
                Usually required for approximating the posterior.
        internal_states: Internal model states. Only useful for recurrent models
                to keep the state from the previous time index.
                internal_states is None at the first frame and should be
                initialized properly.
        video_features: video wide features. None by default.
                Please refer to video_features function for description.
  
      Returns:
        pred_frame: predicted frame BSxWxHxC
                where C is 3 for L1/L2 modality and 3*256 for Softmax.
        pred_reward: the same size as input reward.
                None if the model does not detect rewards.
        pred_action: predicted action logits
        pred_value: predicted value
        extra_loss: any extra loss other than predicted frame and reward.
                e.g. KL loss in case of VAE models.
        internal_states: updated internal models states.
      """
      raise NotImplementedError("Base video model.")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import six
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.layers import discretization
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the NextFrameBase obj's underlying member method code with example usage: obj.next_frame(frames, actions, rewards, target_frame, internal_states, video_features) without return types