\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\begin{document}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\begin{algorithm}[t]
\caption{算法名称}
\label{algo}
\begin{algorithmic}[1]
\Require an input sentence $x=(a_1, a_2, ..., a_n)$ with $n$ words; a pre-trained DNN $f$;
\Ensure blabla
\State inital xxx
%\State initialize the set of current candidate nodes $\Omega=\{a_1, a_2, ..., a_n\}$, \emph{i.e.} each input word as a leaf node;
\For{t=1 $\to$ n-1}
%\State{Compute the Shapley value of each node in $\Omega$}
\State{$m \gets$ |$\Omega$|}
\EndFor
\end{algorithmic}
\end{algorithm}
\end{document}
image.png
参考
http://hustsxh.is-programmer.com/posts/38801.html
https://www.jianshu.com/p/0086da1b9ad0
网友评论