\hypertarget{multi__head__attention__layer_8cpp}{}\doxysection{layers/multi\+\_\+head\+\_\+attention\+\_\+layer.cpp File Reference}
\label{multi__head__attention__layer_8cpp}\index{layers/multi\_head\_attention\_layer.cpp@{layers/multi\_head\_attention\_layer.cpp}}


This is Multi\+Head\+Attention \mbox{\hyperlink{classLayer}{Layer}} Class for Neural Network.  


{\ttfamily \#include $<$cmath$>$}\newline
{\ttfamily \#include $<$layer\+\_\+context.\+h$>$}\newline
{\ttfamily \#include $<$multi\+\_\+head\+\_\+attention\+\_\+layer.\+h$>$}\newline
{\ttfamily \#include $<$nntrainer\+\_\+error.\+h$>$}\newline
{\ttfamily \#include $<$nntrainer\+\_\+log.\+h$>$}\newline
{\ttfamily \#include $<$node\+\_\+exporter.\+h$>$}\newline
Include dependency graph for multi\+\_\+head\+\_\+attention\+\_\+layer.\+cpp\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{multi__head__attention__layer_8cpp__incl}
\end{center}
\end{figure}
\doxysubsection*{Namespaces}
\begin{DoxyCompactItemize}
\item 
 \mbox{\hyperlink{namespacenntrainer}{nntrainer}}
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{namespacenntrainer_a81330eea50f7e95d47d3c82783f0f313}{nntrainer\+::\+I\+N\+O\+U\+T\+\_\+\+I\+N\+D\+EX}} \{ \newline
\mbox{\hyperlink{namespacenntrainer_a81330eea50f7e95d47d3c82783f0f313a183d3f4e03a9f6f5743d3ef96a4024b2}{nntrainer\+::\+Q\+U\+E\+RY}} = 0, 
{\bfseries K\+EY} = 1, 
{\bfseries V\+A\+L\+UE} = 2, 
{\bfseries M\+A\+SK} = 3, 
\newline
\mbox{\hyperlink{namespacenntrainer_a81330eea50f7e95d47d3c82783f0f313a6ecceff0f738c97de873722a3648e644}{nntrainer\+::\+O\+U\+T\+P\+UT}} = 0, 
{\bfseries R\+E\+T\+U\+R\+N\+\_\+\+A\+T\+T\+E\+N\+T\+I\+O\+N\+\_\+\+W\+E\+I\+G\+HT} = 1
 \}
\item 
enum \mbox{\hyperlink{namespacenntrainer_a1b8fc8b5c9c2f9a1fd05d5af3ccebebd}{nntrainer\+::\+Attention\+Params}} \{ \newline
{\bfseries query} = 0, 
\mbox{\hyperlink{namespacenntrainer_a41fadbe61bee85682a61d2251b89f8ccaa7b575b9206729df489556c378b86544}{nntrainer\+::value}} = 1, 
{\bfseries key} = 2, 
{\bfseries weights}, 
\newline
{\bfseries query\+\_\+fc\+\_\+weight}, 
{\bfseries query\+\_\+fc\+\_\+bias}, 
{\bfseries key\+\_\+fc\+\_\+weight}, 
{\bfseries key\+\_\+fc\+\_\+bias}, 
\newline
{\bfseries value\+\_\+fc\+\_\+weight}, 
{\bfseries value\+\_\+fc\+\_\+bias}, 
{\bfseries fc\+\_\+weight}, 
{\bfseries fc\+\_\+bias}, 
\newline
{\bfseries projected\+\_\+query}, 
{\bfseries projected\+\_\+key}, 
{\bfseries projected\+\_\+value}, 
\mbox{\hyperlink{namespacenntrainer_a1b8fc8b5c9c2f9a1fd05d5af3ccebebda361a60eafdd8e3874fb871dedf20135e}{nntrainer\+::attention\+\_\+weight}}, 
\newline
{\bfseries dropout\+\_\+mask}, 
{\bfseries attention\+\_\+output}
 \}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This is Multi\+Head\+Attention \mbox{\hyperlink{classLayer}{Layer}} Class for Neural Network. 

Copyright (C) 2022 hyeonseok Lee \href{mailto:hs89.lee@samsung.com}{\texttt{ hs89.\+lee@samsung.\+com}}

\begin{DoxyDate}{Date}
08 July 2022 
\end{DoxyDate}
\begin{DoxySeeAlso}{See also}
\href{https://github.com/nnstreamer/nntrainer}{\texttt{ https\+://github.\+com/nnstreamer/nntrainer}} \href{https://arxiv.org/abs/1706.03762}{\texttt{ https\+://arxiv.\+org/abs/1706.\+03762}} 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
hyeonseok Lee \href{mailto:hs89.lee@samsung.com}{\texttt{ hs89.\+lee@samsung.\+com}} 
\end{DoxyAuthor}
\begin{DoxyRefDesc}{Bug}
\item[\mbox{\hyperlink{bug__bug000129}{Bug}}]No known bugs except for N\+YI items \end{DoxyRefDesc}
