• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
华东 博客
17年国科大博士毕业,曾就职于三星电子,清华博后,目前在某大模型创业公司工作,研究方向大模型、智能体 新浪博客: http://blog.sina.com.cn/u/2463286753
博客园    首页    新随笔    联系   管理    订阅  订阅
Latex 建立带有竖线和编号的算法环境

Latex 建立带有竖线和编号的算法环境

Latex源码:

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[linesnumbered, ruled]{algorithm2e}
\SetKwRepeat{Do}{do}{while}%
\begin{document}
\begin{algorithm}[!ht]
  \caption{Algorithm for problem \eqref{WWW} }
  \SetKwInOut{Input}{Input}\SetKwInOut{Output}{Output}
 \Input  { data matrix ${\bf X}$, label matrix ${\bf Y}$ and ${\bf W}_0$, $k=0$}
  \Output  {${\bf W}^*$}
\Repeat{ADMM stopping criterion is satisfied}{
 Updating ${\bf W}^k$:
\begin{equation*}
({\bf X}{\bf X}^{\mathrm T}+\mu{\bf I}){\bf W}={\bf B}^{k-1}
\end{equation*}
where ${\bf B}^{k-1} ={\bf X}{\bf Y}+\alpha{\bf A}^{k-1}-{\bf \Sigma}^{k-1}+\mu{\bf U}^{k-1}$\;
Updating ${\bf U}^k$:
\begin{equation*}
  {\bf u}^k_i=
  \begin{cases}
  \frac{\mu\|{\bf n}^{k-1}_i\|_2-\alpha}{\mu\|{\bf n}^{k-1}_i\|_{2}}{\bf n}^{k-1}_i,& ~\mbox{if} ~\alpha<\mu\|{\bf n}^{k-1}_i\|_2 \\
  \quad 0 & ~\mbox{otherwise}\\
  \end{cases}
  \end{equation*}
  
Updating ${\bf \Sigma}^{k}$:
\begin{equation*}
\begin{split}
  {\bf \Sigma}^k:=&{\bf \Sigma}^{k-1}+\mu({\bf W}^{k-1}-{\bf U}^{k-1})
  \end{split}
\end{equation*}\\
$k=k+1$\;}
\end{algorithm}
\end{document}

  

posted on 2016-09-26 00:02  华东博客  阅读(12719)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3