<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Attention on 中文AI术语词典</title><link>https://terms-en.ai-term-hub.com/zh/tags/attention/</link><description>Recent content in Attention on 中文AI术语词典</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 18 Jul 2026 11:44:45 +0000</lastBuildDate><atom:link href="https://terms-en.ai-term-hub.com/zh/tags/attention/index.xml" rel="self" type="application/rss+xml"/><item><title>Transformer</title><link>https://terms-en.ai-term-hub.com/zh/terms/transformer/</link><pubDate>Sat, 18 Jul 2026 10:55:40 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/transformer/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>Transformer架构在《Attention Is All You Need》论文中被提出，彻底革新了自然语言处理及更多领域。它使用多头自注意力机制来权衡输入序列中不同部分的重要性。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>一种基于自注意力机制的深度学习架构，能够并行而非顺序地处理序列数据。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>自注意力&lt;/li>
&lt;li>多头注意力&lt;/li>
&lt;li>位置编码&lt;/li>
&lt;li>编码器-解码器结构&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>机器翻译&lt;/li>
&lt;li>文本生成&lt;/li>
&lt;li>图像识别（ViT）&lt;/li>
&lt;/ul>
&lt;h2 id="code-example">Code Example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> torch.nn &lt;span style="color:#66d9ef">as&lt;/span> nn
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>attention_layer &lt;span style="color:#f92672">=&lt;/span> nn&lt;span style="color:#f92672">.&lt;/span>MultiheadAttention(embed_dim&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">512&lt;/span>, num_heads&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">8&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/attention_mechanism-%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/">attention_mechanism (注意力机制)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/bert-bert%E6%A8%A1%E5%9E%8B/">bert (BERT模型)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/gpt-gpt%E6%A8%A1%E5%9E%8B/">gpt (GPT模型)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/self_attention-%E8%87%AA%E6%B3%A8%E6%84%8F%E5%8A%9B/">self_attention (自注意力)&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>