Buffl

Neural Networks

LT
von Lukas T.

How does a neural Network learn?

How Does a Neural Network Learn?

The learning process consists of adjusting the weights and biases so that the accuracy of predictions improves over time.

  1. Initializing Weights Randomly

    • The initial weights and biases are randomly assigned.

    • This leads to poor initial predictions, but the network improves through training.

  2. Computing the Cost Function

    • The error (or "badness") of the predictions is measured using a cost function (also called a loss function).

    • The higher the value of the cost function, the worse the predictions.

  3. Backpropagation (Using the Chain Rule of Calculus)

    • To improve predictions, we need to adjust the weights so that the cost function decreases.

    • This requires calculating gradients (partial derivatives of the cost function with respect to each weight).

    • The chain rule of calculus is used to propagate these gradients backward through the network.

    Gradients provide two key pieces of information:

    • Direction – Whether a weight should be increased or decreased to reduce the cost.

    • Magnitude – How much changing the weight will affect the final output.

  4. Gradient Descent Optimization

    • Once gradients are computed, they are used in the gradient descent algorithm to update the weights.

    • The update formula is:

  • where η is the learning rate.

  1. Learning Rate and Optimization

    • The learning rate determines how big each update step is:

      • A large learning rate speeds up learning but can cause overshooting.

      • A small learning rate is slower but more precise.

  2. Iterating the Process

    • The entire process (computing the cost, calculating gradients, and updating weights) is repeated for multiple iterations (epochs).

    • Over time, the neural network gradually finds better weights and biases, improving accuracy.


Author

Lukas T.

Informationen

Zuletzt geändert