The algorithms are presented as in. Set up: • Let the data be denoted by x_i \in \R^D, and their corresponding labels by y_i \in \{1, 2, \dots, C\}. • The complete dataset is \{(x_i, y_i)\}_{i=1}^N. • The set of code vectors is w_j \in \R^D. • The learning rate at iteration step t is denoted by \alpha_t. • The hyperparameters w and \epsilon are used by LVQ2 and LVQ3. The original paper suggests \epsilon \in [0.1, 0.5] and w \in [0.2, 0.3].
LVQ1 Initialize several code vectors per label. Iterate until convergence criteria is reached. • Sample a datum x_i, and find out the code vector w_j, such that x_i falls within the
Voronoi cell of w_j. • If its label y_i is the same as that of w_j, then w_j \leftarrow w_j + \alpha_t(x_i - w_j), otherwise, w_j \leftarrow w_j - \alpha_t(x_i - w_j).
LVQ2 LVQ2 is the same as LVQ3, but with this sentence removed: "If w_j and w_k and x_i have the same class, then w_j \leftarrow w_j - \alpha_t(x_i - w_j) and w_k \leftarrow w_k + \alpha_t(x_i - w_k).". If w_j and w_k and x_i have the same class, then nothing happens.
LVQ3 Initialize several code vectors per label. Iterate until convergence criteria is reached. • Sample a datum x_i, and find out two code vectors w_j, w_k closest to it. • Let d_j := \|x_i - w_j\|, d_k := \|x_i - w_k\|. • If \min \left(\frac{d_j}{d_k}, \frac{d_k}{d_j}\right)>s , where s=\frac{1-w}{1+w}, then • If w_j and x_i have the same class, and w_k and x_i have different classes, then w_j \leftarrow w_j + \alpha_t(x_i - w_j) and w_k \leftarrow w_k - \alpha_t(x_i - w_k). • If w_k and x_i have the same class, and w_j and x_i have different classes, then w_j \leftarrow w_j - \alpha_t(x_i - w_j) and w_k \leftarrow w_k + \alpha_t(x_i - w_k). • If w_j and w_k and x_i have the same class, then w_j \leftarrow w_j - \epsilon\alpha_t(x_i - w_j) and w_k \leftarrow w_k + \epsilon\alpha_t(x_i - w_k). • If w_k and x_i have different classes, and w_j and x_i have different classes, then the original paper simply does not explain what happens in this case, but presumably nothing happens in this case. • Otherwise, skip. Note that condition \min \left(\frac{d_j}{d_k}, \frac{d_k}{d_j}\right)>s , where s=\frac{1-w}{1+w}, precisely means that the point x_i falls between two
Apollonian spheres. == References ==