Building Neural Collaborative Filtering recommendation model

TensorFlow · Intermediate ·📄 Research Papers Explained ·3y ago

Key Takeaways

The video demonstrates building a Neural Collaborative Filtering (NMF) recommendation model using TensorFlow, specifically utilizing TensorFlow Model Garden for reference implementations and building a Neural Matrix Factorization (NeuMF) model in TensorFlow 2.

Full Transcript

hi there welcome back to our video series of building recommendation systems with sensor flow my name is way and I'm a developer Advocate at Google in this video we'll be discussing a recommendation model neuro collaborative filing and showing you how to build such a model using tensorflow to core API we have covered a lot of ground in this video series but mostly the tools we discussed are high level apis which are made easy to use on purpose but there are some occasions when you really want to go below the surface and use a centerflow core apis to build a recommendation engine from scratch this sometimes makes sense and we're going to show you how today we're going to build a classical recommendation model called neurometrix factorization new MF new MF comes out of the 2017 research paper by H and his collaborators and it is an instantiation of neur collaborative FY it is a general framework for collaborative furthering of recommendations in which a neuron Network architecture is used to model user item interactions unlike traditional models umf does not resort to Matrix factorization with an inner product on latent features of users and items it replaces the inner product with a multi-layer pectrum that can learn an operatory function from data architecture wise new umf is an ensemble of generalized Matrix factorization gmf and multi-layer perception MLP gmf applies a linear kernel to model the lat feature interaction and MLP applies a nonlinear kernel to learn the interaction function from data new MF is a fused model of gmf and MLP to better model the complex user item interactions and unifies the strength of of linearity of MF and nonlinearity of MLP for modeling the user item latent structures new MF allows gmf and MLP to learn separate embeddings and combines the two models by concatenating their last hidden layers specifically starting at the bottom we have using embedding and moving embeddings from this embeddings we generate user and movie latent Vector for Matrix factorization and MLP layer separately after passing through the generalized Matrix factorization layer and MLP layer we concatenate the outputs of this layers and get the predicted Logics from a dense layer for computing the loss that's it that's the whole architecture we actually provide an excellent implementation of new MF in the tensor FL motor Garden for context tensorflow model Garden is a repository for reference model implementations for 4 2 and it includes more than 50 state-of-the-art models across Vision NP and recommendation engines torfl Motel Garden in a was taking full advantage of torl 2 for research and production it is a community-driven repository with growing contributions and it's a top 10 python package with most unique contributors in 2020 teslow Mel Garden has an implementation of this architecture let's walk through the code to understand how to build it with tlow to first we start with user and item input layers this is quite straightforward next we call Constructor model method to generate the logic by passing the user and item inputs we're going to Define Constructor model function next in Constructor model function we Define the user and item embeddings using the user and item inputs note the embedding Dimension we set as the second parameter this embeddings will be shared by both the Matrix factorization layer and MLP layers and we will extract user and item latent vectors from this embeddings next we're going to use several Lambda layers to slice the embeddings into user and item latent vectors to do the slicing we Define two utility functions MF slice Funk and MLP slice Funk functions as you can see the Matrix factorization lat vectors takes the first two mfdm elements from the embedding while the MLP lat vectors takes the remaining embeddings next for generalized Matrix factorization we're going to use the multiply layer to do element wise multiplication for MLP we're going to first concatenate the user and item latest vectors into a MLP vector and then pass it through several MLP layers lastly we concatenate The Matrix factorization vector and the MLP Vector into a single Vector predictive Vector here and generates the logic FR it using a des layer then we return the model finally we can compute the cross entropy loss from the predicted soft Max loges converted from the predicted loges so that's it that's all the code to build the newer collaborative feding model of course this is just the modeling part you still need to write code to handle data preprocessing model training performance evaluation and so on but hopefully the code walk through here helps you understand how to build a good neur collaborative feding model so to summarize today we walked us through how to build a neuro collaborative fed model with tensor 2 API you can check out the original research paper and the code in tensor modor Garden for additional details with that thank you for watching this video please stay tuned for more updates from us [Music] [Music]

