class_docstr: Pure Baysian Personalized Ranking (BPR) [1]_ based Recommender
  
  Parameters
  ----------
  batch_size: int
      Training batch size. Each training instance consists of 
      an user, a positive item, and a negative item.
  max_user: int
      Maximum number of users in the recommendation system.
  max_item: int
      Maximum number of items in the recommendation system.
  dim_embed: int
      Dimensionality of the user/item embedding.
  test_batch_size: int, optional
      Batch size for testing and serving. Each testing/serving bacth consists of
      an user.
  l2_reg: float, optional
      Weight for L2 regularization, i.e., weight decay.
  opt: 'SGD'(default) or 'Adam', optional
      Optimization algorithm, SGD: Stochastic Gradient Descent.
  lr: float, optional
      Initial learning rate.
  init_dict: dict, optional
      Key-value pairs for inital parameter values.
  sess_config: tensorflow.ConfigProto(), optional
      Tensorflow session configuration.
  
  Notes  
  -----
  BPR recommender is trained on users' implicit feedback signals (e.g., clicks and views). The items 
  clicked or viewed are treated as positive items, and otherwise as negative items. The pure BPR
  recommender does not consider any other auxiliary signals.
  
  References
  ----------
  .. [1] Rendle, S., Freudenthaler, C., Gantner, Z. and Schmidt-Thieme, L., 2009, June. 
      BPR: Bayesian personalized ranking from implicit feedback. In Proceedings of the 
      twenty-fifth conference on uncertainty in artificial intelligence (pp. 452-461). AUAI Press.
class_docstr_tok: ["Pure","Baysian","Personalized","Ranking","(","BPR",")","[","1","]","_","based","Recommender","Parameters","--","--","--","--","--","batch_size",":","int","Training","batch","size",".","Each","training","instance","consists","of","an","user",",","a","positive","item",",","and","a","negative","item",".","max_user",":","int","Maximum","number","of","users","in","the","recommendation","system",".","max_item",":","int","Maximum","number","of","items","in","the","recommendation","system",".","dim_embed",":","int","Dimensionality","of","the","user\/item","embedding",".","test_batch_size",":","int",",","optional","Batch","size","for","testing","and","serving",".","Each","testing\/serving","bacth","consists","of","an","user",".","l2_reg",":","float",",","optional","Weight","for","L2","regularization",",","i.e.",",","weight","decay",".","opt",":","'SGD","'","(","default",")","or","'Adam","'",",","optional","Optimization","algorithm",",","SGD",":","Stochastic","Gradient","Descent",".","lr",":","float",",","optional","Initial","learning","rate",".","init_dict",":","dict",",","optional","Key-value","pairs","for","inital","parameter","values",".","sess_config",":","tensorflow.ConfigProto","(",")",",","optional","Tensorflow","session","configuration",".","Notes","--","--","-","BPR","recommender","is","trained","on","users","'","implicit","feedback","signals","(","e.g.",",","clicks","and","views",")",".","The","items","clicked","or","viewed","are","treated","as","positive","items",",","and","otherwise","as","negative","items",".","The","pure","BPR","recommender","does","not","consider","any","other","auxiliary","signals",".","References","--","--","--","--","--","..","[","1","]","Rendle",",","S.",",","Freudenthaler",",","C.",",","Gantner",",","Z.","and","Schmidt-Thieme",",","L.",",","2009",",","June",".","BPR",":","Bayesian","personalized","ranking","from","implicit","feedback",".","In","Proceedings","of","the","twenty-fifth","conference","on","uncertainty","in","artificial","intelligence","(","pp",".","452-461",")",".","AUAI","Press","."]
code: def __init__(
      self,
      batch_size,
      max_user,
      max_item,
      dim_embed,
      test_batch_size=None,
      l2_reg=None,
      opt="SGD",
      lr=None,
      init_dict=None,
      sess_config=None,
  ):
      self._dim_embed = dim_embed
  
      super(BPR, self).__init__(
          batch_size=batch_size,
          test_batch_size=test_batch_size,
          max_user=max_user,
          max_item=max_item,
          l2_reg=l2_reg,
          opt=opt,
          lr=lr,
          init_dict=init_dict,
          sess_config=sess_config,
      )
  
file_path: openrec/openrec/tf1/legacy/recommenders/bpr.py
imports: from openrec.tf1.legacy.recommenders import Recommender
  from openrec.tf1.legacy.modules.extractions import LatentFactor
  from openrec.tf1.legacy.modules.interactions import PairwiseLog
label_desc: Use image node_id 1 to create a new BPR object from inherited base classes: Recommender with example: obj = BPR(batch_size, max_user, max_item, dim_embed, test_batch_size, l2_reg, opt, lr, init_dict, sess_config)