class_docstr: The PointwiseGeCE module minimizes the cross entropy classification loss with generalized dot product as logits. The generalized    dot-product [ncf]_ between user representation :math:`u_i` and item representation :math:`v_j` is defined as: 
  
  .. math::
      h^T(u_i \odot v_j)
  
  where :math:`\odot` denotes element-wise dot product of two vectors, and :math:`h` denotes learnable model parameters.
  
  Parameters
  ----------
  user: Tensorflow tensor
      Representations for users involved in the interactions. Shape: **[number of interactions, dimensionality of         user representations]**.
  item: Tensorflow tensor
      Representations for items involved in the interactions. Shape: **[number of interactions, dimensionality of         item representations]**.
  item_bias: Tensorflow tensor
      Biases for items involved in the interactions. Shape: **[number of interactions, 1]**.
  labels: Tensorflow tensor, required for training.
      Groundtruth labels for the interactions. Shape **[number of interactions, ]**.
  l2_reg: float, optional
      Weight for L2 regularization, i.e., weight decay.
  train: bool, optionl
      An indicator for training or servining phase.
  scope: str, optional
      Scope for module variables.
  reuse: bool, optional
      Whether or not to reuse module variables.
  
  References
  ----------
  .. [ncf] He, X., Liao, L., Zhang, H., Nie, L., Hu, X. and Chua, T.S., 2017, April. Neural collaborative filtering.         In Proceedings of the 26th International Conference on World Wide Web (pp. 173-182). International World Wide Web         Conferences Steering Committee.
code: def _build_training_graph(self):
      with tf.variable_scope(self._scope, reuse=self._reuse):
          pointwise_product = tf.multiply(self._user, self._item)
          gdp = MultiLayerFC(
              in_tensor=pointwise_product,
              dims=[1],
              bias_in=False,
              bias_mid=False,
              bias_out=False,
              l2_reg=self._l2_reg,
              scope="gmf_reg",
              reuse=self._reuse,
          )
  
          logits = gdp.get_outputs()[0] + self._item_bias
          labels_float = tf.reshape(tf.to_float(self._labels), (-1, 1))
          self._loss = tf.reduce_sum(
              tf.nn.sigmoid_cross_entropy_with_logits(
                  labels=labels_float, logits=logits
              )
          )
          self._outputs.append(logits)
  
file_path: openrec/openrec/tf1/legacy/modules/interactions/pointwise_ge_ce.py
imports: from __future__ import print_function
  import tensorflow
  from termcolor import colored
  from openrec.tf1.legacy.modules.extractions import MultiLayerFC
  from openrec.tf1.legacy.modules.interactions import Interaction
label_desc: Use image node_id 2 for calling the PointwiseGeCE obj's underlying member method code with example usage: obj._build_training_graph() without return types