科研论文之Latex(高效方法)

  • 以下是本人的快捷使用方法。

在线latex编辑

在线latex不需要配置任何环境,导入压缩包直接使用。但是会出现偶尔掉线,经常重新连接。

  • 国外overleaf(缺点是限速,有时候进不去)
  • 国内overleaf(可以随时访问,邮箱注册即可使用)上面有在线的模板可以直接入门练习 了解结构

做好的表格快速转latex(tablesgenerator)

  • tablesgenerator

  • 在线转换表格为latex code,无需下载 。最大支持500行20列的表格

  • 可导入CSV文件,也可直接粘贴数

  • 可自定义表格框线、字体、颜色、居中排列等等 界面简洁,操作方便,速度快

  • 未标注箭头的框 有2个选择 一个是给第一行和最后一行加粗 另外一个是粗细一样

  • 如果想跨栏 占据 在table后面加* 即table*
    在这里插入图片描述

  • 三线表格教程

  • 参考文献

公式快速转latex(Mathpix)

  • Mathpix 自行安装,可以直接截图、手写公式等一系列转化为latex代码
    在这里插入图片描述
  • Latexlive
    写好的公式直接转Latex
    在这里插入图片描述

算法伪代码模板

  • 使用之前先导入对应的包

%这种形式需要在前面 导入包(第二代)
\usepackage{algorithm}
\usepackage{algpseudocode}
%或者替换为\usepackage{algorithmic},就是第一代了,
%但是关键字全部是大写形式,比如 \State 改为 \STATE

%将官方的 require 和 ensure 关键字换成我们常用的 input 和 output
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
 
 
%排版代码为
\begin{algorithm}[h]
  \caption{Gradient substitution MI-FGSM($GSMI-FGSM$)}
  \label{alg::conjugateGradient}
  \begin{algorithmic}[1]
    \Require
      Real-time task set $S_H$
    \Require
      Real-time task set $S_H$
    \Require
      Real-time task set $S_H$
    \Require
      Real-time task set $S_H$     
    \Ensure
      The schedulability of $S_H$
 
    \State $D=0$;
 
    \For {${\tau _i}:{S_H}$}          %For循环结构
        \State $D = D+C_i/D_i$;
    \EndFor
    \If {$D > n$}
        \State return  false;
    \Else
        \State return true;
    \EndIf
 
  \end{algorithmic}
\end{algorithm}
  • 输出结果如下:
    在这里插入图片描述
  • 模板2
%将官方的 require 和 ensure 关键字换成我们常用的 input 和 output
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
 
 
%排版代码为
\begin{algorithm}[h]
  \caption{Gradient substitution MI-FGSM($GSMI-FGSM$)}
  \label{alg::conjugateGradient}
  \begin{algorithmic}[1]
    \Require $A$ classifier $f$ with parameters $\theta$ , loss function $J$
    \Require A raw example $x$ with ground-truth label $y$
    \Require The magnitude of perturbation $\varepsilon $; number of iteration $T$ and decay factor$\mu $  
    \Require The factor $\beta $ for the upper bound of neighborhood
and number of example $N$ for variance tuning    
    \Ensure An adversarial example $x^{adv} $
 
    \State $\alpha=\epsilon / T$
    \State $g_0=0 ; G_0=0 ; x_0^{a d v}=x$
    \For {$t=0 \rightarrow T-1$}          %For循环结构
        \State Calculate the gradient $\hat{g}_{t+1}=\nabla_{x_{t}^{a d v}} J\left(x_{t}^{a d v}, y ; \theta\right)$

        \State Update ${g}_{t+1}$ by gradient substitution based momentum
            \begin{equation}
            \label{m_g}
            g_{t+1}=\mu \cdot g_{t}+\frac{\hat{g}_{t+1}+v_{t}}{\left\|\hat{g}_{t+1}+v_{t}\right\|_{1}}
            \end{equation}
        \State Update ${G}_{t+1}$ by sampling $N $examples in the neighborhood of $x$:
             \begin{equation}
            \label{m_g}
            G(x)=\frac{1}{N-2}\left(\sum_{i=1}^{N} \nabla_{x^{i}} J\left(x^{i}, y ; \theta\right)-\nabla_{x^{i}} J\left(x^{i}, y ; \theta\right)_{\max }-\nabla_{x^{i}} J\left(x^{i}, y ; \theta\right)_{\min }\right)
            \end{equation}     
        \State Update $x_{t+1}^{a d v}$ by applying the sign of gradient
            \begin{equation}
            \label{m_g}
            x_{t+1}^{a d v}=\operatorname{Clip}_{x}^{\epsilon}\left\{x_{t}^{a d v}+\alpha \cdot \operatorname{sign}\left(g_{t+1}\right)\right\}
            \end{equation}        
    \EndFor
    \If {$D > n$}
        \State return  false;
    \Else
        \State return true;
    \EndIf
 
  \end{algorithmic}
\end{algorithm}

在这里插入图片描述

公式

在这里插入图片描述

新手入门

视频18分钟
视频2

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值