# Perceptron learning rate

Today I've seen many Perceptron implementations with learning rates. According to Wikipedia:

there is no need for a learning rate in the perceptron algorithm. This is because multiplying the update by any constant simply rescales the weights but never changes the sign of the prediction

Is there some benefit to implementing a learning rate with Perceptron? If there is not, why do so many implementations have it?

I agree with Dawny33, choosing learning rate only scales w.

While training of Perceptron we are trying to determine minima and choosing of learning rate helps us determine how fast we can reach that minima. If we choose larger value of learning rate then we might overshoot that minima and smaller values of learning rate might take long time for convergence.

It is okay in case of Perceptron to neglect learning rate because Perceptron algorithm guarantees to find a solution (if one exists) in an upperbound number of steps, in other implementations it is not the case so learning rate becomes a necessity in them.

It might be useful in Perceptron algorithm to have learning rate but it's not a necessity.

With regard to the single-layered perceptron (e.g. as described in wikipedia), for every initial weights vector $w_0$ and training rate $\eta>0$, you could instead choose $w_0'=\frac{w_0}{\eta}$ and $\eta'=1$.

For the same training set, training a perceptron with $w_0,\eta$ would be identical to training with $w_0',\eta'$, in the sense that:

• Both perceptrons would make exactly the same mistakes.
• After every mistake, each perceptron would update $w$ such that it would define the same hyperplane as the other perceptron.
• Both perceptrons would make the same amount of mistakes until convergence.

(For a partial proof and code example, see here.)

Thus, in case $w_0=0$, the learning rate doesn't matter at all, and in case $w_0\not=0$, the learning rate also doesn't matter, except that it determines where the perceptron starts looking for an appropriate $w$.

So although tuning the learning rate might help to speed up the convergence in many other learning algorithms, it doesn't help in the case of the simple version of single-layered perceptron.

The choice of learning rate m does not matter because it just changes the scaling of w.

I agree that it is just the scaling of w which is done by the learning rate.

Having said that, as I have explained in this answer, the magnitude of learning rate does play a part in the accuracy of the perceptron.

• Perceptron does not minimize any objective function. So, what do you mean by accuracy here? – AlwaysLearning Nov 21 '19 at 11:31

Some of the answers on this page are misleading. In the perceptron algorithm, the weight vector is a linear combination of the examples on which an error was made, and if you have a constant learning rate, the magnitude of the learning rate simply scales the length of the weight vector. The decision boundary depends on the direction of the weight vector, not the magnitude, so assuming you feed examples into the algorithm in the same order (and you have a positive learning rate) you will obtain the same exact decision boundary regardless of the learning rate.

The talk of "overshooting the minima" does not apply here, because there are an infinite number of weight vectors with different magnitudes which are all equivalent, and therefore an infinite number of minima. The whole beauty of the perceptron algorithm is its simplicity, which makes it less sensitive to hyperparameters like learning rate than, for instance, neural networks. The answer above citing an infinite learning rate is more of an edge case than an informative example - any machine learning algorithm will break if you start setting things to infinity.

That being said, it was recently pointed out to me that more complex implementations of learning rates, such as AdaGrad (which maintains a separate learning rate for each feature) can indeed speed up convergence.

Long story short, unless you are using something significantly more complex than a single constant learning rate for your perceptron, trying to tune the learning rate will not be useful.

To clarify (for people like myself who are learning from scratch and need basic explanations), what Wikipedia means (if you look through the source) is that the learning rate does not affect eventual convergence, assuming the learning rate is between 0 and 1. A learning rate too large (example: consider an infinite learning rate where the weight vector immediately becomes the training case) can fail to converge to a solution.

The learning rate can, however, affect the speed at which you reach convergence (as mentioned in the other answers).

• Please provide a source about how the perceptron can fail to converge if the learning rate is too large. I personally know that a positive learning rate is sufficient for it to converge. – MattSt Mar 9 '18 at 17:29
• Matt, one source off the top of my head is the Google Developer Machine Learning Crash Course. They have a nice sandbox set of exercises that let you visualize the impact of the learning rate; I found it very helpful in understanding. – Silent Zebra Sep 20 '18 at 23:49