ReLU in LaTeX (\text{ReLU})
- LaTeX command
\text{ReLU}- Package
- Add to your preamble:
\usepackage{amsmath} - Mode
- Text and math mode
Where it is used
Name of the rectified linear unit activation, which outputs max(0, x) and zeroes negative inputs.
ReLU is defined as \text{ReLU}(x) = \max(0, x), with derivative 1 for positive inputs and 0 for negative ones. It is the default hidden-layer activation in modern networks; variants include Leaky ReLU, \max(\alpha x, x), and GELU. Writing \text{ReLU} works, but it follows the surrounding text style, so in an italic environment it slants; \operatorname{ReLU} or \mathrm{ReLU} stays upright and \operatorname also handles spacing before the argument. When applied to a vector, state that it acts elementwise, as in \text{ReLU}(\mathbf{W}\mathbf{x} + \mathbf{b}).
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
ReLU: $\text{ReLU}$
\[ \mathbf{h} = \text{ReLU}(\mathbf{W}\mathbf{x} + \mathbf{b}) \]
\end{document}Related symbols
- Nabla
\nabla - Sigma
\sigma - Gradient of L
\nabla_{\theta} \mathcal{L} - Softmax
\text{softmax} - Partial Derivative
\frac{\partial \mathcal{L}}{\partial \theta} - Circle Dot
\odot
Frequently asked questions
- How do I write ReLU in LaTeX?
- Type \text{ReLU} in math mode, for example $\mathbf{h} = \text{ReLU}(\mathbf{W}\mathbf{x} + \mathbf{b})$. Load amsmath first with \usepackage{amsmath}.
- Which package do I need for \text{ReLU}?
- \text{ReLU} needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
- Can I use \text{ReLU} in text mode, or only in math mode?
- Both. \text{ReLU} compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기