class_docstr: An offline evaluator for Contextual Bandits, based on the paper https://arxiv.org/pdf/1003.0146.pdf (Algorithm 3)
class_docstr_tok: ["An","offline","evaluator","for","Contextual","Bandits",",","based","on","the","paper","https",":","\/\/arxiv.org\/pdf\/1003.0146.pdf","(","Algorithm","3",")"]
code: def get_avg_reward(self) -> float:
      assert (
          self.sum_importance_weight_accepted_local.item() == 0.0
      ), f"Non-zero local weight {self.sum_importance_weight_appected_local.item()} in the evaluator. _aggregate_across_instances() Should have beed called to aggregate across all instances and zero-out the local values."
      # return the average reward
      return (
          self.sum_reward_importance_weighted_accepted
          / (self.sum_importance_weight_accepted + EPSILON)
      ).item()
  
file_path: ReAgent/reagent/evaluation/cb/policy_evaluator.py
imports: import logging
  import torch
  from pytorch_lightning.utilities.distributed import ReduceOp, sync_ddp_if_available
  from reagent.core.types import CBInput
  from reagent.evaluation.cb.base_evaluator import BaseOfflineEval
label_desc: Use image node_id 4 for calling the PolicyEvaluator obj's underlying member method code with example usage: obj.get_avg_reward() and returns: unknown