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

The iterative batch generation code is so strange to me in Chapter 6 04_arxiv preprocessing.py. #13

Open
jeffacode opened this issue Nov 2, 2016 · 0 comments

Comments

@jeffacode
Copy link

jeffacode commented Nov 2, 2016

First, for i in range(0, len(text) - self.length + 1, self.max_length // 2):. I'm sorry, but what if len(text) is actually smaller than self.length(I assume it's the max_length)? And Why would I need to do this process?

Second, assert all(len(x) == len(windows[0]) for x in windows). Why do I need to make every text the same length?

Next, the following while True. Isn't it going to loop infinitely?

Last, batch = windows[i: i + self.batch_size]. I don't think last batch generated will be the same size as previous ones in first dimension.

Hope someone could answer my questions:)

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

1 participant