Created
December 21, 2021 23:36
-
-
Save IlievskiV/3736fde2845ab113ac84454fe5f3c429 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.datasets import imdb | |
from keras.preprocessing import sequence | |
max_features = 20000 # vocabulary size | |
maxlen = 100 # max length of every input sequence | |
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=max_features) | |
x_train, y_train = x_train[:2500], y_train[:2500] | |
x_test, y_test = x_test[:1000], y_test[:1000] | |
x_train = sequence.pad_sequences(x_train, maxlen=maxlen) | |
x_test = sequence.pad_sequences(x_test, maxlen=maxlen) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment