similarity function.tex (2658B)
1 \begin{frame}{Similarity Function Approaches} 2 \begin{tabular}{@{}>{\hbadness=5000}m{73mm} @{\hspace{7mm}} >{\tikz[baseline={(0,-0.1)}]{\fill[black!30] (0,0.1) -- (0.75,0.1) -- (0.75,0.35) -- (1.25, 0) -- (0.75,-0.35) -- (0.75, -0.1) -- (0, -0.1) -- cycle;}\hspace{5mm}}l@{}} 3 \tikzmarknode{fewshot-c11}{% 4 \parbox{73mm}{\uhead{Megrez}\textsuperscript{\kern-2.5mm\wdent{850779}} is a star in the northern circumpolar constellation of \utail{Ursa Major}\textsuperscript{\kern-2.5mm\wdent{10460}}.}}% 5 & 6 \tikzmarknode{fewshot-c12}{\sfTripletHolds{e_1}{part of constellation}{e_2}} \\ 7 \multicolumn{2}{c}{} \\[1mm] 8 \tikzmarknode{fewshot-c21}{% 9 \parbox{73mm}{\uhead{Posidonius}\textsuperscript{\kern-2.5mm\wdent{185770}} was a Greek philosopher, astronomer, historian, mathematician, and teacher native to \utail{Apamea, Syria}\textsuperscript{\kern-2.5mm\wdent{617550}}.}}% 10 & 11 \tikzmarknode{fewshot-c22}{\sfTripletHolds{e_1}{born in}{e_2}} \\ 12 \multicolumn{2}{c}{} \\[1mm] 13 \tikzmarknode{fewshot-c31}{% 14 \parbox{73mm}{\uhead{Hipparchus}\textsuperscript{\kern-2.5mm\wdent{159905}} was born in \utail{Nicaea, Bithynia}\textsuperscript{\kern-2.5mm\wdent{739037}}, and probably died on the island of Rhodes, Greece.}}% 15 & 16 \tikzmarknode{fewshot-c32}{\sfTripletHolds{e_1}{born in}{e_2}} \\ 17 \end{tabular}% 18 \begin{tikzpicture}[ 19 remember picture, 20 overlay, 21 fsbrace/.style={decorate, decoration={brace,amplitude=5}}, 22 fsvar/.style={midway, anchor=west, xshift=1mm}, 23 ] 24 \fill[white] (fewshot-c11.north east) rectangle (fewshot-c31.south-|fewshot-c12.east); 25 \draw[fsbrace] (fewshot-c11.north east) -- (fewshot-c11.south east) node[fsvar] {\vphantom{\(x\)}\smash{\textcolor{Dark2-B}{\(x_1\)}}}; 26 \draw[fsbrace] (fewshot-c21.north east) -- (fewshot-c21.south east) node[fsvar] {\vphantom{\(x\)}\smash{\textcolor{Dark2-A}{\(x_2\)}}}; 27 \draw[fsbrace] (fewshot-c31.north east) -- (fewshot-c31.south east) node[fsvar] {\vphantom{\(x\)}\smash{\textcolor{Dark2-C}{\(x_3\)}}}; 28 29 \node[right=2cm of fewshot-c21, text width=5cm] {% 30 Learn a similarity function\\ 31 \(\operatorname{sim}\colon \dataSet\times\dataSet\to\symbb{R}\) 32 33 \bigskip 34 35 \(\operatorname{sim}(\textcolor{Dark2-B}{x_1}, \textcolor{Dark2-A}{x_2}) < \operatorname{sim}(\textcolor{Dark2-A}{x_2}, \textcolor{Dark2-C}{x_3})\)\\ 36 \(\operatorname{sim}(\textcolor{Dark2-B}{x_1}, \textcolor{Dark2-C}{x_3}) < \operatorname{sim}(\textcolor{Dark2-A}{x_2}, \textcolor{Dark2-C}{x_3})\)\\ 37 }; 38 \end{tikzpicture} 39 40 \bigskip 41 42 5~way 1~shot: given 1 query and 5 candidates, which of the candidates is most similar to the query? 43 44 Evaluated using accuracy. 45 \end{frame}