class_docstr: Evaluates a given policy on validation data.
  
  Expects that the first two items returned in the dataset tuple are the observation_dict and action_dict.
  
  :param data_loader: The data used for evaluation.
  :param loss: Loss function to be used.
  :param model_selection: Model selection interface that will be notified of the recorded rewards.
class_docstr_tok: ["Evaluates","a","given","policy","on","validation","data",".","Expects","that","the","first","two","items","returned","in","the","dataset","tuple","are","the","observation_dict","and","action_dict",".",":","param","data_loader",":","The","data","used","for","evaluation",".",":","param","loss",":","Loss","function","to","be","used",".",":","param","model_selection",":","Model","selection","interface","that","will","be","notified","of","the","recorded","rewards","."]
code: def __init__(
      self,
      loss: BCLoss,
      model_selection: Optional[ModelSelectionBase],
      data_loader: DataLoader,
      logging_prefix: Optional[str] = "eval",
  ):
      self.loss = loss
      self.data_loader = data_loader
      self.model_selection = model_selection
  
      self.env = None
      if logging_prefix:
          self.eval_stats = LogStatsAggregator(
              LogStatsLevel.EPOCH, get_stats_logger(logging_prefix)
          )
      else:
          self.eval_stats = LogStatsAggregator(LogStatsLevel.EPOCH)
      self.eval_events = self.eval_stats.create_event_topic(
          ImitationEvents
      )
  
file_path: maze/maze/train/trainers/imitation/bc_validation_evaluator.py
imports: from typing import Optional
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from maze.core.agent.torch_policy import TorchPolicy
  from maze.core.annotations import override
  from maze.core.env.structured_env import ActorID
  from maze.core.log_stats.log_stats import LogStatsLevel, LogStatsAggregator, get_stats_logger
  from maze.perception.perception_utils import convert_to_torch
  from maze.train.trainers.common.evaluators.evaluator import Evaluator
  from maze.train.trainers.common.model_selection.model_selection_base import ModelSelectionBase
  from maze.train.trainers.imitation.bc_loss import BCLoss
  from maze.train.trainers.imitation.imitation_events import ImitationEvents
  from maze.train.utils.train_utils import debatch_actor_ids
label_desc: Use image node_id 1 to create a new BCValidationEvaluator object from inherited base classes: Evaluator with example: obj = BCValidationEvaluator(loss, model_selection, data_loader, logging_prefix)