class_docstr: Interface for an off policy estimator for counterfactual evaluation.
class_docstr_tok: ["Interface","for","an","off","policy","estimator","for","counterfactual","evaluation","."]
docstr: Initializes an OffPolicyEstimator instance.
  
  Args:
      policy: Policy to evaluate.
      gamma: Discount factor of the environment.
      epsilon_greedy: The probability by which we act acording to a fully random
      policy during deployment. With 1-epsilon_greedy we act according the target
      policy.
      # TODO (kourosh): convert the input parameters to a config dict.
docstr_tok: ["Initializes","an","OffPolicyEstimator","instance",".","Args",":","policy",":","Policy","to","evaluate",".","gamma",":","Discount","factor","of","the","environment",".","epsilon_greedy",":","The","probability","by","which","we","act","acording","to","a","fully","random","policy","during","deployment",".","With","1-epsilon_greedy","we","act","according","the","target","policy",".","#","TODO","(","kourosh",")",":","convert","the","input","parameters","to","a","config","dict","."]
code: def __init__(
      self,
      policy: Policy,
      gamma: float = 0.0,
      epsilon_greedy: float = 0.0,
  ):
      """Initializes an OffPolicyEstimator instance.
  
      Args:
          policy: Policy to evaluate.
          gamma: Discount factor of the environment.
          epsilon_greedy: The probability by which we act acording to a fully random
          policy during deployment. With 1-epsilon_greedy we act according the target
          policy.
          # TODO (kourosh): convert the input parameters to a config dict.
      """
      super().__init__(policy)
      self.gamma = gamma
      self.epsilon_greedy = epsilon_greedy
  
imports: import gymnasium
  import numpy
  import tree
  from typing import Dict, Any, List
  import logging
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy import Policy
  from ray.rllib.policy.sample_batch import convert_ma_batch_to_sample_batch
  from ray.rllib.utils.policy import compute_log_likelihoods_from_input_dict
  from ray.rllib.utils.annotations import DeveloperAPI, ExperimentalAPI, OverrideToImplementCustomLogic
  from ray.rllib.utils.deprecation import Deprecated
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.typing import TensorType, SampleBatchType
  from ray.rllib.offline.offline_evaluator import OfflineEvaluator
label_desc: Use image node_id 1 to create a new OffPolicyEstimator object from inherited base classes: OfflineEvaluator with example: obj = OffPolicyEstimator(policy, gamma, epsilon_greedy)