code: def __init__(
      self,
      train_set,
      k=100,
      z_dims=[300],
      n_epoch=300,
      batch_size=300,
      learning_rate=0.001,
      B=1,
      w_determinist=True,
      init_params=None,
  ):
      self.cf_data = (
          train_set.csc_matrix
      )  # user-item interaction (CF data)
      self.aux_data = train_set.item_graph.matrix[
          : train_set.num_items, : train_set.num_items
      ]  # item auxiliary information (items'context in the original paper)
      self.k = k  # the number of user and item latent factors
      self.z_dims = z_dims  # the dimension of the second hidden layer (we consider a 2-layers PCRL)
      self.c_dim = self.aux_data.shape[
          1
      ]  # the dimension of the auxiliary information matrix
      self.n_epoch = n_epoch  # the number of traning epochs
      self.batch_size = batch_size
      self.learning_rate = learning_rate
      self.B = B  # Shape augmentation parameter
      self.init_params = init_params  # initial parameters
      # Additional parameters
      self.aa = 0.3
      self.bb = 0.3
      self.Ls = sp.csc_matrix(
          (self.aux_data.shape[0], self.k)
      )  # Variational Shape parameters of the item factors (Beta in the paper)
      self.Lr = sp.csc_matrix(
          (self.aux_data.shape[0], self.k)
      )  # Variational Rate parameters  of the item factors (Beta in the paper)
      self.Gs = None  # Variational Shapre parameters of the user factors (Theta in the paper)
      self.Gr = None  # Variational Rate parameters of the user factors (Theta in the paper)
      self.L = len(
          z_dims
      )  # The number of deterministic hidden layers "z"
      self.w_determinist = w_determinist  # If true then deterministic wheights are used for the generator network
      self.sess = tf.Session()  # Tensorflow session
      # Inference netwok parameters
      self.inference_params = []
      self.inference_params.append(
          tf.Variable(
              self.glorot_init([self.c_dim, self.z_dims[self.L - 1]])
          )
      )
      for l in range(self.L - 2, -1, -1):
          self.inference_params.append(
              tf.Variable(
                  self.glorot_init([self.z_dims[l + 1], self.z_dims[l]])
              )
          )
      self.inference_params.append(
          tf.Variable(self.glorot_init([self.z_dims[0], self.k]))
      )
      self.inference_params.append(
          tf.Variable(self.glorot_init([self.z_dims[0], self.k]))
      )
      # generator newtork parameters
      self.generator_params = []
      self.generator_params.append(
          tf.Variable(self.glorot_init([self.k, self.z_dims[0]]))
      )
      for l in range(1, self.L):
          self.generator_params.append(
              tf.Variable(
                  self.glorot_init([self.z_dims[l - 1], self.z_dims[l]])
              )
          )
      self.generator_params.append(
          tf.Variable(
              self.glorot_init([self.z_dims[self.L - 1], self.c_dim])
          )
      )
  
file_path: cornac/cornac/models/pcrl/pcrl.py
imports: import numpy
  import scipy.sparse
  import scipy
  import tensorflow
label_desc: Use image node_id 1 to create a new PCRL_ object  with example: obj = PCRL_(train_set, k, z_dims, n_epoch, batch_size, learning_rate, B, w_determinist, init_params)