class_docstr: Session-based Recommendations with Recurrent Neural Networks
  
  Parameters
  ----------
  name: string, default: 'GRU4Rec'
      The name of the recommender model.
  
  layers: list of int, optional, default: [100]
      The number of hidden units in each layer
  
  loss: str, optional, default: 'cross-entropy'
      Select the loss function.
  
  batch_size: int, optional, default: 512
      Batch size
  
  dropout_p_embed: float, optional, default: 0.0
      Dropout ratio for embedding layers
  
  dropout_p_hidden: float, optional, default: 0.0
      Dropout ratio for hidden layers
  
  learning_rate: float, optional, default: 0.05
      Learning rate for the optimizer
  
  momentum: float, optional, default: 0.0
      Momentum for adaptive learning rate
  
  sample_alpha: float, optional, default: 0.5
      Tradeoff factor controls the contribution of negative sample towards final loss
  
  n_sample: int, optional, default: 2048
      Number of negative samples
  
  embedding: int, optional, default: 0
  
  constrained_embedding: bool, optional, default: True
  
  n_epochs: int, optional, default: 10
  
  bpreg: float, optional, default: 1.0
      Regularization coefficient for 'bpr-max' loss.
  
  elu_param: float, optional, default: 0.5
      Elu param for 'bpr-max' loss
  
  logq: float, optional, default: 0,
      LogQ correction  to offset the sampling bias affecting 'cross-entropy' loss.
  
  device: str, optional, default: 'cpu'
      Set to 'cuda' for GPU support.
  
  trainable: boolean, optional, default: True
      When False, the model will not be re-trained, and input of pre-trained parameters are required.
  
  verbose: boolean, optional, default: True
      When True, running logs are displayed.
  
  seed: int, optional, default: None
      Random seed for weight initialization.
  
  References
  ----------
  Hidasi, B., Karatzoglou, A., Baltrunas, L., & Tikk, D. (2015).
  Session-based recommendations with recurrent neural networks.
  arXiv preprint arXiv:1511.06939.
code: def score(self, user_idx, history_items, **kwargs):
      from .gru4rec import score
  
      if len(history_items) > 0:
          return score(
              self.model, self.layers, self.device, history_items
          )
      return np.ones(self.total_items, dtype="float")
  
file_path: cornac/cornac/models/gru4rec/recom_gru4rec.py
imports: import numpy
  from tqdm.auto import trange
  from collections import Counter
  from cornac.models.recommender import NextItemRecommender
  from ...utils import get_rng
label_desc: Use image node_id 3 for calling the GRU4Rec obj's underlying member method code with example usage: obj.score(user_idx, history_items) and returns: np, score