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

Assertion failed when fitting with l2_reg_w=0 l2_reg_V=0 #33

Open
merrellb opened this issue Jan 26, 2016 · 3 comments
Open

Assertion failed when fitting with l2_reg_w=0 l2_reg_V=0 #33

merrellb opened this issue Jan 26, 2016 · 3 comments

Comments

@merrellb
Copy link

When fitting als.FMRegression with l2_reg_w=0 or l2_reg_V=0 I get the following assertion failure:

Assertion failed: (isfinite(new_V_fl) && "V not finite"), function sparse_fit, file ffm_als_mcmc.c, line 218.
Abort trap: 6

I note that older documentation actually has these as defaults but current values are 0.1. Regardless is this expected to fail? I am using pretty basic Movielens training data (ml1m)

5 1:1 11193:1
3 1:1 10661:1
3 1:1 10914:1
4 1:1 13408:1
5 1:1 12355:1
3 1:1 11197:1
5 1:1 11287:1
5 1:1 12804:1
4 1:1 10594:1
4 1:1 10919:1
5 1:1 10595:1
4 1:1 10938:1
@ibayer
Copy link
Owner

ibayer commented Jan 26, 2016

There are a few situations where this is expected. For example if you have a feature that's zero for all examples. One could add input checks for this situations or just always use some regularization (could be very small).
Maybe adding a warning that using FM without regularization is not recommenced would be sensible way to deal with this issue.
I think that regularization is (nearly) always necessary for good performance.

@merrellb
Copy link
Author

I agree it may not be a great idea but given that it seems to be failing at an assertion I wondered if it might be possible to do it more gracefully (or less cryptically). Sorting out the cause is particularly challenging given that these values are given in one of the website examples where the cause isn't as clear as tuning parameters one by one.

http://ibayer.github.io/fastFM/guide.html#how-to-choose-the-right-solver

@ibayer
Copy link
Owner

ibayer commented Jan 26, 2016

The assertion is in the C code which makes error handling quite a bit difficult. I also don't like that the assert crashes python and am open to suggestions on how to do this better (best with PR 😄 ).
Thanks for pointing out the example, this definitely needs to be fixed
#34

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

No branches or pull requests

2 participants