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

【QUES】Padding ??? #2

Open
Data-Designer opened this issue Nov 10, 2021 · 2 comments
Open

【QUES】Padding ??? #2

Data-Designer opened this issue Nov 10, 2021 · 2 comments

Comments

@Data-Designer
Copy link

Obviously, only fixed-length sequences are used here, and there is no filling operation, which limits the scope of application of this model.

@jiwidi
Copy link
Owner

jiwidi commented Nov 10, 2021

The "padding" is done while preprocessing the data. We explode the full ordered list of each user ratings into multiple subsequences. Let me illustrate:

# Example: Transform
# +---+------------+
# | id|  movie     |
# +---+------------+
# |  2|[1, 2, 3, 4]|
# +---+------------+
# Into
# +---+------+------+
# | id|  past|target|
# +---+------+------+
# |  2|[0, 0]|     1|
# |  2|[0, 1]|     2|
# |  2|[1, 2]|     3|
# |  2|[2, 3]|     4|
# +---+------+------+

We are using each movie on the sequence as a target with its subsequent past, padding with 0s if past is missing.

We reserve the latest window of the sequence 2, [2.3] ,4] as validation as is the latest known step of the user (closest to actual time).

There is no application limit of this model as you are not losing any datapoints, once you are using it for inference you can use any sequence length assuming your batch_size is 1.

@Data-Designer
Copy link
Author

Thanks a lot ! You used a third-party library in the model part to build the transformer module.. But will the transformer automatically ignore the loss value caused by padding?

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

2 participants