\documentclass[a4paper,twoside,openright]{report}
\usepackage[ruled,lined,linesnumbered]{algorithm2e}
\usepackage{xepersian}
\settextfont[Scale=1.15]{XB Niloofar}
\setdigitfont{XB Niloofar}
\setlatintextfont{LinLibertine}
\renewcommand*{\algorithmcfname}{الگوریتم}      % used for title
\renewcommand*{\algorithmautorefname}{الگوریتم} % used for autoref
\begin{document}
الگوریتم
\begin{algorithm}
\For{$t=T \rightarrow 1$}
{
\tcp{Output backprop}
% d_s
$ds_{t} \leftarrow \bm{1}_{y_t} - p_{t}$

% W_hy
$dW_{hy} \leftarrow dW_{hy} + ds_{t} \cdot \tp{h_{t}}$

% h_t
$dh_{t} \leftarrow dh_{t} + \tp{W_{hy}} \cdot ds_{t}$

\tcp{RNN backprop}
% W_xh 
$dW_{xh} \leftarrow dW_{xh} + \paren{\sigma'(\rnn z_{t}) \edot dh_{t}} \cdot \tp{x_{t}}$

% W_hh 
$dW_{hh} \leftarrow dW_{hh} + \paren{\sigma'(\rnn z_{t}) \edot dh_{t}} \cdot \tp{h_{t-1}}$

\tcp{Input backprop}
% x_t
$dx_{t} \leftarrow \tp{W_{xh}} \cdot \paren{\sigma'(\rnn z_{t}) \edot dh_{t}}$

% h_{t-1}
$dh_{t-1} \leftarrow \tp{W_{hh}} \cdot \paren{\sigma'(\rnn z_{t}) \edot dh_{t}}$
}
\caption{الگوریتم پس‌انتشار در طول زمان برای شبکه عصبی بازگشتی}
\end{algorithm}
\end{document}