Collaborative Filtering, Matrix Factorization, Recommender Systems, Gradient Descent, Neural Networks.
self.MSE(R, R_hat) def optimize(self, loss): self.optimizer.zero_grad() loss.backward() self.optimizer.step() # Create Model MF_model = PytorchNonLinearModel(num_users, num_items, K, lr) # Training for curr_epoch in range(num_epochs): MF_model.train() # Reconstruct R_hat from latent factor matrices