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

Setting a type into the zeros matrix #12

Open
ayrtondenner opened this issue Jun 27, 2018 · 0 comments
Open

Setting a type into the zeros matrix #12

ayrtondenner opened this issue Jun 27, 2018 · 0 comments

Comments

@ayrtondenner
Copy link

I am trying to run the network using the "Amazon Review Polarity" database, but Python can't manage to create a cubic matrix having (400000, 1014, 69) dimensions, as it throws a MemoryError in this case. But only when I changed it from np.zeros((len(x), maxlen, vocab_size)) to np.zeros((len(x), maxlen, vocab_size), dtype=np.uint8) Python managed to create the cubic matrix, although it used more than 20 GB though.

Taking the fact that the matrix is a one-hot encoding representation, it only needs 0s and 1s and not float numbers (as it was being created before), can I safely assure that it will work correctly? I mean, I just changed the type from float to a smaller int, am I missing something?

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