1

The example and output is attached

         \documentclass[journal]{IEEEtran}
        \IEEEoverridecommandlockouts
      \usepackage{url}
    \usepackage{footnote}
        \usepackage{tablefootnote}
        \usepackage{amsmath,amssymb,amsfonts}
    \usepackage{diagbox}
       \usepackage{csquotes}
      \usepackage{algorithmic}
      \usepackage{graphicx}
       \usepackage{subfig}
       \usepackage[linesnumbered,ruled,vlined]{algorithm2e}
      \usepackage{hyperref}
      \usepackage{float,caption}

     \renewcommand{\arraystretch}{1.5}
     \setlength{\tabcolsep}{4pt}
         \usepackage{textcomp}
        % \usepackage{subfloat}
         \usepackage{caption}% http://ctan.org/pkg/caption
        \usepackage{xcolor}
        \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
            T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
        \providecommand{\nr}[1]{\textcolor{red}{[{\bf #1}]}}
      \newcommand{\subparagraph}{}
        \usepackage[compact]{titlesec}  

     \usepackage{soul}
     \usepackage{makecell}

     \renewcommand\theadalign{bc}
     \renewcommand\theadfont{\bfseries}
     \renewcommand\theadgape{\Gape[4pt]}
          \renewcommand\cellgape{\Gape[4pt]}


         \begin{document}     


     \begin{algorithm}
       \textbf{Given}: A    \\
     \KwIn{B} \\
         \textbf{Output}: C \\
       \textbf{Initialization}: D  \\
      \Repeat {(t=M)}{% 
        \textbf{\ul{Training $IP_{o}N$}} \\
       \For{$i=1$:$T$}  \\
       \State{Update $\hat{f_{c}}$ using Eq~\eqref{eq:3}}\\

              \For{$f_{c}$= $\hat{f_{c}^t}$} \\
             \State{Y}} \\


      \Repeat {(t=M)}{% 
        \textbf{\ul{Training $IP_{o}N$}} \\
           \For{$i=1$:$T$}  \\
              \For{$\phi_{2}$= $\hat{\phi_{2}^t}$} \\
              \State{X} \\
             \End
          \End
     }
       $\hat{\phi_{1}}$ \leftarrow $\phi_{1}^t$, $\hat{\phi_{2}}$ \leftarrow $\phi_{2}^t$ and 
        $\hat{f_{c}}$ \leftarrow $f_{c}^t$ \\
      % Output Reconstructed Image $\hat{f}(x,y)$ \\
      \caption{FF}
      \label{algo:algorithm}
          \end{algorithm}
\end{document}

enter image description here

1 Answer 1

2

Something like that?

\documentclass[journal]{IEEEtran}

\IEEEoverridecommandlockouts

\usepackage{url}
\usepackage{footnote}
\usepackage{tablefootnote}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{diagbox}
\usepackage{csquotes}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}

\usepackage{float}

\renewcommand{\arraystretch}{1.5}
\setlength{\tabcolsep}{4pt}
\usepackage{textcomp}

\usepackage{caption}% http://ctan.org/pkg/caption
\usepackage{xcolor}
        \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
            T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
        \providecommand{\nr}[1]{\textcolor{red}{[{\bf #1}]}}
      \newcommand{\subparagraph}{}
\usepackage[compact]{titlesec}  

\usepackage{soul}
\usepackage{makecell}

\usepackage{hyperref} % <=========== last package to be called here

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}


\begin{document}     

\begin{algorithm}
  \textbf{Given}: A    \\
  \KwIn{B} 
  \textbf{Output}: C \\
  \textbf{Initialization}: D  \\
  \Repeat {(t=M)}{% 
    \textbf{\ul{Training $IP_{o}N$}} \\
    \For{$i=1$:$T$}{  
      \textbf{Update $\hat{f_{c}}$ using Eq~\eqref{eq:3}}\\
      \For{$f_{c}$= $\hat{f_{c}^t}$}{ 
        \textbf{Y}
      }
    }
  } 

  \Repeat {(t=M)}{% 
    \textbf{\ul{Training $IP_{o}N$}} \\
    \For{$i=1$:$T$}{  
        \For{$\phi_{2}$= $\hat{\phi_{2}^t}$}{ 
          \textbf{X} 
        }
    }
  }
  $\hat{\phi_{1}} \leftarrow \phi_{1}^t$, $\hat{\phi_{2}} \leftarrow \phi_{2}^t$ and 
  $\hat{f_{c}} \leftarrow f_{c}^t$ \\
      % Output Reconstructed Image $\hat{f}(x,y)$ \\
  \caption{FF}
  \label{algo:algorithm}
\end{algorithm}
\end{document}

with its result

resulting pdf

3
  • Yes, expected somewhat different pattern of looping, but it is also nice.Thanks Commented Jun 5, 2020 at 13:41
  • Sir, pls also help me to remove numbering up to "repeat" line, i.e. line 4 Commented Jun 5, 2020 at 14:20
  • How to hide numbering from line 1, 2, 3 and 4 Commented Jun 5, 2020 at 15:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.