Keras deep neural network model

After exploring the dataset, it's time to build the deep neural network (DNN) model to labeling newswire from data recorded in the dataset. To build a model, we'll use the Keras Sequential model. Let's start importing the libraries:

from keras.models import Sequentialfrom keras.layers import Densefrom keras.layers import Dropoutfrom keras.layers import Activation

Four layer classes have been imported: Sequential, Dense, Dropout, and Activation. The sequential class is used to define a linear stack of network layers that make up a model. In the following, we'll use the Sequential constructor to create the model, which will then be enriched with layers using the add() method. The Dense class is used to instantiate ...

Get Keras 2.x Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.