The following code implements a simple neural network with depth = 1 (only one hidden layer).
- The sigmoid function is used as activation function.
- Weights and biases are initialized with random values.
- The network adapts to any number of features and outputs, as long as [number of outputs] < [number of feautures].
- The number of nodes in the hidden layer is calculated as the average between [number of feautures] and [number of outputs], rounded up.
The neural network is then used to predict people's genders based on weight and height.
Inspired by An Introduction to Neural Networks. This version extends the functionality to any number of features and outputs.