code: def __init__(
      self,
      action_size,
      memory_size,
      batch_size,
      discount_factor,
      lr,
      load_model,
      epsilon=1,
      epsilon_decay=0.9996,
      epsilon_min=0.1,
  ):
      self.action_size = action_size
      self.epsilon = epsilon
      self.epsilon_decay = epsilon_decay
      self.epsilon_min = epsilon_min
      self.batch_size = batch_size
      self.discount = discount_factor
      self.lr = lr
      self.memory = deque(maxlen=memory_size)
      self.criterion = nn.MSELoss()
  
      if load_model:
          print("Loading model from: ", model_savefile)
          self.q_net = torch.load(model_savefile)
          self.target_net = torch.load(model_savefile)
          self.epsilon = self.epsilon_min
  
      else:
          print("Initializing new model")
          self.q_net = DuelQNet(action_size).to(DEVICE)
          self.target_net = DuelQNet(action_size).to(DEVICE)
  
      self.opt = optim.SGD(self.q_net.parameters(), lr=self.lr)
  
imports: import itertools
  import os
  import random
  from collections import deque
  from time import sleep, time
  import numpy
  import skimage.transform
  import torch
  import torch.nn
  import torch.optim
  from tqdm import trange
  import vizdoom
label_desc: Use image node_id 1 to create a new DQNAgent object  with example: obj = DQNAgent(action_size, memory_size, batch_size, discount_factor, lr, load_model, epsilon, epsilon_decay, epsilon_min)