Original Description

Wei Wei, a Developer Advocate, overviews how to build a Neural Collaborative Filtering (NMF) recommendation model. Learn how to build a recommendation engine from scratch with a code walkthrough utilizing TensorFlow Model Garden to reference model implementations for building a Neural Matrix Factorization (NeuMF) recommendation model in TensorFlow 2. Resources: Neural Collaborative Filtering implementation in TensorFlow Model Garden → https://goo.gle/3jAMaqf Neural Collaborative Filtering research paper → https://goo.gle/3Z89Wdp TensorFlow Model Garden → https://goo.gle/3WJcE7F Watch more Coding TensorFlow → https://goo.gle/3Bi8NUS Subscribe to TensorFlow → https://goo.gle/TensorFlow Products mentioned: TensorFlow - TensorFlow Recommenders Speakers: Wei Wei
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from TensorFlow · TensorFlow · 0 of 60

← Previous Next →
1 The TensorFlow YouTube Channel is Here!
The TensorFlow YouTube Channel is Here!
TensorFlow
2 Answering Your TF Questions #AskTensorFlow
Answering Your TF Questions #AskTensorFlow
TensorFlow
3 Chatting With the TensorFlow Community (TensorFlow Meets)
Chatting With the TensorFlow Community (TensorFlow Meets)
TensorFlow
4 All About TensorFlow Code (Coding TensorFlow)
All About TensorFlow Code (Coding TensorFlow)
TensorFlow
5 TensorFlow: an ML platform for solving impactful and challenging problems
TensorFlow: an ML platform for solving impactful and challenging problems
TensorFlow
6 Keynote (TensorFlow Dev Summit 2018)
Keynote (TensorFlow Dev Summit 2018)
TensorFlow
7 tf.data: Fast, flexible, and easy-to-use input pipelines (TensorFlow Dev Summit 2018)
tf.data: Fast, flexible, and easy-to-use input pipelines (TensorFlow Dev Summit 2018)
TensorFlow
8 Eager Execution (TensorFlow Dev Summit 2018)
Eager Execution (TensorFlow Dev Summit 2018)
TensorFlow
9 Machine Learning in JavaScript (TensorFlow Dev Summit 2018)
Machine Learning in JavaScript (TensorFlow Dev Summit 2018)
TensorFlow
10 Training Performance: A user’s guide to converge faster (TensorFlow Dev Summit 2018)
Training Performance: A user’s guide to converge faster (TensorFlow Dev Summit 2018)
TensorFlow
11 The Practitioner's Guide with TF High Level APIs (TensorFlow Dev Summit 2018)
The Practitioner's Guide with TF High Level APIs (TensorFlow Dev Summit 2018)
TensorFlow
12 Distributed TensorFlow (TensorFlow Dev Summit 2018)
Distributed TensorFlow (TensorFlow Dev Summit 2018)
TensorFlow
13 Debugging TensorFlow with TensorBoard plugins (TensorFlow Dev Summit 2018)
Debugging TensorFlow with TensorBoard plugins (TensorFlow Dev Summit 2018)
TensorFlow
14 TensorFlow Lite (TensorFlow Dev Summit 2018)
TensorFlow Lite (TensorFlow Dev Summit 2018)
TensorFlow
15 Searching Over Ideas (TensorFlow Dev Summit 2018)
Searching Over Ideas (TensorFlow Dev Summit 2018)
TensorFlow
16 Reconstructing Fusion Plasmas (TensorFlow Dev Summit 2018)
Reconstructing Fusion Plasmas (TensorFlow Dev Summit 2018)
TensorFlow
17 Nucleus: TensorFlow toolkit for Genomics (TensorFlow Dev Summit 2018)
Nucleus: TensorFlow toolkit for Genomics (TensorFlow Dev Summit 2018)
TensorFlow
18 Open Source Collaboration (TensorFlow Dev Summit 2018)
Open Source Collaboration (TensorFlow Dev Summit 2018)
TensorFlow
19 Swift for TensorFlow - TFiwS (TensorFlow Dev Summit 2018)
Swift for TensorFlow - TFiwS (TensorFlow Dev Summit 2018)
TensorFlow
20 TensorFlow Hub (TensorFlow Dev Summit 2018)
TensorFlow Hub (TensorFlow Dev Summit 2018)
TensorFlow
21 Applied AI at The Coca-Cola Company (TensorFlow Dev Summit 2018)
Applied AI at The Coca-Cola Company (TensorFlow Dev Summit 2018)
TensorFlow
22 Real-World Robot Learning (TensorFlow Dev Summit 2018)
Real-World Robot Learning (TensorFlow Dev Summit 2018)
TensorFlow
23 TensorFlow Extended (TFX) (TensorFlow Dev Summit 2018)
TensorFlow Extended (TFX) (TensorFlow Dev Summit 2018)
TensorFlow
24 Project Magenta (TensorFlow Dev Summit 2018)
Project Magenta (TensorFlow Dev Summit 2018)
TensorFlow
25 TensorFlow Dev Summit 2018 - Livestream
TensorFlow Dev Summit 2018 - Livestream
TensorFlow
26 Introducing TensorFlow Lite (Coding TensorFlow)
Introducing TensorFlow Lite (Coding TensorFlow)
TensorFlow
27 TensorFlow Dev Summit 2018 Highlights
TensorFlow Dev Summit 2018 Highlights
TensorFlow
28 Jeff Dean, Head of AI at Google discusses the impact of ML (TensorFlow Meets)
Jeff Dean, Head of AI at Google discusses the impact of ML (TensorFlow Meets)
TensorFlow
29 TensorFlow Mobile vs. TF Lite and More! #AskTensorFlow
TensorFlow Mobile vs. TF Lite and More! #AskTensorFlow
TensorFlow
30 Using TensorFlow to enable research & production across many fields (TensorFlow Meets)
Using TensorFlow to enable research & production across many fields (TensorFlow Meets)
TensorFlow
31 Teaching TensorFlow for Deep Learning at Stanford University (TensorFlow Meets)
Teaching TensorFlow for Deep Learning at Stanford University (TensorFlow Meets)
TensorFlow
32 TensorFlow Lite for Android (Coding TensorFlow)
TensorFlow Lite for Android (Coding TensorFlow)
TensorFlow
33 Using the tf.data API to build input pipelines (TensorFlow Meets)
Using the tf.data API to build input pipelines (TensorFlow Meets)
TensorFlow
34 Training Models in the Cloud & the Benefits of AI Toolkits #AskTensorFlow
Training Models in the Cloud & the Benefits of AI Toolkits #AskTensorFlow
TensorFlow
35 Execute operations immediately with TensorFlow's Eager Execution (TensorFlow Meets)
Execute operations immediately with TensorFlow's Eager Execution (TensorFlow Meets)
TensorFlow
36 TensorFlow Lite for iOS (Coding TensorFlow)
TensorFlow Lite for iOS (Coding TensorFlow)
TensorFlow
37 Get started with TensorFlow's High-Level APIs (Google I/O '18)
Get started with TensorFlow's High-Level APIs (Google I/O '18)
TensorFlow
38 TensorFlow for JavaScript (Google I/O '18)
TensorFlow for JavaScript (Google I/O '18)
TensorFlow
39 TensorFlow in production: TF Extended, TF Hub, and TF Serving (Google I/O '18)
TensorFlow in production: TF Extended, TF Hub, and TF Serving (Google I/O '18)
TensorFlow
40 Get started with TensorFlow's High-Level APIs in 5 mins |  Google I/O 2018
Get started with TensorFlow's High-Level APIs in 5 mins | Google I/O 2018
TensorFlow
41 TensorFlow and deep reinforcement learning, without a PhD (Google I/O '18)
TensorFlow and deep reinforcement learning, without a PhD (Google I/O '18)
TensorFlow
42 TensorFlow Lite for mobile developers (Google I/O '18)
TensorFlow Lite for mobile developers (Google I/O '18)
TensorFlow
43 Advances in machine learning and TensorFlow (Google I/O '18)
Advances in machine learning and TensorFlow (Google I/O '18)
TensorFlow
44 Distributed TensorFlow training (Google I/O '18)
Distributed TensorFlow training (Google I/O '18)
TensorFlow
45 Classification using neural networks & ML regression models #AskTensorFlow
Classification using neural networks & ML regression models #AskTensorFlow
TensorFlow
46 TensorFlow and Keras in R - Josh Gordon meets with J.J. Allaire (TensorFlow Meets)
TensorFlow and Keras in R - Josh Gordon meets with J.J. Allaire (TensorFlow Meets)
TensorFlow
47 Focus on your experiment with TensorFlow Estimators (TensorFlow Meets)
Focus on your experiment with TensorFlow Estimators (TensorFlow Meets)
TensorFlow
48 How to get started with AI/ML, retraining models, & more! #AskTensorFlow
How to get started with AI/ML, retraining models, & more! #AskTensorFlow
TensorFlow
49 TensorFlow - the deep learning solution for mobile platforms (TensorFlow Meets)
TensorFlow - the deep learning solution for mobile platforms (TensorFlow Meets)
TensorFlow
50 MiniGo: TensorFlow Meets Andrew Jackson (TensorFlow Meets)
MiniGo: TensorFlow Meets Andrew Jackson (TensorFlow Meets)
TensorFlow
51 The growth of TensorFlow with added support for JS & Swift (TensorFlow Meets)
The growth of TensorFlow with added support for JS & Swift (TensorFlow Meets)
TensorFlow
52 At the intersection of TensorFlow & nuclear physics (TensorFlow Meets)
At the intersection of TensorFlow & nuclear physics (TensorFlow Meets)
TensorFlow
53 NVidia TensorRT: high-performance deep learning inference accelerator (TensorFlow Meets)
NVidia TensorRT: high-performance deep learning inference accelerator (TensorFlow Meets)
TensorFlow
54 Try TensorFlow.js in your browser (Coding TensorFlow)
Try TensorFlow.js in your browser (Coding TensorFlow)
TensorFlow
55 TensorFlow Hub: reusing machine learning modules (TensorFlow Meets)
TensorFlow Hub: reusing machine learning modules (TensorFlow Meets)
TensorFlow
56 How to use TensorFlow in PyCharm (TensorFlow Tip of the Week)
How to use TensorFlow in PyCharm (TensorFlow Tip of the Week)
TensorFlow
57 Training models faster with TensorFlow Hub (TensorFlow Meets)
Training models faster with TensorFlow Hub (TensorFlow Meets)
TensorFlow
58 Prepare your dataset for machine learning (Coding TensorFlow)
Prepare your dataset for machine learning (Coding TensorFlow)
TensorFlow
59 Using ML to predict insulin use for Type 1 Diabetes (TensorFlow Meets)
Using ML to predict insulin use for Type 1 Diabetes (TensorFlow Meets)
TensorFlow
60 TFX: an end-to-end machine learning platform for TensorFlow (TensorFlow Meets)
TFX: an end-to-end machine learning platform for TensorFlow (TensorFlow Meets)
TensorFlow

This video teaches how to build a Neural Collaborative Filtering recommendation model from scratch using TensorFlow, with a focus on utilizing TensorFlow Model Garden for reference implementations. The model built is a Neural Matrix Factorization (NeuMF) recommendation model in TensorFlow 2. This is useful for developers looking to implement recommendation engines in their applications.

Key Takeaways
  1. Import necessary libraries and load data
  2. Define the Neural Collaborative Filtering model architecture
  3. Utilize TensorFlow Model Garden for reference implementations
  4. Build and train the Neural Matrix Factorization (NeuMF) model
  5. Evaluate the model's performance
💡 Utilizing TensorFlow Model Garden can simplify the process of building complex recommendation models like Neural Collaborative Filtering

Related Reads

Up next
The Real AI Frontier Isn't Smarter Machines (with Catherine Williams)
Super Data Science: ML & AI Podcast with Jon Krohn
Watch →