\documentclass[t,aspectratio=169]{beamer}
\usetheme{metropolis}
\metroset{block=fill}

\input{../../_assets/basicslide1}
\input{../../_assets/macros}

\usepackage[noend]{algpseudocode}
\usepackage{listings}
\lstdefinestyle{chack}{
  language=C,
  columns=fullflexible,
  keepspaces=true,
  numbers=left,
  basicstyle=\ttfamily\footnotesize\color{black},
  commentstyle=\ttfamily\footnotesize\color{gray},
  moredelim=**[is][\color{red}]{@}{@},
}

\author{Samuel Vaiter}
\date{}
\institute{
Created: 2023-11-08.\\
Last update: 2023-11-08.\\
Status: inprogress.}
\title{Descent direction}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}


\begin{frame}
  \frametitle{{\tiny (anti-)}Gradient descent}
  \only<1->{\photoUp{pictures/cauchy.jpg}{A. Cauchy (1789--1857)}}
  \begin{columns}[c]
    \begin{column}{0.6\linewidth}
      \begin{tcolorbox}[fonttitle=\bfseries, title={Gradient Descent algorithm}]
        \begin{algorithmic}[1]
          \Require{Initialization $x^{(0)} \in \RR^{d}$, $\quad\quad\quad$ step-size policy $\eta^{(t)} > 0$.}
          \For{$t = 1, \cdots$}
          \begin{equation}
            \label{eq:gradient-descent}\tag{GD}
            x^{(t+1)} = x^{(t)} \alert<1>{-} \alert<2->{\eta^{(t)}} \nabla f(x^{(t)})
          \end{equation}
          \EndFor
        \end{algorithmic}
      \end{tcolorbox}
    \end{column}
    \begin{column}{0.4\linewidth}
      \begin{center}
        \frame{\includegraphics[width=\linewidth]{pictures/article-cauchy}}
      \end{center}
    \end{column}
  \end{columns}
  \pause
  Elephant in the room: choice of $\eta^{(t)}$? \pause 3 main choices {\tiny (discussed later)}
  \begin{itemize}
  \item Constant step-size $\eta^{(t)} = \eta$, or predetermined function
  \item ``Oracle''
  \item Backtracking
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Gradient descent: illustration on a quadratic problem}

  \begin{center}
    \includegraphics[width=0.56\linewidth]{figures/gd_quadratic}
  \end{center}
  \note{GD with fixed step size adequatly chosed on a definitive quadratic}
\end{frame}

\end{document}