All Projects → ash-shar → Long-Tail-GAN

ash-shar / Long-Tail-GAN

Licence: BSD-3-Clause license
Adversarial learning framework to enhance long-tail recommendation in Neural Collaborative Filtering

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Long-Tail-GAN

Articles-Bookmarked
No description or website provided.
Stars: ✭ 30 (+57.89%)
Mutual labels:  generative-adversarial-network
Recommendation-System-Baseline
Some common recommendation system baseline, with description and link.
Stars: ✭ 34 (+78.95%)
Mutual labels:  recommendation-system
favorite-research-papers
Listing my favorite research papers 📝 from different fields as I read them.
Stars: ✭ 12 (-36.84%)
Mutual labels:  generative-adversarial-network
TailCalibX
Pytorch implementation of Feature Generation for Long-Tail Classification by Rahul Vigneswaran, Marc T Law, Vineeth N Balasubramaniam and Makarand Tapaswi
Stars: ✭ 32 (+68.42%)
Mutual labels:  long-tail
WGAN-GP-tensorflow
Tensorflow Implementation of Paper "Improved Training of Wasserstein GANs"
Stars: ✭ 23 (+21.05%)
Mutual labels:  generative-adversarial-network
BERT4Rec-VAE-Pytorch
Pytorch implementation of BERT4Rec and Netflix VAE.
Stars: ✭ 212 (+1015.79%)
Mutual labels:  recommendation-system
Cross-Domain-Image-Translation-Using-CycleGAN
CycleGAN based neural network architecture to change the gender of a person’s face
Stars: ✭ 15 (-21.05%)
Mutual labels:  generative-adversarial-network
deep-learning-roadmap
my own deep learning mastery roadmap
Stars: ✭ 40 (+110.53%)
Mutual labels:  generative-adversarial-network
videoDCGAN
Implementation of a GAN that generates video using LSTM and ConvNet in Tensorflow
Stars: ✭ 14 (-26.32%)
Mutual labels:  generative-adversarial-network
keras-text-to-image
Translate text to image in Keras using GAN and Word2Vec as well as recurrent neural networks
Stars: ✭ 60 (+215.79%)
Mutual labels:  generative-adversarial-network
Awesome-GAN-Resources
🤖A list of resources to help anyone getting started with GANs 🤖
Stars: ✭ 90 (+373.68%)
Mutual labels:  generative-adversarial-network
awesome-graph-self-supervised-learning-based-recommendation
A curated list of awesome graph & self-supervised-learning-based recommendation.
Stars: ✭ 37 (+94.74%)
Mutual labels:  recommendation-system
pytorch-domain-adaptation
Unofficial pytorch implementation of algorithms for domain adaptation
Stars: ✭ 24 (+26.32%)
Mutual labels:  generative-adversarial-network
AGD
[ICML2020] "AutoGAN-Distiller: Searching to Compress Generative Adversarial Networks" by Yonggan Fu, Wuyang Chen, Haotao Wang, Haoran Li, Yingyan Lin, Zhangyang Wang
Stars: ✭ 98 (+415.79%)
Mutual labels:  generative-adversarial-network
Audio2Guitarist-GAN
Two-stage GANs that generate fingerstyle guitarist images from audio.
Stars: ✭ 53 (+178.95%)
Mutual labels:  generative-adversarial-network
WSDM2022-PTUPCDR
This is the official implementation of our paper Personalized Transfer of User Preferences for Cross-domain Recommendation (PTUPCDR), which has been accepted by WSDM2022.
Stars: ✭ 65 (+242.11%)
Mutual labels:  recommendation-system
stylegan-encoder
StyleGAN Encoder - converts real images to latent space
Stars: ✭ 694 (+3552.63%)
Mutual labels:  generative-adversarial-network
Tf-Rec
Tf-Rec is a python💻 package for building⚒ Recommender Systems. It is built on top of Keras and Tensorflow 2 to utilize GPU Acceleration during training.
Stars: ✭ 18 (-5.26%)
Mutual labels:  recommendation-system
mildnet
Visual Similarity research at Fynd. Contains code to reproduce 2 of our research papers.
Stars: ✭ 76 (+300%)
Mutual labels:  recommendation-system
Adversarial-Learning-for-Generative-Conversational-Agents
This repository contains a new adversarial training method for Generative Conversational Agents
Stars: ✭ 71 (+273.68%)
Mutual labels:  generative-adversarial-network

Long-Tail-GAN

