# AI: Taking A Peek Under The Hood. Part 2, Creating a Two-Layer Neural Network the Old-Fashioned Way

Original article was published on Artificial Intelligence on Medium # AI: Taking A Peek Under The Hood. Part 2, Creating a Two-Layer Neural Network the Old-Fashioned Way

Before diving into the new content for this part of the series, a quick recap of what was covered in Part 1 of this series follows to refresh continuing readers and provide context for new readers. As discussed, AI is just math. The mathematical algorithms powering all of the AI functions we see today are Neural Networks.

Neural Networks come in three general forms:

1. Standard Neural Networks (generally used for binary classification and point-estimation or regression-type problems).
2. Convolutional Neural Networks (generally used in image recognition).
3. Recurrent Neural Networks (generally applied to problems involving sequence data such as text and speech recognition, understanding, or prediction).

Today we will be constructing a Standard Neural Network with two layers (one hidden layer, and an output layer). The mathematics will be explained and python code will be provided. This will equip you to not only understand exactly how a Standard Neural Network works, but will also empower you to build them on your own.

To begin, let’s take a quick look at the steps involved before unpacking each step. Note we will not be covering data wrangling, cleaning, or transforming as this can vary widely between datasets and applications. That said, it is worth pointing out that standardizing your input data is important for relationship identification, as well as minimizing computing costs.

# The Steps:

1. Define the model structure (such as number of input features)
2. Initialize the model’s parameters
3. Calculate the current loss (aka “forward propagation”)
4. Calculate the current gradient (aka “backward propagation”)