Discussion of article "Multilayer perceptron and backpropagation algorithm"

 

New article Multilayer perceptron and backpropagation algorithm has been published:

The popularity of these two methods grows, so a lot of libraries have been developed in Matlab, R, Python, C++ and others, which receive a training set as input and automatically create an appropriate network for the problem. Let us try to understand how the basic neural network type works (including single-neuron perceptron and multilayer perceptron). We will consider an exciting algorithm which is responsible for network training - gradient descent and backpropagation. Existing complex models are often based on such simple network models.

Gradient descent is the process of minimizing a function in the direction of the gradients of the cost function.

This implies knowing the cost form, as well as the derivative, so that we can know the gradient from a certain point and can move in this direction, for example, downwards, towards the minimum value.


In machine learning, we can use a technique that evaluates and updates the weights for each iteration, called Stochastic Gradient Descent. Its purpose is to minimize a model error in our training data.

The idea of this algorithm is that each training instance is shown to the model one at a time. The model creates a forecast for the training instance. Then an error is calculated and the model is updated to reduce the error in the next forecast.

This procedure can be used to find a set of model weights which produce the lowest error.

Author: Jonathan Pereira

 
Awesome
 
Superb... long ago I developed a pattern recognition algorithm based on statistical maths in some crude way... this ideas have revitalized and it is now much more accurate than ever. Thank you so much!
 

Please explain the seed() function and its usage on the code, since I could not find on the code where it is being used.. (except being used inside OnStart() function, but it can be commented there, without any problem nor failures at all)

Although, if I change the seed number from 42 to anything else, a lot of thing on the training and results get different. 


How does:  commenting seed() function at all does not affect results, but changing its initial value affects all the results?


For sure I am missing some point here, since I could not understand those relations and its effects on the results. Is there something special with the number "42"  ?


Thanks in advance

 
rrocchi:

......

The use of the seed is for the generation of pseudo-random numbers, so its use is only to make the results reproducible. The generation of the sample depends on a random number generator that is controlled by a seed. Each time the command (rand (), MathRand ()) is called different elements of the sample are produced, because the seed of the generator is automatically modified by the function. In general, the user does not have to worry about this mechanism. But if necessary, the _RandomSeed function can be used to control the behavior of the random number generator. This function defines the current state of the seed that is changed with each subsequent generation of random numbers. So to generate two identical samples, just use a number to define the seed.


The use of the number 42 is a joke that occurs because the number 42 is the atomic mass of calcium, 42 is primary number, a pseudo-perfect and is also the top score in the mathematics Olympics, If we fold a sheet of A4 paper in half and fold again 42 times, with the added measures it would be possible to reach the moon (at least that's what they say, kkkkk), Cambridge astronomers found that 42 is the value of an essential scientific constant - one that determines the age of the universe. And the coolest part, in 1979 Douglas Adams, author of "The Hitch Hiker’s Guide to the Galaxy", describes how an alien race programs a computer called Deep Thought to provide the definitive answer to "Life, Universe and Everything". After seven and a half million complex equations and difficult calculations, he returned the answer - 42, but why 42? Douglas Adams once explained where this number came from:

"The answer is very simple. It was a joke. It had to be a number, an ordinary one, small and I chose this one. Binary representations, base 13, Tibetan monkeys are totally meaningless. I sat at my table, looked at the garden and thought “42 will work” and wrote. History end."


These and other games around the number 42 makes it recurrently chosen when we are going to set a value for seed, but in fact it can be any number.

 
Thanks Jonathan, Awesome article