This repository contains the training and testing codes for the Generative Adversarial learning framework for Neural Collaborative Filtering (NCF) models, which aims to enhance long-tail item recommendations.

If this code helps you in your research, please cite the following publication:

Krishnan, Adit, et al. "An Adversarial Approach to Improve Long-Tail Performance in Neural Collaborative Filtering." Proceedings of the 27th ACM International Conference on Information and Knowledge Management. ACM, 2018.

Getting Started

These instructions will help you setup the proposed model on your local machine.

Platforms Supported

  • Unix, MacOS, Windows (with appropriate Python and Tensorflow environment)

Prerequisites

Our framework can be compiled on Python 2.7+ environments with the following modules installed:

These requirements may be satisified with an updated Anaconda environment as well - https://www.anaconda.com/

Input Files

You will need the following files for running our model:

item_counts.csv:        CSV file containing userId, itemId, and rating (given by user to item) separated by comma (,) 
item_list.txt:          List of item ids.
unique_item_id.txt:     Items to use for training and testing (say, only use items rated by atleast 5 users)
item2id.txt:            Mapping which makes item ids in unique_item_id sequential (0 to num_item), tab-separated
profile2id.txt:         Mapping which makes user ids sequential (0 to num_user), tab-separated
niche_items.txt:        Items which are niche (original ids) 
train_GAN.csv:          CSV file containing pairs of userId (mapped), itemId (mapped) with rating greater than an application-specific threshold
train_GAN_popular.csv:  userId (mapped), itemId (mapped) pairs of niche items
train_GAN_niche.csv:    userId (mapped), itemId (mapped) pairs of popular items (unique_items - niche items)
validation_tr.csv:      Training data for Validation (userId (mapped), itemId (mapped) pairs)
validation_te.csv:      Test Data for Validation (userId (mapped), itemId (mapped) pairs)
test_tr.csv:            Training data for Testing (userId (mapped), itemId (mapped) pairs)
test_te.csv:            Test Data for Testing (userId (mapped), itemId (mapped) pairs)

A set of input files for a sampled version of Askubuntu dataset are present in the Dataset folder. Note that we use the set of tags assigned to the posts of a user as items; the posts correspond to the questions asked by the user, the answers given by the user, the posts liked by the user, and the posts to which the user commented.

Refer to the following ipython notebook for details regarding creation of these files for movielens dataset: ml-parse-vaecf. The movies rated by the users are the items.

Running the Model

Configure

The model can be configured using the file config.ini present inside the Codes folder. The parameters h0_size, h1_size, h2_size, and h3_size are the sizes of the hidden layers as defined in the architecture of our discriminator in the GAN framework (see figure).

Architecture

The other parameters to be configured are:

GANLAMBDA:       Weight provided to the Adversary's Loss Term (Default = 1.0)
NUM_EPOCH:       Number of Epochs for training (Default = 80)
BATCH_SIZE:      Size of each batch (Default = 100)
LEARNING_RATE:   Learning Rate of the Model (Default = 0.0001)
model_name:      Name by which model is saved (Default = "LT_GAN")

Base Recommender

The repo uses VAE-CF as the base recommender (generator in our architecture) by default. You can also replace this with your own recommender models (or other recommenders) to be trained with the GAN loss and long-tail strategy proposed by us. Follow the below instructions:

  1. Create a python class of your recommender. You can use the VAECF class as a template.
  2. Write a wrapper function for your recommender class in the generator.py file. The function should take path to the dataset folder as input, irrespective of its usage. Eg., for Askubuntu dataset, it will take path to the Askubuntu folder as input. The function should return the following: object to the defined class, probability distribution over the set of items (recommender's output), loss function of the recommender, parameters of the recommender to learn, and hyperparamters used by the recommender. Again, refer the wrapper function of VAE-CF defined in the code.
  3. In the train.py file, import the wrapper function of your recommender instead of generator_VAECF (line 21).
  4. If the set of hyperparameters of your recommender are similar to VAE-CF, then no more change would be needed. Otherwise, you might need to take care of them in the code, especially if some of them are updated over training iterations (like annealing).

Train

For training the model, run the following command:

$ python2.7 train.py <path/to/input/folder>

Model parameters are set to the values provided in the config file. By default, the trained model is checkpointed and saved to path/to/input/folder/chkpt/ after every epoch.

Test

For testing the model, run the following command:

$ python2.7 test.py <path/to/input/folder> <path/to/saved/model>

where Path to saved model is the path to the saved model file inside chkpt folder (will be model_<last_epoch> by default).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].