TeX - LaTeX Asked on September 10, 2020
I am using algorithm2e
to try and write an algorithm with an equation. So far we’re looking at
title{AlgorithmTemplate}
documentclass[12pt]{article}
usepackage{fullpage}
usepackage{times}
usepackage{fancyhdr,graphicx,amsmath,amssymb,mathtools}
usepackage[ruled,vlined]{algorithm2e}
include{pythonlisting}
begin{document}
begin{algorithm}[H]
caption{How to write algorithms}
SetAlgoLined
%KwIn{Data $mathcal{D}={mathbf{X} cup mathbf{y}}={(mathbf{x}_1,y_1),...,(mathbf{x}_N,y_N)}$}
SetKwInOut{Input}{Input}
Input{Data $mathcal{D}={mathbf{X} cup mathbf{y}}={(mathbf{x}_1,y_1),...,(mathbf{x}_N,y_N)}$;
Level-one learning algorithms $mathcal{L}_{1,1},...,mathcal{L}_{1,T_1}$;
Level-two learning algorithms
SetKwProg{proced}{Procedure}{:}{}
SetKw{KwBy}{by}
proced{}{
For{$t in mathbb{N} cap [1,T_1]$}{
$h^1_t gets mathcal{L}_{1,t}(mathcal{D})$
}
}
SetKwInOut{Output}{Output}
Output{begin{align}H(x) = h^3(h^2_1(h^1_1(x), &... ,h^1_{T_1}(x)),
&shortvdotswithin{...}
h^2_{T_2}(h^1_1(x), &... ,h^1_{T_1}(x)))end{align}}
end{algorithm}
end{document}
(copied from an algorithm template I found online)
That should run. Now at the bottom of the algo I end up with
As you can see, I’ve made an effort to align. But I want to make the following changes:
How can I achieve these changes?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP