# K An implementation of a Shallow Neural Network in Keras – Moons dataset

# K An implementation of a Shallow Neural Network in Keras – Moons dataset

In this post we will learn how to make classification of Moons dataset with a shallow neural network implemented in Keras. With the following code we are going to import all libraries that we will need.

First, we will generate a random dataset, then we will split it into train and test set. We will also print dimensions of these datasets.

With the following code we will make a shallow neural network. Our shallow neural network will have two hidden layers, the first layers with \( 6\) hidden units and the second layer with just \(1\) units hidden.

Now, let’s train our neural network.

Here we will print some results we go.

Let’s see how loss and accuracy of prediction change over epochs.

Now, we will print values of weights and biases that we got after training process.

Let’s now see what are the calculations behind every node of our neural network.

In the next post we will learn how to perform classification using a shallow neural network on Spiral dataset using Keras.

More resources on the topic:

Leave a Reply

Your email address will not be published. Required fields are marked *