class_docstr: LightGCN
  
  Parameters
  ----------
  name: string, default: 'LightGCN'
      The name of the recommender model.
  
  emb_size: int, default: 64
      Size of the node embeddings.
  
  num_epochs: int, default: 1000
      Maximum number of iterations or the number of epochs.
  
  learning_rate: float, default: 0.001
      The learning rate that determines the step size at each iteration
  
  batch_size: int, default: 1024
      Mini-batch size used for train set
  
  num_layers: int, default: 3
      Number of LightGCN Layers
  
  early_stopping: {min_delta: float, patience: int}, optional, default: None
      If `None`, no early stopping. Meaning of the arguments:
  
      - `min_delta`:  the minimum increase in monitored value on validation
                      set to be considered as improvement,
                      i.e. an increment of less than min_delta will count as
                      no improvement.
  
      - `patience`:   number of epochs with no improvement after which
                      training should be stopped.
  
  lambda_reg: float, default: 1e-4
      Weight decay for the L2 normalization
  
  trainable: boolean, optional, default: True
      When False, the model is not trained and Cornac assumes that the model
      is already pre-trained.
  
  verbose: boolean, optional, default: False
      When True, some running logs are displayed.
  
  seed: int, optional, default: 2020
      Random seed for parameters initialization.
  
  References
  ----------
  *   He, X., Deng, K., Wang, X., Li, Y., Zhang, Y., & Wang, M. (2020).
      LightGCN: Simplifying and Powering Graph Convolution Network for
      Recommendation.
docstr: Calculating monitored value used for early stopping on validation set (`val_set`).
  This function will be called by `early_stop()` function.
  
  Parameters
  ----------
  train_set: :obj:`cornac.data.Dataset`, required
      User-Item preference data as well as additional modalities.
  
  val_set: :obj:`cornac.data.Dataset`, optional, default: None
      User-Item preference data for model selection purposes (e.g., early stopping).
  
  Returns
  -------
  res : float
      Monitored value on validation set.
      Return `None` if `val_set` is `None`.
docstr_tok: ["Calculating","monitored","value","used","for","early","stopping","on","validation","set","(","`","val_set","`",")",".","This","function","will","be","called","by","`","early_stop","(",")","`","function",".","Parameters","--","--","--","--","--","train_set",":",":","obj",":","`","cornac.data.Dataset","`",",","required","User-Item","preference","data","as","well","as","additional","modalities",".","val_set",":",":","obj",":","`","cornac.data.Dataset","`",",","optional",",","default",":","None","User-Item","preference","data","for","model","selection","purposes","(","e.g.",",","early","stopping",")",".","Returns","--","--","--","-","res",":","float","Monitored","value","on","validation","set",".","Return","`","None","`","if","`","val_set","`","is","`","None","`","."]
code: def monitor_value(self, train_set, val_set):
      """Calculating monitored value used for early stopping on validation set (`val_set`).
      This function will be called by `early_stop()` function.
  
      Parameters
      ----------
      train_set: :obj:`cornac.data.Dataset`, required
          User-Item preference data as well as additional modalities.
  
      val_set: :obj:`cornac.data.Dataset`, optional, default: None
          User-Item preference data for model selection purposes (e.g., early stopping).
  
      Returns
      -------
      res : float
          Monitored value on validation set.
          Return `None` if `val_set` is `None`.
      """
      if val_set is None:
          return None
  
      from ...metrics import Recall
      from ...eval_methods import ranking_eval
  
      recall_20 = ranking_eval(
          model=self,
          metrics=[Recall(k=20)],
          train_set=train_set,
          test_set=val_set,
      )[0][0]
  
      return recall_20
  
file_path: cornac/cornac/models/lightgcn/recom_lightgcn.py
imports: from ..recommender import Recommender
  from ..recommender import ANNMixin, MEASURE_DOT
  from ...exception import ScoreException
  from tqdm.auto import tqdm, trange
label_desc: Use image node_id 3 for calling the LightGCN obj's underlying member method code with example usage: obj.monitor_value(train_set, val_set) and returns: recall_20, None