Open korchi opened 1 month ago
@korchi In the predict, say this is your original input sequence list: [1, 2, 3, 4, 5] and these are the item ids. If you want to compare trainer.evaluate()
and trainer.predict()
your input sequences that you feed to the model should be different.
For predict, say your target item is the last item which is 5
, then you should feed this as an input: [1, 2, 3, 4]
.
what's gonna happen the model is gonna use first four entires and predict the fifth one, and then you can compare with your ground truth item id (it is 5
) in this example:
[1, 2, 3, 4] --> [1, 2, 3, 4, predicted_item_id]
compare predicted_item_id
with the ground truth
.
Whereas, for trainer.evaluate()
you feed entire sequence [1,2,3,4,5]
and the evaluate
func will do its job and generate a predicted item id for the last item in the sequence by using the items before that.
please also see this example here.
Discussed in https://github.com/NVIDIA-Merlin/Transformers4Rec/discussions/736