\begin{algorithm}
\caption{End-to-end Adaptive Dynamic Sampling and Reconstruction}
\label{alg:end_to_end}
\KwInput{Initial data $\tilde{\vec{y}}_{\Lambda_0}$, ACS data $\tilde{\vec{y}}_{\Lambda_{\text{acs}}}: \Lambda_{\text{acs}} \subseteq\Lambda_{0} $, Acceleration factor $R$}
\KwOutput{Reconstructed image $\hat{\vec{x}}$}
\For{$k \gets 1$ to $n_c$}{
    \For{$t \gets 1$ to $n_f$}{
         $\vec{S}_t^k \gets \mathcal{S}_{\boldsymbol{\omega}}(\tilde{\vec{y}}_{\Lambda_{\text{acs}}^t}^k)$ \tcp*{  Estimate sensitivity maps}
    }
}
$\tilde{\vec{y}} \gets \text{ADS}_{\boldsymbol{\psi}, \boldsymbol{\theta}} (\tilde{\vec{y}}_{\Lambda_{0}}; \mat{S}, R)$  \tcp*{Adaptively sample $k$-space based on $\tilde{\vec{y}}_{\Lambda_{0}}$ and $R$}
% 
$\hat{\vec{x}} \gets \mathcal{R}_{\boldsymbol{\phi}}(\tilde{\vec{y}}];\vec{S})$ \tcp*{ Reconstruct dynamic image}
% 
\KwRet{$\hat{\vec{x}}$}
\end{algorithm}

