From the course: Artificial Intelligence Foundations: Neural Networks

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Train the neural network using Keras

Train the neural network using Keras

- [Instructor] Since we will be using the Keras Sequential model, we merely need to describe the layers and sequence. model equal Sequential means that we will store our model in the variable model, and we'll describe it sequentially layer by layer in between the square brackets. Our first layer is a Dense layer with four neurons and relu activation. Defining the input shape or the number of inputs is optional, so we did not add it. Recall that Dense refers to a fully connected layer. The second layer is a Dense hidden layer with three neurons and relu activation. Note that we do not have to describe the input shape since Keras can infer from the output of our first layer. The third layer is a Dense output layer with one neuron, linear activation. And that's it. The model architecture is built. So now that we've built the model architecture, we need to configure the model by adding an optimization algorithm. Here, we…

Contents