\usepackage[ruled,linesnumbered]{algorithm2e}
\begin{algorithm}
\caption{pseudocode}\label{pseudocode}
\SetKwInOut{Input}{input}\SetKwInOut{Output}{output}
\Input{input data}
\Output{output, if return none, this line can be ignored}
a=1\;
\Repeat{Stop condition satisfied}{
\For{$x_{batch}^s \in X_s,x_{batch}^t \in X_t$}{
\eIf{understand}{
a = 2\;
a = 3\;
}{
a = 4\;
}
\If{a=1}{
a = 0\;
}
\uIf{condition1}{
something if \;
}
\uElseIf{condition2}{
something elseif \;
}
\uElseIf{condition3}{
something elseif \;
}
\Else{
something else \;
}
}
}
\end{algorithm}
常用的循环,条件都包括了。