شاید یک راه حل، ایجاد محیطی شبیه به محیط algorithm باشد. برای این کار می توانید از دستور newenvironment استفاده کنید. البته در نظر داشته باشید که در این صورت برای استفاده از دستور listofalgorithms نیاز به اضافه نمودن یک دستور addcontentsline در زمان اضافه نمودن الگوریتم خود دارید.
کد:
\documentclass[review]{elsarticle}
\usepackage{lineno,hyperref}
\usepackage{amsmath}
%\usepackage{algorithm2e}
%\usepackage{algorithmic}
\usepackage{algorithm}
%\usepackage{algcompatible}
%\usepackage{algorithmicx}
\usepackage[noend]{algpseudocode}
%\makeatletter
%\def\BState{\State\hskip-\ALG@thistlm}
%\makeatother
\modulolinenumbers[5]
\journal{Journal of \LaTeX\ Templates}
\bibliographystyle{elsarticle-num}
%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{noindentafter}
\newcounter{myAlgorithm}%[section]
\setcounter{myAlgorithm}{0}
\newenvironment{myAlgorithm}[1]{
\refstepcounter{myAlgorithm}
{\bigskip\par}\hrule\vspace*{1mm}\noindent\textbf{Algorithm \themyAlgorithm{.}}\textrm{#1}
\vspace*{1mm}\hrule\vspace*{3mm}
}{\par\hrule\bigskip}
\NoIndentAfterEnv{qd}
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\listofalgorithms
%
\begin{myAlgorithm}{ Inference algorithm for GBML model}
\label{alg:MAP-search}
\addcontentsline{loa}{algorithm}{{\bf Algorithm \ref{alg:MAP-search}.} {\rm Inference algorithm for GBML model}}
\begin{algorithmic}[1]
\floatname{algorithm}{Procedure}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\Require
Data matrix $X$, fuzzifier$m$, Dirichlet parameter$\alpha$, number of clusters $S$;
Gamma hyperparameters $a$ and $b$, number of sampling iterations ${N_{iter}}$;
\Ensure
MAP estimates for membership values ${U^*}$, cluster centers ${C^*}$ and transformation matrix ${L^*}$;
\State initialize hyperparameters ${a^*}$,${b^*}$,$\alpha $ and set ${{\mu _x}}$, ${{\Sigma _x}}$ according to (\ref{equ_mu}) and (\ref{equ_sigma});
\State sample initial ${u_n} \sim Dirichlet(\alpha = {1_S})$ for all $n = \{ 1,...,N\} $;
\State sample initial ${c_s} \sim N({\mu _x},{\Sigma _x})$ for all $s = \{ 1,...,S\} $;
\State sample initial $L = {I_p}$;
\State set MAP samples to current states $u_n^* \leftarrow {u_n}$,$c_s^* \leftarrow {c_s}$,${L_k^*} \leftarrow {L_k}$ for all $n = \{ 1,...,N\} $ , $s = \{ 1,...,S\} $ , $k = \{ 1,...,p\} $
\For{$iter = 1...{N_{iter}}$}
\State /* Sample $U \sim p(U|X,C,L) \propto p(X,C,U,L)$ */
\For{$n = \{ 1,...,N\} $}
\State sample proposed new membership vector $u_n^t$ from ()
\State accept (${u_n} \leftarrow u_n^t$) proposal with probability ${a_u}$ from ()
\If{$p({x_n},u_n^t|{C^*},{L^*}) > p({x_n},u_n^*|{C^*},{L^*})$ using ()}
\State $u_n^* \leftarrow u_n^t$
\EndIf
\EndFor
\State /* Sample $C \sim p(C|X,U,L) \propto p(X,C,U,L)$ */
\For{$s = \{ 1,...,S\} $}
\State sample proposed new cluster center $c_s^t$ from ()
\State accept proposal (${c_s} \leftarrow c_s^t$) with probability ${a_c}$ from ()
\If{$p(X,c_s^t|{U^*},{L^*}) > p(X,c_s^*|{U^*},{L^*})$ using ()}
\State $c_s^* \leftarrow c_s^t$
\EndIf
\EndFor
\State /* Sample $L \sim p(L|X,C,U) \propto p(X,C,U,L)$ */
\For{$k = \{ 1,...,p\} $}
\State sample proposed new cluster center $L_k^t$ from ()
\For{$q = \{ 1,...,p\} $}
\If{$q = = k$}
{$L_q^t = L_k^t$}
\EndIf
\EndFor
\State accept proposal (${L_k} \leftarrow L_k^t$) with probability ${a_L}$ from ()
\If{$p(X,L^t|{C^*},{U^*}) > p(X,L^*|{C^*},{U^*})$ using ()}
\State $L_k^* \leftarrow L_k^t$
\EndIf
\EndFor
\EndFor
\State /* check full sample for new maximum likelihood */
\If{$p(X,C,U,L) > p(X,{C^*},{U^*},{L^*})$ using ()}
\State ${U^*} \leftarrow U$
\State ${C^*} \leftarrow C$
\State ${L^*} \leftarrow L$
\EndIf
\end{algorithmic}
\end{myAlgorithm}
You can even refer to Algorithm \ref{alg:MAP-search}.
\end{document}
قسمت هایی از خروجی:
موفق و پیروز باشید.