datahacker.rs@gmail.com

# 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 data set, then we will split it into training 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 one with $$4$$ hidden layers and the second with $$6$$ units.

Now, we will 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.