class_docstr: DCNV2 improves the cross network by extending the original weight vector to a matrix,
  significantly improves the expressiveness of DCN. It also introduces the MoE and
  low rank techniques to reduce time cost.
class_docstr_tok: ["DCNV2","improves","the","cross","network","by","extending","the","original","weight","vector","to","a","matrix",",","significantly","improves","the","expressiveness","of","DCN",".","It","also","introduces","the","MoE","and","low","rank","techniques","to","reduce","time","cost","."]
docstr: Cross network is composed of cross layers, with each layer having the following formula.
  
  .. math:: x_{l+1} = x_0 \odot (W_l x_l + b_l) + x_l
  
  :math:`x_l`, :math:`x_{l+1}` are column vectors denoting the outputs from the l -th and
  (l + 1)-th cross layers, respectively.
  :math:`W_l`, :math:`b_l` are the weight and bias parameters of the l -th layer.
  
  Args:
      x_0(torch.Tensor): Embedding vectors of all features, input of cross network.
  
  Returns:
      torch.Tensor:output of cross network, [batch_size, num_feature_field * embedding_size]
docstr_tok: ["Cross","network","is","composed","of","cross","layers",",","with","each","layer","having","the","following","formula",".","..","math",":",":","x_","{","l+1","}","=","x_0","\\odot","(","W_l","x_l","+","b_l",")","+","x_l",":","math",":","`","x_l","`",",",":","math",":","`","x_","{","l+1","}","`","are","column","vectors","denoting","the","outputs","from","the","l","-th","and","(","l","+","1",")","-th","cross","layers",",","respectively",".",":","math",":","`","W_l","`",",",":","math",":","`","b_l","`","are","the","weight","and","bias","parameters","of","the","l","-th","layer",".","Args",":","x_0","(","torch.Tensor",")",":","Embedding","vectors","of","all","features",",","input","of","cross","network",".","Returns",":","torch.Tensor",":","output","of","cross","network",",","[","batch_size",",","num_feature_field","*","embedding_size","]"]
code: def cross_network(self, x_0):
      r"""Cross network is composed of cross layers, with each layer having the following formula.
  
      .. math:: x_{l+1} = x_0 \odot (W_l x_l + b_l) + x_l
  
      :math:`x_l`, :math:`x_{l+1}` are column vectors denoting the outputs from the l -th and
      (l + 1)-th cross layers, respectively.
      :math:`W_l`, :math:`b_l` are the weight and bias parameters of the l -th layer.
  
      Args:
          x_0(torch.Tensor): Embedding vectors of all features, input of cross network.
  
      Returns:
          torch.Tensor:output of cross network, [batch_size, num_feature_field * embedding_size]
      """
      x_0 = x_0.unsqueeze(dim=2)
      x_l = x_0  # (batch_size, in_feature_num, 1)
      for i in range(self.cross_layer_num):
          xl_w = torch.matmul(self.cross_layer_w[i], x_l)
          xl_w = xl_w + self.bias[i]
          xl_dot = torch.mul(x_0, xl_w)
          x_l = xl_dot + x_l
  
      x_l = x_l.squeeze(dim=2)
      return x_l
  
file_path: RecBole/recbole/model/context_aware_recommender/dcnv2.py
imports: import torch
  import torch.nn
  from recbole.model.abstract_recommender import ContextRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.layers import MLPLayers
  from recbole.model.loss import RegLoss
label_desc: Use image node_id 2 for calling the DCNV2 obj's underlying member method code with example usage: obj.cross_network(x_0) and returns: x_l