The weights (\(W\) ) of the network are the parameters of the mapping function (called \(G\) ), that reduces the dimensionality by mapping two feature vectors \(\vec{X}_{1}\)  and \(\vec{X}_{2}\)  into \(G_W(\vec{X}_{1})\)  and \(G_W(\vec{X}_{2})\)  and computing the distance measure \(D_W(\vec{X}_{1},\vec{X}_{2})\) , i.e., \(D_W(\vec{X}_{1},\vec{X}_{2}) = || G_W(\vec{X}_{1}) - G_W(\vec{X}_{2}) ||\) .
For simplicity \(D_W(\vec{X}_{1},\vec{X}_{2})\)  is denoted \(D_W\)  and the final loss function [1]} is defined as
\(\leavevmode \xbox {resizebox}{\XMLaddatt {width}{0.0pt} L(W,Y,\vec{X}_{1},\vec{X}_{2}) = \frac{(1-Y)(D_W)^2 + Y\lbrace \max (0,m-D_W)\rbrace ^2}{2}}\) 
