Files
test-repo/docs/.vitepress/theme/components/appendix/transformer-attention/PositionalEncodingDemo.vue
T
sanbuphy 260d17ee8b feat: 添加多个附录交互式组件和文档更新
- 添加浏览器前端组件:无障碍访问、国际化、实时通信
- 添加 Transformer 注意力机制系列组件
- 更新 Canvas、数据追踪等现有组件
- 修复 ESLint 变量名冲突问题
- 完善相关附录文档
2026-02-24 08:34:53 +08:00

41 lines
2.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="demo-card">
<div class="pe-content">
<div class="problem">
<div class="title">问题词序很重要</div>
<div class="examples">
<span class="ex">我爱你</span>
<span class="vs"></span>
<span class="ex">你爱我</span>
</div>
</div>
<div class="solution">
<div class="title">解决位置编码</div>
<div class="formula">Token Embedding + Positional Encoding</div>
<div class="methods">
<div class="method">正弦余弦Transformer 原始</div>
<div class="method">可学习BERTGPT</div>
<div class="method">旋转编码 RoPELLaMA</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
</script>
<style scoped>
.demo-card { border: 1px solid var(--vp-c-divider); border-radius: 8px; background: var(--vp-c-bg-soft); padding: 1rem; margin: 1rem 0; }
.pe-content { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 560px) { .pe-content { grid-template-columns: 1fr; } }
.problem, .solution { background: var(--vp-c-bg); border: 1px solid var(--vp-c-divider); border-radius: 6px; padding: 0.8rem; }
.title { font-size: 0.8rem; font-weight: bold; color: var(--vp-c-text-1); margin-bottom: 0.5rem; }
.examples { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.ex { font-size: 0.9rem; font-weight: bold; color: var(--vp-c-text-1); }
.vs { font-size: 1rem; color: var(--vp-c-brand); }
.formula { background: var(--vp-c-brand-soft); border: 1px dashed var(--vp-c-brand); border-radius: 4px; padding: 0.5rem; font-size: 0.75rem; color: var(--vp-c-brand); text-align: center; margin-bottom: 0.5rem; font-family: monospace; }
.methods { display: flex; flex-direction: column; gap: 0.25rem; }
.method { font-size: 0.7rem; color: var(--vp-c-text-2); background: var(--vp-c-bg-alt); padding: 0.3rem 0.5rem; border-radius: 3px; }
</style>