The framework in PySpark and the data are now complete. It is time to move on to building the neural network. Regardless of the complexity of the neural network, the development follows a similar path:
- Input data
- Add the weights and biases
- Sum the product of the data and weights
- Apply an activation function
- Evaluate the output and compare it to the desired outcome
This section will focus on setting the weights that create the input which feeds into the activation function.
A cursory understanding of the building blocks of a simple neural network is helpful in understanding this section and the rest of the chapter. Each neural network has inputs and outputs. In our case, the inputs are the height and weight of the individuals and the output is the gender. In order to get to the output, the inputs are multiplied with values (also known as weights: w1 and w2) and then a bias (b) is added to the end. This equation is known...