docstr: IQL algorithm
  Args:
      model (parl.Model): forward network of value, actor and critic.
      max_stpes (int): total train steps.
      lr (float): learning rate of the value, actor and critic model.
      tau(float): the coefficient for asymmetric l2 loss.
      beta(float): inverse temperature of policy extraction.
      discount (float): discounted factor for reward computation.
      alpha (float): decay coefficient when updating the weights of self.target_model with self.model.
docstr_tok: ["IQL","algorithm","Args",":","model","(","parl.Model",")",":","forward","network","of","value",",","actor","and","critic",".","max_stpes","(","int",")",":","total","train","steps",".","lr","(","float",")",":","learning","rate","of","the","value",",","actor","and","critic","model",".","tau","(","float",")",":","the","coefficient","for","asymmetric","l2","loss",".","beta","(","float",")",":","inverse","temperature","of","policy","extraction",".","discount","(","float",")",":","discounted","factor","for","reward","computation",".","alpha","(","float",")",":","decay","coefficient","when","updating","the","weights","of","self.target_model","with","self.model","."]
code: def __init__(
      self,
      model,
      max_steps,
      lr=0.0003,
      tau=0.7,
      beta=3.0,
      discount=0.99,
      alpha=0.005,
  ):
      """IQL algorithm
      Args:
          model (parl.Model): forward network of value, actor and critic.
          max_stpes (int): total train steps.
          lr (float): learning rate of the value, actor and critic model.
          tau(float): the coefficient for asymmetric l2 loss.
          beta(float): inverse temperature of policy extraction.
          discount (float): discounted factor for reward computation.
          alpha (float): decay coefficient when updating the weights of self.target_model with self.model.
      """
      # checks
      check_model_method(model, "value", self.__class__.__name__)
      check_model_method(model, "policy", self.__class__.__name__)
      check_model_method(model, "qvalue", self.__class__.__name__)
      check_model_method(
          model, "get_actor_params", self.__class__.__name__
      )
      check_model_method(
          model, "get_critic_params", self.__class__.__name__
      )
      check_model_method(
          model, "get_value_params", self.__class__.__name__
      )
      assert isinstance(max_steps, int)
      assert isinstance(lr, float)
      assert isinstance(tau, float)
      assert isinstance(beta, float)
      assert isinstance(discount, float)
      assert isinstance(alpha, float)
  
      self.device = torch.device(
          "cuda" if torch.cuda.is_available() else "cpu"
      )
      self.model = model.to(self.device)
      self.q_target = copy.deepcopy(self.model).to(self.device)
      self.lr = lr
  
      self.v_optimizer = torch.optim.Adam(
          self.model.get_value_params(), lr=self.lr
      )
      self.q_optimizer = torch.optim.Adam(
          self.model.get_critic_params(), lr=self.lr
      )
      self.policy_optimizer = torch.optim.Adam(
          self.model.get_actor_params(), lr=self.lr
      )
      self.tau = tau
      self.beta = beta
      self.discount = discount
      self.alpha = alpha
  
file_path: PARL/parl/algorithms/torch/iql.py
imports: import copy
  import torch
  import torch.nn
  import parl
  import torch.nn.functional
  from parl.utils.utils import check_model_method
label_desc: Use image node_id 1 to create a new IQL object from inherited base classes: parl with example: obj = IQL(model, max_steps, lr, tau, beta, discount, alpha)