Today’s post will be about backpropagation in neural networks. I will explain what backpropagation is, provide an example problem (from „StatQuest” , very good yt canel ), a diagram, and conclude with a Python program that solves this problem.

We help medical experts in determining the dosage of medication. We have received data collected from volunteers. We have discovered the following property: if the medication is administered in too small dosage, it won’t be effective. Likewise, if it’s given in too large dosage, it won’t work as expected too. Only the specific amount works properly.

Backpropagation is an algorithm using in Neural Networks. It „searching” for optimal values of wages and biases. The final result of backpropagation is the best possible understanding of given training dataset to predicting in future on the new input dataset. If Output of NN(Neural Network) good predicting values we can say that our NN is trained .

The range of dosages is : 0 for no dosage and 1 for the biggest dosage. We have 3 examples from volunteers.

Diagram:

Green color : the values are optimal for this dataset (it should also to be calculated by backpropagation – we already have those optimal values from somewhere to simplify code writing.

Red color : the values are randomly selected from Standard Normal Distribution. We want to train the weight3, weight4 and b_3 (bias). If we do this our NN will be good at predicting the effect of new Dosages.

All mathematical relationships appearing in the code can be understood by watching the „StatQuest” episode that explains these dependencies used in the code.

Wróć

Twoja wiadomość została wysłana

Ostrzeżenie

Uwaga!

My code:

And the functions:

The video of process of learning is available on my tweeter. See to check. Or get this code and check from git 🙂

In summary, the visualization shows the process of training a neural network. In each iteration, the matched function is updated because the weights (weight1, weight2, b_3) are changing. We put to mathematical operations and the updating of values.

For better experience check the video of „StatQuest”. There is very good explanation.

Thank you for spending a moment here.

Dodaj komentarz

Trendy