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

Clarification on embedding input dimension for Recommender system #30

Open
carlrgb opened this issue Apr 26, 2020 · 0 comments
Open

Clarification on embedding input dimension for Recommender system #30

carlrgb opened this issue Apr 26, 2020 · 0 comments

Comments

@carlrgb
Copy link

carlrgb commented Apr 26, 2020

Dear Olivier,

Thank you for the lab tutorial on recommender system, it was really helpful.

While going through and study your lab tutorial on Explicit Feedback Neural Recommender System : https://github.com/m2dsupsdlclass/lectures-labs/blob/master/labs/03_neural_recsys/Explicit_Feedback_Neural_Recommender_System_rendered.ipynb

I would like to check with you whether there is a mistake on the code below :

self.user_embedding = Embedding(output_dim=embedding_size,
input_dim=max_user_id + 1,
input_length=1,
name='user_embedding')
self.item_embedding = Embedding(output_dim=embedding_size,
input_dim=max_item_id + 1,
input_length=1,
name='item_embedding')

Should the input_dim be max_user_id (instead of max_user_id+1) since the dataset is only start from 1 to 943 , ie there are total of 943 user in the dataset hence there is no need to + 1 ?

min_user_id = all_ratings['user_id'].min()
min_user_id
Out[7]:
1

max_user_id = all_ratings['user_id'].max()
max_user_id
Out[8]:
943

The same applies to the item_embedding as well.

Look forward to your reply.

Thanks

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

No branches or pull requests

1 participant