October 2017
Intermediate to advanced
330 pages
7h 7m
English
import numpy as npfrom keras.preprocessing import sequencefrom keras.models import Sequentialfrom keras.layers import Dense, Dropout, Activation, Embedding, LSTM, Bidirectionalfrom keras.callbacks import EarlyStoppingfrom keras.datasets import imdb
n_words = 1000(X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=n_words)print('Train seq: {}'.format(len(X_train)))print('Test seq: {}'.format(len(X_train)))
print('Train example: \n{}'.format(X_train[0]))print('\nTest example: \n{}'.format(X_test[0]))# Note: the ...Read now
Unlock full access