So far, we have built a neural network by defining a class where we define the layers and how the layers are connected with each other. In this section, we will learn about a simplified way of defining the neural network architecture using the Sequential class. We will perform the same steps as we have done in the previous sections, except that the class that was used to define the neural network architecture manually will be substituted with a Sequential class for creating a neural network architecture.
Let's code up the network for the same toy data that we have worked on in this chapter:
- Define the toy dataset:
x = [[1,2],[3,4],[5,6],[7,8]]
y = [,,,]
- Import the relevant packages and define the device we will work on: