latex---插入三线表&伪代码流程图

 

我想实现下述伪代码算法,注意不同于三线表哦

1 三线表要记得加入这个“宏包”

粗细可调: https://blog.csdn.net/lishoubox/article/details/7331653

\usepackage{booktabs}

表格

\begin{table}[htbp]
 \caption{\label{tab:test}示例表格}  %标题
 \begin{tabular}{lcl} %三列,居左,中,左
   \toprule %第一条线
   a11 & a12 & a13 \\
   \midrule %第二条线
   a21 & a22 & a23 \\
   a31 & a32 & a33 \\
   \bottomrule %第三条线
 \end{tabular}
\end{table}

\begin{table}[htbp]
 \caption{\label{tab:test}示例表格}  %标题
 \begin{tabular}{lcl} %三列,居左,中,左
   \toprule %第一条线
   a11 & a12 & a13 \\
   \midrule %第二条线
   a21 & a22 & a23 \\
   a31 & a32 & a33 \\
   \bottomrule %第三条线
 \end{tabular}
\end{table}

2 伪代码:

宏包+算法: https://www.cnblogs.com/52ml/p/3823802.html

多种伪代码格式以及宏包: https://blog.csdn.net/lwb102063/article/details/53046265

https://blog.csdn.net/lwb102063/article/details/53046265

for循环
与if条件句

\For{$i=1;i\leq N;i\leftarrow i+1$}
      \If {$i=N$}
                    \State $middle \gets (left + right) / 2$
                    \State $result \gets result +$ \Call{MergerSort}{$Array, left, middle$}
                    \State $result \gets result +$ \Call{MergerSort}{$Array, middle, right$}
                    \State $result \gets result +$ \Call{Merger}{$Array,left,middle,right$}
      \EndIf 

      \State $d^{3}, d^{4}, d^{5} = D_{d_{3}}(f_{s}^{2}), D_{d_{4}}(f_{s}^{2}), D_{d_{5}}(f_{s}^{2})$ ;
      \State $f_{s}^{2}, f_{s}^{3}, f_{s}^{4}, f_{s}^{5} = D_{f_{i}}(f_{s}^{2}, f_{s}^{3}+d^{3}, f_{s}^{4}+d^{4}, f_{s}^{5}+d^{5});$
      \State $m^{2}, m^{3}, m^{4}, m^{5} = Conv_{2}(f_{s}^{2}), Conv_{3}(f_{s}^{3}), Conv_{4}(f_{s}^{4}), Conv_{5}(f_{s}^{5});$
    \EndFor

宏包:前期准备

\usepackage{algorithm}  
\usepackage{algpseudocode}  
\usepackage{amsmath}  
\renewcommand{\algorithmicrequire}{\textbf{Input:}}  % Use Input in the format of Algorithm  
\renewcommand{\algorithmicensure}{\textbf{Output:}} % Use Output in the format of Algorithm 

 

  \begin{algorithm}[htb]  
  \caption{ Framework of ensemble learning for our system.}  
  \label{alg:Framwork}  
  \begin{algorithmic}[1]  
    \Require  
      The set of positive samples for current batch, $P_n$;  
      The set of unlabelled samples for current batch, $U_n$;  
      Ensemble of classifiers on former batches, $E_{n-1}$;  
    \Ensure  
      Ensemble of classifiers on the current batch, $E_n$;  
    \State Extracting the set of reliable negative and/or positive samples $T_n$ from $U_n$ with help of $P_n$;  
    \label{code:fram:extract}  
    \State Training ensemble of classifiers $E$ on $T_n \cup P_n$, with help of data in former batches;  
    \label{code:fram:trainbase}  
    \State $E_n=E_{n-1}cup E$;  
    \label{code:fram:add}  
    \State Classifying samples in $U_n-T_n$ by $E_n$;  
    \label{code:fram:classify}  
    \State Deleting some weak classifiers in $E_n$ so as to keep the capacity of $E_n$;  
    \label{code:fram:select} \\  
    \Return $E_n$;  
  \end{algorithmic}  
\end{algorithm}  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

计算机视觉-Archer

图像分割没有团队的同学可加群

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值