After downloading the datasets:
-
Place them in a suitable location, e.g.,
/your_root_directory/data. -
Rename the unzipped folders as needed. For example, the code expects the MovieLens data in
/your_root_directory/data/ml-20m.
Preparing Input Data
- MovieLens 20m
python -m utils.movieLens -root /your_root_directory
- Netflix
python -m utils.netflix -root /your_root_directory
- Million Song
python -m utils.MSD -root /your_root_directory
This will generate the following files:
unique_sid.txtis used for helping to readtrain.csvand it is optional.train.csvcontains the training data.validation_tr.csvis used as input for the model in validation stage.validation_te.csvis used for testing the model output in validation stage.test_tr.csv,test_te.csvare the same asvalidation_tr.csv,validation_te.csvbut used in testing stage.
To train the model, run:
python -m train -root /your_root_directory -dataset ml-20m -lambda_alignment 8 -lambda_scale 1.2
The best-val model obtained in training will be saved by default at /your_root_directory/checkpoint/model_name.pt.
-model_type shallow-model_type rec-model_type hierachical_gated
-prior_type normal-prior_type composition-prior_type vamp
-lambda_alignment 8-rho 5-lambda_scale 1.2
To disable Personalized Item Alignment, set: -lambda_alignment 0
python -m train -dataset ml-20m -lambda_alignment 8 -lambda_scale 1.2
python -m train -dataset MSD -lambda_alignment 8 -lambda_scale 1.2
python -m train -dataset netflix -lambda_alignment 8 -lambda_scale 1.2
RecVAE with Full Settings: Alternative training, composition prior, and adaptive beta (RecVAE repository):
python -m train -dataset ml-20m -lambda_alignment 8 -lambda_scale 1.2 -model_type rec -lambda_alignment -prior_type composition
RecVAE Architecture Only: Reduced training time with rec architecture-only implementation:
python -m train -dataset MSD -lambda_alignment 8 -lambda_scale 1.2 -model_type rec
python -m train -dataset netflix -lambda_alignment 8 -lambda_scale 1.2 -model_type rec
Hvamp (Hvamp repository):
python -m train -dataset ml-20m -prior_type vamp -model_type hierachical_gated -lambda_alignment 2 -lambda_scale 1.0
To evaluate a trained model e.g., /your_root_directory/checkpoint/model_name.pt:
python -m evaluation -root /your_root_directory -dataset ml-20m -model_type model -model model_name
To visualize user representations using t-SNE:
python -m plot_tsne -root /your_root_directory -dataset ml-20m -model model_name