Answers.Body: <p>We have 2 classes , 1 subclass for each class</p>
  
  <p><span class="math-container">\begin{equation}
      W^2=\begin{vmatrix}
  1 &amp; 0\\ 
  0 &amp; 1\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">$p_1$</span>:</p>
  
  <p><span class="math-container">\begin{equation}
      \alpha^1=compet(n^1)=compet\begin{vmatrix}
  ||w_1-p_1||\\ 
  ||w_2-p_1||\\
  \end{vmatrix} = compet\begin{vmatrix}
  ||\begin{vmatrix}
  0 &amp; 1\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  1 &amp; 1\\ 
  \end{vmatrix}^T||\\ 
  ||\begin{vmatrix}
  1 &amp; 0\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  1 &amp; 1\\ 
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  1\\ 
  1\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix})
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
     \alpha^2=W^2\cdot\alpha^1= \begin{vmatrix}
  1 &amp; 0\\ 
  0 &amp; 1\\
  \end{vmatrix}\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}=\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
      W_1(1) = W_1(0) + \alpha\cdot(p_1-W_1(0))=\begin{vmatrix}
  0\\ 
  1\\
  \end{vmatrix}+0.5\cdot(\begin{vmatrix}
  1\\ 
  1\\
  \end{vmatrix}-\begin{vmatrix}
  0\\ 
  1\\
  \end{vmatrix})=\begin{vmatrix}
  0\\ 
  1\\
  \end{vmatrix}+\begin{vmatrix}
  0.5\\ 
  0\\
  \end{vmatrix}=\begin{vmatrix}
  0.5\\ 
  1\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">$p_2$</span> :</p>
  
  <p><span class="math-container">\begin{equation}
      \alpha^1=compet(n^1)=compet\begin{vmatrix}
  ||w_1-p_2||\\ 
  ||w_2-p_2||\\
  \end{vmatrix} = compet\begin{vmatrix}
  ||\begin{vmatrix}
  0.5 &amp; 1\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  1 &amp; 2\\ 
  \end{vmatrix}^T||\\ 
  ||\begin{vmatrix}
  1 &amp; 0\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  1 &amp; 2\\ 
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  1.8027756377\\ 
  2.8284271247\\
  \end{vmatrix}) = \begin{vmatrix}
  0\\ 
  1\\
  \end{vmatrix})
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
     \alpha^2=W^2\cdot\alpha^1= \begin{vmatrix}
  1 &amp; 0\\ 
  0 &amp; 1\\
  \end{vmatrix}\begin{vmatrix}
  0\\ 
  1\\
  \end{vmatrix}=\begin{vmatrix}
  0\\ 
  1\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p>wrong class</p>
  
  <p><span class="math-container">\begin{equation}
      W_2(1) = W_2(0) - \alpha\cdot(p_2-W_2(0))=\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}-0.5\cdot(\begin{vmatrix}
  -2\\ 
  2\\
  \end{vmatrix}=\begin{vmatrix}
  2\\ 
  -1\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">$p_3$</span> :</p>
  
  <p><span class="math-container">\begin{equation}
      \alpha^1= compet\begin{vmatrix}
  ||\begin{vmatrix}
  0.5 &amp; 1\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  -2 &amp; 2\\ 
  \end{vmatrix}^T||\\ 
  ||\begin{vmatrix}
  2 &amp; -1\ 
  \end{vmatrix}^T-\begin{vmatrix}
  -2 &amp; 2\\ 
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  70\\ 
  5\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix})
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
     \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p>wrong class</p>
  
  <p><span class="math-container">\begin{equation}
      W_1(2) = W_1(1) - \alpha\cdot(p_3-W_1(1))=\begin{vmatrix}
  0.5\\ 
  0\\
  \end{vmatrix}-0.5\cdot(\begin{vmatrix}
  -2.5\\ 
  1\\
  \end{vmatrix}=\begin{vmatrix}
  1.75\\ 
  0.5\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">$p_2$</span> :</p>
  
  <p><span class="math-container">\begin{equation}
      \alpha^1=compet(n^1)= compet\begin{vmatrix}
  ||\begin{vmatrix}
  1.75 &amp; 0.5\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  -1 &amp; 2\\ 
  \end{vmatrix}^T||\\ 
  ||\begin{vmatrix}
  2 &amp; -1\ 
  \end{vmatrix}^T-\begin{vmatrix}
  -1 &amp; 2\\ 
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  3.13\\ 
  4.24\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix})
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
     \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
      W_1(3) = W_1(2) - \alpha\cdot(p_2-W_1(2))=\begin{vmatrix}
  1.75\\ 
  0.5\\
  \end{vmatrix}+0.5\cdot(\begin{vmatrix}
  -2.75\\ 
  1.5\\
  \end{vmatrix}=\begin{vmatrix}
  0.375\\ 
  1.25\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">$p_3$</span> :</p>
  
  <p><span class="math-container">\begin{equation}
      \alpha^1=compet(n^1)= compet\begin{vmatrix}
  ||\begin{vmatrix}
  0.375 &amp; 1.25\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  -2 &amp; 2\\ 
  \end{vmatrix}^T||\\ 
  ||\begin{vmatrix}
  2 &amp; -1\ 
  \end{vmatrix}^T-\begin{vmatrix}
  -2 &amp; 2\\ 
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  2.95\\ 
  5\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix})
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
     \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p>wrong class</p>
  
  <p><span class="math-container">\begin{equation}
      W_1(4) = W_1(1) - \alpha\cdot(p_3-W_1(3))=\begin{vmatrix}
  0.375\\ 
  1.25\\
  \end{vmatrix}-0.5\cdot(\begin{vmatrix}
  -2.375\\ 
  0.75\\
  \end{vmatrix}=\begin{vmatrix}
  1.5625\ 
  0.875\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p>p_1 :</p>
  
  <p><span class="math-container">\begin{equation}
      \alpha^1=compet(n^1)= compet\begin{vmatrix}
  ||\begin{vmatrix}
  1.5625 &amp; 0.875\\ 
  \end{vmatrix}^T-\begin{vmatrix}
  1 &amp; 1\\ 
  \end{vmatrix}^T||\\ 
  ||\begin{vmatrix}
  2 &amp; -1\ 
  \end{vmatrix}^T-\begin{vmatrix}
  1 &amp; 1\\ 
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  0.57\\ 
  2.23\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix})
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
     \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\ 
  0\\
  \end{vmatrix}
  \end{equation}</span></p>
  
  <p><span class="math-container">\begin{equation}
      W_1(5) = W_1(4) - \alpha\cdot(p_1-W_1(4))=\begin{vmatrix}
  1.5625\\ 
  0.875\\
  \end{vmatrix}+(\begin{vmatrix}
  -0.28125\\ 
  0.0625\\
  \end{vmatrix}=\begin{vmatrix}
  1.28125\ 
  0.9375\\
  \end{vmatrix}
  \end{equation}</span></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-16T16:41:18.440Z
Answers.LastActivityDate: 2020-04-16T16:41:18.440Z
Answers.UserDisplayName: estamos
Body: <p>How can we train a competitive layer on non-normalized vectors using LVQ technique ?</p>
  
  <p>an example is given below from Neural Network Design (2nd Edition) book</p>
  
  <p>The net input expression for LVQ networks calculates the distance between the input
  and each weight vector directly, instead of using the inner product. The result is that the
  LVQ network does not require normalized input vectors. This technique can also be
  used to allow a competitive layer to classify non-normalized vectors. Such a network is
  shown in figure below.</p>
  
  <p><a href="https://i.sstatic.net/TbqJh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TbqJh.png" alt="enter image description here"></a>
  Use this technique to train a two-neuron competitive layer on the (non-normalized)
  vectors below, using a learning rate <span class="math-container">$\alpha=0.5$</span></p>
  
  <p><span class="math-container">$p_1=\begin{bmatrix}
  1 \\
  1
  \end{bmatrix}, p_2=\begin{bmatrix}
  -1 \\
  2
  \end{bmatrix}, p_3=\begin{bmatrix}
  -2 \\
  -2
  \end{bmatrix}$</span></p>
  
  <p>Present the vectors in the following order : <span class="math-container">$p_1, p_2, p_3, p_2, p_3, p_1$</span></p>
  
  <p>Initial weights : <span class="math-container">$W_1=\begin{bmatrix}
  0 \\
  1
  \end{bmatrix}, W_2=\begin{bmatrix}
  1 \\
  o
  \end{bmatrix}$</span></p>
  
Tags: <neural-networks><machine-learning><convolutional-neural-networks>
Title: Train a competitive layer on nonnormalized vectors using LVQ technique
UserDisplayName: estamos
ThreadText: # Train a competitive layer on nonnormalized vectors using LVQ technique
  
  (Asked by: username_0 on 2019-12-16)
  
  How can we train a competitive layer on non-normalized vectors using LVQ technique ?
  
  an example is given below from Neural Network Design (2nd Edition) book
  
  The net input expression for LVQ networks calculates the distance between the input
  and each weight vector directly, instead of using the inner product. The result is that the
  LVQ network does not require normalized input vectors. This technique can also be
  used to allow a competitive layer to classify non-normalized vectors. Such a network is
  shown in figure below.
  
  [![enter image description here](https://i.sstatic.net/TbqJh.png)](https://i.sstatic.net/TbqJh.png)
  Use this technique to train a two-neuron competitive layer on the (non-normalized)
  vectors below, using a learning rate $\alpha=0.5$
  
  $p\_1=\begin{bmatrix}
  1 \\
  1
  \end{bmatrix}, p\_2=\begin{bmatrix}
  -1 \\
  2
  \end{bmatrix}, p\_3=\begin{bmatrix}
  -2 \\
  -2
  \end{bmatrix}$
  
  Present the vectors in the following order : $p\_1, p\_2, p\_3, p\_2, p\_3, p\_1$
  
  Initial weights : $W\_1=\begin{bmatrix}
  0 \\
  1
  \end{bmatrix}, W\_2=\begin{bmatrix}
  1 \\
  o
  \end{bmatrix}$
  
  **Tags:** neural-networks, machine-learning, convolutional-neural-networks
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-04-16. Score: 0 | Accepted answer
  
  We have 2 classes , 1 subclass for each class
  
  \begin{equation}
  W^2=\begin{vmatrix}
  1 & 0\\
  0 & 1\\
  \end{vmatrix}
  \end{equation}
  
  $p\_1$:
  
  \begin{equation}
  \alpha^1=compet(n^1)=compet\begin{vmatrix}
  ||w\_1-p\_1||\\
  ||w\_2-p\_1||\\
  \end{vmatrix} = compet\begin{vmatrix}
  ||\begin{vmatrix}
  0 & 1\\
  \end{vmatrix}^T-\begin{vmatrix}
  1 & 1\\
  \end{vmatrix}^T||\\
  ||\begin{vmatrix}
  1 & 0\\
  \end{vmatrix}^T-\begin{vmatrix}
  1 & 1\\
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  1\\
  1\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\
  0\\
  \end{vmatrix})
  \end{equation}
  
  \begin{equation}
  \alpha^2=W^2\cdot\alpha^1= \begin{vmatrix}
  1 & 0\\
  0 & 1\\
  \end{vmatrix}\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}=\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}
  \end{equation}
  
  \begin{equation}
  W\_1(1) = W\_1(0) + \alpha\cdot(p\_1-W\_1(0))=\begin{vmatrix}
  0\\
  1\\
  \end{vmatrix}+0.5\cdot(\begin{vmatrix}
  1\\
  1\\
  \end{vmatrix}-\begin{vmatrix}
  0\\
  1\\
  \end{vmatrix})=\begin{vmatrix}
  0\\
  1\\
  \end{vmatrix}+\begin{vmatrix}
  0.5\\
  0\\
  \end{vmatrix}=\begin{vmatrix}
  0.5\\
  1\\
  \end{vmatrix}
  \end{equation}
  
  $p\_2$ :
  
  \begin{equation}
  \alpha^1=compet(n^1)=compet\begin{vmatrix}
  ||w\_1-p\_2||\\
  ||w\_2-p\_2||\\
  \end{vmatrix} = compet\begin{vmatrix}
  ||\begin{vmatrix}
  0.5 & 1\\
  \end{vmatrix}^T-\begin{vmatrix}
  1 & 2\\
  \end{vmatrix}^T||\\
  ||\begin{vmatrix}
  1 & 0\\
  \end{vmatrix}^T-\begin{vmatrix}
  1 & 2\\
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  1.8027756377\\
  2.8284271247\\
  \end{vmatrix}) = \begin{vmatrix}
  0\\
  1\\
  \end{vmatrix})
  \end{equation}
  
  \begin{equation}
  \alpha^2=W^2\cdot\alpha^1= \begin{vmatrix}
  1 & 0\\
  0 & 1\\
  \end{vmatrix}\begin{vmatrix}
  0\\
  1\\
  \end{vmatrix}=\begin{vmatrix}
  0\\
  1\\
  \end{vmatrix}
  \end{equation}
  
  wrong class
  
  \begin{equation}
  W\_2(1) = W\_2(0) - \alpha\cdot(p\_2-W\_2(0))=\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}-0.5\cdot(\begin{vmatrix}
  -2\\
  2\\
  \end{vmatrix}=\begin{vmatrix}
  2\\
  -1\\
  \end{vmatrix}
  \end{equation}
  
  $p\_3$ :
  
  \begin{equation}
  \alpha^1= compet\begin{vmatrix}
  ||\begin{vmatrix}
  0.5 & 1\\
  \end{vmatrix}^T-\begin{vmatrix}
  -2 & 2\\
  \end{vmatrix}^T||\\
  ||\begin{vmatrix}
  2 & -1\
  \end{vmatrix}^T-\begin{vmatrix}
  -2 & 2\\
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  70\\
  5\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\
  0\\
  \end{vmatrix})
  \end{equation}
  
  \begin{equation}
  \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}
  \end{equation}
  
  wrong class
  
  \begin{equation}
  W\_1(2) = W\_1(1) - \alpha\cdot(p\_3-W\_1(1))=\begin{vmatrix}
  0.5\\
  0\\
  \end{vmatrix}-0.5\cdot(\begin{vmatrix}
  -2.5\\
  1\\
  \end{vmatrix}=\begin{vmatrix}
  1.75\\
  0.5\\
  \end{vmatrix}
  \end{equation}
  
  $p\_2$ :
  
  \begin{equation}
  \alpha^1=compet(n^1)= compet\begin{vmatrix}
  ||\begin{vmatrix}
  1.75 & 0.5\\
  \end{vmatrix}^T-\begin{vmatrix}
  -1 & 2\\
  \end{vmatrix}^T||\\
  ||\begin{vmatrix}
  2 & -1\
  \end{vmatrix}^T-\begin{vmatrix}
  -1 & 2\\
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  3.13\\
  4.24\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\
  0\\
  \end{vmatrix})
  \end{equation}
  
  \begin{equation}
  \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}
  \end{equation}
  
  \begin{equation}
  W\_1(3) = W\_1(2) - \alpha\cdot(p\_2-W\_1(2))=\begin{vmatrix}
  1.75\\
  0.5\\
  \end{vmatrix}+0.5\cdot(\begin{vmatrix}
  -2.75\\
  1.5\\
  \end{vmatrix}=\begin{vmatrix}
  0.375\\
  1.25\\
  \end{vmatrix}
  \end{equation}
  
  $p\_3$ :
  
  \begin{equation}
  \alpha^1=compet(n^1)= compet\begin{vmatrix}
  ||\begin{vmatrix}
  0.375 & 1.25\\
  \end{vmatrix}^T-\begin{vmatrix}
  -2 & 2\\
  \end{vmatrix}^T||\\
  ||\begin{vmatrix}
  2 & -1\
  \end{vmatrix}^T-\begin{vmatrix}
  -2 & 2\\
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  2.95\\
  5\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\
  0\\
  \end{vmatrix})
  \end{equation}
  
  \begin{equation}
  \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}
  \end{equation}
  
  wrong class
  
  \begin{equation}
  W\_1(4) = W\_1(1) - \alpha\cdot(p\_3-W\_1(3))=\begin{vmatrix}
  0.375\\
  1.25\\
  \end{vmatrix}-0.5\cdot(\begin{vmatrix}
  -2.375\\
  0.75\\
  \end{vmatrix}=\begin{vmatrix}
  1.5625\
  0.875\\
  \end{vmatrix}
  \end{equation}
  
  p\_1 :
  
  \begin{equation}
  \alpha^1=compet(n^1)= compet\begin{vmatrix}
  ||\begin{vmatrix}
  1.5625 & 0.875\\
  \end{vmatrix}^T-\begin{vmatrix}
  1 & 1\\
  \end{vmatrix}^T||\\
  ||\begin{vmatrix}
  2 & -1\
  \end{vmatrix}^T-\begin{vmatrix}
  1 & 1\\
  \end{vmatrix}^T||\\
  \end{vmatrix}=
  compet(\begin{vmatrix}
  0.57\\
  2.23\\
  \end{vmatrix}) = \begin{vmatrix}
  1\\
  0\\
  \end{vmatrix})
  \end{equation}
  
  \begin{equation}
  \alpha^2=W^2\cdot\alpha^1\begin{vmatrix}
  1\\
  0\\
  \end{vmatrix}
  \end{equation}
  
  \begin{equation}
  W\_1(5) = W\_1(4) - \alpha\cdot(p\_1-W\_1(4))=\begin{vmatrix}
  1.5625\\
  0.875\\
  \end{vmatrix}+(\begin{vmatrix}
  -0.28125\\
  0.0625\\
  \end{vmatrix}=\begin{vmatrix}
  1.28125\
  0.9375\\
  \end{vmatrix}
  \end{equation}
  
  
  ---
  
  