Softmax in LaTeX (\text{softmax})

softmax\text{softmax}
LaTeX command
\text{softmax}
Package
Add to your preamble:\usepackage{amsmath}
Mode
Text and math mode

Where it is used

Softmax function name: maps a vector of logits to a probability distribution by exponentiating and normalizing.

Softmax is defined componentwise as \text{softmax}(z)_i = e^{z_i} / \sum_j e^{z_j}, and it closes nearly every classifier and the attention mechanism, where \text{softmax}(QK^\top/\sqrt{d_k})V. Because \text{} uses the surrounding text font, it turns italic inside theorem or emphasis environments. \operatorname{softmax} is usually the better choice: it is always upright and adds operator spacing before the parenthesis, just like \sin. A temperature parameter is written as \text{softmax}(z/T). Use \left( \right) when the argument contains a fraction. In code-heavy papers, say which axis softmax normalizes over, such as the class dimension.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

softmax(z)i=ezi∑j=1Kezj\text{softmax}(z)_i = \frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Softmax: $\text{softmax}$

\[ \text{softmax}(z)_i = \frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}} \]
\end{document}

Related symbols

All 머신러닝 및 AI →

Frequently asked questions

How do I write Softmax in LaTeX?
Type \text{softmax} in math mode, for example $\text{softmax}(z)_i = \frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}}$. Load amsmath first with \usepackage{amsmath}.
Which package do I need for \text{softmax}?
\text{softmax} needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
Can I use \text{softmax} in text mode, or only in math mode?
Both. \text{softmax} compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기