Skip to Content
Neural Network Projects with Python
book

Neural Network Projects with Python

by James Loy
February 2019
Beginner to intermediate
308 pages
7h 42m
English
Packt Publishing
Content preview from Neural Network Projects with Python

Putting it all together

We have covered a lot in this chapter. Let's consolidate all our code here:

from keras.datasets import imdbfrom keras.preprocessing import sequencefrom keras.models import Sequentialfrom keras.layers import Embeddingfrom keras.layers import Dense, Embeddingfrom keras.layers import LSTMfrom matplotlib import pyplot as pltfrom sklearn.metrics import confusion_matriximport seaborn as sns# Import IMDB datasettraining_set, testing_set = imdb.load_data(num_words = 10000)X_train, y_train = training_setX_test, y_test = testing_setprint("Number of training samples = {}".format(X_train.shape[0]))print("Number of testing samples = {}".format(X_test.shape[0]))# Zero-PaddingX_train_padded = sequence.pad_sequences(X_train, maxlen= ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning with Python Cookbook

Machine Learning with Python Cookbook

Chris Albon

Publisher Resources

ISBN: 9781789138900Supplemental Content