Closed jxrloveyou closed 2 years ago
caption_idx = caption_data.caption caption_idx, caption_idx_y = caption_idx[:, :-1], caption_idx[:, 1:] Excuse me, why do you want to remove the first token and the last token in the second line?
caption_idx = caption_data.caption caption_idx, caption_idx_y = caption_idx[:, :-1], caption_idx[:, 1:]
Hi, it is to create targets. We want our model to predict the next token in the sequence:
sequence: start,1,2,3,4,5,end Target (y): 1,2,3,4,5,end Input: start,1,2,3,4,5
caption_idx = caption_data.caption caption_idx, caption_idx_y = caption_idx[:, :-1], caption_idx[:, 1:]
Excuse me, why do you want to remove the first token and the last token in the second line?