class_docstr: Additive combination of two objectives (specification key: `plus`).
  
  Args:
      objective1 (specification): First objective configuration
          (<span style="color:#C00000"><b>required</b></span>).
      objective2 (specification): Second objective configuration
          (<span style="color:#C00000"><b>required</b></span>).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      states_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      internals_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      auxiliaries_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      actions_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      reward_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
class_docstr_tok: ["Additive","combination","of","two","objectives","(","specification","key",":","`","plus","`",")",".","Args",":","objective1","(","specification",")",":","First","objective","configuration","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","objective2","(","specification",")",":","Second","objective","configuration","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","name","(","string",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","states_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","internals_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","auxiliaries_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","actions_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","reward_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def loss(
      self,
      *,
      states,
      horizons,
      internals,
      auxiliaries,
      actions,
      reward,
      reference,
      policy,
      baseline=None,
  ):
      reference_spec1 = self.objective1.reference_spec()
      reference_spec2 = self.objective2.reference_spec()
      assert (
          tf_util.shape(x=reference)[1]
          == reference_spec1.size + reference_spec2.size
      )
  
      reference1 = reference[:, : reference_spec1.size]
      reference1 = tf.reshape(
          tensor=reference1, shape=((-1,) + reference_spec1.shape)
      )
      reference2 = reference[:, reference_spec1.size :]
      reference2 = tf.reshape(
          tensor=reference2, shape=((-1,) + reference_spec2.shape)
      )
  
      loss1 = self.objective1.loss(
          states=states,
          horizons=horizons,
          internals=internals,
          auxiliaries=auxiliaries,
          actions=actions,
          reward=reward,
          reference=reference1,
          policy=policy,
          baseline=baseline,
      )
  
      loss2 = self.objective2.loss(
          states=states,
          horizons=horizons,
          internals=internals,
          auxiliaries=auxiliaries,
          actions=actions,
          reward=reward,
          reference=reference2,
          policy=policy,
          baseline=baseline,
      )
  
      return loss1 + loss2
  
file_path: tensorforce/tensorforce/core/objectives/plus.py
imports: import tensorflow
  from tensorforce import util
  import tensorforce.core
  from tensorforce.core import TensorSpec, tf_function, tf_util
  from tensorforce.core.objectives import Objective
label_desc: Use image node_id 8 for calling the Plus obj's underlying member method code with example usage: obj.loss() and returns: unknown