Skip to content
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

Cannot retrieve latent factors with gd_mf_weights from a trained model #1851

Closed
szipkin opened this issue Apr 19, 2019 · 2 comments
Closed
Assignees
Labels

Comments

@szipkin
Copy link
Contributor

szipkin commented Apr 19, 2019

I trained a rank 40 model on the movielens data, but cannot retrieve the weights from the trained model with gd_mf_weights. I'm following the syntax from the matrix factorization example but it is giving me errors. Any advice?

Model training call:
vw --rank 40 -q ui --l2 0.1 --learning_rate 0.015 --decay_learning_rate 0.97 --power_t 0 --passes 50 --cache_file movielens.cache -f movielens.reg -d train.vw

Weights generating call:
library/gd_mf_weights -I train.vw -O '/data/home/mlteam/notebooks/Recommenders-master/notebooks/Outputs/movielens' --vwparams '-q ui --rank 40 -i movielens.reg'

Error:

WARNING: model file has set of {-q, --cubic, --interactions} settings stored, but they'll be OVERRIDEN by set of {-q, --cubic, --interactions} settings from command line.
creating quadratic features for pairs: ui

finished run
number of examples = 0
weighted example sum = 0
weighted label sum = 0
average loss = -nan
total feature number = 0
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::program_options::multiple_occurrences >'
what(): option '--rank' cannot be specified more than once
Aborted (core dumped)

If I just run it without specifying rank and interaction variables, it doesn't return the same trained model, since the parameters displayed are different from before.

library/gd_mf_weights -I train.vw -O '/data/home/mlteam/notebooks/Recommenders-master/notebooks/Outputs/movielens' --vwparams '-i movielens.reg' 
creating quadratic features for pairs: ui 
Num weight bits = 18 
learning rate = 10 
initial_t = 1 
power_t = 0.5 
using no cache 
Reading datafile = 
num sources = 0 
Segmentation fault (core dumped)

If I run weights generation with the entire set of model training parameters, it just ignores my extra parameters (and finishes much faster than 50 passes would take) and returns same weights from a randomly initiated rank 40 model.
library/gd_mf_weights -I train.vw -0 '/data/home/mlteam/notebooks/Recommenders-master/notebooks/Outputs/movielens' --vwparams '--rank 40 -q ui --l2 0.1 --learning_rate 0.015 --decay_learning_rate 0.97 --power_t 0 --passes 50 --cache_file movielens.cache -f movielens.reg -d train.vw'

@szipkin szipkin changed the title Retrieve latent factors with --audit or --readable_model Retrieve latent factors with gd_mf_weights, --audit, or --readable_model Apr 22, 2019
@szipkin szipkin changed the title Retrieve latent factors with gd_mf_weights, --audit, or --readable_model Retrieve latent factors with gd_mf_weights, --audit, or --readable_model in windows version Apr 22, 2019
@szipkin szipkin changed the title Retrieve latent factors with gd_mf_weights, --audit, or --readable_model in windows version How to interpret --audit and --invert_hash output for --rank model Apr 23, 2019
@szipkin szipkin changed the title How to interpret --audit and --invert_hash output for --rank model Cannot retrieve latent factors with gd_mf_weights from a trained model May 8, 2019
@szipkin
Copy link
Contributor Author

szipkin commented May 10, 2019

This issue is from version 8.1.1, so please close if not current. I have since upgraded to 8.6.1, but have found another bug: #1871 .

@ataymano
Copy link
Member

Issue from 8.1.1. Not reproduced on 8.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants