class_docstr: Dueling Q-Network
  
  See: http://arxiv.org/abs/1511.06581
class_docstr_tok: ["Dueling","Q-Network","See",":","http",":","\/\/arxiv.org\/abs\/1511.06581"]
code: def forward(self, x):
      h = x
      for layer in self.conv_layers:
          h = self.activation(layer(h))
  
      # Advantage
      batch_size = x.shape[0]
      h = h.reshape(batch_size, -1)
      ya = self.a_stream(h)
      mean = torch.reshape(
          torch.sum(ya, dim=1) / self.n_actions, (batch_size, 1)
      )
      ya, mean = torch.broadcast_tensors(ya, mean)
      ya -= mean
  
      # State value
      ys = self.v_stream(h)
  
      ya, ys = torch.broadcast_tensors(ya, ys)
      q = ya + ys
      return action_value.DiscreteActionValue(q)
  
file_path: pfrl/pfrl/q_functions/dueling_dqn.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from pfrl import action_value
  from pfrl.initializers import init_chainer_default
  from pfrl.nn.mlp import MLP
  from pfrl.q_function import StateQFunction
label_desc: Use image node_id 2 for calling the DuelingDQN obj's underlying member method code with example usage: obj.forward(x) and returns: action_value