class_docstr: Parameters
  ----------
  k: int, optional, default: 50
      The dimension of the user and item latent factors.
  
  n_epochs: int, optional, default: 50
      Maximum number of epochs for training.
  
  cnn_epochs: int, optional, default: 5
      Number of epochs for optimizing the CNN for each overall training epoch.
  
  cnn_bs: int, optional, default: 128
      Batch size for optimizing CNN.
      
  cnn_lr: float, optional, default: 0.001
      Learning rate for optimizing CNN.
  
  lambda_u: float, optional, default: 1.0
      The regularization hyper-parameter for user latent factor.
  
  lambda_v: float, optional, default: 100.0
      The regularization hyper-parameter for item latent factor.
  
  emb_dim: int, optional, default: 200
      The embedding size of each word. One word corresponds with [1 x emb_dim] vector in the embedding space
  
  max_len: int, optional, default 300
      The maximum length of item's document
  
  filter_sizes: list, optional, default: [3, 4, 5]
      The length of filters in convolutional layer
  
  num_filters: int, optional, default: 100
      The number of filters in convolutional layer
      
  hidden_dim: int, optional, default: 200
      The dimension of hidden layer after the pooling of all convolutional layers
  
  dropout_rate: float, optional, default: 0.2
      Dropout rate while training CNN
  
  give_item_weight: boolean, optional, default: True
      When True, each item will be weighted base on the number of user who have rated this item
  
  init_params: dict, optional, default: {'U':None, 'V':None, 'W': None}
      Initial U and V matrix and initial weight for embedding layer W
  
  trainable: boolean, optional, default: True
      When False, the model is not trained and Cornac assumes that the model already         pre-trained (U and V are not None).
  
  References
  ----------
  * Donghyun Kim1, Chanyoung Park1. ConvMF: Convolutional Matrix Factorization for Document Context-Aware Recommendation.     In :10th ACM Conference on Recommender Systems Pages 233-240
class_docstr_tok: ["Parameters","--","--","--","--","--","k",":","int",",","optional",",","default",":","50","The","dimension","of","the","user","and","item","latent","factors",".","n_epochs",":","int",",","optional",",","default",":","50","Maximum","number","of","epochs","for","training",".","cnn_epochs",":","int",",","optional",",","default",":","5","Number","of","epochs","for","optimizing","the","CNN","for","each","overall","training","epoch",".","cnn_bs",":","int",",","optional",",","default",":","128","Batch","size","for","optimizing","CNN",".","cnn_lr",":","float",",","optional",",","default",":","0.001","Learning","rate","for","optimizing","CNN",".","lambda_u",":","float",",","optional",",","default",":","1.0","The","regularization","hyper-parameter","for","user","latent","factor",".","lambda_v",":","float",",","optional",",","default",":","100.0","The","regularization","hyper-parameter","for","item","latent","factor",".","emb_dim",":","int",",","optional",",","default",":","200","The","embedding","size","of","each","word",".","One","word","corresponds","with","[","1","x","emb_dim","]","vector","in","the","embedding","space","max_len",":","int",",","optional",",","default","300","The","maximum","length","of","item","'s","document","filter_sizes",":","list",",","optional",",","default",":","[","3",",","4",",","5","]","The","length","of","filters","in","convolutional","layer","num_filters",":","int",",","optional",",","default",":","100","The","number","of","filters","in","convolutional","layer","hidden_dim",":","int",",","optional",",","default",":","200","The","dimension","of","hidden","layer","after","the","pooling","of","all","convolutional","layers","dropout_rate",":","float",",","optional",",","default",":","0.2","Dropout","rate","while","training","CNN","give_item_weight",":","boolean",",","optional",",","default",":","True","When","True",",","each","item","will","be","weighted","base","on","the","number","of","user","who","have","rated","this","item","init_params",":","dict",",","optional",",","default",":","{","'","U","'",":","None",",","'","V","'",":","None",",","'","W","'",":","None","}","Initial","U","and","V","matrix","and","initial","weight","for","embedding","layer","W","trainable",":","boolean",",","optional",",","default",":","True","When","False",",","the","model","is","not","trained","and","Cornac","assumes","that","the","model","already","pre-trained","(","U","and","V","are","not","None",")",".","References","--","--","--","--","--","*","Donghyun","Kim1",",","Chanyoung","Park1",".","ConvMF",":","Convolutional","Matrix","Factorization","for","Document","Context-Aware","Recommendation",".","In",":10th","ACM","Conference","on","Recommender","Systems","Pages","233-240"]
docstr: Predict the scores/ratings of a user for an item.
  
  Parameters
  ----------
  user_idx: int, required
      The index of the user for whom to perform score prediction.
  
  item_idx: int, optional, default: None
      The index of the item for which to perform score prediction.
      If None, scores for all known items will be returned.
  
  Returns
  -------
  res : A scalar or a Numpy array
      Relative scores that the user gives to the item or to all known items
docstr_tok: ["Predict","the","scores\/ratings","of","a","user","for","an","item",".","Parameters","--","--","--","--","--","user_idx",":","int",",","required","The","index","of","the","user","for","whom","to","perform","score","prediction",".","item_idx",":","int",",","optional",",","default",":","None","The","index","of","the","item","for","which","to","perform","score","prediction",".","If","None",",","scores","for","all","known","items","will","be","returned",".","Returns","--","--","--","-","res",":","A","scalar","or","a","Numpy","array","Relative","scores","that","the","user","gives","to","the","item","or","to","all","known","items"]
code: def score(self, user_idx, item_idx=None):
      """Predict the scores/ratings of a user for an item.
  
      Parameters
      ----------
      user_idx: int, required
          The index of the user for whom to perform score prediction.
  
      item_idx: int, optional, default: None
          The index of the item for which to perform score prediction.
          If None, scores for all known items will be returned.
  
      Returns
      -------
      res : A scalar or a Numpy array
          Relative scores that the user gives to the item or to all known items
  
      """
      if self.is_unknown_user(user_idx):
          raise ScoreException(
              "Can't make score prediction for user %d" % user_idx
          )
  
      if item_idx is not None and self.is_unknown_item(item_idx):
          raise ScoreException(
              "Can't make score prediction for item %d" % item_idx
          )
  
      if item_idx is None:
          return self.V.dot(self.U[user_idx, :])
  
      return self.V[item_idx, :].dot(self.U[user_idx, :])
  
imports: import os
  import time
  import math
  import numpy
  from tqdm.auto import trange
  from ..recommender import Recommender
  from ..recommender import ANNMixin, MEASURE_DOT
  from ...exception import ScoreException
  from ...utils import get_rng
  from ...utils.init_utils import xavier_uniform
label_desc: Use image node_id 6 for calling the ConvMF obj's underlying member method code with example usage: obj.score(user_idx, item_idx) and returns: self, self