I experimented a little bit with different Perceptron implementations and want to make sure if I understand the "iterations" correctly.
Rosenblatt's original perceptron rule
As far as I understand, in Rosenblatt's classic perceptron algorithm, the weights are simultaneously updated after every training example via
$\Delta{w}^{(t+1)} = \Delta{w}^{(t)} + \eta(target - actual)x_i$
where $eta$ is the learning rule here. And target and actual are both thresholded (-1 or 1). I implemented it as 1 iteration = 1 pass over the training sample, but the weight vector is updated after each training sample.
And I calculate the "actual" value as
$ sign ({\pmb{w}^T\pmb{x}}) = sign( w_0 + w_1 x_1 + ... + w_d x_d)$
Stochastic gradient descent
$\Delta{w}^{(t+1)} = \Delta{w}^{(t)} + \eta(target - actual)x_i$
Same as the perceptron rule, however, target
and actual
are not thresholded but real values. Also, I count "iteration" as path over the training sample.
Both, SGD and the classic perceptron rule converge in this linearly separable case, however, I am having troubles with the gradient descent implementation.
Gradient Descent
Here, I go over the training sample and sum up the weight changes for 1 pass over the training sample and updated the weights thereafter, e.g,
for each training sample:
$\Delta{w_{new}} \mathrel{{+}{=}} \Delta{w}^{(t)} + \eta(target - actual)x_i$
...
after 1 pass over the training set:
$\Delta{w} \mathrel{{+}{=}} \Delta{w_{new}}$
I am wondering, if this assumption is correct or if I am missing something. I tried various (up to infinitely small) learning rates but never could get it to show any sign of convergence. So, I am wondering if I misunderstood sth. here.
Thanks, Sebastian