jaywonchung / BERT4Rec-VAE-Pytorch

Pytorch implementation of BERT4Rec and Netflix VAE.
GNU General Public License v3.0
344 stars 82 forks source link

About padding index number #17

Open ys201810 opened 2 years ago

ys201810 commented 2 years ago

Hi!!

Thanks for great code! I have one question about padding at dataloaders/bert.py.

https://github.com/jaywonchung/BERT4Rec-VAE-Pytorch/blob/f66f2534ebfd937778c7174b5f9f216efdebe5de/dataloaders/bert.py#L112 https://github.com/jaywonchung/BERT4Rec-VAE-Pytorch/blob/f66f2534ebfd937778c7174b5f9f216efdebe5de/dataloaders/bert.py#L146

At this code, if item length is not enough, then pad using [0]. But I think, index 0 already have a Corresponding itemID, so that is padding using real itemID, right?

Thanks

ys201810 commented 1 year ago

Hi!

Thanks for your message. Exactly your way is good, or use padding_id is item length + 1. ex) padding_id = max(item_len) + 1

If mask_id use max(item_len + 1) then padding_id = max(item_len) + 2

something like that.

I really appreciated your code. Thanks!!

2023年9月1日(金) 21:49 大锤哥 @.***>:

hey,friend,though it's 2023 now,the question you propose i think the itemID start from 1. like this : skill_id = [id:i+1 for i,id in enumerate(skill_original)] Maybe during data preprocessing, when reindexing starts from 1

— Reply to this email directly, view it on GitHub https://github.com/jaywonchung/BERT4Rec-VAE-Pytorch/issues/17#issuecomment-1702694916, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMGYJSBZX5OKLLTDRD23JLXYHKUDANCNFSM5OQ6WBAQ . You are receiving this because you authored the thread.Message ID: @.***>