lucidrains / h-transformer-1d

Implementation of H-Transformer-1D, Hierarchical Attention for Sequence Learning
MIT License
154 stars 21 forks source link

One simple question #10

Closed CiaoHe closed 3 years ago

CiaoHe commented 3 years ago

Hi, Phil!

One simple question, (my math is not good) https://github.com/lucidrains/h-transformer-1d/blob/7c11d036d53926495ec0917a34a1aad7261892b5/train.py#L65

why not be randint(0, self.data.size(0)-self.seq_len+1)? Since the high part should be excluded

lucidrains commented 3 years ago

@CiaoHe Hey! I believe you are right and made the change https://github.com/lucidrains/h-transformer-1d/commit/9c09a00a946ab12e0820f56ebaa21bfb8bb28fcf the extra - 1 was actually to account for fetching sequence length + 1 for being broken up into input and labels

CiaoHe commented 3 years ago

wow i see! thank you !