docstr: Q-Value Head for predicting state-action Q-Values.
  
  :param agent_parameters: containing algorithm parameters, but currently unused.
  :param spaces: containing action spaces used for defining size of network output.
  :param network_name: name of head network. currently unused.
  :param head_type_idx: index of head network. currently unused.
  :param loss_weight: scalar used to adjust relative weight of loss (if using this loss with others).
  :param is_local: flag to denote if network is local. currently unused.
  :param activation_function: activation function to use between layers. currently unused.
  :param dense_layer: type of dense layer to use in network. currently unused.
  :param loss_type: loss function to use.
docstr_tok: ["Q-Value","Head","for","predicting","state-action","Q-Values",".",":","param","agent_parameters",":","containing","algorithm","parameters",",","but","currently","unused",".",":","param","spaces",":","containing","action","spaces","used","for","defining","size","of","network","output",".",":","param","network_name",":","name","of","head","network",".","currently","unused",".",":","param","head_type_idx",":","index","of","head","network",".","currently","unused",".",":","param","loss_weight",":","scalar","used","to","adjust","relative","weight","of","loss","(","if","using","this","loss","with","others",")",".",":","param","is_local",":","flag","to","denote","if","network","is","local",".","currently","unused",".",":","param","activation_function",":","activation","function","to","use","between","layers",".","currently","unused",".",":","param","dense_layer",":","type","of","dense","layer","to","use","in","network",".","currently","unused",".",":","param","loss_type",":","loss","function","to","use","."]
code: def __init__(
      self,
      agent_parameters: AgentParameters,
      spaces: SpacesDefinition,
      network_name: str,
      head_type_idx: int = 0,
      loss_weight: float = 1.0,
      is_local: bool = True,
      activation_function: str = "relu",
      dense_layer: None = None,
      loss_type: Union[HuberLoss, L2Loss] = L2Loss,
  ) -> None:
      """
      Q-Value Head for predicting state-action Q-Values.
  
      :param agent_parameters: containing algorithm parameters, but currently unused.
      :param spaces: containing action spaces used for defining size of network output.
      :param network_name: name of head network. currently unused.
      :param head_type_idx: index of head network. currently unused.
      :param loss_weight: scalar used to adjust relative weight of loss (if using this loss with others).
      :param is_local: flag to denote if network is local. currently unused.
      :param activation_function: activation function to use between layers. currently unused.
      :param dense_layer: type of dense layer to use in network. currently unused.
      :param loss_type: loss function to use.
      """
      super(QHead, self).__init__(
          agent_parameters,
          spaces,
          network_name,
          head_type_idx,
          loss_weight,
          is_local,
          activation_function,
          dense_layer,
      )
      if isinstance(self.spaces.action, BoxActionSpace):
          self.num_actions = 1
      elif isinstance(self.spaces.action, DiscreteActionSpace):
          self.num_actions = len(self.spaces.action.actions)
      self.return_type = QActionStateValue
      assert (loss_type == L2Loss) or (
          loss_type == HuberLoss
      ), "Only expecting L2Loss or HuberLoss."
      self.loss_type = loss_type
  
      with self.name_scope():
          self.dense = nn.Dense(units=self.num_actions)
  
file_path: coach/rl_coach/architectures/mxnet_components/heads/q_head.py
imports: from typing import Union, List, Tuple
  from types import ModuleType
  import mxnet
  from mxnet.gluon.loss import Loss, HuberLoss, L2Loss
  from mxnet.gluon import nn
  from rl_coach.architectures.mxnet_components.heads.head import Head, HeadLoss, LossInputSchema
  from rl_coach.architectures.mxnet_components.heads.head import LOSS_OUT_TYPE_LOSS
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.core_types import QActionStateValue
  from rl_coach.spaces import SpacesDefinition, BoxActionSpace, DiscreteActionSpace
label_desc: Use image node_id 1 to create a new QHead object from inherited base classes: Head with example: obj = QHead(agent_parameters, spaces, network_name, head_type_idx, loss_weight, is_local, activation_function, dense_layer, loss_type)