We analyse the properties of a new learning algorithm for binary perce
ptrons based on the minimization of a temperature-dependent differenti
able cost function. We show that learning at finite temperature increa
ses the stabilities of learned patterns, endowing the perceptron with
robustness, at the price of accepting a small fraction of errors in th
e learning set. If the temperature is appropriately chosen, our algori
thm approaches the optimal generalization performance for linearly sep
arable functions. Therefore, by controlling the learning temperature,
this algorithm solves the main practical problem of perceptron learnin
g, i.e. that of finding the best weights, independently of the nature
of the learning set.