class_docstr: Task for value evaluation.
docstr: Initializes ValueEvalTask.
  
  Args:
    train_task: ValueTrainTask used to train the policy network.
    n_eval_batches: Number of batches per evaluation.
    head_selector: Layer to apply to the network output to select the value
      head. Only needed in multitask training.
docstr_tok: ["Initializes","ValueEvalTask",".","Args",":","train_task",":","ValueTrainTask","used","to","train","the","policy","network",".","n_eval_batches",":","Number","of","batches","per","evaluation",".","head_selector",":","Layer","to","apply","to","the","network","output","to","select","the","value","head",".","Only","needed","in","multitask","training","."]
code: def __init__(self, train_task, n_eval_batches=1, head_selector=()):
      """Initializes ValueEvalTask.
  
      Args:
        train_task: ValueTrainTask used to train the policy network.
        n_eval_batches: Number of batches per evaluation.
        head_selector: Layer to apply to the network output to select the value
          head. Only needed in multitask training.
      """
      labeled_data = map(
          train_task.value_batch, train_task.trajectory_batch_stream
      )
      metrics = [tl.L2Loss(), self.l1_loss]
      metric_names = ["value_l2", "value_l1"]
      # Select the appropriate head for evaluation.
      metrics = [tl.Serial(head_selector, metric) for metric in metrics]
      super().__init__(
          labeled_data,
          metrics,
          sample_batch=train_task.sample_batch,
          metric_names=metric_names,
          n_eval_batches=n_eval_batches,
      )
  
file_path: trax/trax/rl/value_tasks.py
imports: import copy
  import numpy
  from trax import layers
  from trax.fastmath import numpy
  from trax.supervised import training
label_desc: Use image node_id 1 to create a new ValueEvalTask object from inherited base classes: training with example: obj = ValueEvalTask(train_task, n_eval_batches, head_selector)