Why is the perceptron criterion function differentiable?
$\max(-y_i(w x_i), 0)$ is not partial derivable respect $w$ if $w x_i=0$.
Loss functions are problematic when not derivable in some point, but even more when they are flat (constant) in some interval of the weights.
Assume $y_i = 1$ and $w x_i &lt; 0$ (that is, an error of type &quot;false negative&quot;).
In this case, function $[y_i - \text{sign}(w x_i)]^2 = 4$. Derivative on all interval $w x_i &lt; 0$ is zero, thus, the learning algorithm has no any way to decide if it is better increase or decrease $w$.
In same case, $\max(-y_i(w x_i), 0) = - w x_i$, partial derivative is $-x_i$. The learning algorithm knows that it must increase $w$ value if $x_i&gt;0$, decrease otherwise. This is the real reason this loss function is considered more practical than previous one.
How to solve the problem at $w x_i = 0$ ? simply, if you increase $w$ and the result is an exact $0$, assign to it a very small value, $w=\epsilon$. Similar logic for remainder cases.