class_docstr: Collaborative Denoising Auto-Encoder (CDAE) is a recommendation model
  for top-N recommendation that utilizes the idea of Denoising Auto-Encoders.
  We implement the the CDAE model with only user dataloader.
class_docstr_tok: ["Collaborative","Denoising","Auto-Encoder","(","CDAE",")","is","a","recommendation","model","for","top-N","recommendation","that","utilizes","the","idea","of","Denoising","Auto-Encoders",".","We","implement","the","the","CDAE","model","with","only","user","dataloader","."]
code: def __init__(self, config, dataset):
      super(CDAE, self).__init__(config, dataset)
  
      self.reg_weight_1 = config["reg_weight_1"]
      self.reg_weight_2 = config["reg_weight_2"]
      self.loss_type = config["loss_type"]
      self.hid_activation = config["hid_activation"]
      self.out_activation = config["out_activation"]
      self.embedding_size = config["embedding_size"]
      self.corruption_ratio = config["corruption_ratio"]
  
      self.build_histroy_items(dataset)
  
      if self.hid_activation == "sigmoid":
          self.h_act = nn.Sigmoid()
      elif self.hid_activation == "relu":
          self.h_act = nn.ReLU()
      elif self.hid_activation == "tanh":
          self.h_act = nn.Tanh()
      else:
          raise ValueError("Invalid hidden layer activation function")
  
      if self.out_activation == "sigmoid":
          self.o_act = nn.Sigmoid()
      elif self.out_activation == "relu":
          self.o_act = nn.ReLU()
      else:
          raise ValueError("Invalid output layer activation function")
  
      self.dropout = nn.Dropout(p=self.corruption_ratio)
  
      self.h_user = nn.Embedding(self.n_users, self.embedding_size)
      self.h_item = nn.Linear(self.n_items, self.embedding_size)
      self.out_layer = nn.Linear(self.embedding_size, self.n_items)
  
      # parameters initialization
      self.apply(xavier_normal_initialization)
  
file_path: RecBole/recbole/model/general_recommender/cdae.py
imports: import torch
  import torch.nn
  from recbole.model.abstract_recommender import AutoEncoderMixin, GeneralRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new CDAE object from inherited base classes: GeneralRecommender, AutoEncoderMixin with example: obj = CDAE(config, dataset)