Skip to content

Commit e57b560

Browse files
committed
update lang
1 parent 9a35d68 commit e57b560

9 files changed

Lines changed: 4330 additions & 71 deletions

File tree

app/(private)/campuchia/page.md

Lines changed: 860 additions & 0 deletions
Large diffs are not rendered by default.

app/(private)/dutch/page.md

Lines changed: 861 additions & 0 deletions
Large diffs are not rendered by default.

app/(private)/homebrew/page.md

Lines changed: 851 additions & 0 deletions
Large diffs are not rendered by default.

app/(private)/laos/page.md

Lines changed: 861 additions & 0 deletions
Large diffs are not rendered by default.

app/(private)/morocco/page.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,6 @@
44

55
---
66

7-
## جدول المحتويات
8-
9-
- [عائلة الترانسفورمر الإصدار 2.0](#عائلة-الترانسفورمر-الإصدار-20)
10-
- [جدول المحتويات](#جدول-المحتويات)
11-
- [الرموز](#الرموز)
12-
- [أساسيات الترانسفورمر](#أساسيات-الترانسفورمر)
13-
- [الانتباه والانتباه الذاتي](#الانتباه-والانتباه-الذاتي)
14-
- [الانتباه الذاتي متعدد الرؤوس](#الانتباه-الذاتي-متعدد-الرؤوس)
15-
- [معمارية المُشفِّر-فاك التشفير](#معمارية-المُشفِّر-فاك-التشفير)
16-
- [الترميز الموضعي](#الترميز-الموضعي)
17-
- [الترميز الموضعي الجيبي](#الترميز-الموضعي-الجيبي)
18-
- [الترميز الموضعي المُتعلَّم](#الترميز-الموضعي-المُتعلَّم)
19-
- [الترميز الموضعي النسبي](#الترميز-الموضعي-النسبي)
20-
- [التضمين الموضعي الدوراني](#التضمين-الموضعي-الدوراني)
21-
- [سياق أطول](#سياق-أطول)
22-
- [ذاكرة السياق](#ذاكرة-السياق)
23-
- [الذاكرة الخارجية غير القابلة للتفاضل](#الذاكرة-الخارجية-غير-القابلة-للتفاضل)
24-
- [درجات الانتباه المُعززة بالمسافة](#درجات-الانتباه-المُعززة-بالمسافة)
25-
- [جعله تكراريًا](#جعله-تكراريًا)
26-
- [النمذجة التكيفية](#النمذجة-التكيفية)
27-
- [مدى الانتباه التكيفي](#مدى-الانتباه-التكيفي)
28-
- [الترانسفورمر التكيفي العمق](#الترانسفورمر-التكيفي-العمق)
29-
- [الانتباه الفعال](#الانتباه-الفعال)
30-
- [أنماط الانتباه المتفرقة](#أنماط-الانتباه-المتفرقة)
31-
- [السياق المحلي الثابت](#السياق-المحلي-الثابت)
32-
- [السياق ذو الخطوات الواسعة](#السياق-ذو-الخطوات-الواسعة)
33-
- [مزيج من السياق المحلي والعالمي](#مزيج-من-السياق-المحلي-والعالمي)
34-
- [الانتباه القائم على المحتوى](#الانتباه-القائم-على-المحتوى)
35-
- [الانتباه منخفض الرتبة](#الانتباه-منخفض-الرتبة)
36-
- [الترانسفورمر في التعلم المعزز](#الترانسفورمر-في-التعلم-المعزز)
37-
- [الاستشهاد](#الاستشهاد)
38-
- [المراجع](#المراجع)
39-
40-
---
41-
427
تم اقتراح العديد من التحسينات الجديدة على معمارية الترانسفورمر منذ منشوري الأخير حول "[عائلة الترانسفورمر](https://lilianweng.github.io/posts/2020-04-07-the-transformer-family/)" قبل حوالي ثلاث سنوات. هنا قمت بإعادة هيكلة وإثراء كبيرين لذلك المنشور الصادر عام 2020 - حيث أعدت هيكلة التسلسل الهرمي للأقسام وحسنت العديد من الأقسام بأوراق بحثية أحدث. الإصدار 2.0 هو مجموعة شاملة من الإصدار القديم، بطول يبلغ ضعف طوله تقريبًا.
438

449
# الرموز

app/(private)/swedish/page.md

Lines changed: 861 additions & 0 deletions
Large diffs are not rendered by default.

app/(private)/transformer/page.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ Compressive transformer has two additional training losses:
231231
1. **Auto-encoding loss** (lossless compression objective) measures how well we can reconstruct the original memories from compressed memories
232232

233233
$$
234-
\mathcal{L}_{ac} = \| \textbf{old_mem}^{(i)} - g(\textbf{new_cm}^{(i)}) \|_2
234+
\mathcal{L}_{ac} = \left\| \mathbf{old\_mem}^{(i)} - g\big(\mathbf{new\_cm}^{(i)}\big) \right\|_2
235235
$$
236236

237237
where $g: \mathbb{R}^{[\frac{L}{c}] \times d} \to \mathbb{R}^{L \times d}$ reverses the compression function $f$.
238238

239239
2. **Attention-reconstruction loss** (lossy objective) reconstructs content-based attention over memory vs compressed memory and minimize the difference:
240240
$$
241-
\mathcal{L}_{ar} = \|\text{attn}(\mathbf{h}^{(i)}, \textbf{old_mem}^{(i)}) − \text{attn}(\mathbf{h}^{(i)}, \textbf{new_cm}^{(i)})\|_2
241+
\mathcal{L}_{ar} = \left\| \operatorname{attn}\big(\mathbf{h}^{(i)}, \mathbf{old\_mem}^{(i)}\big) - \operatorname{attn}\big(\mathbf{h}^{(i)}, \mathbf{new\_cm}^{(i)}\big) \right\|_2
242242
$$
243243

244244
Transformer-XL with a memory of size $m$ has a maximum temporal range of $m \times N$, where $N$ is the number of layers in the model, and attention cost $\mathcal{O}(L^2 + Lm)$. In comparison, compressed transformer has a temporal range of $(m_m + c \cdot m_{cm}) \times N$ and attention cost $\mathcal{O}(L^2 + L(m_m + m_{cm}))$. A larger compression rate $c$ gives better tradeoff between temporal range length and attention cost.
@@ -742,7 +742,7 @@ $$
742742
\end{aligned}
743743
$$
744744

745-
![RFA Computation Order](RFA.png)
745+
![RFA Computation Order](/posts/transformer-family-2/RFA.png)
746746
_(Left) The order of computation for default softmax operation. (Right) The order of computation when using random feature attention, a lot cheaper than default softmax. (Image source: [Peng et al. 2021](https://arxiv.org/abs/2103.02143))._
747747

748748
**Causal Attention RFA** has token at time step $t$ only attend to earlier keys and values $\{\mathbf{k}_i\}_{i \leq t}, \{\mathbf{v}_i\}_{i \leq t}$. Let us use a tuple of variables, $(\mathbf{S}_t \in \mathbb{R}^{2D \times d}, \mathbf{z} \in \mathbb{R}^{2D})$, to track the hidden state history at time step $t$, similar to RNNs:
@@ -763,7 +763,7 @@ RFA leads to significant speedup in autoregressive decoding and the memory compl
763763

764764
Performer modifies the random feature attention with positive random feature maps to reduce the estimation error. It also keeps the randomly sampled $\mathbf{w}_1, \dots, \mathbf{w}_D$ to be orthogonal to further reduce the variance of the estimator.
765765

766-
![Comparison of approximation error in Performer](performer.png)
766+
![Comparison of approximation error in Performer](/posts/transformer-family-2/performer.png)
767767
_Comparison of approximation error when using (Left) i.i.d vs orthogonal features and (Right) sin/cos vs positive random features. (Image source: [Choromanski et al. 2021](https://arxiv.org/abs/2009.14794))._
768768

769769
# Transformers for Reinforcement Learning

app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@import "../styles/hamburger.css";
1717
@import "../styles/typesetting-article.css";
1818

19-
@import "../styles/i81n/chinese.css";
19+
/* @import "../styles/i81n/chinese.css"; */
2020

2121
@custom-variant dark (&:where(.dark, .dark *));
2222
@custom-variant light (&:where(.light, .light *));

app/layout.jsx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,37 @@ const surveyWithCodeFonts = localFont({
4040
display: "swap",
4141
})
4242

43-
const surveyWithCodeChinese = localFont({
44-
src: [
45-
{
46-
path: "./../public/fonts/chinese/SurveyWithCodeChina-Light.woff2",
47-
weight: "300",
48-
style: "normal",
49-
},
50-
{
51-
path: "./../public/fonts/chinese/SurveyWithCodeChina-Regular.woff2",
52-
weight: "400",
53-
style: "normal",
54-
},
55-
{
56-
path: "./../public/fonts/chinese/SurveyWithCodeChina-Medium.woff2",
57-
weight: "500",
58-
style: "normal",
59-
},
60-
{
61-
path: "./../public/fonts/chinese/SurveyWithCodeChina-SemiBold.woff2",
62-
weight: "600",
63-
style: "normal",
64-
},
65-
{
66-
path: "./../public/fonts/chinese/SurveyWithCodeChina-Bold.woff2",
67-
weight: "700",
68-
style: "normal",
69-
},
70-
],
71-
variable: "--font-survey-code-chinese",
72-
display: "swap",
73-
})
43+
// const surveyWithCodeChinese = localFont({
44+
// src: [
45+
// {
46+
// path: "./../public/fonts/chinese/SurveyWithCodeChina-Light.woff2",
47+
// weight: "300",
48+
// style: "normal",
49+
// },
50+
// {
51+
// path: "./../public/fonts/chinese/SurveyWithCodeChina-Regular.woff2",
52+
// weight: "400",
53+
// style: "normal",
54+
// },
55+
// {
56+
// path: "./../public/fonts/chinese/SurveyWithCodeChina-Medium.woff2",
57+
// weight: "500",
58+
// style: "normal",
59+
// },
60+
// {
61+
// path: "./../public/fonts/chinese/SurveyWithCodeChina-SemiBold.woff2",
62+
// weight: "600",
63+
// style: "normal",
64+
// },
65+
// {
66+
// path: "./../public/fonts/chinese/SurveyWithCodeChina-Bold.woff2",
67+
// weight: "700",
68+
// style: "normal",
69+
// },
70+
// ],
71+
// variable: "--font-survey-code-chinese",
72+
// display: "swap",
73+
// })
7474

7575
export const metadata = {
7676
title: "SurveyWithCode - From Research to Reproducibility",

0 commit comments

Comments
 (0)