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"]
code: def __init__(
      self,
      name="ConvMF",
      k=50,
      n_epochs=50,
      cnn_epochs=5,
      cnn_bs=128,
      cnn_lr=0.001,
      lambda_u=1,
      lambda_v=100,
      emb_dim=200,
      max_len=300,
      filter_sizes=[3, 4, 5],
      num_filters=100,
      hidden_dim=200,
      dropout_rate=0.2,
      give_item_weight=True,
      trainable=True,
      verbose=False,
      init_params=None,
      seed=None,
  ):
      super().__init__(name=name, trainable=trainable, verbose=verbose)
      self.give_item_weight = give_item_weight
      self.n_epochs = n_epochs
      self.cnn_bs = cnn_bs
      self.cnn_lr = cnn_lr
      self.lambda_u = lambda_u
      self.lambda_v = lambda_v
      self.k = k
      self.dropout_rate = dropout_rate
      self.emb_dim = emb_dim
      self.max_len = max_len
      self.filter_sizes = filter_sizes
      self.num_filters = num_filters
      self.hidden_dim = hidden_dim
      self.name = name
      self.verbose = verbose
      self.cnn_epochs = cnn_epochs
      self.seed = seed
  
      # Init params if provided
      self.init_params = {} if init_params is None else init_params
      self.U = self.init_params.get("U", None)
      self.V = self.init_params.get("V", None)
      self.W = self.init_params.get("W", None)
  
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 1 to create a new ConvMF object from inherited base classes: Recommender with example: obj = ConvMF(name, k, n_epochs, cnn_epochs, cnn_bs, cnn_lr, lambda_u, lambda_v, emb_dim, max_len, filter_sizes, num_filters, hidden_dim, dropout_rate, give_item_weight, trainable, verbose, init_params, seed)