algorithm
我在 Tufte LaTeX 中使用
\documentclass{tufte-book}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\begin{document}
\begin{algorithm}\captionsetup{font={sc}, labelfont={bf,sc}}
\caption{Batch Gradient Descent Algorithm}\label{alg:batchgradientdescent}
\begin{algorithmic}[1]
\INPUT $training\text{\_}examples, \alpha, iter$
\Function{GradientDescent}{$X, y, \alpha, iter$}
\State $\theta \gets$ Initialized to small random values
\For{$i \in \{1,\dots,iter\}$}
\State $\Delta\theta_i \gets$ 0 \Comment{Initialize each $\Delta\theta_i$ to 0}
\For{each $(x^i, y^i)$ in $training\_examples$}
\State $h \gets \theta_0x_0 \dots \theta_nx_n$ \Comment{Compute the output h}
\For{each parameter $\theta_i$}
\State $\Delta\theta_i \gets \Delta\theta_i + \alpha(y^i - h)x_i $
\EndFor
\EndFor
\For{each parameter $\theta_i$}
\State $\theta_i \gets \theta_i + \Delta\theta_i$
\EndFor
\EndFor
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{document}
谁能告诉我哪里出了问题?