The magic of neural networks lies in their ability to learn from experience. This learning process, called training, involves several key concepts:
Weights and Biases
Each connection between nodes has an associated weight that determines the strength of that connection. Biases are additional parameters that allow the network to shift its activation function. Together, weights and biases are the learnable parameters that the network adjusts during training.
Forward Propagation
During forward propagation, input data flows through the network from the input layer to the output layer. At each node, the incoming signals are multiplied by their respective weights, summed together with a bias term, and passed through an activation function to produce an output.
Activation Functions
Activation functions introduce non-linearity into the network, enabling it to learn complex patterns. Common activation functions include:
- ReLU (Rectified Linear Unit): The most popular activation function in modern deep learning
- Sigmoid: Maps inputs to a range between 0 and 1
- Tanh: Similar to sigmoid but ranges from -1 to 1
- Softmax: Used in the output layer for multi-class classification problems
Backpropagation and Gradient Descent
When the network makes a prediction, a loss function measures how far off the prediction is from the actual target value. Through a process called backpropagation, the network calculates gradients that indicate how to adjust each weight and bias to reduce the error. Gradient descent optimization algorithms then update these parameters iteratively, gradually improving the network's performance.