From the course: Deep Learning: Image Recognition

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Dense layers

Dense layers - Python Tutorial

From the course: Deep Learning: Image Recognition

Start my 1-month free trial

Dense layers

- [Instructor] Now that we've loaded our data set, we're ready to create a neural network and add the first densely connected layer to it. Let's open open up 04 dense layers.py. The code to load the data set is already here. Starting on line 21 we're ready to add the code to create the neural network itself. The simplest type of neural network has an input, a densely connected layer and then an output. Let's start by creating that. First we need to create a new neural network object in Keras. To do that, we create a new sequential object. So we say model = sequential. The sequential api lets us create a neural network by adding new layers to it one at a time. It's call sequential because you add each layer in sequence and they automatically get connected together in that order. To add a new layer we just call model.add. And then we pass on the type of layer that we want to add. Let's create a dense layer object. This layer class takes on a few parameters. First, we need to tell it how…

Contents