-
Notifications
You must be signed in to change notification settings - Fork 7
Update tutorials #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I've updated some of your existing tutorials and created three new ones for you.
**New Tutorials Created:**
1. `advanced_recommender_ncf.ipynb`:
* Topic: Advanced Recommender Systems: Deep Learning for Collaborative Filtering.
* This tutorial covers Neural Collaborative Filtering (NCF) concepts and implementation using TensorFlow/Keras with the MovieLens 100k dataset. It includes data preprocessing, model building (GMF, MLP, NeuMF), training, and evaluation (RMSE/MAE).
2. `scalable_gaussian_processes_gpytorch.ipynb`:
* Topic: Scalable Gaussian Processes with GPyTorch.
* This explains Stochastic Variational Gaussian Processes (SVGP) for scalability.
* It provides a GPyTorch implementation using `ApproximateGP` and `VariationalELBO` on a synthetic dataset. This includes model training, prediction visualization, and discussion of inducing points.
3. `gnn_recommender_intro.ipynb`:
* Topic: Introduction to Graph Neural Networks for Recommender Systems.
* This introduces GNNs for recommendation, focusing on LightGCN concepts.
* It's implemented using PyTorch and PyTorch Geometric with the MovieLens 100k dataset. This covers graph construction, a LightGCN-style model, training with MSE loss, and basic recommendation generation.
**Updates to Existing Tutorials:**
1. `Generative_models/Mubert_Text_to_Music.ipynb`:
* I successfully updated this to fix runtime errors by adding `mubert-sdk` installation, correctly initializing the Mubert client, and handling API token (`pat`) usage.
* I updated the introductory markdown to include context on SOTA text-to-music generation models (Transformers, Diffusion models) with links to MusicLM, MusicGen, and AudioLDM.
* I also added an optional markdown cell discussing these SOTA open models further.
**Intended (but Unapplied) Updates:**
I encountered some difficulties when trying to apply changes to the Jupyter notebook JSON structure for the following notebooks. The intended changes are documented here for future work:
1. `gp/Simple_GP_Regression_with_losses.ipynb`:
* **Dependencies**: Update `!pip install gpytorch` to `!pip install gpytorch torch torchvision torchaudio matplotlib --upgrade`.
* **SOTA Content**: Add a markdown section titled "Modern Advancements in Gaussian Processes" discussing scalability (SVGP, SKI/KISS-GP), Deep GPs, Deep Kernel Learning, Bayesian Optimization (BoTorch), and non-stationary kernels.
* **Links**: Add a link to the official GPyTorch documentation in the introduction and update the final cell to a markdown cell with "Further Exploration" links (GPyTorch examples, BoTorch).
* **Kernels**: Add a note about other available kernels in GPyTorch (e.g., MaternKernel) in the kernel introduction section.
2. `recommender_system/Movie_recommender_system_CF_v2_TOFILL.ipynb`:
* **Code Completion**: Fill in all `##### FILL HERE (...) ######` sections:
* `df_user_item = df_ratings.pivot(index='userId', columns='itemId', values='rating')`
* SGD function: `n_users = data.userId.nunique()`, `n_items = data.itemId.nunique()`, `err = r_ui - np.dot(p[u], q[i])`, `p[u] += alpha * err * q[i]`, `q[i] += alpha * err * p[u]`.
* `estimate` function: `return np.dot(p[u], q[i])`.
* **Dependencies**: Update `!pip install surprise` to `!pip install surprise pandas numpy matplotlib seaborn scipy --upgrade`.
* **SOTA Content**: Add a markdown section "Modern Advancements in Collaborative Filtering" discussing Deep Learning approaches (NCF, Autoencoders), GNNs (LightGCN, PinSage), advanced MF (SVD++, FMs), and sequence-aware recommenders, with links to libraries like TensorFlow Recommenders, Cornac, Implicit.
* **Pedagogy**: Add a note to the SVD section clarifying that `fillna(0)` is a simplification and not standard practice for sparse CF.
* **Dataset Note**: Add comments to the data loading cell regarding the MovieLens dataset source and its evolving nature.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new tutorial on scalable Gaussian Processes with GPyTorch and refines dependency setup and client initialization in existing GP and Mubert notebooks.
- Introduces
scalable_gp_gpytorch_tutorial.ipynbdemonstrating SVGP modeling, training, and prediction. - Updates
gp/Simple_GP_Regression_with_losses.ipynbto install additional dependencies and remove inline pip output. - Enhances
Generative_models/Mubert_Text_to_Music.ipynbby installingmubert-sdk, properly initializing the client, and adding SOTA context.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scalable_gp_gpytorch_tutorial.ipynb | New SVGP tutorial covering data generation, model, training, and plotting |
| gp/Simple_GP_Regression_with_losses.ipynb | Expanded pip install command and cleared execution outputs |
| Generative_models/Mubert_Text_to_Music.ipynb | Improved SDK install, PAT handling, placeholder logic, and added SOTA links |
Comments suppressed due to low confidence (3)
scalable_gp_gpytorch_tutorial.ipynb:87
- NumPy is never imported in this cell, so
np.random.seed(42)will raise a NameError. Addimport numpy as npat the top of the setup cell.
np.random.seed(42)
Generative_models/Mubert_Text_to_Music.ipynb:71
- Catching
NameErrorwon't handle a missing SDK import (it raises ImportError/ModuleNotFoundError). Useexcept ImportError:or catchModuleNotFoundErrorinstead.
except NameError: # Mubert might not be defined if import failed due to not being installed
Generative_models/Mubert_Text_to_Music.ipynb:56
- [nitpick] The
PlaceholderMubertclass is defined multiple times in different branches. Consider extracting it once and reusing to reduce duplication.
class PlaceholderMubert:
New tutorials:
advanced_recommender_ncf.ipynb:scalable_gaussian_processes_gpytorch.ipynb:ApproximateGPandVariationalELBOon a synthetic dataset. This includes model training, prediction visualization, and discussion of inducing points.gnn_recommender_intro.ipynb:Updates to existing tutorials:
Generative_models/Mubert_Text_to_Music.ipynb:mubert-sdkinstallation, correctly initializing the Mubert client, and handling API token (pat) usage.