美文网首页
Latex 写伪代码

Latex 写伪代码

作者: 乘瓠散人 | 来源:发表于2021-11-18 20:20 被阅读0次
    \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

    相关文章

      网友评论

          本文标题:Latex 写伪代码

          本文链接:https://www.haomeiwen.com/subject/hhjjtrtx.html