class_docstr: Deep Q-Network algorithm.
  
  Args:
      q_function (StateQFunction): Q-function
      optimizer (Optimizer): Optimizer that is already setup
      replay_buffer (ReplayBuffer): Replay buffer
      gamma (float): Discount factor
      explorer (Explorer): Explorer that specifies an exploration strategy.
      gpu (int): GPU device id if not None nor negative.
      replay_start_size (int): if the replay buffer's size is less than
          replay_start_size, skip update
      minibatch_size (int): Minibatch size
      update_interval (int): Model update interval in step
      target_update_interval (int): Target model update interval in step
      clip_delta (bool): Clip delta if set True
      phi (callable): Feature extractor applied to observations
      target_update_method (str): 'hard' or 'soft'.
      soft_update_tau (float): Tau of soft target update.
      n_times_update (int): Number of repetition of update
      batch_accumulator (str): 'mean' or 'sum'
      episodic_update_len (int or None): Subsequences of this length are used
          for update if set int and episodic_update=True
      logger (Logger): Logger used
      batch_states (callable): method which makes a batch of observations.
          default is `pfrl.utils.batch_states.batch_states`
      recurrent (bool): If set to True, `model` is assumed to implement
          `pfrl.nn.Recurrent` and is updated in a recurrent
          manner.
      max_grad_norm (float or None): Maximum L2 norm of the gradient used for
          gradient clipping. If set to None, the gradient is not clipped.
class_docstr_tok: ["Deep","Q-Network","algorithm",".","Args",":","q_function","(","StateQFunction",")",":","Q-function","optimizer","(","Optimizer",")",":","Optimizer","that","is","already","setup","replay_buffer","(","ReplayBuffer",")",":","Replay","buffer","gamma","(","float",")",":","Discount","factor","explorer","(","Explorer",")",":","Explorer","that","specifies","an","exploration","strategy",".","gpu","(","int",")",":","GPU","device","id","if","not","None","nor","negative",".","replay_start_size","(","int",")",":","if","the","replay","buffer","'s","size","is","less","than","replay_start_size",",","skip","update","minibatch_size","(","int",")",":","Minibatch","size","update_interval","(","int",")",":","Model","update","interval","in","step","target_update_interval","(","int",")",":","Target","model","update","interval","in","step","clip_delta","(","bool",")",":","Clip","delta","if","set","True","phi","(","callable",")",":","Feature","extractor","applied","to","observations","target_update_method","(","str",")",":","'hard","'","or","'soft","'",".","soft_update_tau","(","float",")",":","Tau","of","soft","target","update",".","n_times_update","(","int",")",":","Number","of","repetition","of","update","batch_accumulator","(","str",")",":","'mean","'","or","'sum'","episodic_update_len","(","int","or","None",")",":","Subsequences","of","this","length","are","used","for","update","if","set","int","and","episodic_update=True","logger","(","Logger",")",":","Logger","used","batch_states","(","callable",")",":","method","which","makes","a","batch","of","observations",".","default","is","`","pfrl.utils.batch_states.batch_states","`","recurrent","(","bool",")",":","If","set","to","True",",","`","model","`","is","assumed","to","implement","`","pfrl.nn.Recurrent","`","and","is","updated","in","a","recurrent","manner",".","max_grad_norm","(","float","or","None",")",":","Maximum","L2","norm","of","the","gradient","used","for","gradient","clipping",".","If","set","to","None",",","the","gradient","is","not","clipped","."]
code: def batch_act(self, batch_obs: Sequence[Any]) -> Sequence[Any]:
      with torch.no_grad(), evaluating(self.model):
          batch_av = self._evaluate_model_and_update_recurrent_states(
              batch_obs
          )
          batch_argmax = batch_av.greedy_actions.detach().cpu().numpy()
      if self.training:
          batch_action = [
              self.explorer.select_action(
                  self.t,
                  lambda: batch_argmax[i],
                  action_value=batch_av[i : i + 1],
              )
              for i in range(len(batch_obs))
          ]
          self.batch_last_obs = list(batch_obs)
          self.batch_last_action = list(batch_action)
      else:
          batch_action = batch_argmax
      return batch_action
  
imports: import collections
  import copy
  import ctypes
  import multiprocessing
  import multiprocessing.synchronize
  import os
  import time
  import typing
  from logging import Logger, getLogger
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
  import numpy
  import torch
  import torch.nn.functional
  import pfrl
  from pfrl import agent
  from pfrl.action_value import ActionValue
  from pfrl.explorer import Explorer
  from pfrl.replay_buffer import AbstractEpisodicReplayBuffer, ReplayUpdater, batch_experiences, batch_recurrent_experiences
  from pfrl.replay_buffers import PrioritizedReplayBuffer
  from pfrl.utils.batch_states import batch_states
  from pfrl.utils.contexts import evaluating
  from pfrl.utils.copy_param import synchronize_parameters
  from pfrl.utils.recurrent import get_recurrent_state_at, mask_recurrent_state_at, one_step_forward, pack_and_forward, recurrent_state_as_numpy
label_desc: Use image node_id 11 for calling the DQN obj's underlying member method code with example usage: obj.batch_act(batch_obs) and returns: batch_action