diff --git a/transformer-v2/404.html b/transformer-v2/404.html index 6ade2b3d82b4004bc3754d66387466f0d9935c14..aedf115135969d6f9ab5632045b22078a36e5e57 100644 --- a/transformer-v2/404.html +++ b/transformer-v2/404.html @@ -11,16 +11,16 @@ - + - + - +
diff --git a/transformer-v2/assets/DeckFooter-CDGyhr7n.js b/transformer-v2/assets/DeckFooter-CDGyhr7n.js new file mode 100644 index 0000000000000000000000000000000000000000..bed0b0406c0c7a08825a9650d0d4142c32ecbc7d --- /dev/null +++ b/transformer-v2/assets/DeckFooter-CDGyhr7n.js @@ -0,0 +1 @@ +import{_ as e,_t as t,b as n,g as r,w as i,xt as a,y as o,z as s}from"./modules/shiki-BFOesOFp.js";import{t as c}from"./useNav-B1TSwKuf.js";import{t as l}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as u}from"./slidev/context-ChHKJoK9.js";import"./slidev/client-seyoTamJ.js";var d={class:`dl-footer`},f={class:`dl-footer__left`},p={key:0,class:`dl-footer__code`},m={key:1,class:`dl-footer__sep`},h={key:2},g={key:3,class:`dl-footer__sep`},_={key:4,class:`dl-footer__title`},v={class:`dl-footer__right`},y=l(i({__name:`DeckFooter`,setup(i){let{$slidev:l}=u(),y=c(),b=r(()=>l?.themeConfigs??{}),x=r(()=>b.value.courseCode??``),S=r(()=>b.value.lecture??``),C=r(()=>b.value.lectureTitle??``);return(r,i)=>(s(),n(`footer`,d,[e(`div`,f,[x.value?(s(),n(`span`,p,a(x.value),1)):o(`v-if`,!0),S.value?(s(),n(`span`,m,`·`)):o(`v-if`,!0),S.value?(s(),n(`span`,h,`Lecture `+a(S.value),1)):o(`v-if`,!0),C.value?(s(),n(`span`,g,`·`)):o(`v-if`,!0),C.value?(s(),n(`span`,_,a(C.value),1)):o(`v-if`,!0)]),e(`div`,v,a(t(y).currentPage.value)+` / `+a(t(y).total.value),1)]))}}),[[`__scopeId`,`data-v-fe908050`]]);export{y as t}; \ No newline at end of file diff --git a/transformer-v2/assets/DecodeLoop-BEpyTQUC.css b/transformer-v2/assets/DecodeLoop-BEpyTQUC.css new file mode 100644 index 0000000000000000000000000000000000000000..23b4ea260c3897bdfc7853a40dea32ab8631c0a0 --- /dev/null +++ b/transformer-v2/assets/DecodeLoop-BEpyTQUC.css @@ -0,0 +1 @@ +.dl-dec[data-v-87f8004e]{flex-direction:column;gap:.5rem;width:100%;max-width:36rem;display:flex}.dl-dec__row[data-v-87f8004e]{flex-wrap:wrap;align-items:center;gap:.3rem;display:flex}.dl-dec__label[data-v-87f8004e]{letter-spacing:.1em;text-transform:uppercase;color:var(--dl-muted);font-size:.7rem}.dl-dec__tok[data-v-87f8004e]{border:1px solid var(--dl-accent);background:var(--dl-accent-soft);color:var(--dl-heading);border-color:var(--dl-dec);background:color-mix(in srgb, var(--dl-dec) 12%, var(--dl-bg));border-radius:4px;padding:.08rem .5rem;font-size:.86rem}.dl-dec__tok.is-src[data-v-87f8004e]{border-color:var(--dl-enc);background:color-mix(in srgb, var(--dl-enc) 12%, var(--dl-bg))}@media (prefers-reduced-motion:no-preference){.dl-dec__tok.is-new[data-v-87f8004e]{animation:.5s ease-out both dl-dec-in-87f8004e}}@keyframes dl-dec-in-87f8004e{0%{opacity:0;transform:translateY(-.6rem)}to{opacity:1;transform:none}}.dl-dec__tok.is-start[data-v-87f8004e]{color:var(--dl-muted);background:0 0;border-style:dashed}.dl-dec__tok.is-wrong[data-v-87f8004e]{border-color:var(--dl-danger)}.dl-dec__chart[data-v-87f8004e]{flex-direction:column;gap:.15rem;display:flex}.dl-dec__title[data-v-87f8004e]{color:var(--dl-muted);font-size:.78rem}.dl-dec__bar-row[data-v-87f8004e]{grid-template-columns:5rem 1fr 2.6rem;align-items:center;gap:.5rem;font-size:.86rem;display:grid}.dl-dec__word[data-v-87f8004e]{text-align:right;color:var(--dl-body);border-radius:999px;padding:0 .3rem}.dl-dec__word.is-target[data-v-87f8004e]{outline:2px solid var(--dl-accent);color:var(--dl-heading);font-weight:700}.dl-dec__track[data-v-87f8004e]{background:var(--dl-surface);border:1px solid var(--dl-border);border-radius:3px;height:.75rem;overflow:hidden}.dl-dec__fill[data-v-87f8004e]{background:var(--dl-muted);height:100%;transition:width .25s;display:block}.dl-dec__fill.is-pick[data-v-87f8004e]{background:var(--dl-accent)}.dl-dec__p[data-v-87f8004e]{font-variant-numeric:tabular-nums;color:var(--dl-heading)}.dl-dec__loss[data-v-87f8004e]{color:var(--dl-muted);font-variant-numeric:tabular-nums;font-size:.82rem}.dl-dec__l[data-v-87f8004e]{color:var(--dl-heading);margin-left:.5rem}.dl-dec__total[data-v-87f8004e]{color:var(--dl-accent-strong);margin-left:.8rem;font-weight:700} diff --git a/transformer-v2/assets/DecodeLoop-CNTHEb2K.js b/transformer-v2/assets/DecodeLoop-CNTHEb2K.js new file mode 100644 index 0000000000000000000000000000000000000000..24c659fc1e7f7ae34b5c40d4aed7261f4cb6f177 --- /dev/null +++ b/transformer-v2/assets/DecodeLoop-CNTHEb2K.js @@ -0,0 +1 @@ +import{Q as e,S as t,V as n,Y as r,_ as i,_t as a,b as o,bt as s,g as c,lt as l,m as u,v as d,vt as f,w as p,x as m,xt as h,y as g,z as _}from"./modules/shiki-BFOesOFp.js";import{t as v}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as y}from"./slidev/context-ChHKJoK9.js";import{n as b,r as x}from"./interactive-C1KYSeoO.js";import{c as S,i as C,l as w,r as T,s as E,u as D}from"./useIllustrated-CloGYVoH.js";import{t as O}from"./useConvolution-qO1u8ksh.js";var k={class:`dl-dec`},A={class:`dl-dec__row`},j={class:`dl-dec__chart`},M={class:`dl-dec__title`},N={class:`dl-dec__track`},P={class:`dl-dec__p`},F={key:0,class:`dl-dec__loss`},I={key:0,class:`dl-dec__total`},L=v(p({__name:`DecodeLoop`,props:{mode:{default:`trained`},step:{default:0},switchable:{type:Boolean,default:!0},loss:{type:Boolean,default:!1}},setup(p){let{$slidev:v,$nav:L,$clicksContext:R,$clicks:z,$page:B,$renderContext:ee,$frontmatter:te}=y(),V=p,H=C.length,U=l(V.mode),W=l(null),G=c(()=>Math.min(H,Math.max(0,W.value??V.step)));r(()=>V.step,()=>{W.value=null});let K=c(()=>U.value===`trained`?E:S),q=c(()=>Math.min(G.value,H-1)),J=c(()=>K.value[q.value]),Y=e=>e.indexOf(Math.max(...e)),X=c(()=>K.value.slice(0,G.value).map(e=>w[Y(e)])),Z=c(()=>K.value.slice(0,G.value).map((e,t)=>D(e,C[t]))),Q=c(()=>Z.value.reduce((e,t)=>e+t,0));function $(){W.value=G.value>=H?0:G.value+1}return(r,c)=>{let l=b,p=x;return _(),d(p,{"max-width":`44rem`},{controls:e(()=>[t(l,{label:G.value>=a(H)?`Start over`:`Write the next word`,glyph:`▸`,onClick:$},null,8,[`label`]),V.switchable?(_(),d(l,{key:0,label:U.value===`trained`?`Show an untrained model`:`Show a trained model`,variant:`ghost`,glyph:`⇄`,onClick:c[0]||=e=>U.value=U.value===`trained`?`untrained`:`trained`},null,8,[`label`])):g(`v-if`,!0)]),readout:e(()=>[G.value===0?(_(),o(u,{key:0},[c[5]||=m(` The encoder has read `,-1),c[6]||=i(`em`,null,`je suis étudiant`,-1),c[7]||=m(` once. The decoder starts from ⟨start⟩ and writes one word per step. The ringed word is the right answer. `,-1)],64)):G.value[i(`div`,k,[i(`div`,A,[c[1]||=i(`span`,{class:`dl-dec__label`},`input`,-1),(_(!0),o(u,null,n(a(T),e=>(_(),o(`span`,{key:e,class:`dl-dec__tok is-src`},h(e),1))),128)),c[2]||=i(`span`,{class:`dl-dec__label ml-3`},`output so far`,-1),c[3]||=i(`span`,{class:`dl-dec__tok is-start`},`⟨start⟩`,-1),(_(!0),o(u,null,n(X.value,(e,t)=>(_(),o(`span`,{key:t,class:f([`dl-dec__tok`,{"is-wrong":e!==a(w)[a(C)[t]],"is-new":t===X.value.length-1}])},h(e),3))),128))]),i(`div`,j,[i(`div`,M,` output position `+h(q.value+1)+` — probability of each word `,1),(_(!0),o(u,null,n(J.value,(e,t)=>(_(),o(`div`,{key:t,class:`dl-dec__bar-row`},[i(`span`,{class:f([`dl-dec__word`,{"is-target":t===a(C)[q.value]}])},h(a(w)[t]),3),i(`span`,N,[i(`span`,{class:f([`dl-dec__fill`,{"is-pick":t===Y(J.value)}]),style:s({width:`${e*100}%`})},null,6)]),i(`span`,P,h(e.toFixed(2)),1)]))),128))]),V.loss?(_(),o(`div`,F,[c[4]||=m(` loss per position: `,-1),(_(!0),o(u,null,n(Z.value,(e,t)=>(_(),o(`span`,{key:t,class:`dl-dec__l`},h(a(O)(e)),1))),128)),Z.value.length?(_(),o(`span`,I,`sum = `+h(a(O)(Q.value)),1)):g(`v-if`,!0)])):g(`v-if`,!0)])]),_:1})}}}),[[`__scopeId`,`data-v-87f8004e`]]);export{L as t}; \ No newline at end of file diff --git a/transformer-v2/assets/FlowDot-CpcqfMjQ.js b/transformer-v2/assets/FlowDot-CpcqfMjQ.js new file mode 100644 index 0000000000000000000000000000000000000000..cd4644aa4ceb53a16b2132d6a62384d3009ac587 --- /dev/null +++ b/transformer-v2/assets/FlowDot-CpcqfMjQ.js @@ -0,0 +1 @@ +import{_ as e,_t as t,b as n,bt as r,w as i,y as a,z as o}from"./modules/shiki-BFOesOFp.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as c}from"./slidev/context-ChHKJoK9.js";var l=[`r`],u=[`path`,`dur`,`begin`],d=s(i({__name:`FlowDot`,props:{path:{},dur:{default:1.8},delay:{default:0},role:{default:`accent`},r:{default:4.5}},setup(i){let{$slidev:s,$nav:d,$clicksContext:f,$clicks:p,$page:m,$renderContext:h,$frontmatter:g}=c(),_=i,v=typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,y=_.role===`body`?`var(--dl-body)`:`var(--dl-${_.role})`;return(i,s)=>t(v)?a(`v-if`,!0):(o(),n(`circle`,{key:0,r:_.r,class:`dl-flowdot`,style:r({fill:t(y)})},[e(`animateMotion`,{path:_.path,dur:`${_.dur}s`,begin:`-${_.delay}s`,repeatCount:`indefinite`,calcMode:`paced`},null,8,u)],12,l))}}),[[`__scopeId`,`data-v-90635adf`]]);export{d as t}; \ No newline at end of file diff --git a/transformer-v2/assets/FlowDot-DhuTnWHT.css b/transformer-v2/assets/FlowDot-DhuTnWHT.css new file mode 100644 index 0000000000000000000000000000000000000000..aae461ac589d09701cdf7548f3af3e7ecafb2db0 --- /dev/null +++ b/transformer-v2/assets/FlowDot-DhuTnWHT.css @@ -0,0 +1 @@ +.dl-flowdot[data-v-90635adf]{stroke:var(--dl-bg);stroke-width:1.5px} diff --git a/transformer-v2/assets/ItAttention-C9htn_5o.js b/transformer-v2/assets/ItAttention-C9htn_5o.js new file mode 100644 index 0000000000000000000000000000000000000000..e5b8fe92ee284e5dc69426434de9353edc0acb9a --- /dev/null +++ b/transformer-v2/assets/ItAttention-C9htn_5o.js @@ -0,0 +1 @@ +import{Q as e,S as t,V as n,_ as r,_t as i,b as a,bt as o,g as s,lt as c,m as l,v as u,vt as d,w as f,x as p,xt as m,y as h,z as g}from"./modules/shiki-BFOesOFp.js";import{t as _}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as v}from"./slidev/context-ChHKJoK9.js";import{n as y,r as b}from"./interactive-C1KYSeoO.js";import{n as x,t as S}from"./useIllustrated-CloGYVoH.js";var C=[`aria-label`],w=[`x1`,`y1`,`x2`,`y2`],T=[`y`],E=[`y`,`onClick`],D=21,O=16,k=150,A=330,j=_(f({__name:`ItAttention`,props:{head:{default:0},switchable:{type:Boolean,default:!0},movable:{type:Boolean,default:!0}},setup(f){let{$slidev:_,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=v(),L=f,R=c(L.head),z=c(7),B=s(()=>R.value===`both`?[0,1]:[R.value]),V=s(()=>B.value.flatMap(e=>S[e][z.value].map((t,n)=>({h:e,j:n,w:t,y:O+n*D}))));function H(e){let t=S[e][z.value],n=t.indexOf(Math.max(...t));return{word:x[n],w:t[n]}}function U(e){z.value=(z.value+e+x.length)%x.length}function W(e){(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.stopPropagation(),e.preventDefault(),U(e.key===`ArrowUp`?-1:1))}return(s,c)=>{let f=y,_=b;return g(),u(_,{"max-width":`40rem`},{controls:e(()=>[L.switchable?(g(),a(l,{key:0},[t(f,{label:`Head 1`,variant:R.value===0?`primary`:`ghost`,onClick:c[0]||=e=>R.value=0},null,8,[`variant`]),t(f,{label:`Head 2`,variant:R.value===1?`primary`:`ghost`,onClick:c[1]||=e=>R.value=1},null,8,[`variant`]),t(f,{label:`Both`,variant:R.value===`both`?`primary`:`ghost`,onClick:c[2]||=e=>R.value=`both`},null,8,[`variant`])],64)):h(`v-if`,!0),L.movable?(g(),a(l,{key:1},[t(f,{label:`Previous word`,variant:`ghost`,glyph:`↑`,onClick:c[3]||=e=>U(-1)}),t(f,{label:`Next word`,variant:`ghost`,glyph:`↓`,onClick:c[4]||=e=>U(1)})],64)):h(`v-if`,!0)]),readout:e(()=>[(g(!0),a(l,null,n(B.value,e=>(g(),a(l,{key:e},[r(`span`,{class:d(e===1?`dl-ita__h2`:`dl-ita__h1`)},`Head `+m(e+1),3),c[6]||=p(`: `,-1),r(`strong`,null,m(i(x)[z.value]),1),c[7]||=p(` reads `,-1),r(`strong`,null,m(H(e).word),1),p(` most (`+m(H(e).w.toFixed(2))+`). `,1)],64))),128)),c[8]||=r(`span`,{class:`dl-ita__note`},`Weights drawn by hand to show the idea, not taken from a trained model.`,-1)]),default:e(()=>[(g(),a(`svg`,{viewBox:`0 0 460 250`,class:`dl-ita`,role:`img`,tabindex:`0`,"aria-label":`Attention of '${i(x)[z.value]}' over the sentence`,onKeydown:W},[(g(!0),a(l,null,n(V.value,e=>(g(),a(`line`,{key:`${e.h}-${e.j}-${z.value}`,x1:322,y1:O+z.value*D-4,x2:158,y2:e.y-4,class:d([`dl-ita__line`,{"is-h2":e.h===1}]),style:o({strokeWidth:.6+e.w*16,opacity:.25+e.w*1.5})},null,14,w))),128)),(g(!0),a(l,null,n(i(x),(e,t)=>(g(),a(`text`,{key:`k${t}`,x:k,y:O+t*D,"text-anchor":`end`,class:`dl-ita__word`},m(e),9,T))),128)),(g(!0),a(l,null,n(i(x),(e,t)=>(g(),a(`text`,{key:`q${t}`,x:A,y:O+t*D,class:d([`dl-ita__word`,{"is-ask":t===z.value}]),onClick:e=>z.value=t},m(e),11,E))),128)),c[5]||=r(`text`,{x:`20`,y:`245`,class:`dl-ita__small`},`read (keys)`,-1),r(`text`,{x:A,y:`245`,class:`dl-ita__small`},`asking (query)`)],40,C))]),_:1})}}}),[[`__scopeId`,`data-v-1f222a43`]]);export{j as t}; \ No newline at end of file diff --git a/transformer-v2/assets/ItAttention-DcmGpltA.css b/transformer-v2/assets/ItAttention-DcmGpltA.css new file mode 100644 index 0000000000000000000000000000000000000000..f02cfa48c643d98867c783b0be9d47b5812d11ad --- /dev/null +++ b/transformer-v2/assets/ItAttention-DcmGpltA.css @@ -0,0 +1 @@ +.dl-ita[data-v-1f222a43]{outline:none;width:100%;max-width:30rem;height:auto}.dl-ita[data-v-1f222a43]:focus-visible{outline:2px solid var(--dl-accent);outline-offset:2px}.dl-ita__line[data-v-1f222a43]{stroke:var(--dl-accent);stroke-linecap:round}.dl-ita__line.is-h2[data-v-1f222a43]{stroke:var(--dl-k)}.dl-ita__word[data-v-1f222a43]{fill:var(--dl-heading);cursor:pointer;font-size:14px}.dl-ita__word.is-ask[data-v-1f222a43]{fill:var(--dl-q);font-weight:700}.dl-ita__small[data-v-1f222a43]{fill:var(--dl-muted);font-size:11px}.dl-ita__h2[data-v-1f222a43]{color:var(--dl-k)}.dl-ita__h1[data-v-1f222a43]{color:var(--dl-accent)}@media (prefers-reduced-motion:no-preference){.dl-ita__line[data-v-1f222a43]{stroke-dasharray:400;animation:.9s ease-out both dl-ita-draw-1f222a43}}@keyframes dl-ita-draw-1f222a43{0%{stroke-dashoffset:400px}to{stroke-dashoffset:0}}.dl-ita__note[data-v-1f222a43]{color:var(--dl-muted);font-size:.85em;display:block} diff --git a/transformer-v2/assets/PollSlide-uaNGIrh8.js b/transformer-v2/assets/PollSlide-uaNGIrh8.js new file mode 100644 index 0000000000000000000000000000000000000000..1f002a66536db327018a680284112c01ba39efc9 --- /dev/null +++ b/transformer-v2/assets/PollSlide-uaNGIrh8.js @@ -0,0 +1 @@ +import{Q as e,S as t,V as n,_ as r,b as i,m as a,w as o,xt as s,z as c}from"./modules/shiki-BFOesOFp.js";import{t as l}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as u}from"./slidev/context-ChHKJoK9.js";import{t as d}from"./slidev/VClicks-BDQlFH0_.js";var f={class:`dl-poll`},p={class:`dl-poll__question`},m=l(o({__name:`PollSlide`,props:{question:{},items:{}},setup(o){let{$slidev:l,$nav:m,$clicksContext:h,$clicks:g,$page:_,$renderContext:v,$frontmatter:y}=u(),b=o;return(o,l)=>{let u=d;return c(),i(`div`,f,[r(`div`,p,s(b.question),1),t(u,null,{default:e(()=>[(c(!0),i(a,null,n(b.items,e=>(c(),i(`div`,{key:e,class:`dl-poll__item`},[l[0]||=r(`span`,{class:`dl-poll__bullet`},`?`,-1),r(`span`,null,s(e),1)]))),128))]),_:1})])}}}),[[`__scopeId`,`data-v-743a908f`]]);export{m as t}; \ No newline at end of file diff --git a/transformer-v2/assets/SlideWrapper-CbvN8YIq.js b/transformer-v2/assets/SlideWrapper-CbvN8YIq.js new file mode 100644 index 0000000000000000000000000000000000000000..83dab33a330904a21791564e0b26268f13986bcc --- /dev/null +++ b/transformer-v2/assets/SlideWrapper-CbvN8YIq.js @@ -0,0 +1,2 @@ +import{D as e,G as t,H as n,L as r,R as i,S as a,X as o,Y as s,Z as ee,_ as c,_t as l,b as u,bt as d,f,g as p,i as m,lt as h,m as g,mt as _,st as v,v as y,vt as b,w as x,y as S,z as C}from"./modules/shiki-BFOesOFp.js";import{A as w,Q as T,X as E,Z as D,t as te,tt as O,z as k}from"./useNav-B1TSwKuf.js";import{t as A}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{M as j,f as ne}from"./modules/vue-CXhtJkbE.js";import{_ as re,d as ie,f as M,g as N,h as P,m as F,n as I,p as L,v as R}from"./slidev/context-ChHKJoK9.js";import{n as z,r as B,t as V}from"./syncState-BrWO1mSt.js";import{a as H,f as U}from"./index-DBl9KyFJ.js";import"./slidev/client-seyoTamJ.js";import{t as W}from"./useDrawings-Dnt5VfKs.js";var G=[`innerHTML`],K=x({__name:`DrawingPreview`,props:{page:{}},setup(e){let{drawingState:t}=W();return(n,r)=>l(t)[e.page]?(C(),u(`svg`,{key:0,class:`w-full h-full absolute top-0 pointer-events-none`,innerHTML:l(t)[e.page]},null,8,G)):S(`v-if`,!0)}}),q=v({}),J=[],Y=[];z(q,`$syncUp`,!0),z(q,`$syncDown`,!0),z(q,`$paused`,!1),z(q,`$onSet`,e=>J.push(e)),z(q,`$onPatch`,e=>Y.push(e)),B(),z(q,`$patch`,async()=>!1);var ae=V(q,q,!0),X=window.navigator.userAgent.match(/Chrome\/(\d+)/)?.[1];X&&Number(X);var Z=window.navigator.userAgent.match(/Chrome\/(\d+)/)?.[1];Z&&Number(Z);var oe=new class{_screenshotSession=null;getSnapshot(e,t){let n=e+(t?`-dark`:`-light`),r=ae.state[n];if(!r)return;let i=k(e);if(i&&r?.revision===i?.meta.slide.revision)return r.image}async saveSnapshot(e,t,n){return!1}async startCapturing(e){return!1}},se=[`id`],ce=[`id`],le={class:`slidev-slide-container w-full h-full relative`},ue=[`src`],Q=h(null),de=A(x({__name:`SlideContainer`,props:{width:{type:Number},meta:{default:()=>({})},isMain:{type:Boolean,default:!1},no:{type:Number,required:!1},useSnapshot:{type:Boolean,default:!1},contentStyle:{type:Object,default:()=>({})}},setup(e){let t=e,{isPrintMode:a}=te(),l=h(null),f=ne(l),_=h(null),v=p(()=>t.width??f.width.value),y=p(()=>t.width?t.width/E.value:f.height.value),b=p(()=>w.value&&!a.value?+w.value:Math.min(v.value/T.value,y.value/D.value)),x=p(()=>({...t.contentStyle,height:`${D.value}px`,width:`${T.value}px`,"--slidev-slide-scale":b.value})),O=p(()=>t.width?{width:`${t.width}px`,height:`${t.width/E.value}px`}:{});if(t.isMain){let e=document.documentElement.style;o(()=>e.setProperty(`--slidev-slide-scale`,b.value.toString())),i(()=>e.removeProperty(`--slidev-slide-scale`))}j(re,b),j(N,_),ee(()=>{t.isMain&&(Q.value=_.value)}),r(()=>{s(()=>t.isMain&&b.value,()=>{m()})});let k=p(()=>{if(!(t.no==null||!t.useSnapshot))return oe.getSnapshot(t.no,U.value)});return(t,r)=>k.value?(C(),u(g,{key:1},[S(` Image Snapshot `),c(`div`,le,[c(`img`,{src:k.value,class:`w-full h-full object-cover`,style:d(O.value)},null,12,ue),r[0]||=c(`div`,{absolute:``,"bottom-1":``,"right-1":``,"p0.5":``,"text-cyan:75":``,"bg-cyan:10":``,rounded:``,title:`Snapshot`},[c(`div`,{class:`i-carbon-camera`})],-1)])],2112)):(C(),u(`div`,{key:0,id:e.isMain?`slide-container`:void 0,ref_key:`container`,ref:l,class:`slidev-slide-container`,style:d(O.value)},[c(`div`,{id:e.isMain?`slide-content`:void 0,ref_key:`slideElement`,ref:_,class:`slidev-slide-content`,style:d(x.value)},[n(t.$slots,`default`,{},void 0,!0)],12,ce),n(t.$slots,`controls`,{},void 0,!0)],12,se))}}),[[`__scopeId`,`data-v-0167a76e`]]),fe=Object.assign({}),pe=Object.assign({}),me=Object.assign({}),he=Object.assign({}),ge=Object.assign({}),_e=Object.assign({}),ve={course:{code:`PGR207`,year:2026,title:`Deep Learning`,instructor:`Vajira Thambawita (PhD)`,email:`vajira@simula.no`},space:`DeepLearning-VT/DeepLearning_2026`,repo:`vlbthambawita/DeepLearning`,decks:[{id:`lecture-01`,title:`Introduction to Deep Learning`,subtitle:`Course overview, what deep learning is, and where it is used`,week:1,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025- Lecture 01.pdf`},{id:`lecture-02`,title:`Basics of Neural Networks`,subtitle:`Artificial neurons, the perceptron, Adaline and gradient descent`,week:2,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 02 .pdf`},{id:`lecture-03`,title:`PyTorch for Deep Learning`,subtitle:`Tensors, autograd, and a fully-connected network on MNIST`,week:3,published:!0,notebook:null,source:null},{id:`lecture-04`,title:`Deep Convolutional Neural Networks`,subtitle:`Locality and weight sharing, the convolution operation, and CNNs in PyTorch`,week:4,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 03.pdf`},{id:`lecture-05`,title:`Recurrent Neural Networks`,subtitle:`Sequence data, the recurrent layer, LSTM and GRU, and an RNN in PyTorch`,week:6,published:!0,publicNotes:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 5_6.pdf`},{id:`lecture-06`,title:`Transformers`,subtitle:`Query, key and value; the original architecture, and what modern transformers changed`,week:7,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 5_6.pdf`},{id:`transformer-v2`,title:`Transformer v2: The Illustrated Transformer`,subtitle:`Self-attention by hand, many heads, the decoder and training — after Jay Alammar’s The Illustrated Transformer`,week:7,published:!0,notebook:null,source:`https://jalammar.github.io/illustrated-transformer/`},{id:`lecture-07`,title:`Generative Models and GANs`,subtitle:`Autoencoders, VAEs, the adversarial game — and how diffusion took over`,week:9,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 07.pdf`}]},ye=[`href`],be=Object.assign({"../../../../../packages/slidev-theme-dl2026/slide-top.vue":A(x({__name:`slide-top`,setup(e){let{$slidev:t,$page:n,$renderContext:r}=I(),i=p(()=>r.value===`slide`&&!t.nav.isPrintMode),a=p(()=>t.themeConfigs?.lecture??``),o=p(()=>t.themeConfigs?.lectureTitle??``),s=p(()=>{let e=n.value,t=`[${a.value?`Lecture ${a.value}, slide ${e}`:`Slide ${e}`}] `,r=[`**Lecture:** ${a.value}${o.value?` — ${o.value}`:``}`,`**Slide:** ${e}`,`**Link:** ${typeof window<`u`?`${window.location.origin}${window.location.pathname}#/${e}`:``}`,``,`**What is wrong?**`,``,``].join(` +`),i=new URLSearchParams({title:t,body:r,labels:`slides`});return`https://github.com/${ve.repo}/issues/new?${i}`});return(e,t)=>i.value?(C(),u(`a`,{key:0,class:`dl-report`,href:s.value,target:`_blank`,rel:`noopener`,title:`Report a problem with this slide on GitHub`,onClick:t[0]||=f(()=>{},[`stop`])},`Report issue`,8,ye)):S(`v-if`,!0)}}),[[`__scopeId`,`data-v-6b2267dc`]])}),xe=Object.assign({}),Se=Object.assign({}),Ce=Object.assign({}),we=Object.assign({}),Te=Object.assign({}),Ee=[Object.values(fe)[0],Object.values(pe)[0],Object.values(me)[0]].filter(Boolean),De={render:()=>Ee.map(t=>e(t))},$=[Object.values(he)[0],Object.values(ge)[0],Object.values(_e)[0]].filter(Boolean),Oe={render:()=>$.map(t=>e(t))},ke=[Object.values(be)[0],Object.values(xe)[0],Object.values(Se)[0]].filter(Boolean),Ae={render:()=>ke.map(t=>e(t))},je=[Object.values(Ce)[0],Object.values(we)[0],Object.values(Te)[0]].filter(Boolean),Me={render:()=>je.map(t=>e(t))},Ne=[`data-slidev-no`,`lang`],Pe=A(x({__name:`SlideWrapper`,props:{clicksContext:{type:Object,required:!0},renderContext:{type:String,default:`slide`},route:{type:Object,required:!0}},setup(e){let n=e,r=p(()=>n.route.meta?.slide?.frontmatter.zoom??1);j(P,n.route),j(L,n.route.meta.slide.frontmatter),j(M,h(n.route.no)),j(F,h(n.renderContext)),j(ie,_(n,`clicksContext`)),j(R,r);let i=p(()=>({"user-select":O.selectable?void 0:`none`,"--slidev-slide-zoom-scale":r.value===1?void 0:r.value}));return(r,o)=>(C(),u(`div`,{"data-slidev-no":n.route.no,class:b(l(H)(e.route,[`slide`,`presenter`].includes(n.renderContext)?``:`disable-view-transition`)),style:d(i.value),lang:n.route.meta.slide.frontmatter.lang},[a(l(Me)),(C(),y(t(n.route.component))),a(l(Ae))],14,Ne))}}),[[`__scopeId`,`data-v-a7136532`]]);export{Q as a,de as i,Oe as n,K as o,De as r,Pe as t}; \ No newline at end of file diff --git a/transformer-v2/assets/default-DTdNOfwb.js b/transformer-v2/assets/default-DTdNOfwb.js new file mode 100644 index 0000000000000000000000000000000000000000..cb93e8e28de9507b0182342c03df5196c2899409 --- /dev/null +++ b/transformer-v2/assets/default-DTdNOfwb.js @@ -0,0 +1 @@ +import{H as e,S as t,b as n,z as r}from"./modules/shiki-BFOesOFp.js";import{t as i}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as a}from"./slidev/context-ChHKJoK9.js";import{t as o}from"./DeckFooter-CDGyhr7n.js";var s={class:`slidev-layout dl-default`},c=i({__name:`default`,setup(i){let{$slidev:c,$nav:l,$clicksContext:u,$clicks:d,$page:f,$renderContext:p,$frontmatter:m}=a();return(i,a)=>{let c=o;return r(),n(`div`,s,[e(i.$slots,`default`,{},void 0,!0),t(c)])}}},[[`__scopeId`,`data-v-3f3da7ce`]]);export{c as t}; \ No newline at end of file diff --git a/transformer-v2/assets/index-DBl9KyFJ.js b/transformer-v2/assets/index-DBl9KyFJ.js new file mode 100644 index 0000000000000000000000000000000000000000..8ad212cb42143e61686c00c0404dbf7b3a253266 --- /dev/null +++ b/transformer-v2/assets/index-DBl9KyFJ.js @@ -0,0 +1,46 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./modules/file-saver-BpWusTEB.js","./rolldown-runtime-hePW80VL.js","./slidev/entry-DSOswi5I.js","./modules/shiki-BFOesOFp.js","./modules/shiki-BrmBd2_v.css","./_plugin-vue_export-helper-BDNMzG2s.js","./entry-Dba4BKje.css","./slidev/overview-BcBOtip-.js","./useNav-B1TSwKuf.js","./modules/vue-CXhtJkbE.js","./slidev/context-ChHKJoK9.js","./slidev/IconButton-B5keGFol.js","./slidev/NoteDisplay-DHqEdDda.js","./NoteDisplay-DCBzjb4F.css","./modules/unplugin-icons-Btg0kt9H.js","./SlideWrapper-CbvN8YIq.js","./syncState-BrWO1mSt.js","./slidev/client-seyoTamJ.js","./useDrawings-Dnt5VfKs.js","./SlideWrapper-DBNQYNtZ.css","./slidev/NoteEditable-B2cQNQfC.js","./overview-BIQ10iVu.css","./slidev/notes-B1c7N93j.js","./slidev/Modal-BkELU18P.js","./slidev/TimerBar-CibTdbOq.js","./slidev/notes-edit-Df8w7NFL.js","./slidev/presenter-DzmhzatR.js","./slidev/DrawingControls--3fQRT-C.js","./slidev/VerticalDivider-D_ScNBWw.js","./DrawingControls-Dhbx0szf.css","./slidev/shortcuts-C1z9JmOm.js","./shortcuts-nRB69a7e.css","./presenter-J5ibmAMh.css","./slidev/play-BqFUT58m.js","./play-D_7yfuao.css","./slidev/404-Bx_SkrwT.js","./404-bkedjYjP.css"])))=>i.map(i=>d[i]); +import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,I as n,O as r,P as i,S as a,T as o,U as s,X as c,Y as l,_t as u,b as d,ft as f,g as p,gt as m,it as h,k as g,lt as _,m as v,nt as y,s as b,st as x,t as S,w as C,y as w,z as T}from"./modules/shiki-BFOesOFp.js";import{$ as E,A as ee,B as te,G as ne,Q as re,R as D,Z as ie,c as ae,et as oe,h as O,j as se,l as ce,n as le,p as ue,q as k,t as de,tt as A,w as fe,z as pe}from"./useNav-B1TSwKuf.js";import{A as me,B as he,I as ge,L as _e,R as ve,b as ye,d as be,h as xe,i as Se,k as Ce,o as we,w as Te,x as Ee}from"./modules/vue-CXhtJkbE.js";import{a as De,c as Oe,d as ke,f as Ae,g as je,i as Me,m as Ne,o as Pe,p as Fe,r as Ie,s as Le,u as Re,y as ze}from"./slidev/context-ChHKJoK9.js";import{n as j,r as Be,t as Ve}from"./syncState-BrWO1mSt.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),_(!1),_(!1);var He=new Set([`link`,`style`,`script`,`noscript`]),Ue=new Set([`title`,`titleTemplate`,`script`,`style`,`noscript`]),We=new Set([`base`,`meta`,`link`,`style`,`script`,`noscript`]),Ge=new Set([`title`,`base`,`htmlAttrs`,`bodyAttrs`,`meta`,`link`,`style`,`script`,`noscript`]),Ke=new Set([`base`,`title`,`titleTemplate`,`bodyAttrs`,`htmlAttrs`,`templateParams`]),qe=new Set([`key`,`tagPosition`,`tagPriority`,`tagDuplicateStrategy`,`innerHTML`,`textContent`,`processTemplateParams`]),Je=new Set([`templateParams`,`htmlAttrs`,`bodyAttrs`]),Ye=new Set([`theme-color`,`google-site-verification`,`author`,`og:locale:alternate`,`og:image`,`og:video`,`og:audio`,`article:author`,`article:tag`,`book:author`,`book:tag`,`twitter:image`]),Xe={critical:-8,high:-1,low:2},Ze=e=>typeof e==`number`?Number.isFinite(e):e;function Qe(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function $e(e,t,n,r){for(let i=n;ie[i](...t)):e[i](...t);if(n&&typeof n.then==`function`)return Promise.resolve(n).then(()=>$e(e,t,i+1,r))}catch(e){return Promise.reject(e)}}var et=class{_hooks;constructor(){this._hooks={}}hook(e,t){return!e||typeof t!=`function`?()=>{}:(this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)})}removeHook(e,t){let n=this._hooks[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[e]=void 0)}}callHook(e,...t){let n=this._hooks[e];if(!(!n||n.length===0))return $e(n,t,0)}};function tt(e){let t=new et;for(let n in e||{})t.hook(n,e[n]);return t}function M(e,t,n){if(e.hooks?._hooks?.[t]?.length)return e.hooks?.callHook(t,n)}var nt=/^(?:viewport|description|keywords|robots)$/,rt=[`name`,`property`,`http-equiv`];function it(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.slice(t+1);return Ye.has(n)||n.startsWith(`og:image:`)||n.startsWith(`og:video:`)||n.startsWith(`og:audio:`)||n.startsWith(`twitter:image:`)}function at(e){let{props:t,tag:n,key:r}=e;if(Ke.has(n))return n;if(n===`link`){if(t.rel===`canonical`)return`canonical`;if(t.rel===`alternate`&&t.hreflang)return`alternate:${t.hreflang}`}if(t.charset)return`charset`;if(n===`meta`)for(let e of rt){let n=t[e];if(n!==void 0)return`meta:${n}${(typeof n!=`string`||!n.includes(`:`))&&!nt.test(n)&&r?`:key:${r}`:``}`}return r?`${n}:key:${r}`:t.id?`${n}:id:${t.id}`:n===`link`&&t.rel&&t.href?`link:${t.rel}:${t.href}`:Ue.has(n)&&(e.textContent||e.innerHTML)?`${n}:content:${e.textContent||e.innerHTML}`:void 0}function ot(e){let t=e._h||e._d||e.textContent||e.innerHTML;if(t)return t;let n=Object.keys(e.props).sort(),r=`${e.tag}:`,i=``;for(let t of n)r+=`${i}${t}:${String(e.props[t])}`,i=`,`;return r}function st(e,t,n){if(n===`_resolver`)return e;typeof e==`function`&&(!n||n!==`titleTemplate`&&!n.startsWith(`on`))&&(e=e());let r=t?t(n,e):e;if(Array.isArray(r)){let e;for(let n=0;n/=\x00-\x1F\x7F]/;function lt(e,t){let n=e===`style`,r=n?new Map:new Set,i=e=>{if(e){if(n){let t=e.indexOf(`:`);t>0&&r.set(e.slice(0,t).trim(),e.slice(t+1).trim())}else e.split(` `).forEach(e=>e&&r.add(e))}};if(typeof t==`string`)(n?t.split(`;`):[t]).forEach(i);else if(Array.isArray(t))t.forEach(i);else if(t&&typeof t==`object`)for(let e in t){let a=t[e];a&&a!==`false`&&(n?r.set(e.trim(),String(a)):i(e))}return r}function ut(e,t){if(e.props=e.props||{},!t)return e;if(e.tag===`templateParams`)return e.props=t,e;let n=We.has(e.tag)||e.tag===`htmlAttrs`||e.tag===`bodyAttrs`;for(let r in t){if(Qe(r))continue;let i=r.startsWith(`data-`),a=n&&!qe.has(r),o=a&&!i?r.toLowerCase():r;if(a&&(!o||ct.test(o)))continue;let s=t[r];if(s===null)e.props[o]=null;else if(r===`class`||r===`style`)e.props[r]=lt(r,s);else if(qe.has(r)){if((r===`textContent`||r===`innerHTML`)&&typeof s==`object`){let n=t.type||`application/json`;(n.endsWith(`json`)||n===`speculationrules`||n===`importmap`)&&(e.props.type=t.type=n,e[r]=JSON.stringify(s))}else e[r]=s}else if(s!==void 0){let t=String(s),n=e.tag===`meta`&&o===`content`;e.props[o]=t===`true`||t===``?i||n?t:!0:!s&&i&&t===`false`?`false`:s}}return e}function dt(e,t){let n;return t.length&&(n=(e,n)=>{for(let r=0;re._w===t._w?e._p-t._p:e._w-t._w,vt=()=>100;function yt(e){for(let t in e)return!1;return!0}var bt=/^tags:|:render/;function xt(e,t){let n=(t[`entries:resolve`]?.length||0)+(t[`entries:normalize`]?.length||0);if(e._h!==n){e._h=n;for(let t of e.entries.values())delete t._tags}}function St(e){for(let t=0;t>10==i._p>>10&&n.tag===`meta`&&it(r)?(e.tagMap.set(r,Object.assign([...Array.isArray(i)?i:[i],n],n)),t=!0):(n._w===i._w?n._p>i._p:n._wt?(typeof e==`string`?e:JSON.stringify(e)).replace(ht,`\\u003C`):typeof e==`string`?e.replace(gt,`<\\/script`):e;n={...n},r&&(n.innerHTML=i(r)),n.textContent&&(n.textContent=i(n.textContent)),n._d=at(n)}e[t++]=n}}return e.length=t,e}function Dt(e,t){let n=t?.tagWeight??e.resolvedOptions._tagWeight??vt,r={tagMap:new Map,tags:[]},i=e.hooks?._hooks||{};xt(e,i);for(let t of e.entries.values())t._pending!==void 0&&(t.input=t._pending,delete t._pending,delete t._tags,delete t._precomputedTags);let a;(i[`entries:resolve`]?.length||i[`entries:normalize`]?.length)&&(a=[...e.entries.values()],i[`entries:resolve`]?.length&&M(e,`entries:resolve`,{entries:a,...r})),xt(e,i);for(let t of a||e.entries.values()){let a=t._tags;if(!a){if(t._precomputedTags&&n===e.resolvedOptions._tagWeight&&!i[`entries:normalize`]?.length&&!i[`entries:resolve`]?.length&&(!t.options||yt(t.options)))a=t._precomputedTags;else{if(a=mt(t.input,e.resolvedOptions.propResolvers||[]),t.options&&!yt(t.options))for(let e of a)Object.assign(e,t.options);if(i[`entries:normalize`]?.length){let n={tags:a,entry:t};M(e,`entries:normalize`,n),a=n.tags}for(let e=0;eh(t)?m(t):t,{_static:!0});function Mt(e,t={}){let n=t.head||kt();return n.ssr?n.push(e||{},t):Nt(n,e,t)}function Nt(e,r,a={}){let s=y();if(s&&!s.active)return{patch(){},dispose(){},_i:-1};let l=_(!1);if(a.onRendered&&s){let e=a.onRendered;a={...a,onRendered:t=>s.run(()=>e(t))}}let u;return c(()=>{let t=l.value?{}:st(r,jt);u?u.patch(t):u=e.push(t,a)}),o()&&(t(()=>{u.dispose()}),n(()=>{l.value=!0}),i(()=>{l.value=!1})),u}function Pt(e,t){if(typeof t==`function`&&t.key&&e.plugins.has(t.key))return;let n=typeof t==`function`?t(e):t,r=n.key||String(e.plugins.size+1);if(!e.plugins.get(r)){e.plugins.set(r,n);for(let t in n.hooks||{})e.hooks?.hook(t,n.hooks[t])}}function Ft(e,t={}){let n=!t.document,r=new Map,i={_entryCount:1,_h:0,plugins:new Map,resolvedOptions:t,ssr:n,entries:r,hooks:void 0,render:()=>e(i),use:e=>Pt(i,e),push(e,t){let a=t?._index??i._entryCount++,o=t?{...t}:{};delete o.head,delete o.onRendered,delete o._index;let s={_i:a,input:e,options:o};return r.set(a,s),{_i:a,dispose(){r.delete(a)},patch(e){n?(s.input=e,delete s._tags):s._pending=e,r.has(a)||r.set(a,s)}}}};return t.init?.forEach(e=>e&&i.push(e)),i}var It=Object.assign({}),Lt=Object.assign({}),Rt=Object.assign({}),zt=[Object.values(It)[0],Object.values(Lt)[0],Object.values(Rt)[0]].filter(Boolean),Bt=ye(),Vt=xe(`slidev-color-schema`,`auto`),Ht=p(()=>A.colorSchema!==`auto`),Ut=p({get(){return Ht.value?A.colorSchema===`dark`:Vt.value===`auto`?Bt.value:Vt.value===`dark`},set(e){Ht.value||(Vt.value=e===Bt.value?`auto`:e?`dark`:`light`)}}),Wt=ge(Ut);me&&l(Ut,e=>{let t=window.document.createElement(`style`);t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),window.document.head.appendChild(t);let n=document.querySelector(`html`);n.classList.toggle(`dark`,e),n.classList.toggle(`light`,!e),window.getComputedStyle(t).opacity,document.head.removeChild(t)},{immediate:!0});function Gt(){let{isPrintMode:e}=de();Ee(p(()=>e.value?` +@page { + size: ${re.value}px ${ie.value}px; + margin: 0px; +} + +* { + transition: none !important; + transition-duration: 0s !important; +}`:``))}var Kt=Symbol.for(`yaml.alias`),qt=Symbol.for(`yaml.document`),N=Symbol.for(`yaml.map`),Jt=Symbol.for(`yaml.pair`),Yt=Symbol.for(`yaml.scalar`),Xt=Symbol.for(`yaml.seq`),P=Symbol.for(`yaml.node.type`),Zt=e=>!!e&&typeof e==`object`&&e[P]===Kt,Qt=e=>!!e&&typeof e==`object`&&e[P]===qt,$t=e=>!!e&&typeof e==`object`&&e[P]===N,F=e=>!!e&&typeof e==`object`&&e[P]===Jt,I=e=>!!e&&typeof e==`object`&&e[P]===Yt,en=e=>!!e&&typeof e==`object`&&e[P]===Xt;function L(e){if(e&&typeof e==`object`)switch(e[P]){case N:case Xt:return!0}return!1}function R(e){if(e&&typeof e==`object`)switch(e[P]){case Kt:case N:case Yt:case Xt:return!0}return!1}var tn=e=>(I(e)||L(e))&&!!e.anchor,z=Symbol(`break visit`),nn=Symbol(`skip children`),rn=Symbol(`remove node`);function an(e,t){let n=sn(t);Qt(e)?on(null,e.contents,n,Object.freeze([e]))===rn&&(e.contents=null):on(null,e,n,Object.freeze([]))}an.BREAK=z,an.SKIP=nn,an.REMOVE=rn;function on(e,t,n,r){let i=cn(e,t,n,r);if(R(i)||F(i))return ln(e,r,i),on(e,i,n,r);if(typeof i!=`symbol`){if(L(t)){r=Object.freeze(r.concat(t));for(let e=0;eB(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!tn(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var fn=class{constructor(e){Object.defineProperty(this,P,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Qt(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=B(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?dn(i,{"":o},``,o):o}},pn=class extends fn{constructor(e){super(Kt),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],an(e,{Node:(e,t)=>{(Zt(t)||tn(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(B(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=mn(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(un(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function mn(e,t,n){if(Zt(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(L(t)){let r=0;for(let i of t.items){let t=mn(e,i,n);t>r&&(r=t)}return r}if(F(t)){let r=mn(e,t.key,n),i=mn(e,t.value,n);return Math.max(r,i)}return 1}var hn=e=>!e||typeof e!=`function`&&typeof e!=`object`,V=class extends fn{constructor(e){super(Yt),this.value=e}toJSON(e,t){return t?.keep?this.value:B(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED=`BLOCK_FOLDED`,V.BLOCK_LITERAL=`BLOCK_LITERAL`,V.PLAIN=`PLAIN`,V.QUOTE_DOUBLE=`QUOTE_DOUBLE`,V.QUOTE_SINGLE=`QUOTE_SINGLE`;var gn=`tag:yaml.org,2002:`;function _n(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function vn(e,t,n){if(Qt(e)&&(e=e.contents),R(e))return e;if(F(e)){let t=n.schema[N].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new pn(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=gn+t.slice(2));let l=_n(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new V(e);return c&&(c.node=t),t}l=e instanceof Map?o[N]:Symbol.iterator in Object(e)?o[Xt]:o[N]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new V(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function yn(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return vn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var bn=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,xn=class extends fn{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>R(t)||F(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(bn(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(L(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,yn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(L(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&I(i)?i.value:i:L(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F(t))return!1;let n=t.value;return n==null||e&&I(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return L(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(L(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,yn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Sn=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Cn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var wn=(e,t,n)=>e.endsWith(` +`)?Cn(n,t):n.includes(` +`)?` +`+Cn(n,t):(e.endsWith(` `)?``:` `)+n,Tn=`flow`,En=`block`,Dn=`quoted`;function On(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;ii-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=kn(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===` +`)n===`block`&&(h=kn(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==` +`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==` +`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),jn=e=>/^(%|---|\.\.\.)/m.test(e);function Mn(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;tr)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Nn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(jn(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length +`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==` +`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(` +`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===` +`&&(p=p.slice(0,-1)),p.replace(In,`$&${l}`));let h=!1,g,_=-1;for(g=0;g{i=!0});let s=On(`${v}${e}${p}`,l,En,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Rn(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(` +`)||u&&/[[\]{},]/.test(a))return Fn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(` +`)?Fn(a,t):Ln(e,t,n,r);if(!s&&!u&&i!==V.PLAIN&&a.includes(` +`))return Ln(e,t,n,r);if(jn(a)){if(c===``)return t.forceBlockIndent=!0,Ln(e,t,n,r);if(s&&c===l)return Fn(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return Fn(a,t)}return s?d:On(d,c,Tn,An(t,!1))}function zn(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==V.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=V.QUOTE_DOUBLE);let c=e=>{switch(e){case V.BLOCK_FOLDED:case V.BLOCK_LITERAL:return i||a?Fn(o.value,t):Ln(o,t,n,r);case V.QUOTE_DOUBLE:return Nn(o.value,t);case V.QUOTE_SINGLE:return Pn(o.value,t);case V.PLAIN:return Rn(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Bn(e,t){let n=Object.assign({blockQuote:!0,commentString:Sn,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Vn(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(I(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Hn(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(I(e)||L(e))&&e.anchor;a&&un(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Un(e,t,n,r){if(F(e))return e.toString(t,n,r);if(Zt(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=R(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Vn(t.doc.schema.tags,a);let o=Hn(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):I(a)?zn(a,t,n,r):a.toString(t,n,r);return o?I(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Wn({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=R(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(L(e)||!R(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||L(e)||(I(e)?e.type===V.BLOCK_FOLDED||e.type===V.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Un(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=wn(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=wn(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=wn(g,n.indent,l(f))));let _,v,y;R(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&I(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&en(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Un(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?` +`:``,v){let e=l(v);S+=`\n${Cn(e,n.indent)}`}x===``&&!n.inFlow?S===` +`&&y&&(S=` + +`):S+=`\n${n.indent}`}else if(!p&&L(t)){let e=x[0],r=x.indexOf(` +`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&ne===Kn||typeof e==`symbol`&&e.description===Kn,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new V(Symbol(Kn)),{addToJSMap:Yn}),stringify:()=>Kn},Jn=(e,t)=>(qn.identify(t)||I(t)&&(!t.type||t.type===V.PLAIN)&&qn.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===qn.tag&&e.default);function Yn(e,t,n){let r=Zn(e,n);if(en(r))for(let n of r.items)Xn(e,t,n);else if(Array.isArray(r))for(let n of r)Xn(e,t,n);else Xn(e,t,r)}function Xn(e,t,n){let r=Zn(e,n);if(!$t(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Zn(e,t){return e&&Zt(t)?t.resolve(e.doc,e):t}function Qn(e,t,{key:n,value:r}){if(R(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Jn(e,n))Yn(e,t,r);else{let i=B(n,``,e);if(t instanceof Map)t.set(i,B(r,i,e));else if(t instanceof Set)t.add(i);else{let a=$n(n,i,e),o=B(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function $n(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(R(e)&&n?.doc){let t=Bn(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Gn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function er(e,t,n){return new H(vn(e,void 0,n),vn(t,void 0,n))}var H=class e{constructor(e,t=null){Object.defineProperty(this,P,{value:Jt}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return R(n)&&(n=n.clone(t)),R(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Qn(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Wn(this,e,t,n):JSON.stringify(this)}};function tr(e,t,n){return(t.inFlow??e.flow?rr:nr)(e,t,n)}function nr({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;eo=null,()=>d=!0);o&&(s+=wn(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;ea=null);l||=d.length>u||o.includes(` +`),n0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=wn(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:` +`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function ir({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Cn(t(r),e);n.push(i.trimStart())}}function U(e,t){let n=I(t)?t.value:t;for(let r of e)if(F(r)&&(r.key===t||r.key===n||I(r.key)&&r.key.value===n))return r}var W=class extends xn{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(N,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(er(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=F(e)?e:!e||typeof e!=`object`||!(`key`in e)?new H(e,e?.value):new H(e.key,e.value);let r=U(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);I(r.value)&&hn(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=U(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=U(this.items,e)?.value;return(!t&&I(n)?n.value:n)??void 0}has(e){return!!U(this.items,e)}set(e,t){this.add(new H(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Qn(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!F(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),tr(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},ar={collection:`map`,default:!0,nodeClass:W,tag:`tag:yaml.org,2002:map`,resolve(e,t){return $t(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>W.from(e,t,n)},or=class extends xn{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Xt,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=sr(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=sr(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&I(r)?r.value:r}has(e){let t=sr(e);return typeof t==`number`&&t=0?t:null}var cr={collection:`seq`,default:!0,nodeClass:or,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return en(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>or.from(e,t,n)};function lr(e){return typeof e==`bigint`||Number.isInteger(e)}var ur=({value:e})=>JSON.stringify(e),dr=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:ur},{identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:ur},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:ur},{identify:lr,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>lr(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ur}];[ar,cr].concat(dr,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function fr(e,t,n){let{replacer:r}=n,i=new or(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(er(o,s,n))}return i}var pr=class e extends or{constructor(){super(),this.add=W.prototype.add.bind(this),this.delete=W.prototype.delete.bind(this),this.get=W.prototype.get.bind(this),this.has=W.prototype.has.bind(this),this.set=W.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(F(e)?(r=B(e.key,``,t),i=B(e.value,r,t)):r=B(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=fr(e,t,n),i=new this;return i.items=r.items,i}};pr.tag=`tag:yaml.org,2002:omap`;var mr=class e extends W{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=F(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new H(e.key,null):new H(e,null),U(this.items,t.key)||this.items.push(t)}get(e,t){let n=U(this.items,e);return!t&&F(n)?I(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=U(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new H(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(er(e,null,n));return i}};mr.tag=`tag:yaml.org,2002:set`;var hr=Symbol(`break visit`),gr=Symbol(`skip children`),_r=Symbol(`remove item`);function vr(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),yr(Object.freeze([]),e,t)}vr.BREAK=hr,vr.SKIP=gr,vr.REMOVE=_r,vr.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},vr.parentCollection=(e,t)=>{let n=vr.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function yr(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;txr.push(e)),j(G,`$onPatch`,e=>Sr.push(e)),Be(),j(G,`$patch`,async()=>!1);var{init:Cr,onPatch:wr,onUpdate:Tr,patch:Er,state:Dr}=Ve(G,G,!1),K=x({page:0,clicks:0,timer:{status:`stopped`,slides:{},startedAt:0,pausedAt:0}}),Or=[],kr=[];j(K,`$syncUp`,!0),j(K,`$syncDown`,!0),j(K,`$paused`,!1),j(K,`$onSet`,e=>Or.push(e)),j(K,`$onPatch`,e=>kr.push(e)),Be(),j(K,`$patch`,async()=>!1);var{init:Ar,onPatch:jr,onUpdate:Mr,patch:Nr,state:Pr}=Ve(K,{page:1,clicks:0,clicksTotal:0,timer:{status:`stopped`,slides:{},startedAt:0,pausedAt:0}});function Fr(){let e=o().appContext.app,t=x({nav:de(),configs:A,themeConfigs:p(()=>A.themeConfig)});e.provide(Ne,_(`none`)),e.provide(ze,t),e.provide(Ae,p(()=>t.nav.currentSlideNo)),e.provide(ke,f(ne()));for(let e of zt)e();let{clicksContext:n,currentSlideNo:r,hasPrimarySlide:i,isNotesViewer:a,isPresenter:s,isPrintMode:c}=de();Mt({title:E,htmlAttrs:A.htmlAttrs}),Gt(),Ar(`${E} - shared`),Cr(`${E} - drawings`);let u=`${location.origin}_${br()}`,d=p(()=>s.value?`presenter`:`viewer`);function m(){(s.value?se.value.presenterSend:se.value.viewerSend)&&(a.value||c.value||!s.value&&!Re.includes(location.host.split(`:`)[0])||(Nr(`page`,+r.value),Nr(`clicks`,n.value.current),Nr(`clicksTotal`,n.value.total),Nr(`lastUpdate`,{id:u,type:d.value,time:Date.now()})))}let h=he();h.afterEach(m),l(n,m),jr(e=>{(s.value?se.value.presenterReceive:se.value.viewerReceive)&&(!i.value||c.value||e.lastUpdate?.type!==d.value&&(+e.page!=+r.value||+n.value.current!=+e.clicks)&&(ue.value=!1,h.replace({path:te(e.page,s.value),query:{...h.currentRoute.value.query,clicks:e.clicks||0}})))})}var Ir=C({__name:`App`,setup(e){return Fr(),c(()=>{for(let[e,t]of Object.entries(oe.value))document.body.style.setProperty(e,t.toString())}),(e,t)=>{let n=s(`RouterView`);return T(),d(v,null,[a(n),w(`v-if`,!0)],64)}}});function Lr(e,t,n){let r=e.push,i=e;return i.ssr=!1,i.hooks=t,i.dirty=!!i.dirty,i.use=e=>Pt(i,e),i.render=()=>n(i),i.invalidate=()=>{for(let e of i.entries.values())delete e._tags;i.dirty=!0,t.callHook(`entries:updated`,i)},i.push=(n,a)=>{let o=a?.onRendered?t.hook(`dom:rendered`,a.onRendered):void 0,s=r(n,a),c=e.entries.get(s._i);return c&&(c._o=n),i.dirty=!0,t.callHook(`entries:updated`,i),{_i:s._i,patch(e){s.patch(e),i.dirty=!0,t.callHook(`entries:updated`,i)},dispose(){o?.(),e.entries.has(s._i)&&(s.dispose(),i.invalidate())}}},t.hook(`entries:updated`,()=>{i.render()}),i}var Rr=/\s+/;function zr(e={}){return t=>Hr(t,e)}function Br(e){for(let t of e.entries.values())if(t._pending!==void 0)return!0;return!1}function Vr(e,t){let n={_d:t,_t:t.title,_e:new Map([[`htmlAttrs`,t.documentElement],[`bodyAttrs`,t.body]]),_p:{},_s:{},_l:new Map};for(let e of[...t.body.children,...t.head.children]){let t=e.tagName.toLowerCase();if(!We.has(t))continue;let r={innerHTML:e.innerHTML};for(let t of e.getAttributeNames())r[t]=e.getAttribute(t);let i=ut({tag:t,props:{}},r);i.key=e.getAttribute(`data-hid`)||void 0;let a=at(i)||ot(i),o=a,s=1;for(;n._e.has(o);)o=`${a}:${s++}`;n._e.set(o,e)}for(let t of e.entries.values())if(t._o!==void 0){let e=t._o;for(let t of[`bodyAttrs`,`htmlAttrs`]){let r=e[t]?.class;if(typeof r==`string`){let e=n._e.get(t);for(let i of r.split(Rr))i&&(n._p[`${t}:attr:class:${i}`]=()=>e.classList.remove(i))}}}return n}function Hr(e,t={}){let n=t.document||e.resolvedOptions.document,r=e._dom,i=!!r&&r._d!==n;if(!n||r&&!i&&!e.dirty&&!Br(e)||e._du)return!1;let a=n.defaultView;e._du=!0;let o=!1;try{let i=function(e,t,n){d._s[e]=!n&&f[e]||t,delete f[e]},s=function(e,t,n,r,a,o){let s=`${e}:event:${t}`,c=d._l.get(s);if(c&&c[0]===o&&c[1]===n&&c[2]===r){i(s,c[4]);return}c?.[4]();let l=`data-${t}`,u=(e=>r.call(a,e)),f=()=>{o.removeEventListener(n,u),a.getAttribute(l)===``&&a.removeAttribute(l),d._l.get(s)?.[3]===u&&d._l.delete(s)};o.addEventListener(n,u),d._l.set(s,[o,n,r,u,f]),a.setAttribute(l,``),i(s,f,!0)},c=function({id:e,$el:t,tag:n}){let r=n.tag.endsWith(`Attrs`);if(d._e.set(e,t),!r){let r=n.textContent;r!=null&&r!==``&&(r!==t.textContent&&(t.textContent=r),i(`${e}:text`,()=>{t.textContent===r&&(t.textContent=``)},!0));let a=n.innerHTML;a!=null&&a!==``&&(a!==t.innerHTML&&(t.innerHTML=a),i(`${e}:html`,()=>{t.innerHTML===a&&(t.innerHTML=``)},!0));let o=`${e}:el`;i(o,f[o]||(()=>{t?.remove(),d._e.delete(e)}))}for(let r in n.props){let o=n.props[r];if(r[0]===`o`&&r[1]===`n`&&typeof o==`function`){let i=r.slice(2);t?.dataset?.[`${r}fired`]&&o.call(t,new((a?.Event)||Event)(i)),s(e,r,i,o,t,n.tag===`bodyAttrs`&&a?a:t);continue}let c=`${e}:attr:${r}`;if(r===`class`&&o)for(let e of o){let n=`${c}:${e}`;i(n,f[n]||(()=>t.classList.remove(e))),t.classList.contains(e)||t.classList.add(e)}else if(r===`style`&&o)for(let[e,n]of o){let r=`${c}:${e}`;i(r,f[r]||(()=>t.style.removeProperty(e))),t.style.setProperty(e,n)}else o!==!1&&o!==null&&(t.getAttribute(r)!==o&&t.setAttribute(r,o===!0?``:String(o)),i(c,f[c]||(()=>t.removeAttribute(r))))}},l={shouldRender:!0,tags:[]};if(M(e,`dom:beforeRender`,l),!l.shouldRender)return!1;let u=r;if(u?._d!==n){if(u){for(let e in u._s)u._s[e]();for(let e in u._p)u._p[e]();u._s=u._p={},u._e.clear(),u._l.clear()}u=void 0}u?u._p=u._s:u=Vr(e,n),u._s={};let d=u,f=d._p,p=[],m={};e.dirty=!1;let h=Dt(e,t.tagWeight?{tagWeight:t.tagWeight}:void 0),g=[],_={};for(let e of h){let t=_[e._d]||0,r=(t?`${e._d}:${t}`:e._d)||e._h,a={tag:e,id:r,shouldRender:!0};if(e.tag===`meta`&&e._d&&it(e._d)&&(_[e._d]=t+1),g.push(a),e.tag===`title`){n.title=e.textContent,i(`title:`,()=>n.title=d._t);continue}a.$el=d._e.get(r),a.$el?c(a):We.has(e.tag)&&p.push(a)}for(let e of p)e.$el=n.createElement(e.tag.tag),c(e),(m[e.tag.tagPosition||`head`]??=n.createDocumentFragment()).appendChild(e.$el);m.head&&n.head.appendChild(m.head),m.bodyOpen&&n.body.insertBefore(m.bodyOpen,n.body.firstChild),m.bodyClose&&n.body.appendChild(m.bodyClose);for(let e in f)f[e]();e._dom=d,o=!0,M(e,`dom:rendered`,{renders:g})}catch(t){throw e.dirty=!0,t}finally{e._du=!1}return o&&(e.dirty||Br(e))&&Hr(e,t),o}var Ur=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(Xe[e.tagPriority]||0);function Wr(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||zr({document:e.document}),n=Lr(Ft(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:Ur,init:[]}),tt(e.hooks),t);return e.plugins?.forEach(e=>n.use(e)),e.init?.forEach(e=>e&&n.push(e)),n}function Gr(e={}){let t=zr(),n,r=0;return n=Wr({render:()=>{let e=++r;setTimeout(()=>{e===r&&t(n)},0)},...e}),n.install=At(n),n}var Kr=Object.assign({}),qr=Object.assign({}),Jr=Object.assign({}),Yr=[Object.values(Kr)[0],Object.values(qr)[0],Object.values(Jr)[0]].filter(Boolean);function Xr(e,t=``){let n=[`slidev-page`,t],r=e?.meta?.slide?.no;return r!=null&&n.push(`slidev-page-${r}`),n.filter(Boolean).join(` `)}async function Zr(){let{saveAs:t}=await k(async()=>{let{saveAs:t}=await import(`./modules/file-saver-BpWusTEB.js`).then(t=>e(t.t(),1));return{saveAs:t}},__vite__mapDeps([0,1]),import.meta.url);t(typeof A.download==`string`?A.download:A.exportFilename?`${A.exportFilename}.pdf`:`./slidev-exported.pdf`,`${A.title}.pdf`)}function Qr(e,t,n){return(e.instance?.$).provides[t]??n}var $r=/[\s,]+/;function ei(e,t){let n=t.map(e=>`${Ie}${e}`);e.classList.forEach(t=>{t.startsWith(`slidev-vclick-anim-`)&&!n.includes(t)&&e.classList.remove(t)}),n.forEach(t=>e.classList.add(t))}function ti(){return{install(e){e.directive(`click`,{name:`v-click`,mounted(e,t){let n=ri(e,t,t.value);n!=null&&(e.classList.toggle(Oe,!0),e.dataset.slidevClicksStart=String(n.start),Number.isFinite(n.end)&&(e.dataset.slidevClicksEnd=String(n.end)),e.watchStopHandle=c(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;n.flagHide?(e.classList.toggle(De,t),e.classList.toggle(Pe,t)):e.classList.toggle(De,!t),ei(e,n.flagAnimations.value),e.classList.toggle(Me,r),e.classList.toggle(Le,i)}))},unmounted:ii}),e.directive(`after`,{name:`v-after`,mounted(e,t){let n=ri(e,t,`+0`);n!=null&&(e.classList.toggle(Oe,!0),e.watchStopHandle=c(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;n.flagHide?(e.classList.toggle(De,t),e.classList.toggle(Pe,t)):e.classList.toggle(De,!t),ei(e,n.flagAnimations.value),e.classList.toggle(Me,r),e.classList.toggle(Le,i)}))},unmounted:ii}),e.directive(`click-hide`,{name:`v-click-hide`,mounted(e,t){let n=ri(e,t,t.value,!0);n!=null&&(e.classList.toggle(Oe,!0),e.watchStopHandle=c(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;e.classList.toggle(De,t),e.classList.toggle(Pe,t),ei(e,n.flagAnimations.value),e.classList.toggle(Me,r),e.classList.toggle(Le,i)}))},unmounted:ii})}}}var ni=new Map;function ri(e,t,n,r=!1){let i=Qr(t,ke)?.value,a=Qr(t,Fe);if(!e||!i)return null;let o=r||t.modifiers.hide!==!1&&t.modifiers.hide!=null,s=Object.keys({...t.modifiers}).filter(e=>e!==`hide`),c=p(()=>{if(s.length>0)return s;let e=a?.clickAnimation||A.clickAnimation;return e?e.split($r).filter(Boolean):[]}),l=i.calculate(n);if(!l)return null;i.register(e,l);let u=p(()=>o?!l.isActive.value:l.isActive.value),d=p(()=>u.value?`shown`:Number.isFinite(l.end)?i.current{setTimeout(t.update,300)},{flush:`post`,immediate:!0});return{...t,stop:n}}function oi(e){return{info:_(pe(e)?.meta.slide??null),update:async()=>{}}}var si={};function ci(e){function t(e){return si[e]??=oi(e)}return{info:p({get(){return t(u(e)).info.value},set(n){t(u(e)).info.value=n}}),update:async(n,r)=>{let i=t(r??u(e)),a=await i.update(n);return a&&(i.info.value=a),a}}}function li(e){return()=>{}}function ui(e,t,n,r=!1){function i(t){return e?Qr(e,t):Ce(t)}let a=i(Ne),o=i(`$$slidev-fontmatter`)??{},s=i(Ae),c=p(()=>li(s.value)),u=i(`$$slidev-slide-scale`)??_(1),d=i(`$$slidev-slide-zoom`)??_(1),{left:f,top:m,stop:h}=ai(i(`$$slidev-slide-element`)??_()),{isPrintMode:g}=de(),v=[`slide`,`presenter`].includes(a.value)&&!g.value,y=e?`directive`:`prop`,b=br(),x;if(Array.isArray(t)?x=t:typeof t==`string`&&t.includes(`,`)?x=t.split(`,`).map(Number):t!=null&&(y=`frontmatter`,b=`${t}`,t=o?.dragPos?.[b],x=t?.split(`,`).map(Number)),y!==`frontmatter`&&!n)throw Error("[Slidev] Can not identify the source position of the v-drag element, please provide an explicit `id` prop.");let S=[h],C=!r&&t!=null&&!Number.isFinite(x?.[3]);x??=[NaN,NaN,0];let w=_(x[2]),T=_(x[0]+x[2]/2),E=_(r?0:x[4]??0),ee=p(()=>E.value*Math.PI/180),te=p(()=>Math.sin(ee.value)),ne=p(()=>Math.cos(ee.value)),re=_(),D=_({left:0,top:0,width:0,height:0}),ie=_(0);function ae(){if(!re.value)return;let e=re.value.getBoundingClientRect();D.value={left:e.left/d.value,top:e.top/d.value,width:e.width/d.value,height:e.height/d.value},ie.value=(D.value.width+D.value.height)/u.value/(Math.abs(te.value)+Math.abs(ne.value))-w.value}S.push(l(w,ae,{flush:`post`}));let oe=_(x[3]??0),O=C?p({get:()=>(C?ie.value:oe.value)||0,set:e=>!C&&(oe.value=e)}):oe,se=_(C?x[1]:x[1]+x[3]/2),ce=C?p({get:()=>se.value+O.value/2,set:e=>se.value=e-O.value/2}):se,ue=p(()=>Number.isFinite(T.value)?{position:`absolute`,zIndex:100,left:`${T.value-w.value/2}px`,top:`${ce.value-O.value/2}px`,width:`${w.value}px`,height:C?void 0:`${O.value}px`,transformOrigin:`center center`,transform:`rotate(${E.value}deg)`}:{position:`absolute`,zIndex:100});S.push(l([T,ce,w,O,E],([e,t,r,i,a])=>{let o=[e-r/2,t-i/2,r].map(Math.round).join();o+=C?y===`directive`?`,NaN`:`,_`:`,${Math.round(i)}`,Math.round(a)!==0&&(o+=`,${Math.round(a)}`),y===`directive`&&(o=`[${o}]`),c.value(b,o,y,n)}));let k={dragId:b,dataSource:y,markdownSource:n,isArrow:r,zoom:d,autoHeight:C,x0:T,y0:ce,width:w,height:O,rotate:E,container:re,containerStyle:ue,watchStopHandles:S,dragging:p(()=>le.value===k),mounted(){v&&(ae(),t||setTimeout(()=>{ae(),T.value=(D.value.left+D.value.width/2-f.value)/u.value,ce.value=(D.value.top-m.value)/u.value,w.value=D.value.width/u.value,O.value=D.value.height/u.value},100))},unmounted(){v&&k.stopDragging()},startDragging(){v&&(ae(),le.value=k)},stopDragging(){v&&le.value===k&&(le.value=null)}};return S.push(we(re,e=>{let t=document.querySelector(`#drag-control-container`);t&&e.target&&t.contains(e.target)||k.stopDragging()}),l(Te(),e=>{e||k.stopDragging()})),k}function di(){return{install(e){e.directive(`drag`,{name:`v-drag`,created(e,t,n){let r=ui(t,t.value,n.props?.markdownSource);n.props&&(n.props={...n.props},delete n.props.markdownSource),r.container.value=e,e.draggingState=r,e.dataset.dragId=r.dragId,r.watchStopHandles.push(l(r.containerStyle,t=>{for(let[n,r]of Object.entries(t))r&&(e.style[n]=r)},{immediate:!0})),e.addEventListener(`dblclick`,r.startDragging)},mounted(e){e.draggingState.mounted()},unmounted(e){let t=e.draggingState;t.unmounted(),e.removeEventListener(`dblclick`,t.startDragging),t.watchStopHandles.forEach(e=>e())}})}}}function fi(){return Math.floor(Math.random()*2**31)}var pi=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};function mi(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function hi(e,t,n){let r=[];e.forEach(e=>r.push(...e)),mi(r,t,n)}function gi(e,t){return e[0]===t[0]&&e[1]===t[1]}function _i(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)mi(e,s,i);let c=vi(o,a,r);if(i){for(let e of o)mi(e,s,-i);hi(c,s,-i)}return c}function vi(e,t,n){let r=[];for(let t of e){let e=[...t];gi(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;te.ymint.ymin?1:e.xt.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;ts);t++)e=t;a.splice(0,e+1).forEach(e=>{o.push({s,edge:e})})}if(o=o.filter(e=>!(e.edge.ymax<=s)),o.sort((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)),(n!==1||c%t===0)&&o.length>1)for(let e=0;e=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach(e=>{e.edge.x=e.edge.x+n*e.edge.islope}),c++}return i}function yi(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=t.strokeWidth*4),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),_i(e,r,n,i||1)}var bi=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=yi(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function xi(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var Si=class extends bi{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=t.strokeWidth*4),n=Math.max(n,.1);let r=yi(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=n*.5*Math.cos(i),s=n*.5*Math.sin(i);for(let[e,t]of r)xi([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},Ci=class extends bi{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},wi=class{constructor(e){this.helper=e}fillPolygons(e,t){t=Object.assign({},t,{hachureAngle:0});let n=yi(e,t);return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=t.strokeWidth*4),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=xi(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e{let a=xi(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e{let i=xi(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;er%2?e+n:e+t);a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Ii(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(zi(r,i,c,l,e,n,a,o,s).forEach(function(e){t.push({key:`C`,data:e})}),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function Li(e){return Math.PI*e/180}function Ri(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function zi(e,t,n,r,i,a,o,s,c,l){let u=Li(o),d=[],f=0,p=0,m=0,h=0;if(l)[f,p,m,h]=l;else{[e,t]=Ri(e,t,-u),[n,r]=Ri(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i=d*i,a=d*a);let g=s===c?-1:1,_=i*i,v=a*a,y=_*v-_*l*l-v*o*o,b=_*l*l+v*o*o,x=g*Math.sqrt(Math.abs(y/b));m=x*i*l/a+(e+n)/2,h=x*-a*o/i+(t+r)/2,f=Math.asin(parseFloat(((t-h)/a).toFixed(9))),p=Math.asin(parseFloat(((r-h)/a).toFixed(9))),ep&&(f-=Math.PI*2),!c&&p>f&&(p-=Math.PI*2)}let g=p-f;if(Math.abs(g)>Math.PI*120/180){let e=p,t=n,s=r;p=c&&p>f?f+Math.PI*120/180*1:f+Math.PI*120/180*-1,n=m+i*Math.cos(p),r=h+a*Math.sin(p),d=zi(n,r,t,s,i,a,o,0,c,[p,e,m,h])}g=p-f;let _=Math.cos(f),v=Math.sin(f),y=Math.cos(p),b=Math.sin(p),x=Math.tan(g/4),S=4/3*i*x,C=4/3*a*x,w=[e,t],T=[e+S*v,t-C*_],E=[n+S*b,r-C*y],ee=[n,r];if(T[0]=2*w[0]-T[0],T[1]=2*w[1]-T[1],l)return[T,E,ee].concat(d);{d=[T,E,ee].concat(d);let e=[];for(let t=0;t2){let i=[];for(let t=0;tMath.PI*2&&(p=0,m=Math.PI*2);let h=Math.PI*2/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=la(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=la(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...X(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...X(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function Yi(e,t){let n=Ii(Fi(Pi(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...X(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...ua(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...X(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function Xi(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+Y(e,t),r[0][1]+Y(e,t)]});for(let a=1;aMath.PI*2&&(d=0,f=Math.PI*2);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),Zi([m],o)}function $i(e,t){return Y(e,t)}function ea(e,t,n){return ia(e,t,n)}function ta(e,t,n,r,i){return X(e,t,n,r,i,!0)}function na(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function ra(e){return e.randomizer||=new pi(e.seed||0),e.randomizer.next()}function ia(e,t,n,r=1){return n.roughness*r*(ra(n)*(t-e)+e)}function Y(e,t,n=1){return ia(-e,e,t,n)}function X(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=aa(e,t,n,r,i,!0,!1);if(o)return s;let c=aa(e,t,n,r,i,!0,!0);return s.concat(c)}function aa(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+ra(i)*.2,p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=Y(p,i,l),m=Y(m,i,l);let h=[],g=()=>Y(d,i,l),_=()=>Y(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:Y(u,i,l)),t+(v?0:Y(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function oa(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]),r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]);for(let i=1;i3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+21&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=ga(a,o,r),u=ga(o,s,r),d=ga(s,c,r),f=ga(l,u,r),p=ga(u,d,r),m=ga(f,p,r);va([a,l,f,m],0,n,i),va([m,p,d,c],0,n,i)}return i}function ya(e,t){return ba(e,0,e.length,t)}function ba(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;rc&&(c=t,l=r)}return Math.sqrt(c)>r?(ba(e,t,l+1,r,a),ba(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function xa(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n0?ba(r,0,r.length,n):r}function Sa(e,t,n){let r=Ii(Fi(Pi(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...xa(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=ya(e,n);t.length&&u.push(t)}return u}var Z=`none`,Ca=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return fi()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[J(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=Ui(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(Xi([i],a)):o.push(Zi([i],a))}return a.stroke!==Z&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=Ki(n,r,a),c=qi(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=qi(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(Zi([c.estimatedPoints],a))}return a.stroke!==Z&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[Vi(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=Ji(e,t,n,r,i,a,o,!0,c);if(o&&c.fill){if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=Ji(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(Qi(e,t,n,r,i,a,c))}return c.stroke!==Z&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=Wi(e,n);if(n.fill&&n.fill!==Z){if(n.fillStyle===`solid`){let t=Wi(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...xa(fa([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...xa(fa(r),10,(1+n.roughness)/2))}t.length&&r.push(Zi([t],n))}}return n.stroke!==Z&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=Vi(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(Xi([e],n)):r.push(Zi([e],n))),n.stroke!==Z&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Z,a=n.stroke!==Z,o=!!(n.simplification&&n.simplification<1),s=o?4-4*(n.simplification||1):(1+n.roughness)/2,c=Sa(e,1,s),l=Yi(e,n);if(i){if(n.fillStyle===`solid`){if(c.length===1){let t=Yi(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(Xi(c,n))}else r.push(Zi(c,n))}return a&&(o?c.forEach(e=>{r.push(Vi(e,!1,n))}):r.push(l)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map(e=>+e.toFixed(t)):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Z};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Z,strokeWidth:0,fill:n.fill||Z};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Z,strokeWidth:n,fill:Z}}_mergedShape(e){return e.filter((e,t)=>t===0||e.op!==`move`)}},wa=`http://www.w3.org/2000/svg`,Ta=800,Ea=null;function Da(){return Ea||=new Ca().defaultOptions,Ea}function Oa(e,t,n){return{...Da(),maxRandomnessOffset:2,roughness:e===`highlight`?3:1.5,bowing:1,stroke:`#000`,strokeWidth:1.5,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,disableMultiStroke:e!==`double`,disableMultiStrokeFill:!1,seed:t,...n}}function ka(e){let t=e.padding;if(t||t===0){if(typeof t==`number`)return[t,t,t,t];if(Array.isArray(t)){let e=t;if(e.length)switch(e.length){case 4:return[...e];case 1:return[e[0],e[0],e[0],e[0]];case 2:return[...e,...e];case 3:return[...e,e[1]];default:return[e[0],e[1],e[2],e[3]]}}}return[5,5,5,5]}function Aa(e,t,n,r,i,a){let o=[],s=n.strokeWidth||2,c=ka(n),l=n.animate===void 0||!!n.animate,u=n.iterations||2,d=+!!n.rtl,f=Oa(`single`,a,n);switch(n.type){case`underline`:{let e=t.y+t.h+c[2];for(let n=d;ne.setAttribute(t,n);for(let r of t){let t=document.createElementNS(wa,`path`);if(d(t,`d`,r),d(t,`fill`,`none`),d(t,`stroke`,n.color||`currentColor`),d(t,`stroke-width`,`${s}`),n.opacity!==void 0&&d(t,`style`,`opacity:${n.opacity}`),l){let e=t.getTotalLength();a.push(e),u+=e}e.appendChild(t),c.push(t)}if(l){let e=0;for(let t=0;tsetTimeout(t,e))}function Ma(e){let t=[];for(let n of e){let e=``;for(let r of n.ops){let n=r.data;switch(r.op){case`move`:e.trim()&&t.push(e.trim()),e=`M${n[0]} ${n[1]} `;break;case`bcurveTo`:e+=`C${n[0]} ${n[1]}, ${n[2]} ${n[3]}, ${n[4]} ${n[5]} `;break;case`lineTo`:e+=`L${n[0]} ${n[1]} `}}e.trim()&&t.push(e.trim())}return t}function Na(){if(!window.__rno_kf_s){let e=window.__rno_kf_s=document.createElement(`style`);e.textContent=`@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }`,document.head.appendChild(e)}}var Pa=Object.defineProperty,Fa=(e,t,n)=>t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(Fa(e,typeof t==`symbol`?t:t+``,n),n),Ia=class{constructor(e,t){Q(this,`_state`,`unattached`),Q(this,`_config`),Q(this,`_resizing`,!1),Q(this,`_ro`),Q(this,`_seed`,fi()),Q(this,`_e`),Q(this,`_svg`),Q(this,`_lastSizes`,[]),Q(this,`_animationDelay`,0),Q(this,`_resizeListener`,()=>{this._resizing||(this._resizing=!0,setTimeout(()=>{this._resizing=!1,this._state===`showing`&&this.haveRectsChanged()&&this.show()},400))}),Q(this,`pendingRefresh`),this._e=e,this._config=JSON.parse(JSON.stringify(t)),this.attach()}getConfig(e){return this._config[e]}setConfig(e,t){this._config[e]!==t&&(this._config[e]=t,this.refresh())}get animate(){return this._config.animate}set animate(e){this._config.animate=e}get animationDuration(){return this._config.animationDuration}set animationDuration(e){this._config.animationDuration=e}get iterations(){return this._config.iterations}set iterations(e){this._config.iterations=e}get color(){return this._config.color}set color(e){this._config.color!==e&&(this._config.color=e,this.refresh())}get class(){return this._config.class}set class(e){this._config.class!==e&&(this._config.class=e,this._svg&&this._svg.setAttribute(`class`,[`rough-annotation`,this._config.class||``].filter(Boolean).join(` `)))}get strokeWidth(){return this._config.strokeWidth}set strokeWidth(e){this._config.strokeWidth!==e&&(this._config.strokeWidth=e,this.refresh())}get padding(){return this._config.padding}set padding(e){this._config.padding!==e&&(this._config.padding=e,this.refresh())}attach(){if(this._state===`unattached`&&this._e.parentElement){Na();let e=this._svg=document.createElementNS(wa,`svg`);e.setAttribute(`class`,[`rough-annotation`,this._config.class||``].filter(Boolean).join(` `));let t=e.style;t.position=`absolute`,t.top=`0`,t.left=`0`,t.overflow=`visible`,t.pointerEvents=`none`,t.width=`100px`,t.height=`100px`;let n=this._config.type===`highlight`;if(this._e.insertAdjacentElement(n?`beforebegin`:`afterend`,e),this._state=`not-showing`,n){let e=window.getComputedStyle(this._e).position;(!e||e===`static`)&&(this._e.style.position=`relative`)}this.attachListeners()}}detachListeners(){window.removeEventListener(`resize`,this._resizeListener),this._ro&&this._ro.unobserve(this._e)}attachListeners(){this.detachListeners(),window.addEventListener(`resize`,this._resizeListener,{passive:!0}),!this._ro&&`ResizeObserver`in window&&(this._ro=new window.ResizeObserver(e=>{for(let t of e)t.contentRect&&this._resizeListener()})),this._ro&&this._ro.observe(this._e)}haveRectsChanged(){if(this._lastSizes.length){let e=this.rects();if(e.length===this._lastSizes.length){for(let t=0;tMath.round(e)===Math.round(t);return n(e.x,t.x)&&n(e.y,t.y)&&n(e.w,t.w)&&n(e.h,t.h)}isShowing(){return this._state!==`not-showing`}refresh(){this.isShowing()&&!this.pendingRefresh&&(this.pendingRefresh=Promise.resolve().then(()=>{this.isShowing()&&this.show(),delete this.pendingRefresh}))}async show(){switch(this._state){case`unattached`:break;case`showing`:this.hide(),this._svg&&await this.render(this._svg,!0);break;case`not-showing`:this.attach(),this._svg&&await this.render(this._svg,!1)}}hide(){if(this._svg)for(;this._svg.lastChild;)this._svg.removeChild(this._svg.lastChild);this._state=`not-showing`}remove(){this._svg&&this._svg.parentElement&&this._svg.parentElement.removeChild(this._svg),this._svg=void 0,this._state=`unattached`,this.detachListeners()}async render(e,t){let n=this._config;t&&(n=JSON.parse(JSON.stringify(this._config)),n.animate=!1);let r=this.rects(),i=0;r.forEach(e=>i+=e.w);let a=n.animationDuration||Ta,o=0,s=[];for(let t=0;tObject.assign(e,{type:`box`}),circle:e=>Object.assign(e,{type:`circle`}),underline:e=>Object.assign(e,{type:`underline`}),highlight:e=>Object.assign(e,{type:`highlight`}),"strike-through":e=>Object.assign(e,{type:`strike-through`}),"crossed-off":e=>Object.assign(e,{type:`crossed-off`}),bracket:e=>Object.assign(e,{type:`bracket`}),strike:e=>Object.assign(e,{type:`strike-through`}),cross:e=>Object.assign(e,{type:`crossed-off`}),crossed:e=>Object.assign(e,{type:`crossed-off`}),linethrough:e=>Object.assign(e,{type:`strike-through`}),"line-through":e=>Object.assign(e,{type:`strike-through`}),black:e=>$(e,`text-black`),blue:e=>$(e,`text-blue`),cyan:e=>$(e,`text-cyan`),gray:e=>$(e,`text-gray`),green:e=>$(e,`text-green`),indigo:e=>$(e,`text-indigo`),lime:e=>$(e,`text-lime`),orange:e=>$(e,`text-orange`),pink:e=>$(e,`text-pink`),purple:e=>$(e,`text-purple`),red:e=>$(e,`text-red`),teal:e=>$(e,`text-teal`),white:e=>$(e,`text-white`),yellow:e=>$(e,`text-yellow`)},za=[[/^delay-?(\d+)?$/,(e,t,n)=>(t.delay=(e[1]?Number.parseInt(e[1]):n)||300,t)],[/^(?:op|opacity)-?(\d+)?$/,(e,t,n)=>(t.opacity=((e[1]?Number.parseInt(e[1]):n)||100)/100,t)]];function Ba(){return{install(e){e.directive(`mark`,{name:`v-mark`,mounted:(e,t)=>{let{isPrintMode:n}=de(),r=p(()=>{let e=typeof t.value==`object`&&!Array.isArray(t.value)?{...t.value}:{at:t.value},r={at:e.at},i=Object.entries(t.modifiers).filter(([e,t])=>{if(Ra[e])return r=Ra[e](r,t),!1;for(let[n,i]of za){let a=e.match(n);if(a)return r=i(a,r,t),!1}return!0});i.length&&console.warn(`[Slidev] Invalid modifiers for v-mark:`,i);let a={...r,...e};return a.type||=`underline`,n.value&&(a.animationDuration=1),a}),i=La(e,r.value),a=ri(e,t,r.value.at);if(!a){i.show();return}e.watchStopHandle=c(()=>{let e;r.value.class&&(i.class=r.value.class),r.value.color&&(i.color=r.value.color);let t=r.value.at;e=t===!0||t!==!1&&a.isActive.value,e!=null&&(e?i.show():i.hide())})},unmounted:e=>{e.watchStopHandle?.()}})}}}function Va(){return{install(e){let t=Se();e.directive(`motion`,{name:`v-motion`,mounted(e,n,r,i){let a=Qr(n,ke),o=Qr(n,Ae),s=Qr(n,Ne),{currentPage:c,clicks:u,isPrintMode:d}=de(),f=r.props={...r.props},p={...f.initial,...f.variants?.[`slidev-initial`]},m={...f.enter,...f.variants?.[`slidev-enter`]},h={...f.leave,...f.variants?.[`slidev-leave`]};delete f.initial,delete f.enter,delete f.leave;let g=`${br()}-`,_=[];for(let e of Object.keys(f))if(e.startsWith(`click-`)){let t=e.slice(6),n=t.includes(`-`)?t.split(`-`).map(Number):+t,r=g+t;_.push({id:r,at:n,variant:{...f[e]},info:a?.value.calculate(n)}),delete f[e]}_.sort((e,t)=>(Array.isArray(e.at)?e.at[0]:e.at)-(Array.isArray(t.at)?t.at[0]:t.at)),t.created(e,n,r,i),t.mounted(e,n,r,i);let v=e.motionInstance;v.clickIds=_.map(e=>e.id),v.set(p),v.watchStopHandle=l([o,c,u].filter(Boolean),()=>{let t=ni.get(e)?.visibilityState.value??`shown`;if(!a?.value||![`slide`,`presenter`].includes(s?.value??``)){let e={...p,...m};for(let{variant:t}of _)Object.assign(e,t);v.set(e)}else if(d.value||o?.value===c.value){if(t===`shown`){let e={...p,...m};for(let{variant:t,info:n}of _)(!n||n.isActive.value)&&Object.assign(e,t);d.value?v.set(e):v.apply(e)}else v.apply(t===`before`?p:h)}else v.apply((o?.value??-1)>c.value?p:h)},{immediate:!0})},unmounted(e){e.motionInstance.watchStopHandle()}})}}}var Ha=Object.assign({}),Ua=Object.assign({}),Wa=Object.assign({}),Ga=[Object.values(Ha)[0],Object.values(Ua)[0],Object.values(Wa)[0]].filter(Boolean);function Ka(){let e=[];function t(e){if(!A.remote||A.remote===e.query.password)return!0;if(A.remote&&e.query.password===void 0){let e=prompt(`Enter password`);if(A.remote===e)return!0}return e.params.no?{path:`/${e.params.no}`}:{path:``}}return e.push({name:`entry`,path:`/entry`,component:()=>k(()=>import(`./slidev/entry-DSOswi5I.js`),__vite__mapDeps([2,3,1,4,5,6]),import.meta.url),beforeEnter:t},{name:`overview`,path:`/overview`,component:()=>k(()=>import(`./slidev/overview-BcBOtip-.js`),__vite__mapDeps([7,3,1,4,8,5,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url),beforeEnter:t},{name:`notes`,path:`/notes`,component:()=>k(()=>import(`./slidev/notes-B1c7N93j.js`),__vite__mapDeps([22,3,1,4,8,5,9,10,11,23,12,13,24]),import.meta.url),beforeEnter:t},{name:`notes-edit`,path:`/notes-edit`,component:()=>k(()=>import(`./slidev/notes-edit-Df8w7NFL.js`),__vite__mapDeps([25,3,1,4,8,5,9,10,11,23]),import.meta.url),beforeEnter:t},{name:`presenter`,path:`/presenter/:no`,component:()=>k(()=>import(`./slidev/presenter-DzmhzatR.js`),__vite__mapDeps([26,3,1,4,8,5,9,10,18,27,11,28,29,12,13,24,15,16,17,19,20,30,31,32]),import.meta.url),beforeEnter:t},{path:`/presenter`,redirect:{path:`/presenter/1`}}),e.push({name:`play`,path:`/:no`,component:()=>k(()=>import(`./slidev/play-BqFUT58m.js`),__vite__mapDeps([33,3,1,4,8,5,9,10,18,23,14,15,16,17,19,30,11,28,31,34]),import.meta.url)},{path:``,redirect:{path:`/1`}},{path:`/:pathMatch(.*)*`,name:`NotFound`,component:()=>k(()=>import(`./slidev/404-Bx_SkrwT.js`),__vite__mapDeps([35,3,1,4,8,5,9,10,36]),import.meta.url)}),Ga.reduce((e,t)=>t(e),e)}async function qa(e){function t(){document.documentElement.style.setProperty(`--vh`,`${window.innerHeight*.01}px`)}t(),window.addEventListener(`resize`,t);let n=_e({history:ve(`./`),routes:Ka()});e.use(n),e.use(Gr()),e.use(ti()),e.use(Ba()),e.use(di()),e.use(Va()),e.use(S,{container:`#twoslash-container`});let r={app:e,router:n};for(let e of Yr)await e(r)}async function Ja(){let e=b(Ir);await qa(e),e.mount(`#app`)}Ja();export{Xr as a,wr as c,Ht as d,Ut as f,Zr as i,Er as l,Mt as m,oi as n,Pr as o,Wt as p,ai as r,Dr as s,ci as t,br as u}; \ No newline at end of file diff --git a/transformer-v2/assets/index-DmzORiUY.css b/transformer-v2/assets/index-DmzORiUY.css new file mode 100644 index 0000000000000000000000000000000000000000..c77269b3a35a653eccb65bfeafe6708e1825f18a --- /dev/null +++ b/transformer-v2/assets/index-DmzORiUY.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before,:after{--un-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*,:before,:after,::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.prose,[prose=""]{color:var(--un-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--un-prose-counters);font-weight:400}[prose=""] :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--un-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--un-prose-bullets)}[prose=""] :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--un-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--un-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--un-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before,[prose=""] :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after,[prose=""] :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-kbd);box-shadow:0 0 0 1px rgb(var(--un-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--un-prose-kbd-shadows) / 10%);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,[prose=""] :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after,[prose=""] :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-pre-code);background-color:var(--un-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,[prose=""] :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after,[prose=""] :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--un-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--un-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--un-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--un-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose,[prose=""]{font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where():not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where():not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where():not(:where([class~=not-prose],[class~=not-prose] *)),[prose=""] :where():not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose,[prose=""]{--un-prose-body:#374151;--un-prose-invert-body:#d1d5db;--un-prose-headings:#111827;--un-prose-invert-headings:white;--un-prose-lead:#4b5563;--un-prose-invert-lead:#9ca3af;--un-prose-links:#111827;--un-prose-invert-links:white;--un-prose-bold:#111827;--un-prose-invert-bold:white;--un-prose-counters:#6b7280;--un-prose-invert-counters:#9ca3af;--un-prose-bullets:#d1d5db;--un-prose-invert-bullets:#4b5563;--un-prose-hr:#e5e7eb;--un-prose-invert-hr:#374151;--un-prose-quotes:#111827;--un-prose-invert-quotes:#f3f4f6;--un-prose-quote-borders:#e5e7eb;--un-prose-invert-quote-borders:#374151;--un-prose-captions:#6b7280;--un-prose-invert-captions:#9ca3af;--un-prose-kbd:#111827;--un-prose-invert-kbd:white;--un-prose-kbd-shadows:#111827;--un-prose-invert-kbd-shadows:white;--un-prose-code:#111827;--un-prose-invert-code:white;--un-prose-pre-code:#e5e7eb;--un-prose-invert-pre-code:#d1d5db;--un-prose-pre-bg:#1f2937;--un-prose-invert-pre-bg:#00000080;--un-prose-th-borders:#d1d5db;--un-prose-invert-th-borders:#4b5563;--un-prose-td-borders:#e5e7eb;--un-prose-invert-td-borders:#374151}.dark .dark\:prose-invert{--un-prose-body:var(--un-prose-invert-body);--un-prose-headings:var(--un-prose-invert-headings);--un-prose-lead:var(--un-prose-invert-lead);--un-prose-links:var(--un-prose-invert-links);--un-prose-bold:var(--un-prose-invert-bold);--un-prose-counters:var(--un-prose-invert-counters);--un-prose-bullets:var(--un-prose-invert-bullets);--un-prose-hr:var(--un-prose-invert-hr);--un-prose-quotes:var(--un-prose-invert-quotes);--un-prose-quote-borders:var(--un-prose-invert-quote-borders);--un-prose-captions:var(--un-prose-invert-captions);--un-prose-kbd:var(--un-prose-invert-kbd);--un-prose-kbd-shadows:var(--un-prose-invert-kbd-shadows);--un-prose-code:var(--un-prose-invert-code);--un-prose-pre-code:var(--un-prose-invert-pre-code);--un-prose-pre-bg:var(--un-prose-invert-pre-bg);--un-prose-th-borders:var(--un-prose-invert-th-borders);--un-prose-td-borders:var(--un-prose-invert-td-borders)}.container{width:100%}.z-context-menu{z-index:60}.z-label{z-index:40}.z-menu{z-index:20}.z-modal{z-index:70}.z-nav{z-index:50}.slidev-glass-effect{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity));--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color,#0000001a),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);border-width:1px;border-color:#9ca3af33;--un-bg-opacity:.75!important}.border-main,.dark [border~=dark\:main],.dark [dark\:border~=main],[border-main=""],[border~=main]{border-color:#9ca3af33}.border-primary,.hover\:border-primary:hover{border-color:var(--slidev-theme-primary)}.bg-active{background-color:#9ca3af1a}.bg-main{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .bg-main,.dark .slidev-glass-effect{--un-bg-opacity:1;background-color:rgb(18 18 18/var(--un-bg-opacity))}.bg-primary,[bg-primary=""]{background-color:var(--slidev-theme-primary)}.hover\:bg-active:hover,[hover\:bg-active=""]:hover{background-color:#9ca3af1a}.dark .text-main{--un-text-opacity:1;color:rgb(221 221 221/var(--un-text-opacity))}.text-main{--un-text-opacity:1;color:rgb(24 24 24/var(--un-text-opacity))}.text-primary,[text-primary=""]{color:var(--slidev-theme-primary)}@media (width>=640px){.container{max-width:640px}}@media (width>=768px){.container{max-width:768px}}@media (width>=1024px){.container{max-width:1024px}}@media (width>=1280px){.container{max-width:1280px}}@media (width>=1536px){.container{max-width:1536px}}:root{--color-note:#0969da;--color-tip:#1a7f37;--color-warning:#9a6700;--color-severe:#bc4c00;--color-caution:#d1242f;--color-important:#8250df}@media (prefers-color-scheme:dark){:root{--color-note:#2f81f7;--color-tip:#3fb950;--color-warning:#d29922;--color-severe:#db6d28;--color-caution:#f85149;--color-important:#a371f7}}.markdown-alert{color:inherit;border-left:.25em solid #888;margin-bottom:16px;padding:.5rem 1rem}.markdown-alert>:first-child{margin-top:0}.markdown-alert>:last-child{margin-bottom:0}.markdown-alert .markdown-alert-title{align-items:center;font-weight:500;line-height:1;display:flex}.markdown-alert .markdown-alert-title .octicon{vertical-align:text-bottom;fill:currentColor;margin-right:.5rem;display:inline-block;overflow:visible!important}.markdown-alert.markdown-alert-note{border-left-color:var(--color-note)}.markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--color-note)}.markdown-alert.markdown-alert-important{border-left-color:var(--color-important)}.markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--color-important)}.markdown-alert.markdown-alert-warning{border-left-color:var(--color-warning)}.markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--color-warning)}.markdown-alert.markdown-alert-tip{border-left-color:var(--color-tip)}.markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--color-tip)}.markdown-alert.markdown-alert-caution{border-left-color:var(--color-caution)}.markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--color-caution)}:root{--slidev-code-background:#f5f5f5;--slidev-code-foreground:#1b1b1b;--slidev-code-font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--slidev-code-padding:8px;--slidev-code-font-size:12px;--slidev-code-line-height:18px;--slidev-code-radius:4px;--slidev-code-margin:4px 0;--slidev-theme-primary:#3ab9d5;--slidev-transition-duration:.5s;--slidev-slide-container-background:black;--slidev-controls-foreground:white;--slidev-code-tab-divider:#e5e5e5;--slidev-code-tab-text-color:#67676c;--slidev-code-tab-font-size:12px;--slidev-code-tab-active-text-color:#3c3c43}html.dark{--slidev-code-background:#1b1b1b;--slidev-code-foreground:#eee;--slidev-code-tab-divider:#222;--slidev-code-tab-text-color:#98989f;--slidev-code-tab-active-text-color:#dfdfd6}html,body,#app,#page-root{width:100%;height:100vh;height:calc(var(--vh,1vh) * 100);-webkit-print-color-adjust:exact;print-color-adjust:exact;--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity));margin:0;padding:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;overflow:hidden}.dark html,.dark body,.dark #app,.dark #page-root{--un-bg-opacity:1;background-color:rgb(18 18 18/var(--un-bg-opacity))}html{background:0 0}.slidev-icon-btn{aspect-ratio:1;-webkit-user-select:none;user-select:none;cursor:pointer;vertical-align:middle;opacity:.75;border-radius:.25rem;outline:none;justify-content:center;align-items:center;padding:.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-flex;position:relative}@media (width>=768px){.slidev-icon-btn{padding:.5rem}}.slidev-icon-btn:hover{--un-bg-opacity:.1;background-color:rgb(156 163 175/var(--un-bg-opacity))}.slidev-icon-btn:focus-visible{opacity:1;--un-outline-color-opacity:1;outline-width:2px;outline-color:rgb(0 0 0/var(--un-outline-color-opacity));outline-offset:2px;outline-style:solid}.dark .slidev-icon-btn:focus-visible{--un-outline-color-opacity:1;outline-color:rgb(255 255 255/var(--un-outline-color-opacity))}.slidev-icon-btn.shallow{opacity:.3}.slidev-icon-btn.active{opacity:1}.slidev-icon-btn.disabled{opacity:.25;pointer-events:none}.slidev-layout a.slidev-icon-btn{border-style:none}.slidev-layout a.slidev-icon-btn:hover{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity));border-style:none}.slidev-icon{vertical-align:sub;line-height:1em;display:inline-block}.slidev-page{width:100%;position:relative;top:0;left:0;right:0}.slidev-note-with-clicks .slidev-note-fade{color:#888c}.dark .slidev-note-with-clicks .slidev-note-fade{color:#a1a1a1cc}.slidev-note-click-mark{-webkit-user-select:none;user-select:none;--un-text-opacity:1;color:rgb(167 139 250/var(--un-text-opacity));background-color:#a78bfa1a;border-width:1px;border-color:#0000;border-radius:.25rem;align-items:center;padding-left:.25rem;padding-right:.25rem;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.7em;display:inline-flex}.slidev-note-click-mark.slidev-note-click-mark-active{--un-border-opacity:1;border-width:1px;border-color:rgb(167 139 250/var(--un-border-opacity))}.slidev-note-click-mark.slidev-note-click-mark-past{filter:saturate(0);opacity:.5}.slidev-note-click-mark.slidev-note-click-mark-future{opacity:.5}.slidev-note-click-mark:before{content:"";--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M23 28a1 1 0 0 1-.71-.29l-6.13-6.14l-3.33 5a1 1 0 0 1-1 .44a1 1 0 0 1-.81-.7l-6-20A1 1 0 0 1 6.29 5l20 6a1 1 0 0 1 .7.81a1 1 0 0 1-.44 1l-5 3.33l6.14 6.13a1 1 0 0 1 0 1.42l-4 4A1 1 0 0 1 23 28m0-2.41L25.59 23l-7.16-7.15l5.25-3.5L7.49 7.49l4.86 16.19l3.5-5.25Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;opacity:.8;background-color:currentColor;width:1.2em;height:1.2em;display:inline-block;-webkit-mask-size:100% 100%;mask-size:100% 100%}.slidev-note-click-mark:after{content:attr(data-clicks);display:inline-block;transform:translateY(.1em)}.slidev-form-button{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity));--un-border-opacity:1;border-bottom-width:2px;border-color:rgb(55 65 81/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(107 114 128/var(--un-bg-opacity));border-radius:.25rem;padding:.25rem 1rem}.slidev-form-button:hover{--un-border-opacity:1;border-color:rgb(75 85 99/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(156 163 175/var(--un-bg-opacity))}.slidev-form-button.primary{--un-border-opacity:1;border-color:rgb(17 94 89/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(13 148 136/var(--un-bg-opacity))}.slidev-form-button.primary:hover{--un-border-opacity:1;border-color:rgb(15 118 110/var(--un-border-opacity));--un-bg-opacity:1;background-color:rgb(20 184 166/var(--un-bg-opacity))}.rough-annotation{transform:scale(calc(1 / var(--slidev-slide-scale)))}#twoslash-container{position:fixed}#twoslash-container .v-popper__wrapper:not(.no-slide-scale>*){zoom:var(--slidev-slide-scale)}#twoslash-container .v-popper__popper:not(.no-slide-scale>*){translate:calc(10px * (1 - var(--slidev-slide-scale))) 0;width:max-content}.slidev-note ul{margin:0}html.dark:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}html.dark .shiki{color:var(--shiki-dark,inherit);--twoslash-popup-bg:var(--shiki-dark-bg,inherit)}html.dark .shiki span{color:var(--shiki-dark)}html:not(.dark) .shiki{color:var(--shiki-light,inherit);--twoslash-popup-bg:var(--shiki-light-bg,inherit)}html:not(.dark) .shiki span{color:var(--shiki-light)}.twoslash-meta-line.twoslash-popover-line{margin-top:-10px}.slidev-code-wrapper{scroll-padding:var(--slidev-code-padding);margin:var(--slidev-code-margin)!important}.slidev-code-wrapper:-webkit-scrollbar{width:0}.slidev-code{background:var(--slidev-code-background);overflow:auto;font-family:var(--slidev-code-font-family)!important;padding:var(--slidev-code-padding)!important;font-size:var(--slidev-code-font-size)!important;line-height:var(--slidev-code-line-height)!important;border-radius:var(--slidev-code-radius)!important}.slidev-code-block-title,.slidev-code-group-tabs{background:var(--slidev-code-background);color:var(--slidev-code-tab-text-color);padding-left:var(--slidev-code-padding);padding-right:var(--slidev-code-padding);font-size:var(--slidev-code-tab-font-size);border-radius:var(--slidev-code-radius) var(--slidev-code-radius) 0 0;box-shadow:inset 0 -1px var(--slidev-code-tab-divider);align-items:center;gap:8px;display:flex}.slidev-code-block-title{padding:var(--slidev-code-padding)}.slidev-code-tab{font-size:var(--slidev-code-tab-font-size);white-space:nowrap;cursor:pointer;padding:var(--slidev-code-padding);color:var(--slidev-code-tab-text-color);border-bottom:2px solid #0000;align-items:center;gap:8px;transition:color .25s;display:flex;position:relative}.slidev-code-tab:hover{color:var(--slidev-code-tab-active-text-color)!important}.slidev-code-group-blocks .slidev-code-wrapper{margin:0!important}.slidev-code-group-blocks .slidev-code{border-radius:0 0 var(--slidev-code-radius) var(--slidev-code-radius)!important}.slidev-code-group-blocks .slidev-code-wrapper.active{display:block}.slidev-code-group-blocks .slidev-code-wrapper{display:none}.slidev-code-block-title+.slidev-code,.slidev-code-group-tabs+.slidev-code{border-top-left-radius:0!important;border-top-right-radius:0!important}.slidev-code .slidev-code-dishonored{opacity:.3;pointer-events:none}.slidev-code-line-numbers .slidev-code code{counter-reset:step;counter-increment:step calc(var(--start,1) - 1)}.slidev-code-line-numbers .slidev-code code .line:before{content:counter(step);counter-increment:step;text-align:right;--un-text-opacity:1;width:1rem;color:rgb(156 163 175/var(--un-text-opacity));margin-right:1.5rem;display:inline-block}.dark .slidev-code-line-numbers .slidev-code code .line:before{--un-text-opacity:1;color:rgb(75 85 99/var(--un-text-opacity))}.slidev-note :not(pre)>code,.slidev-layout :not(pre)>code{background:var(--slidev-code-background);border-radius:var(--slidev-code-radius);padding:.125rem .375rem;font-size:.9em;font-weight:300}.slidev-note :not(pre)>code:after,.slidev-note :not(pre)>code:before{content:""}.slidev-layout :not(pre)>code:before{margin-right:-.08em}.katex,.katex :after,.katex :before{border-color:currentColor}.slidev-katex-wrapper .mord.dishonored{opacity:.3}.slide-left-enter-active,.slide-left-leave-active,.slide-right-enter-active,.slide-right-leave-active,.slide-up-enter-active,.slide-up-leave-active,.slide-down-enter-active,.slide-down-leave-active{transition:all var(--slidev-transition-duration) ease}.slide-left-enter-from,.slide-right-leave-to{translate:100%}.slide-left-leave-to,.slide-right-enter-from{translate:-100%}.slide-up-enter-from,.slide-down-leave-to{translate:0 100%}.slide-up-leave-to,.slide-down-enter-from{translate:0 -100%}.fade-enter-active,.fade-leave-active{transition:opacity var(--slidev-transition-duration) ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-out-leave-active{transition:opacity calc(var(--slidev-transition-duration) * .6) ease-out}.fade-out-enter-active{transition:opacity calc(var(--slidev-transition-duration) * .8) ease-in;transition-delay:calc(var(--slidev-transition-duration) * .6)}.fade-out-enter-from,.fade-out-leave-to{opacity:0}:root{--twoslash-popup-bg:var(--slidev-code-background);--twoslash-popup-color:var(--slidev-code-foreground);--twoslash-docs-color:inherit;--twoslash-docs-font:inherit;--twoslash-code-font:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--twoslash-underline-color:#8888;--twoslash-border-color:#8888;--twoslash-cursor-color:var(--slidev-theme-primary);--twoslash-matched-color:var(--slidev-theme-primary)}.twoslash-popup-container{font-size:13px}.twoslash-popup-container .twoslash-popup-code{font-size:.85em}.twoslash-floating .twoslash-popup-docs-tags .twoslash-popup-docs-tag-name{color:inherit;opacity:.5}.slidev-vclick-target{transition:all .1s}.slidev-vclick-target.slidev-vclick-anim-none{transition:none}.slidev-vclick-target.slidev-vclick-anim-fade-in{transition:all .3s}.slidev-vclick-hidden{opacity:0!important;pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important}.slidev-vclick-hidden.slidev-vclick-anim-fade{opacity:.5!important}.slidev-vclick-hidden.slidev-vclick-anim-fade-in{opacity:0!important}.slidev-vclick-hidden.slidev-vclick-anim-up{translate:0 20px}.slidev-vclick-hidden.slidev-vclick-anim-down{translate:0 -20px}.slidev-vclick-hidden.slidev-vclick-anim-left{translate:20px}.slidev-vclick-hidden.slidev-vclick-anim-right{translate:-20px}.slidev-vclick-hidden.slidev-vclick-anim-scale{scale:.9}.slidev-vclick-display-none{display:none!important}.slidev-vclick-fade{opacity:.5}:root{--dl-bg:#fff;--dl-surface:#f7f9fa;--dl-border:#e3e8ea;--dl-heading:#111;--dl-body:#595959;--dl-muted:#8a8a8a;--dl-accent:#0097a7;--dl-accent-soft:#e0f4f6;--dl-accent-strong:#00707c;--dl-danger:#d32f2f;--dl-table-header:#eee;--dl-code-bg:#f6f8fa;--dl-fs-title:4.4rem;--dl-fs-section:3rem;--dl-fs-heading:2.1rem;--dl-fs-body:1.5rem;--dl-fs-secondary:1.17rem;--dl-fs-citation:.85rem;--dl-q:#6a3fd6;--dl-k:#c25a00;--dl-v:#1565c0;--dl-enc:#2e7d32;--dl-dec:#ad1457;--dl-pos:#8a6100}html.dark{--dl-bg:#0d1117;--dl-surface:#161b22;--dl-border:#2a323d;--dl-heading:#f2f5f7;--dl-body:#c2cad2;--dl-muted:#8b949e;--dl-accent:#2ec9d8;--dl-accent-soft:#123236;--dl-accent-strong:#7fe3ee;--dl-danger:#ff7b72;--dl-table-header:#1c2530;--dl-code-bg:#161b22;--dl-q:#b69cff;--dl-k:#ffab5e;--dl-v:#74b0ff;--dl-enc:#6fd59a;--dl-dec:#f584b5;--dl-pos:#f2c94c}.slidev-layout{--slidev-code-background:var(--dl-code-bg);background:var(--dl-bg);height:100%;color:var(--dl-body);font-size:var(--dl-fs-body);padding:2.6rem 3rem 3.2rem;line-height:1.5;position:relative}.slidev-layout h1,.slidev-layout h2,.slidev-layout h3,.slidev-layout h4{color:var(--dl-heading);letter-spacing:-.01em;font-weight:600}.slidev-layout h1{font-size:var(--dl-fs-heading);margin-bottom:1.2rem}.slidev-layout h2{margin-bottom:.8rem;font-size:1.7rem}.slidev-layout h3{margin-bottom:.6rem;font-size:1.35rem}.slidev-layout p{margin:.5rem 0}.slidev-layout ul{margin:.4rem 0;padding-left:1.35rem;list-style:outside}.slidev-layout ol{margin:.4rem 0;padding-left:1.6rem;list-style:decimal}.slidev-layout ul ul{list-style:circle}.slidev-layout li{margin:.42rem 0}.slidev-layout li::marker{color:var(--dl-accent)}.slidev-layout a{color:var(--dl-accent);border-bottom:1px solid color-mix(in srgb, var(--dl-accent) 40%, transparent);text-decoration:none;transition:border-color .15s}.slidev-layout a:hover{border-bottom-color:var(--dl-accent)}.slidev-layout strong{color:var(--dl-heading);font-weight:600}.dl-wrong{color:var(--dl-danger);font-weight:600}.dl-secondary{font-size:var(--dl-fs-secondary);color:var(--dl-muted)}.slidev-layout table{border-collapse:collapse;font-size:var(--dl-fs-secondary);width:100%}.slidev-layout table th{background:var(--dl-table-header);color:var(--dl-heading);text-align:left;font-weight:600}.slidev-layout table th,.slidev-layout table td{border:1px solid var(--dl-border);padding:.4rem .7rem}.slidev-layout blockquote{border-left:3px solid var(--dl-accent);background:var(--dl-accent-soft);color:var(--dl-body);margin:.8rem 0;padding:.6rem 1rem}.dl-rule{background:var(--dl-accent);border-radius:2px;width:4.5rem;height:3px}.dl-callout{border-left:3px solid var(--dl-accent);background:var(--dl-accent-soft);border-radius:0 6px 6px 0;padding:.7rem 1rem;font-size:1.05rem}.dl-card{border:1px solid var(--dl-border);background:var(--dl-surface);border-radius:8px;overflow:hidden}.dl-card img{object-fit:cover;width:100%;height:6.2rem;display:block}.dl-card.is-contain img{object-fit:contain;background:var(--dl-bg);padding:.5rem}.dl-card__cap{color:var(--dl-body);padding:.35rem .55rem;font-size:.78rem}.dl-tight{font-size:1.06rem;line-height:1.45}.dl-tight li{margin:.34rem 0}.dl-tight .dl-callout{font-size:1rem}.dl-describe{max-width:52rem;font-size:1.15rem;line-height:1.45}.dl-describe p{margin:.4rem 0}.dl-describe li{margin:.22rem 0}.dl-ledger table{font-size:1.02rem}.dl-ledger table th,.dl-ledger table td{padding:.24rem .6rem}.dl-eq-legend table{font-size:.86rem}.dl-eq-legend table th,.dl-eq-legend table td{padding:.16rem .45rem}.dl-eq-legend table td:first-child{white-space:nowrap}.dl-prompt{color:var(--dl-heading);border-left:3px solid var(--dl-accent);padding-left:.8rem;font-size:1.05rem;font-style:italic}.dl-reveal{color:var(--dl-accent);font-size:1.8rem;font-weight:700}.slidev-layout .katex{color:var(--dl-heading)}.slidev-layout .katex-display>.katex{font-size:1em}.dl-math-sm .katex{font-size:.84em}.dl-math-xs .katex{font-size:.72em}.slidev-code-wrapper{border:1px solid var(--dl-border);border-radius:6px;flex-shrink:0;overflow:hidden}.dl-diagram{width:100%;max-width:41rem;height:auto;font-family:inherit}.dl-dg-box{fill:var(--dl-surface);stroke:var(--dl-border);stroke-width:1.5px}.dl-dg-box.is-accent{fill:var(--dl-accent-soft);stroke:var(--dl-accent)}.dl-dg-box.is-bad{fill:none;stroke:var(--dl-danger);stroke-dasharray:4 3}.dl-dg-net{fill:var(--dl-accent-soft);stroke:var(--dl-accent);stroke-width:1.6px}.dl-dg-net.is-critic{fill:var(--dl-surface);stroke:var(--dl-body)}.dl-dg-op{fill:var(--dl-bg);stroke:var(--dl-heading);stroke-width:1.6px}.dl-dg-lab{fill:var(--dl-heading);font-size:17px;font-style:italic;font-weight:600}.dl-dg-lab.is-sm{font-size:13px;font-style:normal}.dl-dg-in{fill:var(--dl-accent-strong);font-size:13px;font-weight:700}.dl-dg-net.is-critic+.dl-dg-in,.dl-dg-in.is-critic{fill:var(--dl-body)}.dl-dg-small{fill:var(--dl-muted);font-size:11px}.dl-dg-small.is-bad{fill:var(--dl-danger)}.dl-dg-small.is-good{fill:var(--dl-accent-strong)}.dl-dg-arrow{fill:none;stroke:var(--dl-body);stroke-width:1.8px}.dl-dg-head{fill:var(--dl-body)}.dl-dg-loss,.dl-dg-grad{fill:none;stroke:var(--dl-muted);stroke-width:1.4px;stroke-dasharray:3 3}.dl-dg-grad.is-bad{stroke:var(--dl-danger)}.dl-dg-grad.is-good{stroke:var(--dl-accent);stroke-dasharray:none}.dl-dg-split{stroke:var(--dl-border);stroke-width:1px}.dl-diagram.is-sm{max-width:26rem}.dl-diagram.is-xs{max-width:18rem}.dl-dg-bar{fill:var(--dl-muted)}.dl-dg-bar.is-q{fill:var(--dl-accent)}.dl-dg-bar.is-bad{fill:var(--dl-danger)}.dl-dg-fill{fill:var(--dl-accent-soft);stroke:var(--dl-accent);stroke-width:1.4px}.dl-dg-fill.is-muted{fill:var(--dl-surface);stroke:var(--dl-muted)}.dl-dg-fill.is-dashed{stroke-dasharray:4 3}.dl-dg-dot{fill:var(--dl-body)}.dl-dg-dot.is-accent{fill:var(--dl-accent)}.dl-dg-dot.is-bad{fill:var(--dl-danger)}.dl-dg-line{fill:none;stroke:var(--dl-accent);stroke-width:2.2px}.dl-dg-line.is-muted{stroke:var(--dl-muted)}.dl-dg-line.is-bad{stroke:var(--dl-danger)}.dl-dg-emoji{font-size:30px}.dl-dg-lab.is-bad-text{fill:var(--dl-danger)}.dl-diagram.is-sm-h{max-height:11.5rem}.dl-dg-box.is-q,.dl-dg-fill.is-q{fill:color-mix(in srgb, var(--dl-q) 14%, var(--dl-bg));stroke:var(--dl-q)}.dl-dg-box.is-k,.dl-dg-fill.is-k{fill:color-mix(in srgb, var(--dl-k) 14%, var(--dl-bg));stroke:var(--dl-k)}.dl-dg-box.is-v,.dl-dg-fill.is-v{fill:color-mix(in srgb, var(--dl-v) 14%, var(--dl-bg));stroke:var(--dl-v)}.dl-dg-box.is-enc,.dl-dg-fill.is-enc{fill:color-mix(in srgb, var(--dl-enc) 14%, var(--dl-bg));stroke:var(--dl-enc)}.dl-dg-box.is-dec,.dl-dg-fill.is-dec{fill:color-mix(in srgb, var(--dl-dec) 14%, var(--dl-bg));stroke:var(--dl-dec)}.dl-dg-box.is-pos,.dl-dg-fill.is-pos{fill:color-mix(in srgb, var(--dl-pos) 16%, var(--dl-bg));stroke:var(--dl-pos)}.dl-dg-line.is-q,.dl-dg-arrow.is-q{stroke:var(--dl-q)}.dl-dg-line.is-k,.dl-dg-arrow.is-k{stroke:var(--dl-k)}.dl-dg-line.is-v,.dl-dg-arrow.is-v{stroke:var(--dl-v)}.dl-dg-line.is-enc,.dl-dg-arrow.is-enc{stroke:var(--dl-enc)}.dl-dg-line.is-dec,.dl-dg-arrow.is-dec{stroke:var(--dl-dec)}.dl-dg-line.is-pos,.dl-dg-arrow.is-pos{stroke:var(--dl-pos)}.dl-dg-arrow.is-accent{stroke:var(--dl-accent)}.dl-dg-head.is-q{fill:var(--dl-q)}.dl-dg-head.is-k{fill:var(--dl-k)}.dl-dg-head.is-v{fill:var(--dl-v)}.dl-dg-head.is-enc{fill:var(--dl-enc)}.dl-dg-head.is-dec{fill:var(--dl-dec)}.dl-dg-head.is-pos{fill:var(--dl-pos)}.dl-dg-head.is-accent{fill:var(--dl-accent)}.dl-dg-lab.is-q,.dl-dg-in.is-q,.dl-dg-small.is-q{fill:var(--dl-q)}.dl-dg-lab.is-k,.dl-dg-in.is-k,.dl-dg-small.is-k{fill:var(--dl-k)}.dl-dg-lab.is-v,.dl-dg-in.is-v,.dl-dg-small.is-v{fill:var(--dl-v)}.dl-dg-lab.is-enc,.dl-dg-in.is-enc,.dl-dg-small.is-enc{fill:var(--dl-enc)}.dl-dg-lab.is-dec,.dl-dg-in.is-dec,.dl-dg-small.is-dec{fill:var(--dl-dec)}.dl-dg-lab.is-pos,.dl-dg-in.is-pos,.dl-dg-small.is-pos{fill:var(--dl-pos)}.dl-dg-bar.is-v{fill:var(--dl-v)}.dl-dg-bar.is-k{fill:var(--dl-k)}.dl-dg-bar.is-pos{fill:var(--dl-pos)}.dl-c-q{color:var(--dl-q);font-weight:600}.dl-c-k{color:var(--dl-k);font-weight:600}.dl-c-v{color:var(--dl-v);font-weight:600}.dl-c-enc{color:var(--dl-enc);font-weight:600}.dl-c-dec{color:var(--dl-dec);font-weight:600}.dl-c-pos{color:var(--dl-pos);font-weight:600}.dl-dg-flow{stroke-dasharray:7 5}@media (prefers-reduced-motion:no-preference){.dl-dg-flow{animation:.8s linear infinite dl-dg-march}.dl-dg-flow.is-slow{animation-duration:1.6s}.dl-dg-pulse{animation:1.8s ease-in-out infinite dl-dg-pulse}}@keyframes dl-dg-march{to{stroke-dashoffset:-12px}}@keyframes dl-dg-pulse{50%{stroke-width:3.2px}}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(./KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(./KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(./KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(./KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(./KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(./KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(./KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(./KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(./KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(./KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(./KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(./KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(./KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(./KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(./KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(./KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(./KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(./KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(./KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(./KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(./KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(./KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(./KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(./KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(./KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(./KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(./KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(./KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(./KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(./KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(./KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(./KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(./KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(./KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(./KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(./KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(./KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(./KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(./KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(./KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(./KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(./KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(./KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(./KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(./KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(./KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(./KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(./KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(./KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(./KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(./KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(./KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(./KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(./KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(./KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(./KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(./KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(./KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(./KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.18.4"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{white-space:nowrap;width:min-content;position:relative}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .katex-vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .katex-thinbox{flex-direction:row;width:0;max-width:0;display:inline-flex}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .katex-hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.katex-root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .katex-stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}.i-carbon-camera{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M29 26H3a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h6.46l1.71-2.55A1 1 0 0 1 12 4h8a1 1 0 0 1 .83.45L22.54 7H29a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1M4 24h24V9h-6a1 1 0 0 1-.83-.45L19.46 6h-6.92l-1.71 2.55A1 1 0 0 1 10 9H4Z'/%3E%3Cpath fill='currentColor' d='M16 22a6 6 0 1 1 6-6a6 6 0 0 1-6 6m0-10a4 4 0 1 0 4 4a4 4 0 0 0-4-4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon-magic-wand{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M29.414 24L12 6.586a2.05 2.05 0 0 0-2.828 0L6.586 9.172a2 2 0 0 0 0 2.828l17.413 17.414a2 2 0 0 0 2.828 0l2.587-2.586a2 2 0 0 0 0-2.828M8 10.586L10.586 8l5 5l-2.587 2.587zM25.413 28l-11-10.999L17 14.414l11 11ZM2 16l2-2l2 2l-2 2zM14 4l2-2l2 2l-2 2zM2 4l2-2l2 2l-2 2z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon-magic-wand-filled{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M29.414 24L12 6.586a2.05 2.05 0 0 0-2.828 0L6.586 9.172a2 2 0 0 0 0 2.828l17.413 17.414a2 2 0 0 0 2.828 0l2.587-2.586a2 2 0 0 0 0-2.828M8 10.586L10.586 8l5 5l-2.587 2.587zM2 16l2-2l2 2l-2 2zM14 4l2-2l2 2l-2 2zM2 4l2-2l2 2l-2 2z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.503 5.414a15.076 15.076 0 0 0 11.593 18.194a11.1 11.1 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1 1 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.07 13.07 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6M5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:apps{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8 4v4H4V4Zm2-2H2v8h8Zm8 2v4h-4V4Zm2-2h-8v8h8Zm8 2v4h-4V4Zm2-2h-8v8h8ZM8 14v4H4v-4Zm2-2H2v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8ZM8 24v4H4v-4Zm2-2H2v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8Zm8 2v4h-4v-4Zm2-2h-8v8h8Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:arrow-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:arrow-left{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:arrow-right{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:arrow-up{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:arrow-up-right{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:catalog{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M26 2H8a2 2 0 0 0-2 2v4H4v2h2v5H4v2h2v5H4v2h2v4a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2m0 26H8v-4h2v-2H8v-5h2v-2H8v-5h2V8H8V4h18Z'/%3E%3Cpath fill='currentColor' d='M14 8h8v2h-8zm0 7h8v2h-8zm0 7h8v2h-8z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:checkbox{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2M6 26V6h20v20Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:checkmark{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.414 16L24 9.414L22.586 8L16 14.586L9.414 8L8 9.414L14.586 16L8 22.586L9.414 24L16 17.414L22.586 24L24 22.586z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:close-outline{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 2C8.2 2 2 8.2 2 16s6.2 14 14 14s14-6.2 14-14S23.8 2 16 2m0 26C9.4 28 4 22.6 4 16S9.4 4 16 4s12 5.4 12 12s-5.4 12-12 12'/%3E%3Cpath fill='currentColor' d='M21.4 23L16 17.6L10.6 23L9 21.4l5.4-5.4L9 10.6L10.6 9l5.4 5.4L21.4 9l1.6 1.6l-5.4 5.4l5.4 5.4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:cursor-1,[i-carbon\:cursor-1=""]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M23 28a1 1 0 0 1-.71-.29l-6.13-6.14l-3.33 5a1 1 0 0 1-1 .44a1 1 0 0 1-.81-.7l-6-20A1 1 0 0 1 6.29 5l20 6a1 1 0 0 1 .7.81a1 1 0 0 1-.44 1l-5 3.33l6.14 6.13a1 1 0 0 1 0 1.42l-4 4A1 1 0 0 1 23 28m0-2.41L25.59 23l-7.16-7.15l5.25-3.5L7.49 7.49l4.86 16.19l3.5-5.25Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:document-pdf{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2Zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3Z'/%3E%3Cpath fill='currentColor' d='M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:download{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4Zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:drop-photo{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 26a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4m0-6a2 2 0 1 0 2 2a2 2 0 0 0-2-2'/%3E%3Cpath fill='currentColor' d='M27 29H11a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h3.28l.543-1.632A2 2 0 0 1 16.721 13h4.558a2 2 0 0 1 1.898 1.368L23.72 16H27a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2m-16-2h16v-9h-4.72l-1-3h-4.56l-1 3H11Zm16-16h2v2h-2zm0-4h2v2h-2zm0-4h2v2h-2zm-4 0h2v2h-2zm-4 0h2v2h-2zm-4 0h2v2h-2zm-4 0h2v2h-2zM7 3h2v2H7zM3 3h2v2H3zm0 4h2v2H3zm0 4h2v2H3zm0 4h2v2H3zm0 4h2v2H3zm0 4h2v2H3zm0 4h2v2H3z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:edit{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M2 26h28v2H2zM25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4zm-5-5L24 7.6l-3 3L17.4 7zM6 22v-3.6l10-10l3.6 3.6l-10 10z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:erase{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7 27h23v2H7zm20.38-16.49l-7.93-7.92a2 2 0 0 0-2.83 0l-14 14a2 2 0 0 0 0 2.83L7.13 24h9.59l10.66-10.66a2 2 0 0 0 0-2.83M15.89 22H8l-4-4l6.31-6.31l7.93 7.92Zm3.76-3.76l-7.92-7.93L18 4l8 7.93Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:error{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M2 16A14 14 0 1 0 16 2A14 14 0 0 0 2 16m23.15 7.75L8.25 6.85a12 12 0 0 1 16.9 16.9M8.24 25.16a12 12 0 0 1-1.4-16.89l16.89 16.89a12 12 0 0 1-15.49 0'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:help{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2m0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12'/%3E%3Ccircle cx='16' cy='23.5' r='1.5' fill='currentColor'/%3E%3Cpath fill='currentColor' d='M17 8h-1.5a4.49 4.49 0 0 0-4.5 4.5v.5h2v-.5a2.5 2.5 0 0 1 2.5-2.5H17a2.5 2.5 0 0 1 0 5h-2v4.5h2V17a4.5 4.5 0 0 0 0-9'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:information{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17 22v-8h-4v2h2v6h-3v2h8v-2zM16 8a1.5 1.5 0 1 0 1.5 1.5A1.5 1.5 0 0 0 16 8'/%3E%3Cpath fill='currentColor' d='M16 30a14 14 0 1 1 14-14a14 14 0 0 1-14 14m0-26a12 12 0 1 0 12 12A12 12 0 0 0 16 4'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:list-boxes{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 8h14v2H16zm0 14h14v2H16zm-6-8H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2M4 6v6h6.001L10 6Zm6 22H4a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2m-6-8v6h6.001L10 20Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:maximize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20 2v2h6.586L18 12.582L19.414 14L28 5.414V12h2V2zm-6 17.416L12.592 18L4 26.586V20H2v10h10v-2H5.414z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:minimize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4 18v2h6.586L2 28.582L3.414 30L12 21.414V28h2V18zM30 3.416L28.592 2L20 10.586V4h-2v10h10v-2h-6.586z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:pause{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 8v16H8V8zm0-2H8a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2m12 2v16h-4V8zm0-2h-4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:pen{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M27.307 6.107L30 3.414L28.586 2l-2.693 2.693L24.8 3.6a1.933 1.933 0 0 0-2.8 0l-18 18V28h6.4l18-18a1.933 1.933 0 0 0 0-2.8ZM9.6 26H6v-3.6L23.4 5L27 8.6ZM9 11.586L16.586 4L18 5.414L10.414 13z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:pin{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M28.59 13.31L30 11.9L20 2l-1.31 1.42l1.18 1.18l-11.49 9.72l-1.72-1.71L5.25 14l5.66 5.68L2 28.58L3.41 30l8.91-8.91L18 26.75l1.39-1.42l-1.71-1.71l9.72-11.49ZM16.26 22.2L9.8 15.74L21.29 6L26 10.71Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:pin-filled{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M28.586 13.314L30 11.9L20 2l-1.314 1.415l1.186 1.186L8.38 14.322l-1.716-1.715L5.25 14l5.657 5.677L2 28.583L3.41 30l8.911-8.909L18 26.748l1.393-1.414l-1.716-1.716l9.724-11.49Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:play{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M7 28a1 1 0 0 1-1-1V5a1 1 0 0 1 1.482-.876l20 11a1 1 0 0 1 0 1.752l-20 11A1 1 0 0 1 7 28M8 6.69v18.62L24.925 16Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:presentation-file{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M15 10h2v8h-2zm5 4h2v4h-2zm-10-2h2v6h-2z'/%3E%3Cpath fill='currentColor' d='M25 4h-8V2h-2v2H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8v6h-4v2h10v-2h-4v-6h8a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 16H7V6h18Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:radio-button{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2m0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:redo{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 10h12.185l-3.587-3.586L22 5l6 6l-6 6l-1.402-1.415L24.182 12H12a6 6 0 0 0 0 12h8v2h-8a8 8 0 0 1 0-16'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:renew{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 10H6.78A11 11 0 0 1 27 16h2A13 13 0 0 0 6 7.68V4H4v8h8Zm8 12h5.22A11 11 0 0 1 5 16H3a13 13 0 0 0 23 8.32V28h2v-8h-8Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:settings-adjust{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3s3 1.3 3 3s-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3s-3-1.3-3-3s1.3-3 3-3'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:template{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M26 6v4H6V6zm0-2H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2M10 16v10H6V16zm0-2H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2m16 2v10H16V16zm0-2H16a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:text-annotation-toggle{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath d='M29.537 13.76l-3.297-3.297a1.586 1.586 0 0 0-2.24 0L10 24.467V30h5.533l14.004-14a1.586 1.586 0 0 0 0-2.24zM14.704 28H12v-2.704l9.44-9.441l2.705 2.704zM25.56 17.145l-2.704-2.704l2.267-2.267l2.704 2.704z' fill='currentColor'/%3E%3Cpath d='M11 17h2v-7h3V8H8v2h3v7z' fill='currentColor'/%3E%3Cpath d='M8 20H4V4h16v4h2V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4z' fill='currentColor'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:time{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 30a14 14 0 1 1 14-14a14 14 0 0 1-14 14m0-26a12 12 0 1 0 12 12A12 12 0 0 0 16 4'/%3E%3Cpath fill='currentColor' d='M20.59 22L15 16.41V7h2v8.58l5 5.01z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:timer{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M15 11h2v9h-2zm-2-9h6v2h-6z'/%3E%3Cpath fill='currentColor' d='m28 9l-1.42-1.41l-2.25 2.25a10.94 10.94 0 1 0 1.18 1.65ZM16 26a9 9 0 1 1 9-9a9 9 0 0 1-9 9'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:trash-can{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12 12h2v12h-2zm6 0h2v12h-2z'/%3E%3Cpath fill='currentColor' d='M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6Zm4 22V8h16v20Zm4-26h8v2h-8z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:undo{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20 10H7.815l3.587-3.586L10 5l-6 6l6 6l1.402-1.415L7.818 12H20a6 6 0 0 1 0 12h-8v2h8a8 8 0 0 0 0-16'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:user-speaker{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M29.415 19L27.7 17.285A3 3 0 0 0 28 16a3 3 0 1 0-3 3a3 3 0 0 0 1.286-.3L28 20.414V28h-6v-3a7.01 7.01 0 0 0-7-7H9a7.01 7.01 0 0 0-7 7v5h28v-9.586A2 2 0 0 0 29.415 19M4 25a5.006 5.006 0 0 1 5-5h6a5.006 5.006 0 0 1 5 5v3H4Z'/%3E%3Cpath fill='currentColor' d='M12 4a5 5 0 1 1-5 5a5 5 0 0 1 5-5m0-2a7 7 0 1 0 7 7a7 7 0 0 0-7-7'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:zoom-in{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M18 12h-4V8h-2v4H8v2h4v4h2v-4h4z'/%3E%3Cpath fill='currentColor' d='M21.448 20A10.86 10.86 0 0 0 24 13a11 11 0 1 0-11 11a10.86 10.86 0 0 0 7-2.552L27.586 29L29 27.586ZM13 22a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-carbon\:zoom-out{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8 12h10v2H8z'/%3E%3Cpath fill='currentColor' d='M21.448 20A10.86 10.86 0 0 0 24 13a11 11 0 1 0-11 11a10.86 10.86 0 0 0 7-2.552L27.586 29L29 27.586ZM13 22a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-ph-cursor-duotone{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M213.66 201L201 213.66a8 8 0 0 1-11.31 0l-51.31-51.31a8 8 0 0 0-13 2.46l-17.82 46.41a8 8 0 0 1-14.85-.71L40.41 50.44a8 8 0 0 1 10-10l160.1 52.24a8 8 0 0 1 .71 14.85l-46.41 17.82a8 8 0 0 0-2.46 13l51.31 51.31a8 8 0 0 1 0 11.34' opacity='.2'/%3E%3Cpath d='M168 132.69L214.08 115l.33-.13a16 16 0 0 0-1.41-29.8L52.92 32.8A15.95 15.95 0 0 0 32.8 52.92L85.07 213a15.82 15.82 0 0 0 14.41 11h.78a15.84 15.84 0 0 0 14.61-9.59l.13-.33L132.69 168L184 219.31a16 16 0 0 0 22.63 0l12.68-12.68a16 16 0 0 0 0-22.63ZM195.31 208L144 156.69a16 16 0 0 0-26 4.93c0 .11-.09.22-.13.32l-17.65 46L48 48l159.85 52.2l-45.95 17.64l-.32.13a16 16 0 0 0-4.93 26L208 195.31Z'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-ph-cursor-fill{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.49 207.8l-12.69 12.69a12 12 0 0 1-17 0l-56.57-56.57L115 214.08l-.13.33a15.84 15.84 0 0 1-14.61 9.59h-.78a15.82 15.82 0 0 1-14.41-11L32.8 52.92A15.95 15.95 0 0 1 52.92 32.8L213 85.07a16 16 0 0 1 1.41 29.8l-.33.13l-50.16 19.27l56.57 56.56a12 12 0 0 1 0 16.97'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-ph\:arrow-down-bold{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m208.49 152.49l-72 72a12 12 0 0 1-17 0l-72-72a12 12 0 0 1 17-17L116 187V40a12 12 0 0 1 24 0v147l51.51-51.52a12 12 0 0 1 17 17Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-ph\:arrow-up-bold{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M208.49 120.49a12 12 0 0 1-17 0L140 69v147a12 12 0 0 1-24 0V69l-51.51 51.49a12 12 0 0 1-17-17l72-72a12 12 0 0 1 17 0l72 72a12 12 0 0 1 0 17'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.i-svg-spinners-90-ring-with-bg{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='currentColor' d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;color:inherit;background-color:currentColor;width:1em;height:1em;-webkit-mask-size:100% 100%;mask-size:100% 100%}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.pointer-events-none,[pointer-events-none=""]{pointer-events:none}.visible{visibility:visible}.absolute,[absolute=""]{position:absolute}.fixed,[fixed=""]{position:fixed}.relative,[relative=""]{position:relative}.inset-0,[inset-0=""]{inset:0}.inset-y-0,[inset-y-0=""]{top:0;bottom:0}.-top-15px{top:-15px}.-top-20{top:-5rem}.bottom-\[-6px\]{bottom:-6px}.bottom-0,[bottom-0=""]{bottom:0}.bottom-1,[bottom-1=""]{bottom:.25rem}.bottom-10{bottom:2.5rem}.bottom-5{bottom:1.25rem}.left-0,[left-0=""]{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-110\%{left:110%}.right--2,[right--2=""]{right:-.5rem}.right-\[-6px\]{right:-6px}.right-0,[right-0=""]{right:0}.right-0\.5,[right-0\.5=""]{right:.125rem}.right-1,[right-1=""]{right:.25rem}.right-18{right:4.5rem}.right-4{right:1rem}.right-5,[right-5=""]{right:1.25rem}.top-\[-6px\]{top:-6px}.top-0,[top-0=""]{top:0}.top-0\.5,[top-0\.5=""]{top:.125rem}.top-1\/2,.top-50\%{top:50%}.top-4{top:1rem}.top-5{top:1.25rem}.z-1,.z1,[z-1=""]{z-index:1}.z-2,.z2{z-index:2}.-z-1,[z~="-1"]{z-index:-1}.z-10,[z-10=""]{z-index:10}.grid{display:grid}.inline-grid{display:inline-grid}.grid-cols-\[1\.25fr_1fr\]{grid-template-columns:1.25fr 1fr}.grid-cols-\[1\.2fr_1fr\]{grid-template-columns:1.2fr 1fr}.grid-cols-\[1\.3fr_1fr\]{grid-template-columns:1.3fr 1fr}.grid-cols-\[1\.45fr_1fr\]{grid-template-columns:1.45fr 1fr}.grid-cols-\[1\.5fr_1fr\]{grid-template-columns:1.5fr 1fr}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[1\.7fr_1fr\]{grid-template-columns:1.7fr 1fr}.grid-cols-\[1fr_1\.05fr\]{grid-template-columns:1fr 1.05fr}.grid-cols-\[1fr_3fr\]{grid-template-columns:1fr 3fr}.grid-cols-\[1fr_max-content\]{grid-template-columns:1fr max-content}.grid-cols-\[35px_1fr\]{grid-template-columns:35px 1fr}.grid-rows-\[1fr_max-content\]{grid-template-rows:1fr max-content}.grid-rows-\[1fr_min-content\]{grid-template-rows:1fr min-content}.grid-rows-\[auto_max-content\]{grid-template-rows:auto max-content}.grid-rows-\[max-content_1fr\]{grid-template-rows:max-content 1fr}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.m--1,[m--1=""]{margin:-.25rem}.m-1{margin:.25rem}.m-auto,.ma{margin:auto}.m\[0\],.m0,[m0=""]{margin:0}.m\[1\]{margin:1px}.children\:my-auto>*,.my-auto,.mya{margin-top:auto;margin-bottom:auto}.mx--1\.2{margin-left:-.3rem;margin-right:-.3rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1,.my1{margin-top:.25rem;margin-bottom:.25rem}.my2{margin-top:.5rem;margin-bottom:.5rem}.my5{margin-top:1.25rem;margin-bottom:1.25rem}.-mt-0\.5{margin-top:-.125rem}.mb-4{margin-bottom:1rem}.mb2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr--14px{margin-right:-14px}.mr--4{margin-right:-1rem}.mr-2{margin-right:.5rem}.mr0{margin-right:0}.mr1{margin-right:.25rem}.ms{margin-inline-start:1rem}.mt-1,.mt1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-px{margin-top:1px}.block{display:block}.inline-block,[inline-block=""]{display:inline-block}.hidden,.group:hover .group-hover\:hidden,.group:not(:hover) .group-not-hover\:hidden{display:none}.aspect-ratio-initial{aspect-ratio:initial}[size~="120"]{width:30rem;height:30rem}[size~="150"]{width:37.5rem;height:37.5rem}[size~="190"]{width:47.5rem;height:47.5rem}[size~="56"]{width:14rem;height:14rem}[size~="70"]{width:17.5rem;height:17.5rem}[size~="84"]{width:21rem;height:21rem}.h-\[22px\],.h-22px,[h-22px=""]{height:22px}.h-\[40px\]{height:40px}.h-\[calc\(var\(--vh\,1vh\)\*100\)\]{height:calc(var(--vh,1vh) * 100)}.h-0\.7{height:.175rem}.h-1\.5,[h-1\.5=""]{height:.375rem}.h-1px{height:1px}.h-2,[h-2=""]{height:.5rem}.h-40{height:10rem}.h-4px{height:4px}.h-5,.h5,[h-5=""]{height:1.25rem}.h-6{height:1.5rem}.h-8,[h-8=""]{height:2rem}.h-full,[h-full=""]{height:100%}.h-max{height:max-content}.h-screen{height:100vh}.h1,[h1=""]{height:.25rem}.max-h-full{max-height:100%}.max-h-full\!{max-height:100%!important}.max-w-\[calc\(100\%-3rem\)\]{max-width:calc(100% - 3rem)}.max-w-150{max-width:37.5rem}.max-w-250{max-width:62.5rem}.max-w-90,[max-w-90=""]{max-width:22.5rem}.max-w-full{max-width:100%}.max-w-full\!{max-width:100%!important}.max-w-xs{max-width:20rem}.min-h-50{min-height:12.5rem}.min-h-full\!{min-height:100%!important}.min-w-\[70\%\]{min-width:70%}.min-w-0{min-width:0}.min-w-16{min-width:4rem}.min-w-30,[min-w-30=""]{min-width:7.5rem}.min-w-40{min-width:10rem}.min-w-90,[min-w-90=""]{min-width:22.5rem}.min-w-full\!{min-width:100%!important}.w-\[40px\]{width:40px}.w-\[calc\(100\%-0\.25rem\)\]{width:calc(100% - .25rem)}.w-0{width:0}.w-0\.5,[w-0\.5=""]{width:.125rem}.w-1\.5,[w-1\.5=""]{width:.375rem}.w-13{width:3.25rem}.w-1px,[w-1px=""]{width:1px}.w-2,[w-2=""]{width:.5rem}.w-20,[w-20=""]{width:5rem}.w-200{width:50rem}.w-22px{width:22px}.w-250{width:62.5rem}.w-30,[w-30=""]{width:7.5rem}.w-5,[w-5=""]{width:1.25rem}.w-6{width:1.5rem}.w-60,[w-60=""]{width:15rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-88{width:22rem}.w-9{width:2.25rem}.w-90,[w-90=""]{width:22.5rem}.w-full,[w-full=""]{width:100%}.w-full\!{width:100%!important}.w-screen{width:100vw}.w1,[w1=""]{width:.25rem}.w3{width:.75rem}.flex,[flex=""],[flex~=\~]{display:flex}.inline-flex{display:inline-flex}.flex-1{flex:1}.flex-auto,[flex-auto=""]{flex:auto}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}[flex~=row]{flex-direction:row}.flex-col,[flex~=col]{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-wrap-reverse{flex-wrap:wrap-reverse}.table,[table=""]{display:table}.table-cell,[table-cell=""]{display:table-cell}.table-row,[table-row=""]{display:table-row}.border-collapse,[border-collapse=""]{border-collapse:collapse}.-translate-y-1\/2,.translate-y--50\%{--un-translate-y:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.-rotate-45{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:-45deg;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.scale-102{--un-scale-x:1.02;--un-scale-y:1.02;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.scale-85{--un-scale-x:.85;--un-scale-y:.85;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.scale-x-80{--un-scale-x:.8;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:1s linear fade-in}.animate-duration-100{animation-duration:.1s}.cursor-default{cursor:default}.cursor-pointer,[cursor-pointer=""]{cursor:pointer}.touch-none,[touch-none=""]{touch-action:none}.important\:\[\&_\*\]\:select-none *{-webkit-user-select:none!important;user-select:none!important}.select-none,[select-none=""]{-webkit-user-select:none;user-select:none}.resize{resize:both}.resize-none{resize:none}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center,[flex~=items-center],[items-center=""]{align-items:center}.self-center{align-self:center}.justify-center,[flex~=justify-center],[justify-center=""]{justify-content:center}.justify-between{justify-content:space-between}.justify-items-start{justify-items:start}.gap-0{gap:0}.gap-0\.2{gap:.05rem}.gap-0\.5{gap:.125rem}.gap-1,[flex~=gap-1],[gap-1=""]{gap:.25rem}.gap-2,[flex~=gap-2]{gap:.5rem}.gap-3{gap:.75rem}.gap-4,[flex~=gap-4]{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-px{gap:1px}.gap-x-4{column-gap:1rem}.gap-x-8{column-gap:2rem}.gap-y-2{row-gap:.5rem}.gap-y-4{row-gap:1rem}.of-auto,.overflow-auto{overflow:auto}.of-hidden,.overflow-hidden,[of-hidden=""]{overflow:hidden}.of-x-visible{overflow-x:visible}.of-y-auto,.overflow-y-auto{overflow-y:auto}.whitespace-nowrap,.ws-nowrap,[ws-nowrap=""]{white-space:nowrap}.b,.border,.dark .dark\:border,.dark [dark\:border~=\~],[b=""],[border=""],[border~=\~]{border-width:1px}.border-2,[b~="2"]{border-width:2px}[b~="100%"]{border-width:100%}[b~="16"]{border-width:16px}[b~="50%"]{border-width:50%}[b~="64"]{border-width:64px}[border~="0"]{border-width:0}.border-x,[b~=x]{border-left-width:1px;border-right-width:1px}[b~=y],[border~=y]{border-top-width:1px;border-bottom-width:1px}.border-b,[b~=b],[border~=b]{border-bottom-width:1px}.border-b-0{border-bottom-width:0}.border-l{border-left-width:1px}.border-r,[border~=r]{border-right-width:1px}.border-r-2{border-right-width:2px}.border-t,[border-t=""],[border~=t]{border-top-width:1px}.b-dark{--un-border-opacity:1;border-color:rgb(34 34 34/var(--un-border-opacity))}.border-gray,.dark .dark\:b-gray-400,[border-gray=""]{--un-border-opacity:1;border-color:rgb(156 163 175/var(--un-border-opacity))}.border-gray-300\/50{border-color:#d1d5db80}.border-transparent,[border~=transparent]{border-color:#0000}.border-white{--un-border-opacity:1;border-color:rgb(255 255 255/var(--un-border-opacity))}.dark .dark\:border-gray-500,.dark [dark\:border-gray-500=""]{--un-border-opacity:1;border-color:rgb(107 114 128/var(--un-border-opacity))}[b-dark~="1"]{--un-border-opacity:1;border-color:rgb(60 60 60/var(--un-border-opacity))}.dark [b~=dark\:b-gray-400]{--un-border-opacity:1;--un-border-bottom-opacity:var(--un-border-opacity);border-bottom-color:rgb(156 163 175/var(--un-border-bottom-opacity))}[b~=b-dark]{--un-border-opacity:1;--un-border-bottom-opacity:var(--un-border-opacity);border-bottom-color:rgb(34 34 34/var(--un-border-bottom-opacity))}.rounded,[border~=rounded],[rounded=""]{border-radius:.25rem}.rounded-1\/2{border-radius:50%}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-md,[border~=rounded-md]{border-radius:.375rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-lb{border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-tr-0{border-top-right-radius:0}.\!border-none{border-style:none!important}.b-dashed{border-style:dashed}[b~=b-dashed]{border-bottom-style:dashed}.bg-blue{--un-bg-opacity:1;background-color:rgb(96 165 250/var(--un-bg-opacity))}.bg-current{background-color:currentColor}.bg-cyan\:10,[bg-cyan\:10=""]{background-color:#22d3ee1a}.bg-gray,[bg-gray=""]{--un-bg-opacity:1;background-color:rgb(156 163 175/var(--un-bg-opacity))}.bg-gray\:10,.bg-gray\/10{background-color:#9ca3af1a}.bg-gray\:4,[bg-gray\:4=""]{background-color:#9ca3af0a}.bg-gray\:5,.bg-gray\/5,[bg-gray\:5=""]{background-color:#9ca3af0d}.bg-gray\/20{background-color:#9ca3af33}.bg-green{--un-bg-opacity:1;background-color:rgb(74 222 128/var(--un-bg-opacity))}.bg-red{--un-bg-opacity:1;background-color:rgb(248 113 113/var(--un-bg-opacity))}.bg-transparent{background-color:#0000}.bg-yellow{--un-bg-opacity:1;background-color:rgb(250 204 21/var(--un-bg-opacity))}.dark .dark\:bg-gray-800,.dark [dark\:bg-gray-800=""]{--un-bg-opacity:1;background-color:rgb(31 41 55/var(--un-bg-opacity))}[bg~=black]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.hover\:bg-gray-400:hover{--un-bg-opacity:1;background-color:rgb(156 163 175/var(--un-bg-opacity))}.hover\:bg-gray\/20:hover{background-color:#9ca3af33}[bg-transparent~=placeholder\:]::placeholder{background-color:#0000}.\!bg-opacity-75{--un-bg-opacity:.75!important}.bg-opacity-30,[bg-opacity-30=""]{--un-bg-opacity:.3}[bg~=opacity-80]{--un-bg-opacity:.8}.hover\:bg-opacity-10:hover{--un-bg-opacity:.1}[stroke-width~="1"]{stroke-width:1px}[stroke-width~="2"]{stroke-width:2px}[stroke-width~="3"]{stroke-width:3px}.dark .dark\:stroke-black{--un-stroke-opacity:1;stroke:rgb(0 0 0/var(--un-stroke-opacity))}.stroke-white{--un-stroke-opacity:1;stroke:rgb(255 255 255/var(--un-stroke-opacity))}.object-cover{object-fit:cover}.object-contain{object-fit:contain}.\!p-4{padding:1rem!important}.p-1,.p1,[p1=""]{padding:.25rem}.p-16{padding:4rem}.p-2,.p2,[p2=""]{padding:.5rem}.p-6px{padding:6px}.p0\.5,[p0\.5=""]{padding:.125rem}.p3{padding:.75rem}.p4{padding:1rem}.p5{padding:1.25rem}.px,.px-4,.px4,[p~=x-4],[px=""],[px4=""]{padding-left:1rem;padding-right:1rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2,.px2,[px2=""]{padding-left:.5rem;padding-right:.5rem}.px-3,.px3,[px3=""]{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px1{padding-left:.25rem;padding-right:.25rem}.py-1,.py1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2,.py2,[p~=y-2],[py-2=""],[py2=""]{padding-top:.5rem;padding-bottom:.5rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py0\.5{padding-top:.125rem;padding-bottom:.125rem}.py1\.5{padding-top:.375rem;padding-bottom:.375rem}.pb2{padding-bottom:.5rem}.pl-0{padding-left:0}.pl-1,.pl1{padding-left:.25rem}.pl-4,[pl-4=""]{padding-left:1rem}.pl2,[pl2=""]{padding-left:.5rem}.pr-3,[pr-3=""]{padding-right:.75rem}.pr-4,[pr-4=""]{padding-right:1rem}.pt-\.5{padding-top:.125rem}.pt-15\%{padding-top:15%}.pt2{padding-top:.5rem}.text-center{text-align:center}.text-right,[text-right=""]{text-align:right}.text-nowrap{text-wrap:nowrap}.align-top,[align-top=""]{vertical-align:top}.vertical-middle,[vertical-middle=""]{vertical-align:middle}.text-1\.2em{font-size:1.2em}.text-11px{font-size:11px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3em{font-size:3em}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-9xl,[text-9xl=""]{font-size:8rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm,[text-sm=""]{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs,[text-xs=""]{font-size:.75rem;line-height:1rem}.\!text-current{color:currentColor!important}.dark .dark\:text-blue3{--un-text-opacity:1;color:rgb(147 197 253/var(--un-text-opacity))}.dark .dark\:text-green,.text-green{--un-text-opacity:1;color:rgb(74 222 128/var(--un-text-opacity))}.dark .dark\:text-green3{--un-text-opacity:1;color:rgb(134 239 172/var(--un-text-opacity))}.dark .dark\:text-red-500{--un-text-opacity:1;color:rgb(239 68 68/var(--un-text-opacity))}.dark .dark\:text-red3{--un-text-opacity:1;color:rgb(252 165 165/var(--un-text-opacity))}.dark .dark\:text-yellow3{--un-text-opacity:1;color:rgb(253 224 71/var(--un-text-opacity))}.text-\$slidev-controls-foreground{color:var(--slidev-controls-foreground)}.text-black{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.text-blue{--un-text-opacity:1;color:rgb(96 165 250/var(--un-text-opacity))}.text-blue6{--un-text-opacity:1;color:rgb(37 99 235/var(--un-text-opacity))}.text-cyan{--un-text-opacity:1;color:rgb(34 211 238/var(--un-text-opacity))}.text-cyan\:75,[text-cyan\:75=""]{color:#22d3eebf}.text-gray,.text-gray-400{--un-text-opacity:1;color:rgb(156 163 175/var(--un-text-opacity))}.text-gray-500{--un-text-opacity:1;color:rgb(107 114 128/var(--un-text-opacity))}.text-green-500{--un-text-opacity:1;color:rgb(34 197 94/var(--un-text-opacity))}.text-green6{--un-text-opacity:1;color:rgb(22 163 74/var(--un-text-opacity))}.text-indigo{--un-text-opacity:1;color:rgb(129 140 248/var(--un-text-opacity))}.text-lime{--un-text-opacity:1;color:rgb(163 230 53/var(--un-text-opacity))}.text-orange{--un-text-opacity:1;color:rgb(251 146 60/var(--un-text-opacity))}.text-pink{--un-text-opacity:1;color:rgb(244 114 182/var(--un-text-opacity))}.text-purple{--un-text-opacity:1;color:rgb(192 132 252/var(--un-text-opacity))}.dark .dark\:color-red-400,.text-red,.text-red-400{--un-text-opacity:1;color:rgb(248 113 113/var(--un-text-opacity))}.text-red-700{--un-text-opacity:1;color:rgb(185 28 28/var(--un-text-opacity))}.color-red-600,.text-red6{--un-text-opacity:1;color:rgb(220 38 38/var(--un-text-opacity))}.text-teal{--un-text-opacity:1;color:rgb(45 212 191/var(--un-text-opacity))}.text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}.text-yellow{--un-text-opacity:1;color:rgb(250 204 21/var(--un-text-opacity))}.text-yellow6{--un-text-opacity:1;color:rgb(202 138 4/var(--un-text-opacity))}.important-text-op-50,.text-opacity-50\!{--un-text-opacity:.5!important}.font-bold,[font-bold=""]{font-weight:700}.font-light{font-weight:300}.leading-1\.6em{line-height:1.6em}.leading-tight{line-height:1.25}.font-mono,[font-mono=""]{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.line-through{text-decoration-line:line-through}.underline,.hover\:underline:hover{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.tab{tab-size:4}.\!opacity-0{opacity:0!important}.\!opacity-100{opacity:1!important}.op-60,.op60{opacity:.6}.op-80,.op80,.opacity-80{opacity:.8}.op0,.opacity-0{opacity:0}.op100,.group:hover .group-hover\:op100{opacity:1}.op15{opacity:.15}.op20{opacity:.2}.op25,.opacity-25,[op25=""]{opacity:.25}.op30{opacity:.3}.op35{opacity:.35}.op40,.opacity-40,[op40=""]{opacity:.4}.op50,.opacity-50,[op50=""]{opacity:.5}.op75,[op75=""]{opacity:.75}.opacity-10,[opacity-10=""]{opacity:.1}.opacity-5{opacity:.05}.focus-within\:opacity-100:focus-within,.hover\:op-100:hover,.hover\:op100:hover{opacity:1}.hover\:op90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-90:hover{opacity:.9}[hover~=op100]:hover,.focus-visible\:opacity-100:focus-visible{opacity:1}.placeholder\:op25::placeholder{opacity:.25}.shadow,[shadow~=\~]{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color,#0000001a),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)}.shadow-xl{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color,#0000001a),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)}.outline,[outline=""]{outline-style:solid}.outline-none,[outline-none=""]{outline-offset:2px;outline:2px solid #0000}.\!backdrop-blur-0px{--un-backdrop-blur:blur(0px)!important;-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)!important;backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)!important}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-5px{--un-backdrop-blur:blur(5px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition-all~="0"]{transition-property:all;transition-duration:0s;transition-timing-function:cubic-bezier(.4,0,.2,1)}[transition-all~="4"]{transition-property:all;transition-duration:4ms;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-400{transition-duration:.4s}[delay~="0"]{transition-delay:0s}[delay~="0.17"]{transition-delay:.17ms}[delay~="0.2"]{transition-delay:.2ms}[delay~="0.25"]{transition-delay:.25ms}[delay~="0.3"]{transition-delay:.3ms}[delay~="0.33"]{transition-delay:.33ms}[delay~="0.4"]{transition-delay:.4ms}[delay~="0.6"]{transition-delay:.6ms}[delay~="0.66"]{transition-delay:.66ms}[delay~="0.7"]{transition-delay:.7ms}[delay~="0.8"]{transition-delay:.8ms}[delay~="0.9"]{transition-delay:.9ms}[delay~="1"]{transition-delay:1ms}[delay~="1.1"]{transition-delay:1.1ms}[delay~="1.2"]{transition-delay:1.2ms}[delay~="1.4"]{transition-delay:1.4ms}[delay~="1.5"]{transition-delay:1.5ms}[delay~="1.6"]{transition-delay:1.6ms}[delay~="2.0"]{transition-delay:2ms}.ease{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.view-transition-name{view-transition-name:name}@media (width<=767.9px){.lt-md\:hidden{display:none}.lt-md\:flex-col{flex-direction:column}}@media (width>=768px){.md\:p-10px{padding:10px}}@media (width>=1024px){.lg\:m-2{margin:.5rem}.lg\:p-2{padding:.5rem}.lg\:p-4{padding:1rem}} diff --git a/transformer-v2/assets/interactive-C1KYSeoO.js b/transformer-v2/assets/interactive-C1KYSeoO.js new file mode 100644 index 0000000000000000000000000000000000000000..b595f6346b1bbe4bcf66cd116121413dad256505 --- /dev/null +++ b/transformer-v2/assets/interactive-C1KYSeoO.js @@ -0,0 +1 @@ +import{H as e,S as t,_ as n,b as r,bt as i,vt as a,w as o,x as s,xt as c,y as l,z as u}from"./modules/shiki-BFOesOFp.js";import{t as d}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as f}from"./slidev/context-ChHKJoK9.js";import{t as p}from"./DeckFooter-CDGyhr7n.js";var m={class:`dl-widget__stage`},h={class:`dl-widget__controls`},g={class:`dl-widget__readout`},_=d(o({__name:`WidgetFrame`,props:{maxWidth:{default:`100%`},controlsFirst:{type:Boolean}},setup(t){let{$slidev:o,$nav:s,$clicksContext:c,$clicks:l,$page:d,$renderContext:p,$frontmatter:_}=f(),v=t;return(t,o)=>(u(),r(`div`,{class:a([`dl-widget`,{"is-controls-first":v.controlsFirst}]),style:i({maxWidth:v.maxWidth})},[n(`div`,m,[e(t.$slots,`default`,{},void 0,!0)]),n(`div`,h,[e(t.$slots,`controls`,{},void 0,!0)]),n(`div`,g,[e(t.$slots,`readout`,{},void 0,!0)])],6))}}),[[`__scopeId`,`data-v-0f64089e`]]),v=[`disabled`],y={key:0,class:`dl-btn__glyph`,"aria-hidden":`true`},b=d(o({__name:`StepButton`,props:{label:{},variant:{default:`primary`},disabled:{type:Boolean,default:!1},glyph:{}},emits:[`click`],setup(e,{emit:t}){let{$slidev:n,$nav:i,$clicksContext:o,$clicks:d,$page:p,$renderContext:m,$frontmatter:h}=f(),g=e,_=t;return(e,t)=>(u(),r(`button`,{type:`button`,class:a([`dl-btn`,`is-${g.variant}`]),disabled:g.disabled,onClick:t[0]||=e=>_(`click`)},[g.glyph?(u(),r(`span`,y,c(g.glyph),1)):l(`v-if`,!0),s(` `+c(g.label),1)],10,v))}}),[[`__scopeId`,`data-v-f82500e8`]]),x={class:`slidev-layout dl-interactive`},S={key:0,class:`dl-interactive__title`},C={class:`dl-interactive__stage`},w=d(o({__name:`interactive`,props:{heading:{},asideWidth:{},asideLeft:{type:Boolean}},setup(o){let{$slidev:s,$nav:d,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=f(),y=o;return(o,s)=>{let d=p;return u(),r(`div`,x,[y.heading?(u(),r(`h1`,S,c(y.heading),1)):l(`v-if`,!0),n(`div`,{class:a([`dl-interactive__grid`,{"is-aside-left":y.asideLeft}])},[n(`div`,C,[e(o.$slots,`default`,{},void 0,!0)]),n(`div`,{class:`dl-interactive__aside`,style:i({flexBasis:y.asideWidth??`17rem`})},[e(o.$slots,`aside`,{},void 0,!0)],4)],2),t(d)])}}}),[[`__scopeId`,`data-v-0c449bbd`]]);export{b as n,_ as r,w as t}; \ No newline at end of file diff --git a/transformer-v2/assets/md-4y3kr0IX2.js b/transformer-v2/assets/md-4y3kr0IX2.js new file mode 100644 index 0000000000000000000000000000000000000000..fe59be7bf2bf737d204afa6df8768ec510ab9152 --- /dev/null +++ b/transformer-v2/assets/md-4y3kr0IX2.js @@ -0,0 +1 @@ +import{E as e,Q as t,S as n,_ as r,_t as i,b as a,v as o,w as s,xt as c,y as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{t as f}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as p,t as m}from"./slidev/context-ChHKJoK9.js";import{t as h}from"./TransformerGlyph-XWvPPlsx.js";import{t as g}from"./default-DTdNOfwb.js";var _=[`href`],v={key:0,class:`dl-linkcard__icon`},y={class:`dl-linkcard__text`},b={class:`dl-linkcard__title`},x={key:0,class:`dl-linkcard__blurb`},S={class:`dl-linkcard__host`},C=f(s({__name:`LinkCard`,props:{href:{},title:{},blurb:{},icon:{}},setup(e){let{$slidev:t,$nav:n,$clicksContext:o,$clicks:s,$page:u,$renderContext:f,$frontmatter:m}=p(),h=e,g=h.href.replace(/^https?:\/\//,``).replace(/\/.*$/,``);return(e,t)=>(d(),a(`a`,{class:`dl-linkcard`,href:h.href,target:`_blank`,rel:`noopener`},[h.icon?(d(),a(`div`,v,c(h.icon),1)):l(`v-if`,!0),r(`div`,y,[r(`div`,b,c(h.title),1),h.blurb?(d(),a(`div`,x,c(h.blurb),1)):l(`v-if`,!0),r(`div`,S,c(i(g)),1)])],8,_))}}),[[`__scopeId`,`data-v-77ab5d10`]]),w={class:`grid grid-cols-[1fr_3fr] gap-6 mt-3 items-center`},T={class:`flex justify-center`},E={class:`flex flex-col gap-3`},D={__name:`slides.md__slidev_91`,setup(a){let{$slidev:s,$nav:c,$clicksContext:l,$clicks:f,$page:_,$renderContext:v,$frontmatter:y}=p();return l.setup(),(a,s)=>{let c=h,l=C;return d(),o(g,u(e(i(m)(i(y),90))),{default:t(()=>[s[0]||=r(`h1`,null,`Going further`,-1),r(`div`,w,[r(`div`,T,[n(c,{kind:`encdec`,size:150})]),r(`div`,E,[n(l,{href:`https://jalammar.github.io/illustrated-transformer/`,title:`The Illustrated Transformer`,blurb:`Jay Alammar's post, which this deck follows. Read it once more with these slides beside it.`}),n(l,{href:`https://arxiv.org/abs/1706.03762`,title:`Attention Is All You Need`,blurb:`The 2017 paper. Sections 3.1 to 3.5 are the architecture in this deck.`}),n(l,{href:`https://nlp.seas.harvard.edu/annotated-transformer/`,title:`The Annotated Transformer`,blurb:`The same paper, line by line, as working PyTorch code.`})])])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-B2eT1_4x.js b/transformer-v2/assets/md-B2eT1_4x.js new file mode 100644 index 0000000000000000000000000000000000000000..4140e93fa94c31bc5acb705d820a0db5ad025ca4 --- /dev/null +++ b/transformer-v2/assets/md-B2eT1_4x.js @@ -0,0 +1,11 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";var b={class:`grid grid-cols-[1.45fr_1fr] gap-5 mt-1 items-start`},x={class:`dl-ledger dl-tight dl-eq-legend`},S={viewBox:`0 0 260 120`,class:`dl-diagram`,role:`img`,"aria-label":`Two, zero, two, zero minus 1 gives one, minus one, one, minus one; divided by 1 it stays the same`},C=[`y`],w=[`x`,`y`],T=[`x`,`y`],E={class:`dl-callout`},D={__name:`slides.md__slidev_57`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=g();return A.setup(),(g,D)=>{let O=y,k=a(`click`);return h(),u(v,m(t(s(_)(s(P),56))),{default:n(()=>[D[2]||=o(`h1`,null,`Reading the equation: layer normalisation`,-1),o(`div`,b,[o(`div`,x,[r(O,null,{default:n(()=>[...D[0]||=[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,null,`symbol`),o(`th`,null,`name`),o(`th`,null,`what it is here`),o(`th`,null,`example`)])]),o(`tbody`,null,[o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`v`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{v}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),o(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`)])])])]),o(`td`,null,`input vector`),o(`td`,null,[f(`one word’s `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`2`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`2`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[2, 0, 2, 0]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`μ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mu`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`μ`)])])])]),o(`td`,null,`mean`),o(`td`,null,[f(`average of the `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers`)]),o(`td`,null,`1`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`σ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\sigma`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`σ`)])])])]),o(`td`,null,`standard deviation`),o(`td`,null,[f(`square root of the average squared gap from `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`μ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mu`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`μ`)])])])]),o(`td`,null,`1`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`v`),o(`mo`,null,`−`),o(`mi`,null,`μ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{v} - \\mu`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`−`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`μ`)])])])]),o(`td`,null,`centred vector`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`μ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mu`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`μ`)])])]),f(` subtracted from every number`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, -1, 1, -1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold-italic`},`γ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\gamma}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.0639em`}},`γ`)])])])])])]),o(`td`,null,`scale`),o(`td`,null,[f(`learned, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers, starts as all 1`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, 1, 1, 1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold-italic`},`β`)]),o(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\beta}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.034em`}},`β`)])])])])])]),o(`td`,null,`shift`),o(`td`,null,[f(`learned, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers, starts as all 0`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[0, 0, 0, 0]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`⊙`)]),o(`annotation`,{encoding:`application/x-tex`},`\\odot`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`⊙`)])])])]),o(`td`,null,`element-wise product`),o(`td`,null,`multiply position by position`),o(`td`)])])],-1)]]),_:1})]),o(`div`,null,[(h(),c(`svg`,S,[(h(),c(l,null,i([[`v`,[`2`,`0`,`2`,`0`]],[`v − μ`,[`1`,`−1`,`1`,`−1`]],[`÷ σ`,[`1`,`−1`,`1`,`−1`]]],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:`50`,y:30+t*36,"text-anchor":`end`},p(e[0]),9,C),(h(!0),c(l,null,i(e[1],(e,n)=>(h(),c(`g`,{key:n},[o(`rect`,{class:d(t===2?`dl-dg-box is-accent`:`dl-dg-box`),x:60+n*46,y:12+t*36,width:`46`,height:`28`},null,10,w),o(`text`,{class:`dl-dg-lab is-sm`,x:83+n*46,y:31+t*36,"text-anchor":`middle`},p(e),9,T)]))),128))])),64))])),e((h(),c(`div`,E,[...D[1]||=[o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`μ`),o(`mo`,null,`=`),o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`2`),o(`mo`,null,`+`),o(`mn`,null,`0`),o(`mo`,null,`+`),o(`mn`,null,`2`),o(`mo`,null,`+`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`)`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`4`),o(`mo`,null,`=`),o(`mn`,null,`1`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mu = (2 + 0 + 2 + 0) / 4 = 1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`μ`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mord`},`/4`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1`)])])])],-1),o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`σ`),o(`mo`,null,`=`),o(`msqrt`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`1`),o(`mo`,null,`+`),o(`mn`,null,`1`),o(`mo`,null,`+`),o(`mn`,null,`1`),o(`mo`,null,`+`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`)`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`4`)])]),o(`mo`,null,`=`),o(`mn`,null,`1`)]),o(`annotation`,{encoding:`application/x-tex`},`\\sigma = \\sqrt{(1 + 1 + 1 + 1) / 4} = 1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`σ`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.24em`,"vertical-align":`-0.305em`}}),o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.935em`}},[o(`span`,{class:`svg-align`,style:{top:`-3.2em`}},[o(`span`,{class:`pstrut`,style:{height:`3.2em`}}),o(`span`,{class:`mord`,style:{"padding-left":`1em`}},[o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mord`},`/4`)])]),o(`span`,{style:{top:`-2.895em`}},[o(`span`,{class:`pstrut`,style:{height:`3.2em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`1.02em`,height:`1.28em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.28em`,viewBox:`0 0 400000 1296`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M263,681c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l0 -0 +c4.7,-7.3,11,-11,19,-11 +H40000v40H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M1001 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.305em`}},[o(`span`)])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1`)])])])],-1),o(`p`,null,[f(`With `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold-italic`},`γ`),o(`mo`,null,`=`),o(`mn`,null,`1`)]),o(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\gamma} = 1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.0639em`}},`γ`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1`)])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold-italic`},`β`),o(`mo`,null,`=`),o(`mn`,null,`0`)]),o(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\beta} = 0`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.034em`}},`β`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0`)])])]),f(`: `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, -1, 1, -1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])])],-1)]])),[[k]])])])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-B5YzwuK5.js b/transformer-v2/assets/md-B5YzwuK5.js new file mode 100644 index 0000000000000000000000000000000000000000..4ce450431050416e80ed0458daa4394720432f6b --- /dev/null +++ b/transformer-v2/assets/md-B5YzwuK5.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,xt as d,yt as f,z as p}from"./modules/shiki-BFOesOFp.js";import{n as m,t as h}from"./slidev/context-ChHKJoK9.js";import{t as g}from"./default-DTdNOfwb.js";import{t as _}from"./FlowDot-CpcqfMjQ.js";var v={class:`flex justify-center`},y={viewBox:`0 0 660 324`,class:`dl-diagram`,style:{"max-height":`19.5rem`},role:`img`,"aria-label":`Two encoder layers stacked on the left, each with self-attention and feed-forward, each followed by add and norm. Two decoder layers on the right with self-attention, encoder-decoder attention and feed-forward. The top encoder's output feeds the encoder-decoder attention of both decoders. Above the decoders: linear, then softmax`},b=[`y`],x=[`y`],S=[`y`],C=[`y`],w=[`y`],T=[`y`],E=[`y`],D=[`y`],O=[`y`],k=[`y`],A=[`y`],j=[`y`],M=[`y`],N=[`y`],P=[`y`],F=[`y`],I=[`y`],L=[`y`],R=[`y`],z=[`y`],B=[`y`],V=[`y`],H=[`y`],U=[`y`],W={__name:`slides.md__slidev_62`,setup(W){let{$slidev:G,$nav:K,$clicksContext:q,$clicks:J,$page:Y,$renderContext:X,$frontmatter:Z}=m();return q.setup(),(m,W)=>{let G=_,K=a(`click`);return p(),u(g,f(t(s(h)(s(Z),61))),{default:n(()=>[W[12]||=o(`h1`,null,`The full picture, two layers deep`,-1),o(`div`,v,[(p(),c(`svg`,y,[W[8]||=o(`defs`,null,[o(`marker`,{id:`tv2s4-full`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s4-full-k`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-k`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(p(),c(l,null,i([214,120],(e,t)=>o(`g`,{key:`e`+t},[o(`rect`,{class:`dl-dg-fill is-enc`,x:`60`,y:e,width:`220`,height:`86`,rx:`5`},null,8,b),o(`rect`,{class:`dl-dg-fill`,x:`70`,y:e+4,width:`200`,height:`14`,rx:`2`},null,8,x),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+15,"text-anchor":`middle`},`add & norm`,8,S),o(`rect`,{class:`dl-dg-box`,x:`70`,y:e+21,width:`200`,height:`20`,rx:`3`},null,8,C),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+35,"text-anchor":`middle`},`feed-forward`,8,w),o(`rect`,{class:`dl-dg-fill`,x:`70`,y:e+44,width:`200`,height:`14`,rx:`2`},null,8,T),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+55,"text-anchor":`middle`},`add & norm`,8,E),o(`rect`,{class:`dl-dg-box is-accent`,x:`70`,y:e+61,width:`200`,height:`20`,rx:`3`},null,8,D),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+75,"text-anchor":`middle`},`self-attention`,8,O),o(`text`,{class:`dl-dg-small is-enc`,x:`286`,y:e+48},`encoder `+d(2-t),9,k)])),64)),W[9]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M170 304 V302`},null,-1),W[10]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M170 214 V208`},null,-1),W[11]||=o(`text`,{class:`dl-dg-small`,x:`170`,y:`318`,"text-anchor":`middle`},`Thinking, Machines + positions`,-1),r(G,{path:`M170 306 V100`,role:`enc`,dur:3}),r(G,{path:`M170 306 V100`,role:`enc`,dur:3,delay:1.5}),e((p(),c(`g`,null,[(p(),c(l,null,i([174,40],(e,t)=>o(`g`,{key:`d`+t},[o(`rect`,{class:`dl-dg-fill is-dec`,x:`380`,y:e,width:`220`,height:`126`,rx:`5`},null,8,A),o(`rect`,{class:`dl-dg-fill`,x:`390`,y:e+4,width:`200`,height:`14`,rx:`2`},null,8,j),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+15,"text-anchor":`middle`},`add & norm`,8,M),o(`rect`,{class:`dl-dg-box`,x:`390`,y:e+21,width:`200`,height:`20`,rx:`3`},null,8,N),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+35,"text-anchor":`middle`},`feed-forward`,8,P),o(`rect`,{class:`dl-dg-fill`,x:`390`,y:e+44,width:`200`,height:`14`,rx:`2`},null,8,F),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+55,"text-anchor":`middle`},`add & norm`,8,I),o(`rect`,{class:`dl-dg-box is-accent`,x:`390`,y:e+61,width:`200`,height:`20`,rx:`3`},null,8,L),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+75,"text-anchor":`middle`},`encoder–decoder attention`,8,R),o(`rect`,{class:`dl-dg-fill`,x:`390`,y:e+84,width:`200`,height:`14`,rx:`2`},null,8,z),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+95,"text-anchor":`middle`},`add & norm`,8,B),o(`rect`,{class:`dl-dg-box is-accent`,x:`390`,y:e+101,width:`200`,height:`20`,rx:`3`},null,8,V),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+115,"text-anchor":`middle`},`self-attention`,8,H),o(`text`,{class:`dl-dg-small is-dec`,x:`606`,y:e+68},`decoder `+d(2-t),9,U)])),64)),W[0]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M490 174 V168`},null,-1),W[1]||=o(`text`,{class:`dl-dg-small`,x:`490`,y:`318`,"text-anchor":`middle`},`outputs so far + positions`,-1),W[2]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M490 310 V302`},null,-1),W[3]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,d:`M170 120 V104 H345`},null,-1),W[4]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s4-full-k)`,d:`M345 104 V111 H388`},null,-1),W[5]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s4-full-k)`,d:`M345 104 V245 H388`},null,-1),r(G,{path:`M170 120 V104 H345 V111 H388`,role:`k`,dur:2}),r(G,{path:`M170 120 V104 H345 V245 H388`,role:`v`,dur:2.6,delay:1}),r(G,{path:`M490 312 V40`,role:`dec`,dur:3}),W[6]||=o(`text`,{class:`dl-dg-small is-k`,x:`186`,y:`97`},`K, V for every decoder`,-1)])),[[K]]),e((p(),c(`g`,null,[...W[7]||=[o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M490 40 V32`},null,-1),o(`rect`,{class:`dl-dg-box`,x:`390`,y:`8`,width:`200`,height:`22`,rx:`3`},null,-1),o(`text`,{class:`dl-dg-small`,x:`490`,y:`23`,"text-anchor":`middle`},`linear → softmax: next word`,-1)]])),[[K]])]))])]),_:1},16)}}};export{W as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BE6SL9lC.js b/transformer-v2/assets/md-BE6SL9lC.js new file mode 100644 index 0000000000000000000000000000000000000000..b2c90ec67743fa8299fb322f6154124e304b64cd --- /dev/null +++ b/transformer-v2/assets/md-BE6SL9lC.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 680 230`,class:`dl-diagram`,role:`img`,"aria-label":`The decoder's 512-number output goes through a linear layer to six logits, 0.5 0.2 2.6 0.1 0.4 -0.5, then softmax to probabilities 0.08 0.06 0.69 0.06 0.08 0.03; the largest is i`},x=[`y`],S=[`x`,`y`,`width`],C=[`x`,`y`],w=[`y`],T=[`y`,`width`],E=[`x`,`y`],D={class:`mt-1 dl-callout`},O={__name:`slides.md__slidev_74`,setup(O){let{$slidev:k,$nav:A,$clicksContext:j,$clicks:M,$page:N,$renderContext:P,$frontmatter:F}=h();return j.setup(),(h,O)=>{let k=v,A=a(`click`);return m(),u(_,p(t(s(g)(s(F),73))),{default:n(()=>[O[16]||=o(`h1`,null,`From a vector to a word: linear and softmax`,-1),o(`div`,y,[(m(),c(`svg`,b,[O[7]||=o(`defs`,null,[o(`marker`,{id:`tv2s5-out-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s5-out-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s5-out-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),O[8]||=o(`rect`,{class:`dl-dg-box is-dec`,x:`10`,y:`40`,width:`34`,height:`150`,rx:`4`},null,-1),O[9]||=o(`text`,{class:`dl-dg-small`,x:`27`,y:`210`,"text-anchor":`middle`},`512 numbers`,-1),O[10]||=o(`text`,{class:`dl-dg-small is-dec`,x:`27`,y:`26`,"text-anchor":`middle`},`decoder`,-1),O[11]||=o(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s5-out-dec)`,d:`M48 115 H72`},null,-1),r(k,{path:`M27 115 H76`,role:`dec`,dur:1.2}),O[12]||=o(`polygon`,{class:`dl-dg-net`,points:`76,70 156,40 156,190 76,160`},null,-1),O[13]||=o(`text`,{class:`dl-dg-in`,x:`116`,y:`120`,"text-anchor":`middle`},`linear`,-1),O[14]||=o(`path`,{class:`dl-dg-arrow dl-dg-flow`,"marker-end":`url(#tv2s5-out-head)`,d:`M160 115 H184`},null,-1),e((m(),c(`g`,null,[O[0]||=o(`text`,{class:`dl-dg-small`,x:`252`,y:`26`,"text-anchor":`middle`},`logits: one score per word`,-1),O[1]||=o(`line`,{class:`dl-dg-split`,x1:`252`,y1:`40`,x2:`252`,y2:`190`},null,-1),(m(),c(l,null,i([[`a`,.5],[`am`,.2],[`i`,2.6],[`thanks`,.1],[`student`,.4],[`⟨eos⟩`,-.5]],(e,t)=>o(`g`,{key:`z`+t},[o(`text`,{class:`dl-dg-small`,x:`228`,y:56+t*25,"text-anchor":`end`},f(e[0]),9,x),o(`rect`,{class:d(e[1]<0?`dl-dg-bar is-bad`:`dl-dg-bar`),x:e[1]<0?252+e[1]*30:252,y:45+t*25,width:Math.abs(e[1])*30,height:`14`,rx:`2`},null,10,S),o(`text`,{class:`dl-dg-small`,x:e[1]<0?262:258+e[1]*30,y:56+t*25},f(e[1]),9,C)])),64))])),[[A]]),e((m(),c(`g`,null,[O[2]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s5-out-acc)`,d:`M380 115 H420`},null,-1),r(k,{path:`M376 115 H422`,role:`accent`,dur:1.2}),O[3]||=o(`text`,{class:`dl-dg-small`,x:`400`,y:`105`,"text-anchor":`middle`},`softmax`,-1),O[4]||=o(`text`,{class:`dl-dg-small`,x:`520`,y:`26`,"text-anchor":`middle`},`probabilities: sum to 1`,-1),O[5]||=o(`line`,{class:`dl-dg-split`,x1:`490`,y1:`40`,x2:`490`,y2:`190`},null,-1),(m(),c(l,null,i([[`a`,.08],[`am`,.06],[`i`,.69],[`thanks`,.06],[`student`,.08],[`⟨eos⟩`,.03]],(e,t)=>o(`g`,{key:`p`+t},[o(`text`,{class:`dl-dg-small`,x:`482`,y:56+t*25,"text-anchor":`end`},f(e[0]),9,w),o(`rect`,{class:d(t===2?`dl-dg-bar is-q`:`dl-dg-bar`),x:`490`,y:45+t*25,width:e[1]*120,height:`14`,rx:`2`},null,10,T),o(`text`,{class:`dl-dg-small`,x:496+e[1]*120,y:56+t*25},f(e[1].toFixed(2)),9,E)])),64))])),[[A]]),e((m(),c(`g`,null,[...O[6]||=[o(`text`,{class:`dl-dg-lab is-dec`,x:`645`,y:`110`,"text-anchor":`middle`},`"i"`,-1),o(`text`,{class:`dl-dg-small is-good`,x:`645`,y:`128`,"text-anchor":`middle`},`the largest`,-1)]])),[[A]])]))]),e((m(),c(`div`,D,[...O[15]||=[o(`p`,null,`A linear layer gives one score per vocabulary word. Softmax turns the scores into probabilities.`,-1)]])),[[A]])]),_:1},16)}}};export{O as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BRvTXwre.js b/transformer-v2/assets/md-BRvTXwre.js new file mode 100644 index 0000000000000000000000000000000000000000..96178c7a855e3bced392c8b0972e49dc71e74279 --- /dev/null +++ b/transformer-v2/assets/md-BRvTXwre.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./FlowDot-CpcqfMjQ.js";var b={class:`mt-1 flex justify-center`},x={viewBox:`0 0 660 216`,class:`dl-diagram`,role:`img`,"aria-label":`The embedding x1 = [1,0,1,0] times three learned matrices gives the query q1 = [1,1], the key k1 = [2,2] and the value v1 = [2,0]`},S=[`id`],C=[`x`],w=[`x`],T=[`marker-end`,`d`],E=[`y`],D=[`x`,`y`],O=[`y`],k=[`y`],A=[`x`,`y`],j=[`x`,`y`],M=[`y`],N=[`y`],P={class:`dl-callout`},F={__name:`slides.md__slidev_18`,setup(F){let{$slidev:I,$nav:L,$clicksContext:R,$clicks:z,$page:B,$renderContext:V,$frontmatter:H}=g();return R.setup(),(g,F)=>{let I=y,L=a(`click`);return h(),u(v,m(t(s(_)(s(H),17))),{default:n(()=>[F[3]||=o(`h1`,null,`Step 1: three vectors for every word`,-1),o(`div`,b,[(h(),c(`svg`,x,[o(`defs`,null,[(h(),c(l,null,i([`q`,`k`,`v`],e=>o(`marker`,{id:`tv2s1-qkv-${e}`,key:e,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:d(`dl-dg-head is-${e}`),d:`M0 0 L7 3.5 L0 7 z`},null,2)],8,S)),64))]),F[0]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`14`},`"Thinking"`,-1),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`rect`,{key:`x${t}`,class:`dl-dg-box`,x:10+t*28,y:`86`,width:`24`,height:`24`,rx:`2`},null,8,C)),64)),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`text`,{key:`xt${t}`,class:`dl-dg-small`,x:22+t*28,y:`102`,"text-anchor":`middle`},p(e),9,w)),64)),F[1]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`62`,y:`132`,"text-anchor":`middle`},`x₁`,-1),(h(),c(l,null,i([{n:`W_Q`,c:`q`,w:[[1,0],[0,1],[0,1],[0,0]],out:[1,1],o:`q₁`,role:`query: what I look for`},{n:`W_K`,c:`k`,w:[[1,1],[1,0],[1,1],[0,0]],out:[2,2],o:`k₁`,role:`key: what I offer to match`},{n:`W_V`,c:`v`,w:[[2,0],[0,2],[0,0],[0,0]],out:[2,0],o:`v₁`,role:`value: what I hand over`}],(t,n)=>e((h(),c(`g`,{key:t.n},[o(`path`,{class:d(`dl-dg-arrow is-${t.c} dl-dg-flow`),"marker-end":`url(#tv2s1-qkv-${t.c})`,d:`M118 98 C 126 98, 122 ${26+n*66}, 134 ${26+n*66}`},null,10,T),r(I,{path:`M118 98 C 126 98, 122 ${26+n*66}, 134 ${26+n*66}`,role:t.c,dur:1.1,r:3.5},null,8,[`path`,`role`]),o(`text`,{class:d(`dl-dg-small is-${t.c}`),x:`140`,y:30+n*66},`× `+p(t.n),11,E),(h(!0),c(l,null,i(t.w,(e,t)=>(h(),c(`g`,{key:t},[(h(!0),c(l,null,i(e,(e,r)=>(h(),c(`text`,{key:r,class:`dl-dg-small`,x:196+r*18,y:18+n*66+t*13,"text-anchor":`middle`},p(e),9,D))),128))]))),128)),o(`rect`,{class:`dl-dg-box`,x:`184`,y:6+n*66,width:`42`,height:`54`,rx:`2`,style:{fill:`none`}},null,8,O),o(`text`,{class:`dl-dg-small`,x:`248`,y:36+n*66,"text-anchor":`middle`},`=`,8,k),(h(!0),c(l,null,i(t.out,(e,r)=>(h(),c(`rect`,{key:`o${r}`,class:d(`dl-dg-box is-${t.c}`),x:268+r*28,y:20+n*66,width:`24`,height:`24`,rx:`2`},null,10,A))),128)),(h(!0),c(l,null,i(t.out,(e,t)=>(h(),c(`text`,{key:`ot${t}`,class:`dl-dg-small`,x:280+t*28,y:36+n*66,"text-anchor":`middle`},p(e),9,j))),128)),o(`text`,{class:d(`dl-dg-lab is-sm is-${t.c}`),x:`334`,y:37+n*66},p(t.o),11,M),o(`text`,{class:d(`dl-dg-small is-${t.c}`),x:`370`,y:37+n*66},p(t.role),11,N)])),[[L]])),64))]))]),e((h(),c(`div`,P,[...F[2]||=[o(`p`,null,[f(`Three `),o(`strong`,null,`learned`),f(` matrices, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`Q`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`K`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_K`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` and `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`V`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_V`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(`, shared by every word. Each turns 4 numbers into 2 (paper: 512 into 64).`)],-1)]])),[[L]])]),_:1},16)}}};export{F as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BT1hbqH6.js b/transformer-v2/assets/md-BT1hbqH6.js new file mode 100644 index 0000000000000000000000000000000000000000..904c3d7d01d759791979deef215220e3969a79a0 --- /dev/null +++ b/transformer-v2/assets/md-BT1hbqH6.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./slidev/VClicks-BDQlFH0_.js";import{t as y}from"./FlowDot-CpcqfMjQ.js";var b={class:`grid grid-cols-[1.25fr_1fr] gap-8 mt-1 items-center`},x={viewBox:`0 0 380 300`,class:`dl-diagram`,role:`img`,"aria-label":`Six encoder boxes stacked on the left, six decoder boxes stacked on the right; the top encoder's output feeds every decoder`},S=[`y`],C=[`y`],w=[`y`],T=[`y`],E=[`d`],D={__name:`slides.md__slidev_7`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=h();return A.setup(),(h,D)=>{let O=y,k=v,A=a(`click`);return m(),u(_,p(t(s(g)(s(P),6))),{default:n(()=>[D[6]||=o(`h1`,null,`Six encoders, six decoders`,-1),o(`div`,b,[o(`div`,null,[(m(),c(`svg`,x,[D[2]||=o(`defs`,null,[o(`marker`,{id:`tv2s0-stack`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(m(),c(l,null,i(6,e=>o(`g`,{key:`e${e}`},[o(`rect`,{class:`dl-dg-box is-enc`,x:`30`,y:258-e*38,width:`120`,height:`28`,rx:`4`},null,8,S),o(`text`,{class:`dl-dg-small`,x:`90`,y:277-e*38,"text-anchor":`middle`},`encoder `+f(e),9,C)])),64)),(m(),c(l,null,i(6,e=>o(`g`,{key:`d${e}`},[o(`rect`,{class:`dl-dg-box is-dec`,x:`230`,y:258-e*38,width:`120`,height:`28`,rx:`4`},null,8,w),o(`text`,{class:`dl-dg-small`,x:`290`,y:277-e*38,"text-anchor":`middle`},`decoder `+f(e),9,T)])),64)),D[3]||=o(`text`,{class:`dl-dg-small is-enc`,x:`90`,y:`292`,"text-anchor":`middle`},`je suis étudiant ↑`,-1),(m(),c(l,null,i(3,e=>r(O,{key:`fd${e}`,path:`M42 270 V26`,role:`enc`,dur:3,delay:e,r:4},null,8,[`delay`])),64)),D[4]||=o(`text`,{class:`dl-dg-small`,x:`290`,y:`12`,"text-anchor":`middle`},`↑ i am a student`,-1),e((m(),c(`g`,null,[D[0]||=o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,d:`M150 34 H190 V244`},null,-1),(m(),c(l,null,i(6,e=>o(`path`,{key:`a${e}`,class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-stack)`,d:`M190 ${244-(e-1)*38} H228`},null,8,E)),64)),(m(),c(l,null,i(3,e=>r(O,{key:`wd${e}`,path:`M150 34 H190 V244`,role:`enc`,dur:2.4,delay:e*.8},null,8,[`delay`])),64)),D[1]||=o(`text`,{class:`dl-dg-small is-enc`,x:`196`,y:`292`},`top encoder → every decoder`,-1)])),[[A]])]))]),o(`div`,null,[r(k,null,{default:n(()=>[...D[5]||=[o(`ul`,null,[o(`li`,null,[d(`The paper uses `),o(`strong`,null,`6`),d(` of each. The number is a choice, not a law`)]),o(`li`,null,[d(`Each encoder has the `),o(`strong`,null,`same design`),d(` and its own weights`)]),o(`li`,null,[d(`The input enters the `),o(`strong`,null,`bottom`),d(` encoder and climbs the stack`)]),o(`li`,null,[d(`The `),o(`strong`,null,`top`),d(` encoder’s output goes to `),o(`strong`,null,`every`),d(` decoder`)])],-1)]]),_:1})])])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BUsztF6n2.js b/transformer-v2/assets/md-BUsztF6n2.js new file mode 100644 index 0000000000000000000000000000000000000000..2e06e6859cdb6ef88224a10296c89926c748094e --- /dev/null +++ b/transformer-v2/assets/md-BUsztF6n2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_88`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),87))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Greedy or beam search`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The tree starts at ⟨start⟩. Step 1 keeps the two best first words: `),n(`em`,null,`i`),a(` (0.80) and `),n(`em`,null,`a`),a(` (0.08).`)]),n(`li`,null,[a(`Step 2 extends each of them. A partial sentence is scored by multiplying its probabilities: `),n(`em`,null,`i am`),a(` is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`0.80`),n(`mo`,null,`×`),n(`mn`,null,`0.75`),n(`mo`,null,`=`),n(`mn`,null,`0.60`)]),n(`annotation`,{encoding:`application/x-tex`},`0.80 \\times 0.75 = 0.60`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`0.80`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0.75`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0.60`)])])]),a(`.`)]),n(`li`,null,[a(`With beam size 2, the two best survive: `),n(`em`,null,`i am`),a(` (0.60) and `),n(`em`,null,`i a`),a(` (0.08). The red boxes are dropped.`)]),n(`li`,null,`Greedy decoding keeps only the single best word at each step: the thick teal arrows with moving dots.`),n(`li`,null,`If the best first word turns out wrong, beam search still holds a second option. The beam size is a hyperparameter, set by hand.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BUwdHoCB.js b/transformer-v2/assets/md-BUwdHoCB.js new file mode 100644 index 0000000000000000000000000000000000000000..2982470432a6eb7684311c3916ad8d25b425361a --- /dev/null +++ b/transformer-v2/assets/md-BUwdHoCB.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`mt-2 flex justify-center`},v={viewBox:`0 0 660 250`,class:`dl-diagram`,role:`img`,"aria-label":`A French sentence goes into a box labelled transformer and an English sentence comes out; opened, the box holds an encoder part and a decoder part`},y={__name:`slides.md__slidev_5`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=g,x=h,S=i(`click`);return d(),c(m,u(t(o(p)(o(E),4))),{default:n(()=>[y[20]||=a(`h1`,null,`A black box that translates`,-1),a(`div`,_,[(d(),s(`svg`,v,[y[12]||=a(`defs`,null,[a(`marker`,{id:`tv2s0-box`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s0-box-enc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s0-box-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[13]||=a(`text`,{class:`dl-dg-lab is-sm is-enc`,x:`70`,y:`58`,"text-anchor":`middle`},`je suis étudiant`,-1),y[14]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-box-enc)`,d:`M140 54 H200`},null,-1),r(b,{path:`M140 54 H200`,role:`enc`,dur:1.2}),y[15]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`206`,y:`22`,width:`248`,height:`64`,rx:`8`},null,-1),y[16]||=a(`text`,{class:`dl-dg-in`,x:`330`,y:`59`,"text-anchor":`middle`},`TRANSFORMER`,-1),y[17]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-box-dec)`,d:`M454 54 H514`},null,-1),r(b,{path:`M454 54 H514`,role:`dec`,dur:1.2,delay:.6}),y[18]||=a(`text`,{class:`dl-dg-lab is-sm is-dec`,x:`588`,y:`58`,"text-anchor":`middle`},`i am a student`,-1),e((d(),s(`g`,null,[y[0]||=a(`line`,{class:`dl-dg-split`,x1:`10`,y1:`108`,x2:`650`,y2:`108`},null,-1),y[1]||=a(`text`,{class:`dl-dg-small`,x:`330`,y:`128`,"text-anchor":`middle`},`open the box`,-1),y[2]||=a(`rect`,{class:`dl-dg-box`,x:`206`,y:`144`,width:`248`,height:`96`,rx:`8`},null,-1),y[3]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`222`,y:`166`,width:`96`,height:`56`,rx:`5`},null,-1),y[4]||=a(`text`,{class:`dl-dg-in is-enc`,x:`270`,y:`199`,"text-anchor":`middle`},`ENCODERS`,-1),y[5]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`342`,y:`166`,width:`96`,height:`56`,rx:`5`},null,-1),y[6]||=a(`text`,{class:`dl-dg-in is-dec`,x:`390`,y:`199`,"text-anchor":`middle`},`DECODERS`,-1),y[7]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-box-enc)`,d:`M318 194 H340`},null,-1),y[8]||=a(`text`,{class:`dl-dg-lab is-sm is-enc`,x:`70`,y:`198`,"text-anchor":`middle`},`je suis étudiant`,-1),y[9]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-box-enc)`,d:`M140 194 H220`},null,-1),r(b,{path:`M140 194 H220`,role:`enc`,dur:1.2}),r(b,{path:`M318 194 H340`,role:`enc`,dur:.8}),y[10]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-box-dec)`,d:`M438 194 H514`},null,-1),r(b,{path:`M438 194 H514`,role:`dec`,dur:1.2,delay:.6}),y[11]||=a(`text`,{class:`dl-dg-lab is-sm is-dec`,x:`588`,y:`198`,"text-anchor":`middle`},`i am a student`,-1)])),[[S]])]))]),r(x,null,{default:n(()=>[...y[19]||=[a(`ul`,null,[a(`li`,null,[l(`The `),a(`strong`,null,`encoder`),l(` part reads the whole input sentence`)]),a(`li`,null,[l(`The `),a(`strong`,null,`decoder`),l(` part writes the output sentence, using what the encoder found`)])],-1)]]),_:1})]),_:1},16)}}};export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BVyRYzwm.js b/transformer-v2/assets/md-BVyRYzwm.js new file mode 100644 index 0000000000000000000000000000000000000000..d7ea3ec7719de3ed9abdc306a48ac9ebe242f29d --- /dev/null +++ b/transformer-v2/assets/md-BVyRYzwm.js @@ -0,0 +1,12 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_24`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),23))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Steps 3 and 4: scale, then softmax`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Scale:`),a(` divide each score by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])])]),n(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])])])])]),a(`, the square root of the key length. Here `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)]),n(`mo`,null,`=`),n(`mn`,null,`2`)]),n(`annotation`,{encoding:`application/x-tex`},`d_k = 2`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`2`)])])]),a(`: the scores 4 and 1 become 2.83 and 0.71.`)]),n(`li`,null,[n(`strong`,null,`Softmax:`),a(),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`α`),n(`mrow`,null,[n(`mn`,null,`1`),n(`mi`,null,`j`)])]),n(`mo`,null,`=`),n(`mi`,null,`exp`),n(`mo`,null,`⁡`),n(`mo`,{stretchy:`false`},`(`),n(`msub`,null,[n(`mi`,null,`s`),n(`mrow`,null,[n(`mn`,null,`1`),n(`mi`,null,`j`)])]),n(`mo`,{stretchy:`false`},`)`),n(`mi`,{mathvariant:`normal`},`/`),n(`msub`,null,[n(`mo`,null,`∑`),n(`mi`,null,`m`)]),n(`mi`,null,`exp`),n(`mo`,null,`⁡`),n(`mo`,{stretchy:`false`},`(`),n(`msub`,null,[n(`mi`,null,`s`),n(`mrow`,null,[n(`mn`,null,`1`),n(`mi`,null,`m`)])]),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`\\alpha_{1j} = \\exp(s_{1j}) / \\sum_m \\exp(s_{1m})`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0037em`}},`α`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3117em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0037em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`1`),n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`j`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.0497em`,"vertical-align":`-0.2997em`}}),n(`span`,{class:`mop`},`exp`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`s`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3117em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`1`),n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`j`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])]),n(`span`,{class:`mclose`},`)`),n(`span`,{class:`mord`},`/`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`∑`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.0017em`}},[n(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`m`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2997em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},`exp`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`s`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`1`),n(`span`,{class:`mord mathnormal mtight`},`m`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mclose`},`)`)])])]),a(`. This gives `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`16.95`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`18.98`),n(`mo`,null,`=`),n(`mn`,null,`0.89`)]),n(`annotation`,{encoding:`application/x-tex`},`16.95 / 18.98 = 0.89`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`16.95/18.98`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0.89`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`2.03`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`18.98`),n(`mo`,null,`=`),n(`mn`,null,`0.11`)]),n(`annotation`,{encoding:`application/x-tex`},`2.03 / 18.98 = 0.11`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`2.03/18.98`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0.11`)])])]),a(`. The weights are positive and add up to 1.`)]),n(`li`,null,[a(`So `),n(`em`,null,`Thinking`),a(` takes 0.89 from itself and 0.11 from `),n(`em`,null,`Machines`),a(`.`)]),n(`li`,null,[a(`In the paper, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)]),n(`mo`,null,`=`),n(`mn`,null,`64`)]),n(`annotation`,{encoding:`application/x-tex`},`d_k = 64`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`64`)])])]),a(`, so the divisor is 8. Scores 112 and 96 become 14 and 12, then 0.88 and 0.12.`)]),n(`li`,null,`Why scale: long keys give large scores. The softmax then puts nearly all weight on one word, and its gradients become almost zero.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BWt5EuMf.js b/transformer-v2/assets/md-BWt5EuMf.js new file mode 100644 index 0000000000000000000000000000000000000000..387fcf6feb58abf1f343c93404b986e4f34b0f55 --- /dev/null +++ b/transformer-v2/assets/md-BWt5EuMf.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";import{t as b}from"./FlowDot-CpcqfMjQ.js";var x={class:`grid grid-cols-[1.3fr_1fr] gap-8 mt-1 items-center`},S={viewBox:`0 0 400 230`,class:`dl-diagram`,role:`img`,"aria-label":`An embedding table with one row per vocabulary word; looking up a word returns its row, a vector of numbers`},C=[`y`],w=[`x`,`y`],T=[`x`],E=[`x`],D={__name:`slides.md__slidev_11`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=g();return A.setup(),(g,D)=>{let O=b,k=y,A=a(`click`);return h(),u(v,m(t(s(_)(s(P),10))),{default:n(()=>[D[7]||=o(`h1`,null,`Refresher: a word becomes a vector`,-1),o(`div`,x,[o(`div`,null,[(h(),c(`svg`,S,[D[4]||=o(`defs`,null,[o(`marker`,{id:`tv2s0-emb`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),D[5]||=o(`text`,{class:`dl-dg-small`,x:`150`,y:`14`,"text-anchor":`middle`},`embedding table (learned)`,-1),(h(),c(l,null,i([`…`,`je`,`machines`,`suis`,`thinking`,`…`],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:`70`,y:44+t*30,"text-anchor":`end`},p(e),9,C),(h(),c(l,null,i(4,e=>o(`rect`,{key:e,class:d(t===4?`dl-dg-box is-accent`:`dl-dg-box`),x:80+(e-1)*34,y:28+t*30,width:`30`,height:`22`,rx:`2`},null,10,w)),64))])),64)),e((h(),c(`g`,null,[D[0]||=o(`rect`,{class:`dl-dg-fill dl-dg-pulse`,x:`76`,y:`144`,width:`140`,height:`30`,rx:`4`,style:{fill:`none`}},null,-1),D[1]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s0-emb)`,d:`M220 159 H262`},null,-1),r(O,{path:`M220 159 H260`,dur:.9}),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`rect`,{key:`x${t}`,class:`dl-dg-box is-accent`,x:270+t*30,y:`146`,width:`26`,height:`26`,rx:`2`},null,8,T)),64)),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`text`,{key:`t${t}`,class:`dl-dg-small`,x:283+t*30,y:`164`,"text-anchor":`middle`},p(e),9,E)),64)),D[2]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`330`,y:`196`,"text-anchor":`middle`},`x₁ for "Thinking"`,-1),D[3]||=o(`text`,{class:`dl-dg-small`,x:`330`,y:`214`,"text-anchor":`middle`},`toy: 4 numbers · paper: 512`,-1)])),[[A]])]))]),o(`div`,null,[r(k,null,{default:n(()=>[...D[6]||=[o(`ul`,null,[o(`li`,null,[f(`A network needs `),o(`strong`,null,`numbers`),f(`, not words`)]),o(`li`,null,[f(`An `),o(`strong`,null,`embedding table`),f(` has one row of numbers per word`)]),o(`li`,null,[f(`Looking up a word returns its row: a `),o(`strong`,null,`vector`)]),o(`li`,null,[f(`The rows are `),o(`strong`,null,`learned`),f(` in training, like any weight`)])],-1)]]),_:1})])])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-B_GNIk3O.js b/transformer-v2/assets/md-B_GNIk3O.js new file mode 100644 index 0000000000000000000000000000000000000000..4dfb92d6950222cd0129fef2ea343eafb11173a8 --- /dev/null +++ b/transformer-v2/assets/md-B_GNIk3O.js @@ -0,0 +1 @@ +import{E as e,Q as t,S as n,V as r,Y as i,_ as a,_t as o,b as s,bt as c,g as l,lt as u,m as d,v as f,vt as p,w as m,x as h,xt as g,yt as _,z as v}from"./modules/shiki-BFOesOFp.js";import{t as y}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as b,t as x}from"./slidev/context-ChHKJoK9.js";import{n as S,r as C,t as w}from"./interactive-C1KYSeoO.js";import{a as T,d as E,o as D}from"./useIllustrated-CloGYVoH.js";import{t as O}from"./useConvolution-qO1u8ksh.js";var k={class:`dl-sas`},A={class:`dl-sas__ask`},j=[`disabled`,`onClick`],M={class:`dl-sas__grid`},N={class:`dl-sas__bar`},P={class:`dl-sas__z`},F=6,I=y(m({__name:`SelfAttentionSteps`,props:{query:{default:0},step:{default:0},switchable:{type:Boolean,default:!0}},setup(e){let{$slidev:m,$nav:_,$clicksContext:y,$clicks:x,$page:w,$renderContext:I,$frontmatter:L}=b(),R=e,z=u(R.query),B=u(null),V=l(()=>Math.min(F,Math.max(0,B.value??R.step)));i(()=>R.step,()=>{B.value=null});let H=E(),U=l(()=>H.rows[z.value]),W=l(()=>V.value>=F);function G(){B.value=W.value?0:V.value+1}function K(e){z.value=e}let q=e=>`[${e.map(e=>O(e)).join(`, `)}]`,J=[`two words, each a vector of four numbers — nothing computed yet`,`step 1: every word makes a query, a key and a value (x times W_Q, W_K, W_V)`,`step 2: score — the asking word's query dotted with every key`,`step 3: divide each score by √d_k = √2`,`step 4: softmax — weights that are positive and add up to 1`,`step 5: multiply each value by its weight`,`step 6: add the weighted values — the layer’s output for this word`];return(e,i)=>{let l=S,u=C;return v(),f(u,{"max-width":`46rem`},{controls:t(()=>[n(l,{label:W.value?`Start over`:`Next step`,glyph:`▸`,onClick:G},null,8,[`label`])]),readout:t(()=>[W.value?(v(),s(d,{key:1},[a(`strong`,null,g(U.value.word),1),h(` gives `+g(U.value.weights[z.value].toFixed(2))+` of its attention to itself and `+g(U.value.weights[1-z.value].toFixed(2))+` to `,1),a(`strong`,null,g(o(T)[1-z.value]),1),i[14]||=h(`. Its output z`,-1),a(`sub`,null,g(z.value+1),1),h(` = `+g(q(U.value.z))+` is mostly `,1),a(`em`,null,g(o(T)[U.value.weights[0]>=U.value.weights[1]?0:1]),1),i[15]||=h(`’s value. `,-1)],64)):(v(),s(d,{key:0},[h(g(J[V.value])+`. `,1)],64))]),default:t(()=>[a(`div`,k,[a(`div`,A,[i[0]||=a(`span`,{class:`dl-sas__label`},`asking word`,-1),(v(!0),s(d,null,r(o(T),(e,t)=>(v(),s(`button`,{key:e,type:`button`,class:p([`dl-sas__word`,{"is-current":t===z.value}]),disabled:!R.switchable&&t!==z.value,onClick:e=>K(t)},g(e),11,j))),128))]),a(`table`,M,[a(`thead`,null,[a(`tr`,null,[i[1]||=a(`th`,{class:`dl-sas__rl`},null,-1),(v(!0),s(d,null,r(o(T),(e,t)=>(v(),s(`th`,{key:e,class:p([`dl-sas__col`,{"is-ask":t===z.value}])},g(e),3))),128))])]),a(`tbody`,null,[a(`tr`,null,[i[2]||=a(`th`,{class:`dl-sas__rl`},`embedding x`,-1),(v(!0),s(d,null,r(o(D),(e,t)=>(v(),s(`td`,{key:`x${t}`,class:`is-given`},g(q(e)),1))),128))]),a(`tr`,{class:p([{"is-hidden":V.value<1},`is-q`])},[i[3]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`1`),h(` query q`)],-1),(v(!0),s(d,null,r(o(H).q,(e,t)=>(v(),s(`td`,{key:`q${t}`,class:p({"is-ask":t===z.value})},g(q(e)),3))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<1},`is-k`])},[i[4]||=a(`th`,{class:`dl-sas__rl`},`key k`,-1),(v(!0),s(d,null,r(o(H).k,(e,t)=>(v(),s(`td`,{key:`k${t}`},g(q(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<1},`is-v`])},[i[5]||=a(`th`,{class:`dl-sas__rl`},`value v`,-1),(v(!0),s(d,null,r(o(H).v,(e,t)=>(v(),s(`td`,{key:`v${t}`},g(q(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<2},`is-step`])},[i[6]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`2`),h(` score q · k`)],-1),(v(!0),s(d,null,r(U.value.raw,(e,t)=>(v(),s(`td`,{key:`s${t}`},g(o(O)(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<3},`is-step`])},[i[7]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`3`),h(` ÷ √2`)],-1),(v(!0),s(d,null,r(U.value.scaled,(e,t)=>(v(),s(`td`,{key:`c${t}`},g(o(O)(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<4},`is-step`])},[i[8]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`4`),h(` softmax`)],-1),(v(!0),s(d,null,r(U.value.weights,(e,t)=>(v(),s(`td`,{key:`w${t}`},[a(`div`,null,g(e.toFixed(2)),1),a(`div`,N,[a(`span`,{style:c({width:`${e*100}%`})},null,4)])]))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<5},`is-step is-v`])},[i[9]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`5`),h(` weight × v`)],-1),(v(!0),s(d,null,r(U.value.terms,(e,t)=>(v(),s(`td`,{key:`t${t}`},g(q(e)),1))),128))],2)])]),a(`div`,{class:p([`dl-sas__out`,{"is-hidden":V.value<6}])},[i[11]||=a(`span`,{class:`dl-sas__n`},`6`,-1),i[12]||=a(`span`,{class:`dl-sas__label`},`sum`,-1),i[13]||=a(`span`,null,`→`,-1),a(`span`,P,[i[10]||=h(`z`,-1),a(`sub`,null,g(z.value+1),1),h(` = `+g(q(U.value.z)),1)])],2)])]),_:1})}}}),[[`__scopeId`,`data-v-d9cb833e`]]),L={__name:`slides.md__slidev_27`,setup(r){let{$slidev:i,$nav:s,$clicksContext:c,$clicks:l,$page:u,$renderContext:d,$frontmatter:p}=b();return c.setup(),(r,i)=>{let s=I;return v(),f(w,_(e(o(x)(o(p),26))),{aside:t(e=>[...i[0]||=[a(`p`,null,`Each click adds one step.`,-1),a(`p`,null,[a(`strong`,null,`Then`),h(` press `),a(`em`,null,`Machines`),h(` and compute its output yourself first.`)],-1),a(`div`,{class:`dl-secondary mt-3`},[a(`p`,null,[h(`Check: `),a(`em`,null,`Machines`),h(` gives 0.80 to `),a(`em`,null,`Thinking`),h(`, and its output is `),a(`span`,null,`1.61, 0.39`),h(`.`)])],-1)]]),default:t(()=>[n(s,{step:o(l)},null,8,[`step`])]),_:1},16)}}};export{L as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BcztEDTt.js b/transformer-v2/assets/md-BcztEDTt.js new file mode 100644 index 0000000000000000000000000000000000000000..ef6c5adc6c0a014e474c262cc4c67891edb63e71 --- /dev/null +++ b/transformer-v2/assets/md-BcztEDTt.js @@ -0,0 +1,12 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";var g={class:`grid grid-cols-[1.2fr_1fr] gap-8 mt-1 items-center`},_={viewBox:`0 0 380 210`,class:`dl-diagram`,role:`img`,"aria-label":`Scores 4 and 1 divided by root 2 give 2.83 and 0.71; softmax turns them into weights 0.89 and 0.11`},v={class:`mt-1 dl-callout`},y={__name:`slides.md__slidev_22`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=h,x=i(`click`);return d(),c(m,u(t(o(p)(o(E),21))),{default:n(()=>[y[9]||=a(`h1`,null,`Steps 3 and 4: scale, then softmax`,-1),a(`div`,g,[a(`div`,null,[(d(),s(`svg`,_,[y[2]||=a(`text`,{class:`dl-dg-small`,x:`120`,y:`16`,"text-anchor":`middle`},`Thinking`,-1),y[3]||=a(`text`,{class:`dl-dg-small`,x:`250`,y:`16`,"text-anchor":`middle`},`Machines`,-1),y[4]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`44`},`score`,-1),y[5]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`120`,y:`44`,"text-anchor":`middle`},`4`,-1),y[6]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`44`,"text-anchor":`middle`},`1`,-1),e((d(),s(`g`,null,[...y[0]||=[a(`defs`,null,[a(`marker`,{id:`tv2s1-scale`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L6 3 L0 6 z`})])],-1),a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s1-scale)`,d:`M150 40 V62`},null,-1),a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s1-scale)`,d:`M280 40 V62`},null,-1),a(`text`,{class:`dl-dg-small`,x:`10`,y:`78`},`÷ √2`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`120`,y:`78`,"text-anchor":`middle`},`2.83`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`78`,"text-anchor":`middle`},`0.71`,-1)]])),[[x]]),e((d(),s(`g`,null,[...y[1]||=[a(`text`,{class:`dl-dg-small`,x:`10`,y:`150`},`softmax`,-1),a(`line`,{class:`dl-dg-split`,x1:`80`,y1:`190`,x2:`300`,y2:`190`},null,-1),a(`rect`,{class:`dl-dg-bar is-q`,x:`95`,y:101,width:`50`,height:89},null,-1),a(`rect`,{class:`dl-dg-bar`,x:`225`,y:179,width:`50`,height:11},null,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`120`,y:95,"text-anchor":`middle`},`0.89`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:173,"text-anchor":`middle`},`0.11`,-1),a(`text`,{class:`dl-dg-small`,x:`190`,y:`206`,"text-anchor":`middle`},`positive, add up to 1`,-1)]])),[[x]])]))]),a(`div`,null,[r(b,null,{default:n(()=>[...y[7]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Scale`),l(`: divide by `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msqrt`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])])]),a(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k}`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),a(`span`,{class:`mord sqrt`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8572em`}},[a(`span`,{class:`svg-align`,style:{top:`-3em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])]),a(`span`,{style:{top:`-2.8172em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[a(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1828em`}},[a(`span`)])])])])])])]),l(`, the root of the key length`)]),a(`li`,null,[a(`strong`,null,`Softmax`),l(`: positive weights that add up to 1`)]),a(`li`,null,[l(`Paper: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)]),a(`mo`,null,`=`),a(`mn`,null,`64`)]),a(`annotation`,{encoding:`application/x-tex`},`d_k = 64`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`64`)])])]),l(`, divide by `),a(`strong`,null,`8`),l(`. Scores 112, 96 → 14, 12 → 0.88, 0.12`)])],-1)]]),_:1})])]),e((d(),s(`div`,v,[...y[8]||=[a(`p`,null,`Unscaled, long keys give huge scores. The softmax then saturates and its gradients vanish.`,-1)]])),[[x]])]),_:1},16)}}};export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-Bf5Oits0.js b/transformer-v2/assets/md-Bf5Oits0.js new file mode 100644 index 0000000000000000000000000000000000000000..692ca87e4eda6e2db96aab99c4eac7a8b6225377 --- /dev/null +++ b/transformer-v2/assets/md-Bf5Oits0.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./FlowDot-CpcqfMjQ.js";var g={class:`mt-1 flex justify-center`},_={viewBox:`0 0 660 256`,class:`dl-diagram`,role:`img`,"aria-label":`The encoder stack reads je suis étudiant once; its top output is turned into keys and values that go to every one of the six decoders`},v={class:`mt-1 dl-callout`},y={__name:`slides.md__slidev_65`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=h,x=i(`click`);return d(),c(m,u(t(o(p)(o(E),64))),{default:n(()=>[y[39]||=a(`h1`,null,`The encoder hands over keys and values`,-1),a(`div`,g,[(d(),s(`svg`,_,[y[6]||=a(`defs`,null,[a(`marker`,{id:`tv2s5-kv-enc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s5-kv-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s5-kv-k`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-k`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[7]||=a(`text`,{class:`dl-dg-small is-enc`,x:`130`,y:`250`,"text-anchor":`middle`},`input: je suis étudiant`,-1),y[8]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`50`,y:`204`,width:`50`,height:`24`,rx:`4`},null,-1),y[9]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`105`,y:`204`,width:`50`,height:`24`,rx:`4`},null,-1),y[10]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`160`,y:`204`,width:`50`,height:`24`,rx:`4`},null,-1),y[11]||=a(`text`,{class:`dl-dg-small`,x:`75`,y:`220`,"text-anchor":`middle`},`je`,-1),y[12]||=a(`text`,{class:`dl-dg-small`,x:`130`,y:`220`,"text-anchor":`middle`},`suis`,-1),y[13]||=a(`text`,{class:`dl-dg-small`,x:`185`,y:`220`,"text-anchor":`middle`},`étudiant`,-1),y[14]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 202 V186`},null,-1),y[15]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`40`,y:`150`,width:`180`,height:`34`,rx:`4`},null,-1),y[16]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`130`,y:`172`,"text-anchor":`middle`},`encoder 1`,-1),y[17]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 148 V134`},null,-1),y[18]||=a(`text`,{class:`dl-dg-small is-enc`,x:`130`,y:`124`,"text-anchor":`middle`},`encoders 2 to 5`,-1),y[19]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 112 V98`},null,-1),y[20]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`40`,y:`62`,width:`180`,height:`34`,rx:`4`},null,-1),y[21]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`130`,y:`84`,"text-anchor":`middle`},`encoder 6`,-1),y[22]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 60 V44`},null,-1),y[23]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`70`,y:`20`,width:`36`,height:`22`,rx:`3`},null,-1),y[24]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`112`,y:`20`,width:`36`,height:`22`,rx:`3`},null,-1),y[25]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`154`,y:`20`,width:`36`,height:`22`,rx:`3`},null,-1),y[26]||=a(`text`,{class:`dl-dg-small`,x:`130`,y:`13`,"text-anchor":`middle`},`one vector per input word`,-1),y[27]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`440`,y:`150`,width:`180`,height:`34`,rx:`4`},null,-1),y[28]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`530`,y:`172`,"text-anchor":`middle`},`decoder 1`,-1),y[29]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 148 V134`},null,-1),y[30]||=a(`text`,{class:`dl-dg-small is-dec`,x:`530`,y:`124`,"text-anchor":`middle`},`decoders 2 to 5`,-1),y[31]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 112 V98`},null,-1),y[32]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`440`,y:`62`,width:`180`,height:`34`,rx:`4`},null,-1),y[33]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`530`,y:`84`,"text-anchor":`middle`},`decoder 6`,-1),y[34]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 60 V44`},null,-1),y[35]||=a(`text`,{class:`dl-dg-small is-dec`,x:`530`,y:`34`,"text-anchor":`middle`},`the next output word`,-1),y[36]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 230 V186`},null,-1),y[37]||=a(`text`,{class:`dl-dg-small is-dec`,x:`530`,y:`248`,"text-anchor":`middle`},`output so far: ⟨start⟩ …`,-1),e((d(),s(`g`,null,[y[0]||=a(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s5-kv-k)`,d:`M192 31 C 330 31, 330 167, 436 167`},null,-1),y[1]||=a(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s5-kv-k)`,d:`M192 31 C 330 31, 340 122, 436 122`},null,-1),y[2]||=a(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s5-kv-k)`,d:`M192 31 C 330 31, 350 79, 436 79`},null,-1),r(b,{path:`M192 31 C 330 31, 330 167, 436 167`,role:`k`,dur:2.4,delay:0}),r(b,{path:`M192 31 C 330 31, 330 167, 436 167`,role:`v`,dur:2.4,delay:1.2}),r(b,{path:`M192 31 C 330 31, 340 122, 436 122`,role:`k`,dur:2.4,delay:.4}),r(b,{path:`M192 31 C 330 31, 340 122, 436 122`,role:`v`,dur:2.4,delay:1.6}),r(b,{path:`M192 31 C 330 31, 350 79, 436 79`,role:`k`,dur:2.4,delay:.8}),r(b,{path:`M192 31 C 330 31, 350 79, 436 79`,role:`v`,dur:2.4,delay:2}),y[3]||=a(`text`,{class:`dl-dg-in`,x:`300`,y:`22`,"text-anchor":`middle`},[a(`tspan`,{style:{fill:`var(--dl-k)`}},`K`),l(` and `),a(`tspan`,{style:{fill:`var(--dl-v)`}},`V`)],-1),y[4]||=a(`text`,{class:`dl-dg-small is-good`,x:`330`,y:`200`,"text-anchor":`middle`},`the same K and V`,-1),y[5]||=a(`text`,{class:`dl-dg-small is-good`,x:`330`,y:`214`,"text-anchor":`middle`},`go to every decoder`,-1)])),[[x]])]))]),e((d(),s(`div`,v,[...y[38]||=[a(`p`,null,[l(`The encoder runs `),a(`strong`,null,`once`),l(`. Its top output becomes keys `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`K`)]),a(`annotation`,{encoding:`application/x-tex`},`K`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),l(` and values `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),l(` that every decoder reads.`)],-1)]])),[[x]])]),_:1},16)}}};export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BgWTBxyL.js b/transformer-v2/assets/md-BgWTBxyL.js new file mode 100644 index 0000000000000000000000000000000000000000..f58f77269a5514832658bf603ab08d24195c85fd --- /dev/null +++ b/transformer-v2/assets/md-BgWTBxyL.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./slidev/VClicks-BDQlFH0_.js";import{t as y}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var b={class:`dl-math-xs`},x={class:`grid grid-cols-[1.5fr_1fr] gap-5 items-start`},S={class:`dl-ledger dl-tight dl-eq-legend`},C={viewBox:`0 0 250 92`,class:`dl-diagram`,role:`img`,"aria-label":`Position 1 with width 4: sin 1, cos 1, sin 0.01, cos 0.01 give 0.84, 0.54, 0.01, 1.00`},w=[`x`],T=[`x`],E=[`x`],D={class:`dl-callout`},O={__name:`slides.md__slidev_49`,setup(O){let{$slidev:k,$nav:A,$clicksContext:j,$clicks:M,$page:N,$renderContext:P,$frontmatter:F}=h();return j.setup(),(h,O)=>{let k=y,A=v,j=a(`click`);return m(),u(_,p(t(s(g)(s(F),48))),{default:n(()=>[O[4]||=o(`h1`,null,`Reading the equation: positional encoding`,-1),O[5]||=o(`p`,null,`Each pair of dimensions is a wave: early pairs change fast, later pairs slowly.`,-1),o(`div`,b,[r(k,{ranges:[]},{default:n(()=>[...O[0]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`P`),o(`msub`,null,[o(`mi`,null,`E`),o(`mrow`,null,[o(`mo`,{stretchy:`false`},`(`),o(`mi`,null,`p`),o(`mi`,null,`o`),o(`mi`,null,`s`),o(`mo`,{separator:`true`},`,`),o(`mtext`,null,` `),o(`mn`,null,`2`),o(`mi`,null,`i`),o(`mo`,{stretchy:`false`},`)`)])]),o(`mo`,null,`=`),o(`mi`,null,`sin`),o(`mo`,null,`⁡`),o(`mtext`,null,` ⁣`),o(`mrow`,null,[o(`mo`,{fence:`true`},`(`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`p`),o(`mi`,null,`o`),o(`mi`,null,`s`)]),o(`msup`,null,[o(`mn`,null,`10000`),o(`mrow`,null,[o(`mn`,null,`2`),o(`mi`,null,`i`),o(`mi`,{mathvariant:`normal`},`/`),o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])])])]),o(`mo`,{fence:`true`},`)`)]),o(`mspace`,{width:`2em`}),o(`mi`,null,`P`),o(`msub`,null,[o(`mi`,null,`E`),o(`mrow`,null,[o(`mo`,{stretchy:`false`},`(`),o(`mi`,null,`p`),o(`mi`,null,`o`),o(`mi`,null,`s`),o(`mo`,{separator:`true`},`,`),o(`mtext`,null,` `),o(`mn`,null,`2`),o(`mi`,null,`i`),o(`mo`,null,`+`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`)`)])]),o(`mo`,null,`=`),o(`mi`,null,`cos`),o(`mo`,null,`⁡`),o(`mtext`,null,` ⁣`),o(`mrow`,null,[o(`mo`,{fence:`true`},`(`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`p`),o(`mi`,null,`o`),o(`mi`,null,`s`)]),o(`msup`,null,[o(`mn`,null,`10000`),o(`mrow`,null,[o(`mn`,null,`2`),o(`mi`,null,`i`),o(`mi`,{mathvariant:`normal`},`/`),o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])])])]),o(`mo`,{fence:`true`},`)`)])]),o(`annotation`,{encoding:`application/x-tex`},`PE_{(pos,\\,2i)} = \\sin\\!\\left(\\frac{pos}{10000^{2i/d_{model}}}\\right) \\qquad PE_{(pos,\\,2i+1)} = \\cos\\!\\left(\\frac{pos}{10000^{2i/d_{model}}}\\right) `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.0385em`,"vertical-align":`-0.3552em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`P`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0576em`}},`E`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3448em`}},[o(`span`,{style:{top:`-2.5198em`,"margin-left":`-0.0576em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mopen mtight`},`(`),o(`span`,{class:`mord mathnormal mtight`},`p`),o(`span`,{class:`mord mathnormal mtight`},`os`),o(`span`,{class:`mpunct mtight`},`,`),o(`span`,{class:`mspace mtight`,style:{"margin-right":`0.1952em`}}),o(`span`,{class:`mord mtight`},`2`),o(`span`,{class:`mord mathnormal mtight`},`i`),o(`span`,{class:`mclose mtight`},`)`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3552em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.854em`,"vertical-align":`-0.704em`}}),o(`span`,{class:`mop`},`sin`),o(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`minner`},[o(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size2`},`(`)]),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.1076em`}},[o(`span`,{style:{top:`-2.296em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`1000`),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`0`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.814em`}},[o(`span`,{style:{top:`-2.989em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`2`),o(`span`,{class:`mord mathnormal mtight`},`i`),o(`span`,{class:`mord mtight`},`/`),o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3448em`}},[o(`span`,{style:{top:`-2.3488em`,"margin-left":`0em`,"margin-right":`0.0714em`}},[o(`span`,{class:`pstrut`,style:{height:`2.5em`}}),o(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1512em`}},[o(`span`)])])])])])])])])])])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`mord mathnormal`},`os`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.704em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size2`},`)`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`2em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`P`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0576em`}},`E`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3448em`}},[o(`span`,{style:{top:`-2.5198em`,"margin-left":`-0.0576em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mopen mtight`},`(`),o(`span`,{class:`mord mathnormal mtight`},`p`),o(`span`,{class:`mord mathnormal mtight`},`os`),o(`span`,{class:`mpunct mtight`},`,`),o(`span`,{class:`mspace mtight`,style:{"margin-right":`0.1952em`}}),o(`span`,{class:`mord mtight`},`2`),o(`span`,{class:`mord mathnormal mtight`},`i`),o(`span`,{class:`mbin mtight`},`+`),o(`span`,{class:`mord mtight`},`1`),o(`span`,{class:`mclose mtight`},`)`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3552em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.854em`,"vertical-align":`-0.704em`}}),o(`span`,{class:`mop`},`cos`),o(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`minner`},[o(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size2`},`(`)]),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.1076em`}},[o(`span`,{style:{top:`-2.296em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`1000`),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`0`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.814em`}},[o(`span`,{style:{top:`-2.989em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`2`),o(`span`,{class:`mord mathnormal mtight`},`i`),o(`span`,{class:`mord mtight`},`/`),o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3448em`}},[o(`span`,{style:{top:`-2.3488em`,"margin-left":`0em`,"margin-right":`0.0714em`}},[o(`span`,{class:`pstrut`,style:{height:`2.5em`}}),o(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1512em`}},[o(`span`)])])])])])])])])])])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`mord mathnormal`},`os`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.704em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size2`},`)`)])])])])])])],-1)]]),_:1})]),o(`div`,x,[o(`div`,S,[r(A,null,{default:n(()=>[...O[1]||=[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,null,`symbol`),o(`th`,null,`name`),o(`th`,null,`what it is here`),o(`th`,null,`example`)])]),o(`tbody`,null,[o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`P`),o(`mi`,null,`E`)]),o(`annotation`,{encoding:`application/x-tex`},`PE`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`P`),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0576em`}},`E`)])])])]),o(`td`,null,`position vector`),o(`td`,null,[d(`fixed, added to `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`x`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),o(`span`,{class:`mord mathbf`},`x`)])])])]),o(`td`,null,`see right`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`p`),o(`mi`,null,`o`),o(`mi`,null,`s`)]),o(`annotation`,{encoding:`application/x-tex`},`pos`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`mord mathnormal`},`os`)])])])]),o(`td`,null,`position`),o(`td`,null,`counted from 0`),o(`td`,null,[d(`1 (`),o(`em`,null,`Machines`),d(`)`)])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`2`),o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`2i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mord mathnormal`},`i`)])])]),d(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`2`),o(`mi`,null,`i`),o(`mo`,{lspace:`0em`,rspace:`0em`},`+`),o(`mn`,null,`1`)]),o(`annotation`,{encoding:`application/x-tex`},`2i{+}1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7429em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mord mathnormal`},`i`),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`+`)]),o(`span`,{class:`mord`},`1`)])])])]),o(`td`,null,[d(`dimension pair `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])])]),o(`td`,null,[d(`even: `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`sin`),o(`mo`,null,`⁡`)]),o(`annotation`,{encoding:`application/x-tex`},`\\sin`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6679em`}}),o(`span`,{class:`mop`},`sin`)])])]),d(`, odd: `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`cos`),o(`mo`,null,`⁡`)]),o(`annotation`,{encoding:`application/x-tex`},`\\cos`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mop`},`cos`)])])])]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`),o(`mo`,null,`=`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`)]),o(`annotation`,{encoding:`application/x-tex`},`i = 0, 1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),d(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`10000`)]),o(`annotation`,{encoding:`application/x-tex`},`10000`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`10000`)])])])]),o(`td`,null,`width, constant`),o(`td`,null,`set by hand`),o(`td`,null,`4 (paper 512)`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`sin`),o(`mo`,null,`⁡`)]),o(`annotation`,{encoding:`application/x-tex`},`\\sin`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6679em`}}),o(`span`,{class:`mop`},`sin`)])])]),d(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`cos`),o(`mo`,null,`⁡`)]),o(`annotation`,{encoding:`application/x-tex`},`\\cos`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mop`},`cos`)])])])]),o(`td`,null,`sine, cosine`),o(`td`,null,[d(`waves in `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[-1, 1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])])]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`sin`),o(`mo`,null,`⁡`),o(`mn`,null,`1`),o(`mo`,null,`=`),o(`mn`,null,`0.84`)]),o(`annotation`,{encoding:`application/x-tex`},`\\sin 1 = 0.84`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6679em`}}),o(`span`,{class:`mop`},`sin`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.84`)])])])])])])],-1)]]),_:1})]),o(`div`,null,[(m(),c(`svg`,C,[(m(),c(l,null,i([`sin 1`,`cos 1`,`sin 0.01`,`cos 0.01`],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:31+t*60,y:`16`,"text-anchor":`middle`},f(e),9,w),o(`rect`,{class:`dl-dg-fill is-pos`,x:4+t*60,y:`24`,width:`54`,height:`30`},null,8,T),o(`text`,{class:`dl-dg-lab is-sm`,x:31+t*60,y:`44`,"text-anchor":`middle`},f([`0.84`,`0.54`,`0.01`,`1.00`][t]),9,E)])),64)),O[2]||=o(`text`,{class:`dl-dg-small`,x:`125`,y:`80`,"text-anchor":`middle`},`PE for pos = 1, d_model = 4`,-1)])),e((m(),c(`div`,D,[...O[3]||=[o(`p`,null,[d(`Angles: `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`1`),o(`mi`,{mathvariant:`normal`},`/`),o(`msup`,null,[o(`mn`,null,`10000`),o(`mn`,null,`0`)]),o(`mo`,null,`=`),o(`mn`,null,`1`)]),o(`annotation`,{encoding:`application/x-tex`},`1 / 10000^{0} = 1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.0641em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`1/1000`),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`0`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8141em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`0`)])])])])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1`)])])]),d(` and `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`1`),o(`mi`,{mathvariant:`normal`},`/`),o(`msup`,null,[o(`mn`,null,`10000`),o(`mrow`,null,[o(`mn`,null,`2`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`4`)])]),o(`mo`,null,`=`),o(`mn`,null,`0.01`)]),o(`annotation`,{encoding:`application/x-tex`},`1 / 10000^{2/4} = 0.01`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.138em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`1/1000`),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},`0`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.888em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`2/4`)])])])])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.01`)])])])],-1)]])),[[j]])])])]),_:1},16)}}};export{O as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BkwHwcNT.js b/transformer-v2/assets/md-BkwHwcNT.js new file mode 100644 index 0000000000000000000000000000000000000000..1452430d0910adc99f0c43910f5ba3fec263ab6c --- /dev/null +++ b/transformer-v2/assets/md-BkwHwcNT.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`grid grid-cols-[1.3fr_1fr] gap-8 mt-2 items-center`},v={viewBox:`0 0 380 200`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking's query [1,1] dotted with Thinking's key [2,2] gives 4; with Machines' key [1,0] gives 1`},y={class:`mt-2 dl-callout`},b={__name:`slides.md__slidev_20`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=g,S=h,C=i(`click`);return d(),c(m,u(t(o(p)(o(D),19))),{default:n(()=>[b[16]||=a(`h1`,null,`Step 2: score every word`,-1),a(`div`,_,[a(`div`,null,[(d(),s(`svg`,v,[b[10]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`16`},`asking: "Thinking"`,-1),b[11]||=a(`rect`,{class:`dl-dg-box is-q dl-dg-pulse`,x:`10`,y:`80`,width:`70`,height:`36`,rx:`4`},null,-1),b[12]||=a(`text`,{class:`dl-dg-in is-q`,x:`45`,y:`103`,"text-anchor":`middle`},`q₁ [1, 1]`,-1),e((d(),s(`g`,null,[b[0]||=a(`path`,{class:`dl-dg-line is-q dl-dg-flow`,d:`M82 92 L180 52`},null,-1),r(x,{path:`M82 92 L180 52`,role:`q`,dur:1.2}),b[1]||=a(`rect`,{class:`dl-dg-box is-k`,x:`182`,y:`34`,width:`86`,height:`36`,rx:`4`},null,-1),b[2]||=a(`text`,{class:`dl-dg-small is-k`,x:`225`,y:`56`,"text-anchor":`middle`},`k₁ [2, 2]`,-1),b[3]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`290`,y:`46`},`1·2 + 1·2`,-1),b[4]||=a(`text`,{class:`dl-dg-lab`,x:`290`,y:`68`},`= 4`,-1)])),[[C]]),e((d(),s(`g`,null,[b[5]||=a(`path`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,d:`M82 104 L180 146`,style:{"stroke-width":`1.2`}},null,-1),r(x,{path:`M82 104 L180 146`,role:`q`,dur:1.2,delay:.6,r:3}),b[6]||=a(`rect`,{class:`dl-dg-box is-k`,x:`182`,y:`128`,width:`86`,height:`36`,rx:`4`},null,-1),b[7]||=a(`text`,{class:`dl-dg-small is-k`,x:`225`,y:`150`,"text-anchor":`middle`},`k₂ [1, 0]`,-1),b[8]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`290`,y:`140`},`1·1 + 1·0`,-1),b[9]||=a(`text`,{class:`dl-dg-lab`,x:`290`,y:`162`},`= 1`,-1)])),[[C]]),b[13]||=a(`text`,{class:`dl-dg-small`,x:`225`,y:`192`,"text-anchor":`middle`},`keys of Thinking and Machines`,-1)]))]),a(`div`,null,[r(S,null,{default:n(()=>[...b[14]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Score`),l(` = the asking word’s query `),a(`strong`,null,`dot`),l(` each word’s key`)]),a(`li`,null,[l(`Large score: the two vectors `),a(`strong`,null,`point the same way`)]),a(`li`,null,[l(`The word also scores `),a(`strong`,null,`itself`)])],-1)]]),_:1})])]),e((d(),s(`div`,y,[...b[15]||=[a(`p`,null,[a(`em`,null,`Thinking`),l(` scores 4 with itself and 1 with `),a(`em`,null,`Machines`),l(`.`)],-1)]])),[[C]])]),_:1},16)}}};export{b as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BmDYNuWL.js b/transformer-v2/assets/md-BmDYNuWL.js new file mode 100644 index 0000000000000000000000000000000000000000..95ce3ce6b2308e738c6ffc264560b368f9546d4d --- /dev/null +++ b/transformer-v2/assets/md-BmDYNuWL.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_66`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),65))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The encoder hands over keys and values`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The green stack on the left is the encoder: six encoders on top of each other. It reads the input `),n(`em`,null,`je suis étudiant`),a(` from the bottom.`)]),n(`li`,null,`The green boxes at the top are its output: one vector per input word.`),n(`li`,null,[a(`The orange curves carry that output, turned into keys `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`K`)]),n(`annotation`,{encoding:`application/x-tex`},`K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),a(` (orange dots) and values `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(` (blue dots), to the magenta decoders.`)]),n(`li`,null,[a(`The same `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`K`)]),n(`annotation`,{encoding:`application/x-tex`},`K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(` go to `),n(`strong`,null,`all six`),a(` decoders. Decoder 3 does not read encoder 3; every decoder reads the top encoder.`)]),n(`li`,null,`The encoder runs once per sentence. The decoder runs once per output word.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-BnB9SH19.css b/transformer-v2/assets/md-BnB9SH19.css new file mode 100644 index 0000000000000000000000000000000000000000..7364b3627ff41078b1edda5227962c5176e31665 --- /dev/null +++ b/transformer-v2/assets/md-BnB9SH19.css @@ -0,0 +1 @@ +.dl-sas[data-v-d9cb833e]{flex-direction:column;align-items:center;gap:.35rem;width:100%;display:flex}.dl-sas__ask[data-v-d9cb833e]{align-items:center;gap:.4rem;display:flex}.dl-sas__label[data-v-d9cb833e]{letter-spacing:.1em;text-transform:uppercase;color:var(--dl-muted);font-size:.72rem}.dl-sas__word[data-v-d9cb833e]{border:1px solid var(--dl-border);background:var(--dl-bg);color:var(--dl-body);font:inherit;cursor:pointer;border-radius:5px;padding:.12rem .7rem;font-size:.88rem}.dl-sas__word.is-current[data-v-d9cb833e]{background:var(--dl-accent);border-color:var(--dl-accent-strong);color:#fff;font-weight:600}.dl-sas__word[data-v-d9cb833e]:focus-visible{outline:2px solid var(--dl-accent);outline-offset:2px}.dl-sas__grid[data-v-d9cb833e]{border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums;width:100%;max-width:34rem}.dl-sas__grid th[data-v-d9cb833e],.dl-sas__grid td[data-v-d9cb833e]{text-align:center;color:var(--dl-heading);padding:.1rem .25rem;font-size:.84rem}.dl-sas__rl[data-v-d9cb833e]{white-space:nowrap;width:8.4rem;font-weight:500;text-align:right!important;color:var(--dl-muted)!important;font-size:.76rem!important}.dl-sas__col[data-v-d9cb833e]{border-bottom:2px solid var(--dl-border);font-weight:600}.dl-sas__col.is-ask[data-v-d9cb833e]{border-bottom-color:var(--dl-accent);color:var(--dl-accent)!important}.dl-sas__grid td.is-given[data-v-d9cb833e]{color:var(--dl-muted)}.dl-sas__grid td.is-ask[data-v-d9cb833e]{color:var(--dl-accent-strong);font-weight:700}.dl-sas__grid tr.is-step td[data-v-d9cb833e]{font-weight:600}.dl-sas__grid tr.is-q td[data-v-d9cb833e],.dl-sas__grid tr.is-q th[data-v-d9cb833e]{color:var(--dl-q)!important}.dl-sas__grid tr.is-k td[data-v-d9cb833e],.dl-sas__grid tr.is-k th[data-v-d9cb833e]{color:var(--dl-k)!important}.dl-sas__grid tr.is-v td[data-v-d9cb833e],.dl-sas__grid tr.is-v th[data-v-d9cb833e]{color:var(--dl-v)!important}.dl-sas__grid tr.is-q td.is-ask[data-v-d9cb833e]{background:color-mix(in srgb, var(--dl-q) 12%, transparent);border-radius:4px}.is-hidden[data-v-d9cb833e]{visibility:hidden}.dl-sas__n[data-v-d9cb833e]{background:var(--dl-accent-soft);width:1.05rem;height:1.05rem;color:var(--dl-accent);vertical-align:middle;border-radius:50%;place-items:center;margin-right:.25rem;font-size:.62rem;font-weight:700;display:inline-grid}.dl-sas__bar[data-v-d9cb833e]{background:var(--dl-border);border-radius:2px;width:80%;height:4px;margin:.1rem auto 0;overflow:hidden}.dl-sas__bar span[data-v-d9cb833e]{background:var(--dl-accent);height:100%;display:block}.dl-sas__out[data-v-d9cb833e]{border-top:1px solid var(--dl-border);justify-content:center;align-items:center;gap:.45rem;width:100%;max-width:34rem;padding-top:.3rem;display:flex}.dl-sas__z[data-v-d9cb833e]{border:1px solid var(--dl-accent);background:var(--dl-accent-soft);color:var(--dl-heading);font-variant-numeric:tabular-nums;border-radius:4px;padding:.12rem .6rem;font-weight:700} diff --git a/transformer-v2/assets/md-Bt-qs18d.js b/transformer-v2/assets/md-Bt-qs18d.js new file mode 100644 index 0000000000000000000000000000000000000000..0ae1ee049b07f7e7bcb6bfc9692bcaef6aef41da --- /dev/null +++ b/transformer-v2/assets/md-Bt-qs18d.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";import{t as b}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var x={class:`grid grid-cols-[1.45fr_1fr] gap-5 mt-1 items-start`},S={class:`dl-math-sm`},C={class:`dl-ledger dl-tight dl-eq-legend`},w={viewBox:`0 0 260 120`,class:`dl-diagram`,role:`img`,"aria-label":`exp of each logit: 1.65 1.22 13.46 1.11 1.49 0.61, total 19.54`},T=[`x`,`y`,`height`],E=[`x`,`y`],D=[`x`],O={class:`dl-callout`},k={__name:`slides.md__slidev_75`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=g();return M.setup(),(g,k)=>{let A=b,j=y,M=a(`click`);return h(),u(v,m(t(s(_)(s(I),74))),{default:n(()=>[k[4]||=o(`h1`,null,`Reading the equation: the output layer`,-1),o(`div`,x,[o(`div`,null,[o(`div`,S,[r(A,{ranges:[]},{default:n(()=>[...k[0]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`z`),o(`mo`,null,`=`),o(`mi`,{mathvariant:`bold`},`h`),o(`mtext`,null,` `),o(`msub`,null,[o(`mi`,null,`W`),o(`mrow`,null,[o(`mi`,null,`o`),o(`mi`,null,`u`),o(`mi`,null,`t`)])]),o(`mo`,null,`+`),o(`mi`,{mathvariant:`bold`},`b`),o(`mo`,{separator:`true`},`,`),o(`mspace`,{width:`2em`}),o(`mi`,{mathvariant:`bold`},`p`),o(`mo`,null,`=`),o(`mi`,{mathvariant:`normal`},`softmax`),o(`mo`,null,`⁡`),o(`mo`,{stretchy:`false`},`(`),o(`mi`,{mathvariant:`bold`},`z`),o(`mo`,{stretchy:`false`},`)`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z} = \\mathbf{h}\\,W_{out} + \\mathbf{b}, \\qquad \\mathbf{p} = \\operatorname{softmax}(\\mathbf{z}) `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),o(`span`,{class:`mord mathbf`},`z`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord mathbf`},`h`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2806em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`u`),o(`span`,{class:`mord mathnormal mtight`},`t`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`2em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathbf`},`p`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mord mathrm`},`softmax`)]),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord mathbf`},`z`),o(`span`,{class:`mclose`},`)`)])])])])],-1)]]),_:1})]),o(`div`,C,[r(j,null,{default:n(()=>[...k[1]||=[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,null,`symbol`),o(`th`,null,`name`),o(`th`,null,`what it is here`),o(`th`,null,`example`)])]),o(`tbody`,null,[o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`h`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),o(`span`,{class:`mord mathbf`},`h`)])])])]),o(`td`,null,`decoder output`),o(`td`,null,[f(`one position, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers (data)`)]),o(`td`,null,`512 numbers`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mrow`,null,[o(`mi`,null,`o`),o(`mi`,null,`u`),o(`mi`,null,`t`)])])]),o(`annotation`,{encoding:`application/x-tex`},`W_{out}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2806em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`u`),o(`span`,{class:`mord mathnormal mtight`},`t`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`output weights`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])]),o(`mo`,null,`×`),o(`msub`,null,[o(`mi`,null,`N`),o(`mtext`,null,`vocab`)])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model} \\times N_{\\text{vocab}}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`N`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.109em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord text mtight`},[o(`span`,{class:`mord mtight`},`vocab`)])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` matrix, learned`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`512`),o(`mo`,null,`×`),o(`mn`,null,`10`),o(`mtext`,null,` `),o(`mn`,null,`000`)]),o(`annotation`,{encoding:`application/x-tex`},`512 \\times 10\\,000`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`512`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`10`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`000`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`b`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{b}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),o(`span`,{class:`mord mathbf`},`b`)])])])]),o(`td`,null,`bias`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`N`),o(`mtext`,null,`vocab`)])]),o(`annotation`,{encoding:`application/x-tex`},`N_{\\text{vocab}}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`N`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.109em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord text mtight`},[o(`span`,{class:`mord mtight`},`vocab`)])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers, learned`)]),o(`td`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`N`),o(`mtext`,null,`vocab`)])]),o(`annotation`,{encoding:`application/x-tex`},`N_{\\text{vocab}}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`N`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.109em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord text mtight`},[o(`span`,{class:`mord mtight`},`vocab`)])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`vocabulary size`),o(`td`,null,`set by hand`),o(`td`,null,`10 000 (toy: 6)`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`z`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),o(`span`,{class:`mord mathbf`},`z`)])])])]),o(`td`,null,`logits`),o(`td`,null,`one score per word`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`z`),o(`mi`,null,`i`)]),o(`mo`,null,`=`),o(`mn`,null,`2.6`)]),o(`annotation`,{encoding:`application/x-tex`},`z_i = 2.6`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.044em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`i`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`2.6`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`p`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{p}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathbf`},`p`)])])])]),o(`td`,null,`probabilities`),o(`td`,null,`positive, sum to 1`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`p`),o(`mi`,null,`i`)]),o(`mo`,null,`=`),o(`mn`,null,`0.69`)]),o(`annotation`,{encoding:`application/x-tex`},`p_i = 0.69`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`i`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.69`)])])])])])])],-1)]]),_:1})])]),o(`div`,null,[(h(),c(`svg`,w,[k[2]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`11`},`e to the power of each logit`,-1),(h(),c(l,null,i([[`a`,1.65],[`am`,1.22],[`i`,13.46],[`thanks`,1.11],[`student`,1.49],[`⟨eos⟩`,.61]],(e,t)=>o(`g`,{key:t},[o(`rect`,{class:d(t===2?`dl-dg-bar is-q`:`dl-dg-bar`),x:12+t*40,y:96-e[1]*4.4,width:`28`,height:e[1]*4.4,rx:`2`},null,10,T),o(`text`,{class:`dl-dg-small`,x:26+t*40,y:91-e[1]*4.4,"text-anchor":`middle`},p(e[1]),9,E),o(`text`,{class:`dl-dg-small`,x:26+t*40,y:`112`,"text-anchor":`middle`},p(e[0]),9,D)])),64))])),e((h(),c(`div`,O,[...k[3]||=[o(`p`,null,[f(`Total `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`=`),o(`mn`,null,`1.65`),o(`mo`,null,`+`),o(`mn`,null,`1.22`),o(`mo`,null,`+`),o(`mn`,null,`13.46`),o(`mo`,null,`+`),o(`mn`,null,`1.11`),o(`mo`,null,`+`),o(`mn`,null,`1.49`),o(`mo`,null,`+`),o(`mn`,null,`0.61`),o(`mo`,null,`=`),o(`mn`,null,`19.54`)]),o(`annotation`,{encoding:`application/x-tex`},`= 1.65 + 1.22 + 13.46 + 1.11 + 1.49 + 0.61 = 19.54`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.3669em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`1.65`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`1.22`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`13.46`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`1.11`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`1.49`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.61`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`19.54`)])])])],-1),o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`p`),o(`mi`,null,`i`)]),o(`mo`,null,`=`),o(`mn`,null,`13.46`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`19.54`),o(`mo`,null,`=`),o(`mn`,null,`0.69`)]),o(`annotation`,{encoding:`application/x-tex`},`p_i = 13.46 / 19.54 = 0.69`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`i`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`13.46/19.54`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.69`)])])])],-1)]])),[[M]])])])]),_:1},16)}}};export{k as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-C4csASMu2.js b/transformer-v2/assets/md-C4csASMu2.js new file mode 100644 index 0000000000000000000000000000000000000000..30dfaf6676193d78240dc2615a261468d3cdbd91 --- /dev/null +++ b/transformer-v2/assets/md-C4csASMu2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 660 210`,class:`dl-diagram`,role:`img`,"aria-label":`X, two rows of four numbers, times W_Q, four rows of two, gives Q, two rows of two. The same X times W_K and W_V gives K and V`},x=[`x`,`y`],S=[`x`,`y`],C=[`x`,`y`],w=[`x`,`y`],T=[`x`,`y`],E=[`x`,`y`],D=[`x`,`y`],O=[`x`,`y`],k=[`x`,`y`],A=[`x`,`y`],j={class:`mt-2 dl-callout`},M={__name:`slides.md__slidev_32`,setup(M){let{$slidev:N,$nav:P,$clicksContext:F,$clicks:I,$page:L,$renderContext:R,$frontmatter:z}=h();return F.setup(),(h,M)=>{let N=v,P=a(`click`);return m(),u(_,p(t(s(g)(s(z),31))),{default:n(()=>[M[15]||=o(`h1`,null,`Every word at once: matrices`,-1),M[16]||=o(`p`,null,[d(`Stack the word vectors as the rows of one matrix `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`X`)]),o(`annotation`,{encoding:`application/x-tex`},`X`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),d(`. One product per matrix gives every query, key and value at once.`)],-1),o(`div`,y,[(m(),c(`svg`,b,[M[5]||=o(`defs`,null,[o(`marker`,{id:`tv2s2-mat-q`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-q`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s2-mat-k`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-k`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s2-mat-v`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-v`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),M[6]||=o(`path`,{class:`dl-dg-arrow is-q dl-dg-flow`,"marker-end":`url(#tv2s2-mat-q)`,d:`M150 40 C 205 12, 320 12, 368 40`},null,-1),r(N,{path:`M150 40 C 205 12, 320 12, 368 40`,role:`q`,dur:2}),M[7]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`62`,"text-anchor":`end`},`Thinking`,-1),M[8]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`88`,"text-anchor":`end`},`Machines`,-1),(m(),c(l,null,i([[1,0,1,0],[0,1,0,1]],(e,t)=>o(`g`,{key:`x`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box`,x:90+n*30,y:44+t*26,width:`30`,height:`26`},null,8,x),o(`text`,{class:`dl-dg-lab is-sm`,x:105+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,S)]))),128))])),64)),M[9]||=o(`text`,{class:`dl-dg-small`,x:`150`,y:`118`,"text-anchor":`middle`},`X (2 × 4)`,-1),M[10]||=o(`text`,{class:`dl-dg-lab`,x:`226`,y:`76`,"text-anchor":`middle`},`×`,-1),(m(),c(l,null,i([[1,0],[0,1],[0,1],[0,0]],(e,t)=>o(`g`,{key:`w`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-q`,x:244+n*30,y:26+t*22,width:`30`,height:`22`},null,8,C),o(`text`,{class:`dl-dg-lab is-sm`,x:259+n*30,y:42+t*22,"text-anchor":`middle`},f(e),9,w)]))),128))])),64)),M[11]||=o(`text`,{class:`dl-dg-small is-q`,x:`274`,y:`130`,"text-anchor":`middle`},`W_Q (4 × 2)`,-1),M[12]||=o(`text`,{class:`dl-dg-lab`,x:`324`,y:`76`,"text-anchor":`middle`},`=`,-1),(m(),c(l,null,i([[1,1],[0,1]],(e,t)=>o(`g`,{key:`q`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-q`,x:344+n*30,y:44+t*26,width:`30`,height:`26`},null,8,T),o(`text`,{class:`dl-dg-lab is-sm`,x:359+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,E)]))),128))])),64)),M[13]||=o(`text`,{class:`dl-dg-small is-q`,x:`374`,y:`118`,"text-anchor":`middle`},`Q (2 × 2)`,-1),e((m(),c(`g`,null,[M[0]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s2-mat-k)`,d:`M150 40 C 230 4, 420 4, 474 40`},null,-1),M[1]||=o(`path`,{class:`dl-dg-arrow is-v dl-dg-flow`,"marker-end":`url(#tv2s2-mat-v)`,d:`M150 40 C 250 -2, 520 -2, 584 40`},null,-1),r(N,{path:`M150 40 C 230 4, 420 4, 474 40`,role:`k`,dur:2.2,delay:.7}),r(N,{path:`M150 40 C 250 -2, 520 -2, 584 40`,role:`v`,dur:2.4,delay:1.4}),(m(),c(l,null,i([[2,2],[1,0]],(e,t)=>o(`g`,{key:`k`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-k`,x:450+n*30,y:44+t*26,width:`30`,height:`26`},null,8,D),o(`text`,{class:`dl-dg-lab is-sm`,x:465+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,O)]))),128))])),64)),M[2]||=o(`text`,{class:`dl-dg-small is-k`,x:`480`,y:`118`,"text-anchor":`middle`},`K = X W_K`,-1),(m(),c(l,null,i([[2,0],[0,2]],(e,t)=>o(`g`,{key:`v`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-v`,x:560+n*30,y:44+t*26,width:`30`,height:`26`},null,8,k),o(`text`,{class:`dl-dg-lab is-sm`,x:575+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,A)]))),128))])),64)),M[3]||=o(`text`,{class:`dl-dg-small is-v`,x:`590`,y:`118`,"text-anchor":`middle`},`V = X W_V`,-1)])),[[P]]),e((m(),c(`g`,null,[...M[4]||=[o(`line`,{class:`dl-dg-split`,x1:`10`,y1:`150`,x2:`650`,y2:`150`},null,-1),o(`text`,{class:`dl-dg-small`,x:`330`,y:`174`,"text-anchor":`middle`},`row 1 of Q, K and V belongs to Thinking, row 2 to Machines`,-1),o(`text`,{class:`dl-dg-small is-good`,x:`330`,y:`196`,"text-anchor":`middle`},`the same three weight matrices serve every word`,-1)]])),[[P]])]))]),e((m(),c(`div`,j,[...M[14]||=[o(`p`,null,[d(`Three matrix products replace step 1 for `),o(`strong`,null,`every word at once`),d(`. A computer does this fast, in parallel.`)],-1)]])),[[P]])]),_:1},16)}}};export{M as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-C68rt1Jx2.js b/transformer-v2/assets/md-C68rt1Jx2.js new file mode 100644 index 0000000000000000000000000000000000000000..43f3af6d3eea38dc420fe42373fa66b5b662ac4c --- /dev/null +++ b/transformer-v2/assets/md-C68rt1Jx2.js @@ -0,0 +1 @@ +import{$ as e,E as t,K as n,Q as r,S as i,V as a,_ as o,_t as s,b as c,bt as l,g as u,j as d,l as f,lt as p,m,v as h,vt as g,w as _,x as v,xt as y,y as b,yt as x,z as S}from"./modules/shiki-BFOesOFp.js";import{t as C}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as w,t as T}from"./slidev/context-ChHKJoK9.js";import{t as E}from"./slidev/VClicks-BDQlFH0_.js";import{n as D,r as O,t as k}from"./interactive-C1KYSeoO.js";import{t as A}from"./useConvolution-qO1u8ksh.js";var j={key:0,class:`dl-slider__label`},M=[`min`,`max`,`step`,`disabled`],N={class:`dl-slider__value`},P={key:0,class:`dl-slider__unit`},F=C(_({__name:`Slider`,props:d({label:{},min:{default:0},max:{default:1},step:{default:.01},precision:{default:2},unit:{},format:{},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let{$slidev:r,$nav:i,$clicksContext:a,$clicks:s,$page:l,$renderContext:d,$frontmatter:p}=w(),m=t,h=n(t,`modelValue`),_=u(()=>m.format?m.format(h.value):h.value.toFixed(m.precision)),x=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`PageUp`,`PageDown`,` `]);function C(e){x.has(e.key)&&e.stopPropagation()}return(t,n)=>(S(),c(`label`,{class:g([`dl-slider`,{"is-disabled":m.disabled}])},[m.label?(S(),c(`span`,j,y(m.label),1)):b(`v-if`,!0),e(o(`input`,{"onUpdate:modelValue":n[0]||=e=>h.value=e,type:`range`,min:m.min,max:m.max,step:m.step,disabled:m.disabled,onKeydown:C},null,40,M),[[f,h.value,void 0,{number:!0}]]),o(`output`,N,[v(y(_.value),1),m.unit?(S(),c(`span`,P,y(m.unit),1)):b(`v-if`,!0)])],2))}}),[[`__scopeId`,`data-v-b8762282`]]),I={class:`dl-logit`},L={class:`dl-logit__track`},R={class:`dl-logit__zval`},z={class:`dl-logit__track is-prob`},B={class:`dl-logit__pval`},V={class:`dl-logit__loss`},H={key:0},U={key:1,class:`dl-logit__muted`},W=C(_({__name:`LogitLab`,props:{mode:{default:`multiclass`},classes:{default:()=>[`cat`,`dog`,`bird`]},logits:{default:()=>[2,.5,-1]},trueClass:{default:0},range:{default:()=>[-6,6]}},setup(e){let{$slidev:t,$nav:n,$clicksContext:d,$clicks:f,$page:_,$renderContext:x,$frontmatter:C}=w(),T=e,E=p([...T.logits]),k=p(T.trueClass);function j(){E.value=[...T.logits],k.value=T.trueClass}function M(){E.value=E.value.map(e=>Math.min(T.range[1],e+2))}let N=e=>1/(1+Math.exp(-e)),P=u(()=>{if(T.mode===`binary`){let e=N(E.value[0]);return[1-e,e]}let e=Math.max(...E.value),t=E.value.map(t=>Math.exp(t-e)),n=t.reduce((e,t)=>e+t,0);return t.map(e=>e/n)}),W=u(()=>T.mode===`binary`?T.classes.length>=2?[`${T.classes[0]} (y=0)`,`${T.classes[1]} (y=1)`]:[`y = 0`,`y = 1`]:T.classes),G=u(()=>-Math.log(Math.max(P.value[k.value]??1e-12,1e-12))),K=u(()=>W.value.map((e,t)=>({i:t,name:e,z:T.mode===`binary`?t===1?E.value[0]:-E.value[0]:E.value[t],p:P.value[t],isTrue:t===k.value}))),q=u(()=>T.range[1]-T.range[0]),J=u(()=>(0-T.range[0])/q.value*100);function Y(e){let t=Math.abs(e)/q.value*100;return{left:`${e>=0?J.value:J.value-t}%`,width:`${t}%`}}let X=u(()=>P.value.reduce((e,t)=>e+t,0));return(e,t)=>{let n=F,u=D,d=O;return S(),h(d,{"max-width":`40rem`},{controls:r(()=>[T.mode===`binary`?(S(),h(n,{key:0,modelValue:E.value[0],"onUpdate:modelValue":t[0]||=e=>E.value[0]=e,label:`score z`,min:T.range[0],max:T.range[1],step:.25,precision:2},null,8,[`modelValue`,`min`,`max`])):(S(),c(m,{key:1},[(S(!0),c(m,null,a(E.value,(e,t)=>(S(),h(n,{key:`s${t}`,modelValue:E.value[t],"onUpdate:modelValue":e=>E.value[t]=e,label:`z(${T.classes[t]})`,min:T.range[0],max:T.range[1],step:.25,precision:2},null,8,[`modelValue`,`onUpdate:modelValue`,`label`,`min`,`max`]))),128)),i(u,{label:`+2 to every logit`,variant:`ghost`,glyph:`↑`,onClick:M})],64)),(S(!0),c(m,null,a(K.value,e=>(S(),h(u,{key:`t${e.i}`,label:`truth: ${e.name}`,variant:e.isTrue?`primary`:`ghost`,onClick:t=>k.value=e.i},null,8,[`label`,`variant`,`onClick`]))),128)),i(u,{label:`Reset`,variant:`ghost`,glyph:`↺`,onClick:j})]),readout:r(()=>[T.mode===`binary`?(S(),c(m,{key:0},[t[5]||=v(` One score in, one probability out: `,-1),o(`strong`,null,`σ(`+y(s(A)(E.value[0]))+`) = `+y(s(A)(P.value[1])),1),v(`, and the other class takes the remaining `+y(s(A)(P.value[0]))+`. z = 0 is exactly 0.5 — the decision threshold. With the label as it stands, the loss is `,1),o(`strong`,null,y(s(A)(G.value)),1),t[6]||=v(`. `,-1)],64)):(S(),c(m,{key:1},[v(` The `+y(E.value.length)+` probabilities sum to `+y(s(A)(X.value))+` — always. Only the `,1),o(`strong`,null,y(W.value[k.value]),1),t[7]||=v(` bar enters the loss; the others act on it by taking away probability. Press `,-1),t[8]||=o(`strong`,null,`+2 to every logit`,-1),t[9]||=v(`: every score moves, nothing else does. `,-1)],64))]),default:r(()=>[o(`div`,I,[t[1]||=o(`span`,{class:`dl-logit__head`},null,-1),t[2]||=o(`span`,{class:`dl-logit__head`},[v(`raw score `),o(`em`,null,`z`),v(` — a logit`)],-1),t[3]||=o(`span`,{class:`dl-logit__head`},`probability`,-1),t[4]||=o(`span`,{class:`dl-logit__head`},null,-1),(S(!0),c(m,null,a(K.value,e=>(S(),c(m,{key:e.i},[o(`div`,{class:g([`dl-logit__name`,{"is-true":e.isTrue}])},y(e.name),3),b(` Logits are signed, so the track carries a zero line. `),o(`div`,L,[o(`div`,{class:`dl-logit__zero`,style:l({left:`${J.value}%`})},null,4),o(`div`,{class:g([`dl-logit__z`,{"is-neg":e.z<0}]),style:l(Y(e.z))},null,6),o(`span`,R,y(s(A)(e.z)),1)]),o(`div`,z,[o(`div`,{class:g([`dl-logit__p`,{"is-true":e.isTrue}]),style:l({width:`${e.p*100}%`})},null,6),o(`span`,B,y(s(A)(e.p)),1)]),o(`div`,V,[e.isTrue?(S(),c(`span`,H,[v(`−log `+y(s(A)(e.p))+` = `,1),o(`strong`,null,y(s(A)(G.value)),1)])):(S(),c(`span`,U,`—`))])],64))),128))])]),_:1})}}}),[[`__scopeId`,`data-v-e48eef9f`]]),G={style:{zoom:`0.72`}},K={__name:`slides.md__slidev_80`,setup(e){let{$slidev:n,$nav:a,$clicksContext:c,$clicks:l,$page:u,$renderContext:d,$frontmatter:f}=w();return c.setup(),(e,n)=>{let a=W,c=E;return S(),h(k,x(t(s(T)(s(f),79))),{aside:r(e=>[n[1]||=o(`p`,null,[v(`Input `),o(`em`,null,`merci`),v(`, right answer `),o(`em`,null,`thanks`),v(`.`)],-1),i(c,null,{default:r(()=>[...n[0]||=[o(`ul`,null,[o(`li`,null,[v(`Untrained: all logits 0, so every word gets `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`1`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`6`),o(`mo`,null,`=`),o(`mn`,null,`0.17`)]),o(`annotation`,{encoding:`application/x-tex`},`1/6 = 0.17`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`1/6`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.17`)])])])]),o(`li`,null,[v(`Loss `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`=`),o(`mo`,null,`−`),o(`mi`,null,`log`),o(`mo`,null,`⁡`),o(`mn`,null,`0.17`),o(`mo`,null,`=`),o(`mn`,null,`1.79`)]),o(`annotation`,{encoding:`application/x-tex`},`= -\\log 0.17 = 1.79`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.3669em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mop`},[v(`lo`),o(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0.17`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1.79`)])])])]),o(`li`,null,[v(`Drag `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`z`)]),o(`annotation`,{encoding:`application/x-tex`},`z`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`)])])]),v(`(thanks) up: the loss falls`)]),o(`li`,null,[v(`Backpropagation nudges `),o(`strong`,null,`every`),v(` weight that way`)])],-1)]]),_:1})]),default:r(()=>[o(`div`,G,[i(a,{mode:`multiclass`,classes:[`a`,`am`,`i`,`thanks`,`student`,`⟨eos⟩`],logits:[0,0,0,0,0,0],"true-class":3,range:[-4,6]})])]),_:1},16)}}};export{K as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CBiwiAUN2.js b/transformer-v2/assets/md-CBiwiAUN2.js new file mode 100644 index 0000000000000000000000000000000000000000..7c55d78f5b5e64d4980c99ddea64dd6a25ae4339 --- /dev/null +++ b/transformer-v2/assets/md-CBiwiAUN2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./FlowDot-CpcqfMjQ.js";import{t as g}from"./PollSlide-uaNGIrh8.js";var _={class:`grid grid-cols-[1.7fr_1fr] gap-6 items-start`},v={class:`mt-12`},y={viewBox:`0 0 240 150`,class:`dl-diagram`,role:`img`,"aria-label":`Machines asks: one line to Thinking, one line back to itself, weights hidden`},b={class:`mt-3 dl-reveal`},x={class:`mt-2 dl-secondary`},S={__name:`slides.md__slidev_29`,setup(S){let{$slidev:C,$nav:w,$clicksContext:T,$clicks:E,$page:D,$renderContext:O,$frontmatter:k}=f();return T.setup(),(f,S)=>{let C=g,w=h,T=i(`click`);return d(),c(m,u(t(o(p)(o(k),28))),{default:n(()=>[a(`div`,_,[a(`div`,null,[r(C,{question:`In self-attention, does every word give its largest weight to itself?`,items:[`Yes, always`,`Yes, but only after dividing by √d_k`,`No: it depends on the learned matrices`,`No: a word never attends to itself`]})]),a(`div`,v,[(d(),s(`svg`,y,[S[0]||=a(`rect`,{class:`dl-dg-box is-k`,x:`10`,y:`20`,width:`96`,height:`30`,rx:`4`},null,-1),S[1]||=a(`text`,{class:`dl-dg-small`,x:`58`,y:`40`,"text-anchor":`middle`},`Thinking`,-1),S[2]||=a(`rect`,{class:`dl-dg-box is-q`,x:`10`,y:`100`,width:`96`,height:`30`,rx:`4`},null,-1),S[3]||=a(`text`,{class:`dl-dg-small`,x:`58`,y:`120`,"text-anchor":`middle`},`Machines`,-1),S[4]||=a(`path`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,d:`M106 115 C 170 115, 170 35, 106 35`},null,-1),S[5]||=a(`path`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,d:`M106 122 C 150 140, 150 100, 106 108`},null,-1),r(w,{path:`M106 115 C 170 115, 170 35, 106 35`,role:`q`,dur:1.8,r:3.5}),r(w,{path:`M106 122 C 150 140, 150 100, 106 108`,role:`q`,dur:1.8,delay:.9,r:3.5}),S[6]||=a(`text`,{class:`dl-dg-small`,x:`168`,y:`80`},`?`,-1),S[7]||=a(`text`,{class:`dl-dg-small`,x:`150`,y:`146`},`?`,-1)]))])]),e((d(),s(`div`,b,[...S[8]||=[a(`p`,null,`No: it depends on the learned matrices`,-1)]])),[[T]]),e((d(),s(`div`,x,[...S[9]||=[a(`p`,null,[a(`em`,null,`Machines`),l(` gives 0.80 to `),a(`em`,null,`Thinking`),l(` and only 0.20 to itself.`)],-1)]])),[[T]])]),_:1},16)}}};export{S as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CBx0Em09.js b/transformer-v2/assets/md-CBx0Em09.js new file mode 100644 index 0000000000000000000000000000000000000000..34941c94be5183b799039bb39158cb763c6d727e --- /dev/null +++ b/transformer-v2/assets/md-CBx0Em09.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_68`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),67))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: One word per step`,-1),n(`div`,{class:`dl-describe`},[n(`ol`,null,[n(`li`,null,[a(`The encoder has already read `),n(`em`,null,`je suis étudiant`),a(` (green). The decoder starts from a ⟨start⟩ symbol; its words are magenta.`)]),n(`li`,null,`At each step it gives a probability to every word in the vocabulary. Here the vocabulary has six words.`),n(`li`,null,[a(`It picks the most likely word: `),n(`em`,null,`i`),a(` (0.80), then `),n(`em`,null,`am`),a(` (0.75), `),n(`em`,null,`a`),a(` (0.70), `),n(`em`,null,`student`),a(` (0.85) and ⟨eos⟩ (0.90).`)]),n(`li`,null,`Each picked word becomes part of the decoder’s input for the next step. It is embedded and gets a position vector first.`),n(`li`,null,`⟨eos⟩ means "end of sentence", so the loop stops there.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CChSOWnD.js b/transformer-v2/assets/md-CChSOWnD.js new file mode 100644 index 0000000000000000000000000000000000000000..ad531e905bbbfe79b1582d2cab0a860207c45e89 --- /dev/null +++ b/transformer-v2/assets/md-CChSOWnD.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_58`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),57))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Layer normalisation`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`Layer normalisation works on one word’s vector at a time.`),n(`li`,null,[a(`The left bars are `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[2, 0, 2, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`. Their mean `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`μ`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mu`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord mathnormal`},`μ`)])])]),a(` is 1, the dashed line.`)]),n(`li`,null,[a(`Subtract the mean: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1, -1, 1, -1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`. The standard deviation `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`σ`)]),n(`annotation`,{encoding:`application/x-tex`},`\\sigma`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`σ`)])])]),a(` is 1, so dividing by it changes nothing. These are the right-hand bars.`)]),n(`li`,null,`The result has mean 0 and standard deviation 1.`),n(`li`,null,[a(`Then a learned scale `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold-italic`},`γ`)]),n(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\gamma}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord`},[n(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.0639em`}},`γ`)])])])])]),a(` and shift `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold-italic`},`β`)]),n(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\beta}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord`},[n(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.034em`}},`β`)])])])])]),a(` are applied. They start at 1 and 0.`)]),n(`li`,null,`This keeps the numbers at a steady size from layer to layer, which keeps training stable.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CDcgbbik.js b/transformer-v2/assets/md-CDcgbbik.js new file mode 100644 index 0000000000000000000000000000000000000000..9c000ca30a3ec4ee4b0462670541b39e7c73416f --- /dev/null +++ b/transformer-v2/assets/md-CDcgbbik.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_12`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),11))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Refresher: a word becomes a vector`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`A network can only work with numbers, so each word first becomes a vector.`),n(`li`,null,[a(`The table on the left is the `),n(`strong`,null,`embedding table`),a(`. It has one row per word in the vocabulary.`)]),n(`li`,null,[a(`Looking up a word returns its row. For `),n(`em`,null,`Thinking`),a(` the toy row is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_1 = [1, 0, 1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,`The toy uses 4 numbers per word so the arithmetic fits on a slide. The paper uses 512.`),n(`li`,null,`The table is a weight matrix. Its rows are learned during training, like any other weight.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CE--CYvf.js b/transformer-v2/assets/md-CE--CYvf.js new file mode 100644 index 0000000000000000000000000000000000000000..599b65a6f5be5d17713bc800687f70296d3f7669 --- /dev/null +++ b/transformer-v2/assets/md-CE--CYvf.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,yt as l,z as u}from"./modules/shiki-BFOesOFp.js";import{n as d,t as f}from"./slidev/context-ChHKJoK9.js";import{t as p}from"./TransformerGlyph-XWvPPlsx.js";import{t as m}from"./default-DTdNOfwb.js";var h={class:`grid grid-cols-4 gap-x-4 gap-y-2 mt-2`},g={class:`flex flex-col items-center text-center gap-1`},_={class:`flex flex-col items-center text-center gap-1`},v={class:`flex flex-col items-center text-center gap-1`},y={class:`flex flex-col items-center text-center gap-1`},b={class:`flex flex-col items-center text-center gap-1`},x={class:`flex flex-col items-center text-center gap-1`},S={class:`flex flex-col items-center text-center gap-1`},C={class:`flex flex-col items-center text-center gap-1`},w={class:`mt-2 dl-callout`},T={__name:`slides.md__slidev_2`,setup(T){let{$slidev:E,$nav:D,$clicksContext:O,$clicks:k,$page:A,$renderContext:j,$frontmatter:M}=d();return O.setup(),(d,T)=>{let E=p,D=i(`click`);return u(),c(m,l(t(o(f)(o(M),1))),{default:n(()=>[T[9]||=a(`h1`,null,`Today, in eight parts`,-1),T[10]||=a(`p`,null,`The whole machine, its core step, then the parts around it.`,-1),a(`div`,h,[a(`div`,g,[r(E,{kind:`encdec`,size:56}),T[0]||=a(`span`,{class:`dl-secondary`},`00 The big picture`,-1)]),a(`div`,_,[r(E,{kind:`qkv`,size:56}),T[1]||=a(`span`,{class:`dl-secondary`},`01 Self-attention`,-1)]),a(`div`,v,[r(E,{kind:`heads`,size:56}),T[2]||=a(`span`,{class:`dl-secondary`},`02 Matrices and many heads`,-1)]),a(`div`,y,[r(E,{kind:`position`,size:56}),T[3]||=a(`span`,{class:`dl-secondary`},`03 Word order`,-1)]),a(`div`,b,[r(E,{kind:`block`,size:56}),T[4]||=a(`span`,{class:`dl-secondary`},`04 Add & norm`,-1)]),a(`div`,x,[r(E,{kind:`decoder`,size:56}),T[5]||=a(`span`,{class:`dl-secondary`},`05 The decoder side`,-1)]),a(`div`,S,[r(E,{kind:`train`,size:56}),T[6]||=a(`span`,{class:`dl-secondary`},`06 Training and decoding`,-1)]),a(`div`,C,[r(E,{kind:`encdec`,size:56}),T[7]||=a(`span`,{class:`dl-secondary`},`07 Recap`,-1)])]),e((u(),s(`div`,w,[...T[8]||=[a(`p`,null,`Section 01 is the heart: one word’s output, computed by hand.`,-1)]])),[[D]])]),_:1},16)}}};export{T as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CG5Sy8Ts.js b/transformer-v2/assets/md-CG5Sy8Ts.js new file mode 100644 index 0000000000000000000000000000000000000000..83c29cc500319b4dc092e89d481c15ec93e18dfc --- /dev/null +++ b/transformer-v2/assets/md-CG5Sy8Ts.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_26`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),25))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Steps 5 and 6: weigh the values, then add`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The blue boxes on the left are the two values: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`v`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{v}_1 = [2, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.016em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(` for `),n(`em`,null,`Thinking`),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`v`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{v}_2 = [0, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.016em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(` for `),n(`em`,null,`Machines`),a(`. The big and small blue dots show how much of each value flows into the sum.`)]),n(`li`,null,[n(`strong`,null,`Step 5, weigh:`),a(` multiply each value by its attention weight. `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`0.893`),n(`mo`,null,`×`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.79`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`0.893 \\times [2, 0] = [1.79, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`0.893`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.79`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`0.107`),n(`mo`,null,`×`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.21`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`0.107 \\times [0, 2] = [0, 0.21]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`0.107`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.21`),n(`span`,{class:`mclose`},`]`)])])]),a(` (the weights 0.89 and 0.11, to three decimals).`)]),n(`li`,null,`A word with a small weight almost disappears from the result.`),n(`li`,null,[n(`strong`,null,`Step 6, add:`),a(` the weighted values are added up. `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`z`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.79`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.21`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1 = [1.79, 0.21]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`z`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.79`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.21`),n(`span`,{class:`mclose`},`]`)])])]),a(` is the self-attention output for `),n(`em`,null,`Thinking`),a(`.`)]),n(`li`,null,`The output is a blend of every word’s value, mixed in the proportions the softmax chose.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CIEPxxCW.js b/transformer-v2/assets/md-CIEPxxCW.js new file mode 100644 index 0000000000000000000000000000000000000000..ccf190504176e0d4d9d34c6ddfe939600bec575c --- /dev/null +++ b/transformer-v2/assets/md-CIEPxxCW.js @@ -0,0 +1,12 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,y as m,yt as h,z as g}from"./modules/shiki-BFOesOFp.js";import{n as _,t as v}from"./slidev/context-ChHKJoK9.js";import{t as y}from"./default-DTdNOfwb.js";import{t as b}from"./FlowDot-CpcqfMjQ.js";import{t as x}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var S={class:`dl-math-sm`},C={class:`flex justify-center`},w={viewBox:`0 0 660 150`,class:`dl-diagram`,style:{"max-height":`10.5rem`},role:`img`,"aria-label":`Q K transpose is 4 1 over 2 0. Divided by root 2: 2.83 0.71 over 1.41 0. Softmax of each row: 0.89 0.11 over 0.80 0.20. Times V gives Z: 1.79 0.21 over 1.61 0.39`},T=[`x`],E=[`x`,`y`],D=[`x`,`y`],O=[`d`],k={class:`mt-1 dl-callout`},A={__name:`slides.md__slidev_34`,setup(A){let{$slidev:j,$nav:M,$clicksContext:N,$clicks:P,$page:F,$renderContext:I,$frontmatter:L}=_();return N.setup(),(_,A)=>{let j=x,M=b,N=a(`click`);return g(),u(y,h(t(s(v)(s(L),33))),{default:n(()=>[A[7]||=o(`h1`,null,`The whole layer in one line`,-1),A[8]||=o(`p`,null,`Steps 2 to 6, for every word at once, as matrices.`,-1),o(`div`,S,[r(j,{ranges:[]},{default:n(()=>[...A[0]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`Z`),o(`mo`,null,`=`),o(`mi`,{mathvariant:`normal`},`softmax`),o(`mo`,null,`⁡`),o(`mtext`,null,` ⁣`),o(`mrow`,null,[o(`mo`,{fence:`true`},`(`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`Q`),o(`msup`,null,[o(`mi`,null,`K`),o(`mi`,{mathvariant:`normal`},`⊤`)])]),o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])]),o(`mo`,{fence:`true`},`)`)]),o(`mi`,null,`V`)]),o(`annotation`,{encoding:`application/x-tex`},`Z = \\operatorname{softmax}\\!\\left(\\frac{QK^\\top}{\\sqrt{d_k}}\\right) V `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`2.4761em`,"vertical-align":`-0.95em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mord mathrm`},`softmax`)]),o(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`minner`},[o(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`(`)]),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.5261em`}},[o(`span`,{style:{top:`-2.2528em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`Q`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8491em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.93em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`)`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])])],-1)]]),_:1})]),o(`div`,C,[(g(),c(`svg`,w,[A[1]||=o(`defs`,null,[o(`marker`,{id:`tv2s2-one-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),A[2]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`66`,"text-anchor":`end`},`Thinking`,-1),A[3]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`96`,"text-anchor":`end`},`Machines`,-1),(g(),c(l,null,i([[`score: QKᵀ`,[[`4`,`1`],[`2`,`0`]]],[`scale: ÷ √2`,[[`2.83`,`0.71`],[`1.41`,`0`]]],[`softmax, each row`,[[`0.89`,`0.11`],[`0.80`,`0.20`]]],[`× V = Z`,[[`1.79`,`0.21`],[`1.61`,`0.39`]]]],(t,n)=>o(`g`,{key:n},[e((g(),c(`g`,null,[o(`text`,{class:`dl-dg-small`,x:136+n*140,y:`30`,"text-anchor":`middle`},p(t[0]),9,T),(g(!0),c(l,null,i(t[1],(e,t)=>(g(),c(`g`,{key:t},[(g(!0),c(l,null,i(e,(e,r)=>(g(),c(`g`,{key:r},[o(`rect`,{class:d(n===3?t===0?`dl-dg-box is-accent dl-dg-pulse`:`dl-dg-box is-accent`:`dl-dg-box`),x:90+n*140+r*46,y:44+t*30,width:`46`,height:`30`},null,10,E),o(`text`,{class:`dl-dg-lab is-sm`,x:113+n*140+r*46,y:64+t*30,"text-anchor":`middle`},p(e),9,D)]))),128))]))),128)),n<3?(g(),c(`path`,{key:0,class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-one-head)`,d:`M${186+n*140} 74 H${224+n*140}`},null,8,O)):m(`v-if`,!0),n<3?(g(),u(M,{key:1,path:`M${186+n*140} 74 H${224+n*140}`,role:`accent`,dur:1,delay:n*.3},null,8,[`path`,`delay`])):m(`v-if`,!0)])),[[N]])])),64)),A[4]||=o(`text`,{class:`dl-dg-small`,x:`136`,y:`128`,"text-anchor":`middle`},`columns: the key read`,-1),A[5]||=o(`text`,{class:`dl-dg-small is-good`,x:`556`,y:`128`,"text-anchor":`middle`},`row 1 = z₁`,-1)]))]),e((g(),c(`div`,k,[...A[6]||=[o(`p`,null,[f(`Row 1 of `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`Z`)]),o(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])]),f(` is `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1.79`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0.21`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1.79, 0.21]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1.79`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0.21`),o(`span`,{class:`mclose`},`]`)])])]),f(`: the `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`z`),o(`mn`,null,`1`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`z`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` you computed by hand. One line does the same work for `),o(`strong`,null,`every word at once`),f(`.`)],-1)]])),[[N]])]),_:1},16)}}};export{A as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CKe0B4NX2.js b/transformer-v2/assets/md-CKe0B4NX2.js new file mode 100644 index 0000000000000000000000000000000000000000..163d5fe7620d43b557f97f45d2cb732cdc682127 --- /dev/null +++ b/transformer-v2/assets/md-CKe0B4NX2.js @@ -0,0 +1,12 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_30`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),29))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Poll: does a word attend most to itself?`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The answer is `),n(`strong`,null,`no`),a(`. A word’s weights depend only on how its query matches each key.`)]),n(`li`,null,[a(`Queries and keys come from the learned matrices `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`Q`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`K`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(`. Nothing in the mechanism makes a word’s own key special.`)]),n(`li`,null,[a(`In the toy, `),n(`em`,null,`Machines`),a(` has query `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[0, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`. It scores 2 with `),n(`em`,null,`Thinking`),a(`’s key and 0 with its own.`)]),n(`li`,null,[a(`After scaling and the softmax it gives 0.80 to `),n(`em`,null,`Thinking`),a(` and 0.20 to itself.`)]),n(`li`,null,[a(`Dividing by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])])]),n(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])])])])]),a(` shrinks every score by the same factor. So it never changes which word gets the largest weight.`)])])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CLNMUNew2.js b/transformer-v2/assets/md-CLNMUNew2.js new file mode 100644 index 0000000000000000000000000000000000000000..3252ebbd6843ce9962e00f3bff0fb0ed37468628 --- /dev/null +++ b/transformer-v2/assets/md-CLNMUNew2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_82`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),81))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The loss on one word: merci → thanks`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The input is `),n(`em`,null,`merci`),a(`; the right answer is `),n(`em`,null,`thanks`),a(`.`)]),n(`li`,null,[a(`An untrained model gives all six words logit 0, so each gets probability `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`6`),n(`mo`,null,`=`),n(`mn`,null,`0.17`)]),n(`annotation`,{encoding:`application/x-tex`},`1/6 = 0.17`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`1/6`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0.17`)])])]),a(`.`)]),n(`li`,null,[a(`The loss is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`L`),n(`mo`,null,`=`),n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`msub`,null,[n(`mi`,null,`p`),n(`mi`,null,`y`)])]),n(`annotation`,{encoding:`application/x-tex`},`L = -\\log p_{y}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`},`L`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`p`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1514em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(`, minus the log of the right word’s probability: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`mn`,null,`0.17`),n(`mo`,null,`=`),n(`mn`,null,`1.79`)]),n(`annotation`,{encoding:`application/x-tex`},`-\\log 0.17 = 1.79`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.17`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1.79`)])])]),a(`.`)]),n(`li`,null,[a(`Raising the `),n(`em`,null,`thanks`),a(` logit raises its probability and lowers the loss. A probability of 0.90 gives a loss of 0.11: the moving teal arrow from the red bar to the short teal bar.`)]),n(`li`,null,`Backpropagation finds how every weight should change to do this. Gradient descent takes the step.`),n(`li`,null,`For a sentence, add the losses of all its positions.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CNTV1QrC2.js b/transformer-v2/assets/md-CNTV1QrC2.js new file mode 100644 index 0000000000000000000000000000000000000000..ce1b734328b5f3a44e36a9b3904f5409d8c0d8ba --- /dev/null +++ b/transformer-v2/assets/md-CNTV1QrC2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 660 220`,class:`dl-diagram`,style:{"max-height":`11.5rem`},role:`img`,"aria-label":`Step 1 keeps i 0.80 and a 0.08. Step 2 extends both: i am 0.60, i a 0.08, a student 0.032, a am 0.016. Beam size 2 keeps i am and i a`},y={class:`mt-1 dl-callout`},b={__name:`slides.md__slidev_87`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=g,S=h,C=i(`click`);return d(),c(m,u(t(o(p)(o(D),86))),{default:n(()=>[b[27]||=a(`h1`,null,`Greedy or beam search`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[12]||=a(`defs`,null,[a(`marker`,{id:`tv2s6-beam-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s6-beam-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),b[13]||=a(`text`,{class:`dl-dg-small`,x:`60`,y:`16`,"text-anchor":`middle`},`start`,-1),b[14]||=a(`text`,{class:`dl-dg-small`,x:`250`,y:`16`,"text-anchor":`middle`},`step 1`,-1),b[15]||=a(`text`,{class:`dl-dg-small`,x:`500`,y:`16`,"text-anchor":`middle`},`step 2: score = product`,-1),b[16]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`20`,y:`96`,width:`80`,height:`30`,rx:`4`},null,-1),b[17]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`60`,y:`116`,"text-anchor":`middle`},`⟨start⟩`,-1),b[18]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s6-beam-acc)`,d:`M100 104 L196 66`,style:{"stroke-width":`2.6`}},null,-1),r(x,{path:`M100 104 L196 66`,role:`accent`,dur:1.4}),b[19]||=a(`path`,{class:`dl-dg-arrow dl-dg-flow is-slow`,"marker-end":`url(#tv2s6-beam-head)`,d:`M100 118 L196 156`},null,-1),b[20]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`200`,y:`48`,width:`100`,height:`32`,rx:`4`},null,-1),b[21]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`69`,"text-anchor":`middle`},`i 0.80`,-1),b[22]||=a(`rect`,{class:`dl-dg-box`,x:`200`,y:`140`,width:`100`,height:`32`,rx:`4`},null,-1),b[23]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`161`,"text-anchor":`middle`},`a 0.08`,-1),e((d(),s(`g`,null,[b[0]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s6-beam-acc)`,d:`M300 58 L416 36`,style:{"stroke-width":`2.6`}},null,-1),r(x,{path:`M300 58 L416 36`,role:`accent`,dur:1.4,delay:.7}),b[1]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow is-slow`,"marker-end":`url(#tv2s6-beam-acc)`,d:`M300 70 L416 84`},null,-1),r(x,{path:`M300 70 L416 84`,role:`accent`,dur:1.8,delay:.3,r:`3.5`}),b[2]||=a(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s6-beam-head)`,d:`M300 150 L416 136`},null,-1),b[3]||=a(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s6-beam-head)`,d:`M300 162 L416 184`},null,-1),b[4]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`420`,y:`22`,width:`220`,height:`28`,rx:`4`},null,-1),b[5]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`41`},`i am: 0.80 × 0.75 = 0.60`,-1),b[6]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`420`,y:`70`,width:`220`,height:`28`,rx:`4`},null,-1),b[7]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`89`},`i a: 0.80 × 0.10 = 0.08`,-1),b[8]||=a(`rect`,{class:`dl-dg-box is-bad`,x:`420`,y:`122`,width:`220`,height:`28`,rx:`4`},null,-1),b[9]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`141`},`a student: 0.08 × 0.40 = 0.032`,-1),b[10]||=a(`rect`,{class:`dl-dg-box is-bad`,x:`420`,y:`170`,width:`220`,height:`28`,rx:`4`},null,-1),b[11]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`189`},`a am: 0.08 × 0.20 = 0.016`,-1)])),[[C]]),b[24]||=a(`text`,{class:`dl-dg-small`,x:`330`,y:`214`,"text-anchor":`middle`},`toy numbers; beam size 2 keeps the two teal boxes`,-1)]))]),r(S,null,{default:n(()=>[...b[25]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Greedy`),l(`: keep only the top word at each step`)]),a(`li`,null,[a(`strong`,null,`Beam search`),l(` (size 2): keep the 2 best partial sentences; score = product of probabilities`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[26]||=[a(`p`,null,`Beam search can recover from a wrong first word. Beam size is set by hand.`,-1)]])),[[C]])]),_:1},16)}}};export{b as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CV0LbJ3U2.js b/transformer-v2/assets/md-CV0LbJ3U2.js new file mode 100644 index 0000000000000000000000000000000000000000..c081d48e9a61714d5b0b48d40f58269002ae0ab3 --- /dev/null +++ b/transformer-v2/assets/md-CV0LbJ3U2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_3`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),2))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Today, in eight parts`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The slide is the map of the lecture. Each glyph stands for one section, and the same glyph returns on that section’s divider and on the recap.`),n(`ol`,null,[n(`li`,null,[n(`strong`,null,`00, two stacks.`),a(` The whole translation machine, seen from outside.`)]),n(`li`,null,[n(`strong`,null,`01, a query with weighted lines.`),a(` Self-attention, computed by hand.`)]),n(`li`,null,[n(`strong`,null,`02 to 04.`),a(` Many heads, word order, and the wiring around each layer.`)]),n(`li`,null,[n(`strong`,null,`05, a masked grid.`),a(` How the decoder writes one word at a time.`)]),n(`li`,null,[n(`strong`,null,`06, bars against a target.`),a(` How the model is trained, and how it picks words.`)])]),n(`p`,null,`Section 01 is the core of the lecture.`)],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CW77YPMv.js b/transformer-v2/assets/md-CW77YPMv.js new file mode 100644 index 0000000000000000000000000000000000000000..15f8243fb54aeb84c01c40af243526c686254722 --- /dev/null +++ b/transformer-v2/assets/md-CW77YPMv.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_6`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),5))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: A black box that translates`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The top row is the transformer seen from outside. The French sentence `),n(`em`,null,`je suis étudiant`),a(` goes in, and the English `),n(`em`,null,`i am a student`),a(` comes out.`)]),n(`li`,null,`The bottom row opens the box. Inside are two parts, joined by an arrow.`),n(`li`,null,[a(`The encoder reads all of `),n(`em`,null,`je suis étudiant`),a(` before anything is written.`)]),n(`li`,null,`The decoder produces the English words. It uses the encoder’s result, which is the arrow between the two parts.`),n(`li`,null,`Green marks the encoder side and magenta the decoder side, on every slide. The moving dots show the sentence travelling through.`),n(`li`,null,`Everything in this lecture is a closer look at one of these two parts.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CaP1nPh7.js b/transformer-v2/assets/md-CaP1nPh7.js new file mode 100644 index 0000000000000000000000000000000000000000..98614c587c6aa14a48a274140b71ac682a36dd00 --- /dev/null +++ b/transformer-v2/assets/md-CaP1nPh7.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_47`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),46))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Attention does not see order`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`The moving dots climb from each word, through self-attention, to its output.`),n(`li`,null,[a(`The left half runs `),n(`em`,null,`Thinking Machines`),a(` through self-attention. `),n(`em`,null,`Thinking`),a(` comes out as `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.79`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.21`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1.79, 0.21]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.79`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.21`),n(`span`,{class:`mclose`},`]`)])])]),a(` and `),n(`em`,null,`Machines`),a(` as `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.61`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.39`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1.61, 0.39]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.61`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.39`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,`The right half swaps the words. Each word still meets the same keys and values, so it gets the same weights and the same output.`),n(`li`,null,`The two outputs only change places. Nothing in the six steps looks at where a word stands.`),n(`li`,null,[a(`So self-attention depends on `),n(`strong`,null,`which`),a(` words are present, not on their order.`)]),n(`li`,null,`Word order changes meaning. The model must therefore put each word’s position into its vector.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CacrcamQ.js b/transformer-v2/assets/md-CacrcamQ.js new file mode 100644 index 0000000000000000000000000000000000000000..cc6c4f5a9eaecba9620b61ce267809df63f81daa --- /dev/null +++ b/transformer-v2/assets/md-CacrcamQ.js @@ -0,0 +1,23 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";var b={class:`grid grid-cols-[1.45fr_1fr] gap-5 mt-1 items-start`},x={class:`dl-ledger dl-tight dl-eq-legend`},S={viewBox:`0 0 280 120`,class:`dl-diagram`,role:`img`,"aria-label":`Row 2: scores 1, 1, minus infinity, add the mask row 0, 0, minus infinity, softmax gives 0.5, 0.5, 0`},C=[`y`],w=[`x`,`y`],T=[`x`,`y`],E={class:`dl-callout`},D={__name:`slides.md__slidev_70`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=g();return A.setup(),(g,D)=>{let O=y,k=a(`click`);return h(),u(v,m(t(s(_)(s(P),69))),{default:n(()=>[D[3]||=o(`h1`,null,`Reading the equation: the mask`,-1),o(`div`,b,[o(`div`,x,[r(O,null,{default:n(()=>[...D[0]||=[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,null,`symbol`),o(`th`,null,`name`),o(`th`,null,`what it is here`),o(`th`,null,`example`)])]),o(`tbody`,null,[o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`Q`),o(`mo`,{separator:`true`},`,`),o(`mi`,null,`K`),o(`mo`,{separator:`true`},`,`),o(`mi`,null,`V`)]),o(`annotation`,{encoding:`application/x-tex`},`Q, K, V`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`Q`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])]),o(`td`,null,`queries, keys, values`),o(`td`,null,`one row per decoder position`),o(`td`,null,`3 rows`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`Q`),o(`msup`,null,[o(`mi`,null,`K`),o(`mi`,{mathvariant:`normal`},`⊤`)])]),o(`annotation`,{encoding:`application/x-tex`},`QK^\\top`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.0435em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`Q`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8491em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])])]),o(`td`,null,`score matrix`),o(`td`,null,`every query dotted with every key`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`3`),o(`mo`,null,`×`),o(`mn`,null,`3`)]),o(`annotation`,{encoding:`application/x-tex`},`3 \\times 3`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`3`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`3`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])]),o(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])])])]),o(`td`,null,`scale`),o(`td`,null,`square root of the key width`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msqrt`,null,[o(`mn`,null,`64`)]),o(`mo`,null,`=`),o(`mn`,null,`8`)]),o(`annotation`,{encoding:`application/x-tex`},`\\sqrt{64} = 8`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1328em`}}),o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.9072em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},`64`)])]),o(`span`,{style:{top:`-2.8672em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1328em`}},[o(`span`)])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`8`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`M`)]),o(`annotation`,{encoding:`application/x-tex`},`M`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`M`)])])])]),o(`td`,null,`mask`),o(`td`,null,[f(`0 where `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`j`),o(`mo`,null,`≤`),o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`j \\le i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`≤`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,{mathvariant:`normal`},`∞`)]),o(`annotation`,{encoding:`application/x-tex`},`-\\infty`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`∞`)])])]),f(` where `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`j`),o(`mo`,null,`>`),o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`j > i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`>`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])])]),o(`td`,null,[f(`upper triangle `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,{mathvariant:`normal`},`∞`)]),o(`annotation`,{encoding:`application/x-tex`},`-\\infty`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`∞`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`),o(`mo`,{separator:`true`},`,`),o(`mi`,null,`j`)]),o(`annotation`,{encoding:`application/x-tex`},`i, j`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`},`i`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`)])])])]),o(`td`,null,`row, column`),o(`td`,null,`asking position, position read`),o(`td`,null,[f(`row 2 reads `),o(`em`,null,`i`)])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`normal`},`softmax`),o(`mo`,null,`⁡`)]),o(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mord mathrm`},`softmax`)])])])])]),o(`td`,null,`softmax per row`),o(`td`,null,`positive weights, each row sums to 1`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`0.5`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0.5`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`)]),o(`annotation`,{encoding:`application/x-tex`},`0.5, 0.5, 0`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},`0.5`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0.5`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`)])])])])])])],-1)]]),_:1})]),o(`div`,null,[(h(),c(`svg`,S,[(h(),c(l,null,i([[`scores`,[`1`,`1`,`−∞`]],[`softmax`,[`0.5`,`0.5`,`0`]]],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:`66`,y:40+t*50,"text-anchor":`end`},p(e[0]),9,C),(h(!0),c(l,null,i(e[1],(e,n)=>(h(),c(`g`,{key:n},[o(`rect`,{class:d(n===2?`dl-dg-box is-bad`:`dl-dg-box`),x:76+n*64,y:20+t*50,width:`56`,height:`32`,rx:`3`},null,10,w),o(`text`,{class:`dl-dg-lab is-sm`,x:104+n*64,y:41+t*50,"text-anchor":`middle`},p(e),9,T)]))),128))])),64)),D[1]||=o(`text`,{class:`dl-dg-small`,x:`76`,y:`114`},`row for the position reading "i"`,-1)])),e((h(),c(`div`,E,[...D[2]||=[o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msup`,null,[o(`mi`,null,`e`),o(`mn`,null,`1`)]),o(`mi`,{mathvariant:`normal`},`/`),o(`mo`,{stretchy:`false`},`(`),o(`msup`,null,[o(`mi`,null,`e`),o(`mn`,null,`1`)]),o(`mo`,null,`+`),o(`msup`,null,[o(`mi`,null,`e`),o(`mn`,null,`1`)]),o(`mo`,null,`+`),o(`msup`,null,[o(`mi`,null,`e`),o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,{mathvariant:`normal`},`∞`)])]),o(`mo`,{stretchy:`false`},`)`),o(`mo`,null,`=`),o(`mn`,null,`2.72`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`5.44`),o(`mo`,null,`=`),o(`mn`,null,`0.5`)]),o(`annotation`,{encoding:`application/x-tex`},`e^{1} / (e^{1} + e^{1} + e^{-\\infty}) = 2.72 / 5.44 = 0.5`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.0641em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`e`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8141em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`1`)])])])])])])])]),o(`span`,{class:`mord`},`/`),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`e`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8141em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`1`)])])])])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8974em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`e`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8141em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`1`)])])])])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.0213em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`e`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.7713em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`−`),o(`span`,{class:`mord mtight`},`∞`)])])])])])])])]),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`2.72/5.44`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.5`)])])])],-1),o(`p`,null,[f(`The third weight is `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`0`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`5.44`),o(`mo`,null,`=`),o(`mn`,null,`0`)]),o(`annotation`,{encoding:`application/x-tex`},`0 / 5.44 = 0`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`0/5.44`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0`)])])]),f(`.`)],-1)]])),[[k]])])])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-Cil9bYLP.js b/transformer-v2/assets/md-Cil9bYLP.js new file mode 100644 index 0000000000000000000000000000000000000000..5d4501910a065766525cc75f083314e698b6ee0b --- /dev/null +++ b/transformer-v2/assets/md-Cil9bYLP.js @@ -0,0 +1,23 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_28`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),27))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: All six steps, for either word`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The table has one column per word and one row per step.`),n(`ol`,null,[n(`li`,null,`Make the query, key and value of every word.`),n(`li`,null,`Score: the asking word’s query dotted with every key.`),n(`li`,null,[a(`Divide every score by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])]),n(`mo`,null,`=`),n(`msqrt`,null,[n(`mn`,null,`2`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k} = \\sqrt{2}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1328em`}}),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.9072em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},`2`)])]),n(`span`,{style:{top:`-2.8672em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1328em`}},[n(`span`)])])])])])])]),a(`.`)]),n(`li`,null,`Softmax: turn the scores into weights that add up to 1.`),n(`li`,null,`Multiply each value by its weight.`),n(`li`,null,[a(`Add them up: the output `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`z`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),n(`span`,{class:`mord mathbf`},`z`)])])]),a(` for the asking word.`)])]),n(`p`,null,[a(`For `),n(`em`,null,`Thinking`),a(`: weights 0.89 and 0.11, output `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.79`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.21`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1.79, 0.21]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.79`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.21`),n(`span`,{class:`mclose`},`]`)])])]),a(`. For `),n(`em`,null,`Machines`),a(`: scores 2 and 0, weights 0.80 on `),n(`em`,null,`Thinking`),a(` and 0.20 on itself, output `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.61`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.39`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1.61, 0.39]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.61`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.39`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-ClA16Aez.js b/transformer-v2/assets/md-ClA16Aez.js new file mode 100644 index 0000000000000000000000000000000000000000..abda13a84bda7d4eb2a7aa3afbd80caad2070ac4 --- /dev/null +++ b/transformer-v2/assets/md-ClA16Aez.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_33`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),32))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Every word at once: matrices`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The slide stacks the two word vectors as the rows of a matrix `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`)]),n(`annotation`,{encoding:`application/x-tex`},`X`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),a(`. Row 1 is `),n(`em`,null,`Thinking`),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1, 0, 1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`. Row 2 is `),n(`em`,null,`Machines`),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[0, 1, 0, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,[a(`Multiplying `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`)]),n(`annotation`,{encoding:`application/x-tex`},`X`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),a(` by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`Q`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(` gives `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Q`)]),n(`annotation`,{encoding:`application/x-tex`},`Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord mathnormal`},`Q`)])])]),a(` (purple). Each row of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Q`)]),n(`annotation`,{encoding:`application/x-tex`},`Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord mathnormal`},`Q`)])])]),a(` is one word’s query. Row 1 is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`, the same `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`q`),n(`mn`,null,`1`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{q}_1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`q`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` as in the six steps.`)]),n(`li`,null,[n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`K`)])]),n(`annotation`,{encoding:`application/x-tex`},`X W_K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` gives the keys `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`K`)]),n(`annotation`,{encoding:`application/x-tex`},`K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),a(` (orange): rows `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[2, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,[n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`V`)])]),n(`annotation`,{encoding:`application/x-tex`},`X W_V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` gives the values `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(` (blue): rows `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[2, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[0, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,[a(`The moving arcs show `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`)]),n(`annotation`,{encoding:`application/x-tex`},`X`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),a(` feeding each product.`)]),n(`li`,null,`There is one set of weight matrices, shared by every word.`),n(`li`,null,`Three matrix products make every query, key and value at once.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-CqT2jAjy2.js b/transformer-v2/assets/md-CqT2jAjy2.js new file mode 100644 index 0000000000000000000000000000000000000000..5e1d6559db16c24de99f9ca55805552655428e4d --- /dev/null +++ b/transformer-v2/assets/md-CqT2jAjy2.js @@ -0,0 +1 @@ +import{E as e,Q as t,S as n,_ as r,_t as i,v as a,x as o,yt as s,z as c}from"./modules/shiki-BFOesOFp.js";import{n as l,t as u}from"./slidev/context-ChHKJoK9.js";import{t as d}from"./slidev/VClicks-BDQlFH0_.js";import{t as f}from"./interactive-C1KYSeoO.js";import{t as p}from"./DecodeLoop-CNTHEb2K.js";var m={__name:`slides.md__slidev_85`,setup(m){let{$slidev:h,$nav:g,$clicksContext:_,$clicks:v,$page:y,$renderContext:b,$frontmatter:x}=l();return _.setup(),(l,m)=>{let h=p,g=d;return c(),a(f,s(e(i(u)(i(x),84))),{aside:t(e=>[m[1]||=r(`p`,null,[o(`The sentence loss adds one `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mo`,null,`−`),r(`mi`,null,`log`),r(`mo`,null,`⁡`),r(`mi`,null,`p`)]),r(`annotation`,{encoding:`application/x-tex`},`-\\log p`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),r(`span`,{class:`mord`},`−`),r(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),r(`span`,{class:`mop`},[o(`lo`),r(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),r(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),r(`span`,{class:`mord mathnormal`},`p`)])])]),o(` per position.`)],-1),n(g,null,{default:t(()=>[...m[0]||=[r(`ul`,null,[r(`li`,null,[o(`Untrained: `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mn`,null,`1.79`)]),r(`annotation`,{encoding:`application/x-tex`},`1.79`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`1.79`)])])]),o(` per word, `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mn`,null,`8.96`)]),r(`annotation`,{encoding:`application/x-tex`},`8.96`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`8.96`)])])]),o(` in total`)]),r(`li`,null,[o(`Press `),r(`em`,null,`Show a trained model`),o(`: `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mn`,null,`1.14`)]),r(`annotation`,{encoding:`application/x-tex`},`1.14`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`1.14`)])])]),o(` in total`)]),r(`li`,null,[o(`In training the decoder is fed the `),r(`strong`,null,`right`),o(` previous words, not its own guesses (teacher forcing)`)])],-1)]]),_:1})]),default:t(()=>[n(h,{mode:`untrained`,loss:!0,step:i(v)},null,8,[`step`])]),_:1},16)}}};export{m as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-D-DRW-H6.js b/transformer-v2/assets/md-D-DRW-H6.js new file mode 100644 index 0000000000000000000000000000000000000000..2752ad8977b067ad0dd2e2a2d8fe03ecd83bdc40 --- /dev/null +++ b/transformer-v2/assets/md-D-DRW-H6.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,bt as l,g as u,lt as d,m as f,v as p,vt as m,w as h,x as g,xt as _,y as v,yt as y,z as b}from"./modules/shiki-BFOesOFp.js";import{t as x}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as S,t as C}from"./slidev/context-ChHKJoK9.js";import{t as w}from"./slidev/VClicks-BDQlFH0_.js";import{n as T,r as E,t as D}from"./interactive-C1KYSeoO.js";import{i as O,t as k}from"./useAttention-B502Bcm9.js";import{t as A}from"./useConvolution-qO1u8ksh.js";var j={key:0,class:`dl-pe`},M={class:`dl-pe__cards`},N={class:`dl-pe__slot`},P={class:`dl-pe__word`},F={class:`dl-pe__vec`},I={class:`dl-pe__was`},L={class:`dl-pe dl-pe--heat`},R={class:`dl-pe__heatwrap`},z={class:`dl-pe__heat`},B=[`onMouseenter`],V={class:`dl-pe__pos`},H=[`title`],U=x(h({__name:`PositionalEncoding`,props:{mode:{default:`blind`},dModel:{default:16},positions:{default:12}},setup(e){let{$slidev:t,$nav:r,$clicksContext:a,$clicks:h,$page:y,$renderContext:x,$frontmatter:C}=S(),w=e,D=[[0,1,2],[2,0,1],[1,2,0],[2,1,0]],U=d(0),W=u(()=>D[U.value].map(e=>k.river[e])),G=u(()=>O(W.value)),K=u(()=>O(k.river));function q(e,t){let n=t.rows.find(t=>t.word===e);return n?n.out:[]}let J=u(()=>W.value.every(e=>{let t=q(e,G.value),n=q(e,K.value);return t.every((e,t)=>Math.abs(e-n[t])<1e-9)}));function Y(){U.value=(U.value+1)%D.length}let X=u(()=>Array.from({length:w.positions},(e,t)=>Array.from({length:w.dModel},(e,n)=>{let r=t/1e4**(2*Math.floor(n/2)/w.dModel);return n%2==0?Math.sin(r):Math.cos(r)}))),Z=d(null);return(e,t)=>{let r=T,a=E;return b(),p(a,{"max-width":`42rem`},{controls:n(()=>[w.mode===`blind`?(b(),p(r,{key:0,label:`Shuffle the words`,glyph:`⇄`,onClick:Y})):v(`v-if`,!0)]),readout:n(()=>[w.mode===`blind`?(b(),c(f,{key:0},[U.value===0?(b(),c(f,{key:0},[t[3]||=g(` The sentence in its written order. Press `,-1),t[4]||=o(`em`,null,`Shuffle`,-1),t[5]||=g(` and watch the vectors. `,-1)],64)):(b(),c(f,{key:1},[t[6]||=o(`strong`,null,`Every word's output vector is exactly what it was.`,-1),t[7]||=g(` Attention is a weighted sum over a `,-1),t[8]||=o(`em`,null,`set`,-1),t[9]||=g(`, and a sum has no order in it — so as far as this layer is concerned `,-1),t[10]||=o(`em`,null,`the river bank`,-1),t[11]||=g(` and `,-1),t[12]||=o(`em`,null,`bank river the`,-1),t[13]||=g(` are the same input. Yet in language, word order changes the meaning. `,-1),t[14]||=o(`span`,{class:`dl-pe__note`},` Permute the input and the outputs permute with it, unchanged. That property is called permutation equivariance, and here it is a bug. `,-1)],64))],64)):Z.value===null?(b(),c(f,{key:2},[g(` One row per position, `+_(w.dModel)+` columns wide. Left-hand dimensions oscillate once every few positions; right-hand ones barely move across the whole sentence — so the same vector carries “which word am I” and “which end of the sentence am I” at once. Nothing here is learned, and nothing caps the length: position 5000 has a vector too. `,1)],64)):(b(),c(f,{key:1},[t[15]||=g(` Position `,-1),o(`strong`,null,_(Z.value),1),g(` is the fixed vector [`+_(X.value[Z.value].slice(0,4).map(e=>s(A)(e)).join(`, `))+`, …] — `+_(w.dModel)+` numbers, computed from sines and cosines, `,1),t[16]||=o(`strong`,null,`not learned`,-1),t[17]||=g(`. It is `,-1),t[18]||=o(`em`,null,`added`,-1),t[19]||=g(` to the word's embedding, not concatenated, so the width of the model never changes. `,-1)],64))]),default:n(()=>[w.mode===`blind`?(b(),c(`div`,j,[o(`div`,M,[(b(!0),c(f,null,i(W.value,(e,n)=>(b(),c(`div`,{key:`${e}${n}`,class:`dl-pe__card`},[o(`div`,N,`position `+_(n+1),1),o(`div`,P,_(e),1),t[1]||=o(`div`,{class:`dl-pe__arrow`},`↓`,-1),o(`div`,F,[(b(!0),c(f,null,i(q(e,G.value),(e,t)=>(b(),c(`span`,{key:t,class:`dl-pe__cell`},_(s(A)(e)),1))),128))]),o(`div`,I,` in the original order: [`+_(q(e,K.value).map(e=>s(A)(e)).join(`, `))+`] `,1)]))),128))]),v(` Nothing to claim until something has actually been reordered. `),U.value>0?(b(),c(`div`,{key:0,class:m([`dl-pe__verdict`,{"is-same":J.value}])},_(J.value?`every vector identical`:`something changed`),3)):v(`v-if`,!0)])):(b(),c(f,{key:1},[v(` One fixed vector per position, added before the first block. `),o(`div`,L,[o(`div`,R,[t[2]||=o(`div`,{class:`dl-pe__heatlabel`},`dimension →`,-1),o(`div`,z,[(b(!0),c(f,null,i(X.value,(e,n)=>(b(),c(`div`,{key:n,class:m([`dl-pe__heatrow`,{"is-active":Z.value===n}]),onMouseenter:e=>Z.value=n,onMouseleave:t[0]||=e=>Z.value=null},[o(`span`,V,_(n),1),(b(!0),c(f,null,i(e,(e,t)=>(b(),c(`span`,{key:t,class:m([`dl-pe__heatcell`,e>=0?`is-pos`:`is-neg`]),style:l({opacity:.12+Math.abs(e)*.88}),title:`pos ${n}, dim ${t}: ${s(A)(e)}`},null,14,H))),128))],42,B))),128))])])])],2112))]),_:1})}}}),[[`__scopeId`,`data-v-5144d094`]]),W={class:`mt-2 dl-callout`},G={__name:`slides.md__slidev_51`,setup(i){let{$slidev:l,$nav:u,$clicksContext:d,$clicks:f,$page:m,$renderContext:h,$frontmatter:_}=S();return d.setup(),(i,l)=>{let u=U,d=w,f=a(`click`);return b(),p(D,y(t(s(C)(s(_),50))),{aside:n(t=>[l[2]||=o(`p`,null,`One row per position, one column per dimension.`,-1),r(d,null,{default:n(()=>[...l[0]||=[o(`ul`,null,[o(`li`,null,[g(`Left columns change `),o(`strong`,null,`fast`),g(` from row to row`)]),o(`li`,null,[g(`Right columns change `),o(`strong`,null,`slowly`)]),o(`li`,null,`Every row is different`)],-1)]]),_:1}),e((b(),c(`div`,W,[...l[1]||=[o(`p`,null,`It works for any position, even beyond the longest training sentence.`,-1)]])),[[f]])]),default:n(()=>[r(u,{mode:`sinusoid`,"d-model":16,positions:12})]),_:1},16)}}};export{G as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-D-b0YBoE.js b/transformer-v2/assets/md-D-b0YBoE.js new file mode 100644 index 0000000000000000000000000000000000000000..7c677fab4e8bb0db81470e6226dd3ef2b076fa25 --- /dev/null +++ b/transformer-v2/assets/md-D-b0YBoE.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./interactive-C1KYSeoO.js";import{t as h}from"./ItAttention-C9htn_5o.js";var g={class:`mt-3 dl-callout`},_={__name:`slides.md__slidev_16`,setup(_){let{$slidev:v,$nav:y,$clicksContext:b,$clicks:x,$page:S,$renderContext:C,$frontmatter:w}=f();return b.setup(),(f,_)=>{let v=h,y=i(`click`);return d(),c(m,u(t(o(p)(o(w),15))),{aside:n(t=>[_[1]||=a(`p`,null,[a(`em`,null,[l(`The animal didn’t cross the street because `),a(`strong`,null,`it`),l(` was too tired.`)])],-1),_[2]||=a(`p`,null,[l(`To understand `),a(`strong`,null,`it`),l(`, the model must find `),a(`strong`,null,`animal`),l(`.`)],-1),e((d(),s(`div`,g,[..._[0]||=[a(`p`,null,[a(`strong`,null,`Self-attention`),l(`: every word reads every word, and takes most from the ones that matter to it.`)],-1)]])),[[y]])]),default:n(()=>[r(v,{head:0,switchable:!1})]),_:1},16)}}};export{_ as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-D2UfMBGR.js b/transformer-v2/assets/md-D2UfMBGR.js new file mode 100644 index 0000000000000000000000000000000000000000..ef152e47f99ca6d0a440d2db3da5573ca19ace94 --- /dev/null +++ b/transformer-v2/assets/md-D2UfMBGR.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_10`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),9))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Inside one encoder, inside one decoder`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The left box is one encoder. Data enters at the bottom, passes through `),n(`strong`,null,`self-attention`),a(`, then through a `),n(`strong`,null,`feed-forward network`),a(`, and leaves at the top.`)]),n(`li`,null,[a(`The right box is one decoder. It has the same two parts, plus `),n(`strong`,null,`encoder–decoder attention`),a(` between them.`)]),n(`li`,null,`The green arrow shows where that middle part reads from: the output of the top encoder. The moving dots show data climbing each box.`),n(`li`,null,`Self-attention is the part where each word looks at the other words.`),n(`li`,null,`The feed-forward network is a small MLP (multilayer perceptron). It works on each word on its own.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-D2cNEyY32.js b/transformer-v2/assets/md-D2cNEyY32.js new file mode 100644 index 0000000000000000000000000000000000000000..f0c00356724ce2ce458207f478d2815dfc07cb05 --- /dev/null +++ b/transformer-v2/assets/md-D2cNEyY32.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_8`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),7))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Six encoders, six decoders`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`The left column is six encoders. The right column is six decoders.`),n(`li`,null,`All six encoders have the same design, but each has its own learned weights. The same is true of the decoders.`),n(`li`,null,`The input sentence enters the bottom encoder. Each encoder passes its result to the one above.`),n(`li`,null,[a(`The green wire on the right of the encoders carries the top encoder’s output to `),n(`strong`,null,`every`),a(` decoder. The green dots travel along it.`)]),n(`li`,null,`The paper uses six of each. That number is a design choice; other models use more or fewer.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-D8sbaEtQ.js b/transformer-v2/assets/md-D8sbaEtQ.js new file mode 100644 index 0000000000000000000000000000000000000000..a428eb71b3b0da2f54108da27c04f25bf6ccca4d --- /dev/null +++ b/transformer-v2/assets/md-D8sbaEtQ.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_14`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),13))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: A list of vectors flows up the stack`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`Each word of `),n(`em`,null,`je suis étudiant`),a(` becomes a vector at the bottom. The three vectors climb on three separate paths, shown by the moving dots.`)]),n(`li`,null,[a(`The wide box is `),n(`strong`,null,`self-attention`),a(`. The lines inside it join the paths: each word’s new vector depends on the other words.`)]),n(`li`,null,[a(`The three small boxes are copies of one `),n(`strong`,null,`feed-forward network`),a(`. Each word goes through it alone, so all three can be computed at the same time.`)]),n(`li`,null,`Only the bottom encoder looks words up in the embedding table. Higher encoders receive the list of vectors from the encoder below.`),n(`li`,null,`To remember: one vector per word, and only self-attention mixes them.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DAKQJiBX2.js b/transformer-v2/assets/md-DAKQJiBX2.js new file mode 100644 index 0000000000000000000000000000000000000000..e965917a098b3745635c400dc356ae2ab0db65b2 --- /dev/null +++ b/transformer-v2/assets/md-DAKQJiBX2.js @@ -0,0 +1,12 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_90`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),89))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The whole transformer, in one picture`,-1),n(`div`,{class:`dl-describe`},[n(`ol`,null,[n(`li`,null,[n(`strong`,null,`Two stacks.`),a(` Encoders read the input; decoders write the output, one word per step.`)]),n(`li`,null,[n(`strong`,null,`Self-attention.`),a(` Score, scale, softmax, sum: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`normal`},`softmax`),n(`mo`,null,`⁡`),n(`mo`,{stretchy:`false`},`(`),n(`mi`,null,`Q`),n(`msup`,null,[n(`mi`,null,`K`),n(`mi`,{mathvariant:`normal`},`⊤`)]),n(`mi`,{mathvariant:`normal`},`/`),n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])]),n(`mo`,{stretchy:`false`},`)`),n(`mtext`,null,` `),n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}(QK^\\top/\\sqrt{d_k})\\,V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.1072em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mord mathrm`},`softmax`)]),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord mathnormal`},`Q`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8491em`}},[n(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`⊤`)])])])])])])]),n(`span`,{class:`mord`},`/`),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])]),n(`span`,{class:`mclose`},`)`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Many heads.`),a(` Several attentions side by side, joined by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`O`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_O`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0278em`}},`O`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Position.`),a(` A fixed vector is added to each word, so order is known.`)]),n(`li`,null,[n(`strong`,null,`Add and norm.`),a(` A residual connection and layer normalisation around every sub-layer.`)]),n(`li`,null,[n(`strong`,null,`The decoder.`),a(` A mask hides future words; then it reads the encoder’s `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`K`)]),n(`annotation`,{encoding:`application/x-tex`},`K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`The loss.`),a(),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`mi`,null,`p`)]),n(`annotation`,{encoding:`application/x-tex`},`-\\log p`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`},`p`)])])]),a(` of the right word, added over the sentence.`)])])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DA_krWYn2.js b/transformer-v2/assets/md-DA_krWYn2.js new file mode 100644 index 0000000000000000000000000000000000000000..f12137a0eee7be138e4f33ae4f96ebc84e1e2b23 --- /dev/null +++ b/transformer-v2/assets/md-DA_krWYn2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_38`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),37))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Many heads: one question each`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The picture writes the sentence twice. The asking word, `),n(`em`,null,`it`),a(`, is on the right. Each line goes to a word on the left, as thick as its weight.`)]),n(`li`,null,`One head has one softmax, so it can spread only one budget of weight.`),n(`li`,null,[a(`The word `),n(`em`,null,`it`),a(` needs two answers. Head 1 (teal lines) asks who `),n(`em`,null,`it`),a(` is and puts 0.55 on `),n(`em`,null,`animal`),a(`. Head 2 (orange lines) asks what is said about it and puts 0.45 on `),n(`em`,null,`tired`),a(`.`)]),n(`li`,null,[a(`Each head has its own `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`Q`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`K`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`V`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(`, so each can learn a different question.`)]),n(`li`,null,`These weights were drawn by hand to show the idea.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DByKDP8J.js b/transformer-v2/assets/md-DByKDP8J.js new file mode 100644 index 0000000000000000000000000000000000000000..62834ebe7ba0cdb6192f18332fda96626183f665 --- /dev/null +++ b/transformer-v2/assets/md-DByKDP8J.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_55`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),54))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: A shortcut around every sub-layer`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The picture is one encoder layer, read left to right. The green path is the main road; the teal dashed paths are the shortcuts. Moving dots show the data travelling along both.`),n(`ol`,null,[n(`li`,null,[a(`The vector `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`x`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),n(`span`,{class:`mord mathbf`},`x`)])])]),a(` goes into self-attention.`)]),n(`li`,null,[a(`The dashed shortcut carries `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`x`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),n(`span`,{class:`mord mathbf`},`x`)])])]),a(` around it. The circle adds the two: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mo`,null,`+`),n(`mtext`,null,`Sublayer`),n(`mo`,{stretchy:`false`},`(`),n(`mi`,{mathvariant:`bold`},`x`),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x} + \\text{Sublayer}(\\mathbf{x})`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord text`},[n(`span`,{class:`mord`},`Sublayer`)]),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`mclose`},`)`)])])]),a(`.`)]),n(`li`,null,`The sum is normalised.`),n(`li`,null,`The same happens around the feed-forward network.`)]),n(`p`,null,`The sub-layer only has to learn a change to its input. In training, the gradient flows back along the shortcut. It passes no weight matrix on the way. "Add & norm" is what lets many layers be stacked and still train.`)],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DCToEkhh2.js b/transformer-v2/assets/md-DCToEkhh2.js new file mode 100644 index 0000000000000000000000000000000000000000..3597388170fbed415c35a777c2b2b4a0f614cece --- /dev/null +++ b/transformer-v2/assets/md-DCToEkhh2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_84`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),83))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Poll: the loss of a model that knows nothing`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The picture shows six equal bars. An untrained model gives each word probability `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`6`)]),n(`annotation`,{encoding:`application/x-tex`},`1/6`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`1/6`)])])]),a(`, and the right word, in accent, is no exception.`)]),n(`li`,null,[a(`The loss is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`msub`,null,[n(`mi`,null,`p`),n(`mi`,null,`y`)])]),n(`annotation`,{encoding:`application/x-tex`},`-\\log p_y`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`p`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1514em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(`. Here `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`p`),n(`mi`,null,`y`)]),n(`mo`,null,`=`),n(`mn`,null,`1`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`6`)]),n(`annotation`,{encoding:`application/x-tex`},`p_y = 1/6`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`p`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1514em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`1/6`)])])]),a(`, so the loss is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`mstyle`,{scriptlevel:`0`,displaystyle:`false`},[n(`mfrac`,null,[n(`mn`,null,`1`),n(`mn`,null,`6`)])]),n(`mo`,null,`=`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`mn`,null,`6`),n(`mo`,null,`=`),n(`mn`,null,`1.79`)]),n(`annotation`,{encoding:`application/x-tex`},`-\\log \\tfrac16 = \\log 6 = 1.79`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.1901em`,"vertical-align":`-0.345em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mopen nulldelimiter`}),n(`span`,{class:`mfrac`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8451em`}},[n(`span`,{style:{top:`-2.655em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`6`)])])]),n(`span`,{style:{top:`-3.23em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),n(`span`,{style:{top:`-3.394em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.345em`}},[n(`span`)])])])]),n(`span`,{class:`mclose nulldelimiter`})]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`6`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1.79`)])])]),a(`.`)]),n(`li`,null,`It is not 0: the model did predict, and badly.`),n(`li`,null,[a(`It is not 0.17: that is the probability, before the `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`)]),n(`annotation`,{encoding:`application/x-tex`},`-\\log`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)])])])]),a(`.`)]),n(`li`,null,[a(`With a vocabulary of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`N`),n(`mtext`,null,`vocab`)])]),n(`annotation`,{encoding:`application/x-tex`},`N_{\\text{vocab}}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`N`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.109em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord text mtight`},[n(`span`,{class:`mord mtight`},`vocab`)])])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` words, an untrained model starts near a loss of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`msub`,null,[n(`mi`,null,`N`),n(`mtext`,null,`vocab`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\log N_{\\text{vocab}}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`N`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.109em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord text mtight`},[n(`span`,{class:`mord mtight`},`vocab`)])])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(`. That is a quick check on a new training run.`)])])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DD7CU7HJ.js b/transformer-v2/assets/md-DD7CU7HJ.js new file mode 100644 index 0000000000000000000000000000000000000000..95306f787067f4e7e8af743cadb6341ec1643661 --- /dev/null +++ b/transformer-v2/assets/md-DD7CU7HJ.js @@ -0,0 +1,12 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";import{t as b}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var x={class:`grid grid-cols-[1fr_1.05fr] gap-8 mt-1 items-start`},S={viewBox:`0 0 320 210`,class:`dl-diagram`,role:`img`,"aria-label":`Scaled scores for three decoder positions. Every cell to the right of the diagonal is minus infinity. After softmax the rows are 1 0 0, 0.5 0.5 0, and 0.79 0.11 0.11`},C=[`x`],w=[`y`],T=[`x`,`y`],E=[`x`,`y`],D={class:`dl-tight`},O={class:`dl-math-sm`},k={class:`mt-2 dl-callout`},A={__name:`slides.md__slidev_69`,setup(A){let{$slidev:j,$nav:M,$clicksContext:N,$clicks:P,$page:F,$renderContext:I,$frontmatter:L}=g();return N.setup(),(g,A)=>{let j=y,M=b,N=a(`click`);return h(),u(v,m(t(s(_)(s(L),68))),{default:n(()=>[A[5]||=o(`h1`,null,`No looking ahead: the mask`,-1),o(`div`,x,[o(`div`,null,[(h(),c(`svg`,S,[A[1]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`14`},`scaled scores, one row per asking position`,-1),(h(),c(l,null,i([`⟨start⟩`,`i`,`am`],(e,t)=>o(`text`,{key:`h`+t,class:`dl-dg-small is-dec`,x:128+t*64,y:`36`,"text-anchor":`middle`},p(e),9,C)),64)),(h(),c(l,null,i([[`⟨start⟩`,[`3`,`−∞`,`−∞`]],[`i`,[`1`,`1`,`−∞`]],[`am`,[`2`,`0`,`0`]]],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small is-dec`,x:`88`,y:64+t*40,"text-anchor":`end`},p(e[0]),9,w),(h(!0),c(l,null,i(e[1],(e,n)=>(h(),c(`g`,{key:n},[o(`rect`,{class:d(n>t?`dl-dg-box is-bad dl-dg-pulse`:`dl-dg-box is-accent`),x:100+n*64,y:44+t*40,width:`56`,height:`32`,rx:`3`},null,10,T),o(`text`,{class:d(n>t?`dl-dg-small is-bad`:`dl-dg-lab is-sm`),x:128+n*64,y:65+t*40,"text-anchor":`middle`},p(e),11,E)]))),128))])),64)),e((h(),c(`g`,null,[...A[0]||=[o(`text`,{class:`dl-dg-small is-good`,x:`10`,y:`182`},`after softmax:`,-1),o(`text`,{class:`dl-dg-small is-good`,x:`10`,y:`198`},`1, 0, 0 · 0.5, 0.5, 0 · 0.79, 0.11, 0.11`,-1)]])),[[N]])]))]),o(`div`,D,[r(j,null,{default:n(()=>[...A[2]||=[o(`ul`,null,[o(`li`,null,[f(`In training, the decoder sees the `),o(`strong`,null,`whole`),f(` right answer at once`)]),o(`li`,null,[f(`Position `),o(`em`,null,`t`),f(` must not read the words after `),o(`em`,null,`t`),f(`: those are the answer`)]),o(`li`,null,[f(`So the future cells get `),o(`strong`,null,`−∞`),f(` before the softmax, and weight `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msup`,null,[o(`mi`,null,`e`),o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,{mathvariant:`normal`},`∞`)])]),o(`mo`,null,`=`),o(`mn`,null,`0`)]),o(`annotation`,{encoding:`application/x-tex`},`e^{-\\infty} = 0`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7713em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`e`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.7713em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`−`),o(`span`,{class:`mord mtight`},`∞`)])])])])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0`)])])])])],-1)]]),_:1}),e((h(),c(`div`,O,[r(M,{ranges:[]},{default:n(()=>[...A[3]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`normal`},`softmax`),o(`mo`,null,`⁡`),o(`mtext`,null,` ⁣`),o(`mrow`,null,[o(`mo`,{fence:`true`},`(`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`Q`),o(`msup`,null,[o(`mi`,null,`K`),o(`mi`,{mathvariant:`normal`},`⊤`)])]),o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])]),o(`mo`,null,`+`),o(`mi`,null,`M`),o(`mo`,{fence:`true`},`)`)]),o(`mi`,null,`V`)]),o(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}\\!\\left(\\frac{QK^\\top}{\\sqrt{d_k}} + M\\right) V `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`2.4761em`,"vertical-align":`-0.95em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mord mathrm`},`softmax`)]),o(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`minner`},[o(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`(`)]),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.5261em`}},[o(`span`,{style:{top:`-2.2528em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`Q`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8491em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.93em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`M`),o(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`)`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])])],-1)]]),_:1})])),[[N]])])]),e((h(),c(`div`,k,[...A[4]||=[o(`p`,null,`The mask blocks the future. Each word is predicted from the words before it only.`,-1)]])),[[N]])]),_:1},16)}}};export{A as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DE54QcLZ.js b/transformer-v2/assets/md-DE54QcLZ.js new file mode 100644 index 0000000000000000000000000000000000000000..14b3ba333f03887a920e8ee1fd85771e63e635d1 --- /dev/null +++ b/transformer-v2/assets/md-DE54QcLZ.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 640 250`,class:`dl-diagram`,role:`img`,"aria-label":`Three word vectors enter an encoder; in self-attention the three paths are joined by lines; in the feed-forward network each path has its own copy of the same network`},x=[`x`],S=[`x`],C=[`d`],w=[`d`],T=[`d`],E=[`x`],D=[`x`],O={class:`dl-callout`},k={__name:`slides.md__slidev_13`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=h();return M.setup(),(h,k)=>{let A=v,j=a(`click`);return m(),u(_,p(t(s(g)(s(I),12))),{default:n(()=>[k[8]||=o(`h1`,null,`A list of vectors flows up the stack`,-1),o(`div`,y,[(m(),c(`svg`,b,[k[4]||=o(`defs`,null,[o(`marker`,{id:`tv2s0-flow`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(m(),c(l,null,i([`je`,`suis`,`étudiant`],(e,t)=>o(`g`,{key:e},[o(`text`,{class:`dl-dg-small`,x:150+t*170,y:`244`,"text-anchor":`middle`},f(e),9,x),(m(),c(l,null,i(4,e=>o(`rect`,{key:e,class:`dl-dg-box is-accent`,x:114+t*170+(e-1)*18,y:`208`,width:`16`,height:`16`,rx:`2`},null,8,S)),64)),o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-flow)`,d:`M${150+t*170} 206 V176`},null,8,C),o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-flow)`,d:`M${150+t*170} 128 V96`},null,8,w),o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-flow)`,d:`M${150+t*170} 52 V18`},null,8,T),r(A,{path:`M${150+t*170} 206 V178`,role:`enc`,dur:.9,delay:t*.3},null,8,[`path`,`delay`]),r(A,{path:`M${150+t*170} 128 V98`,role:`enc`,dur:.9,delay:.3+t*.3},null,8,[`path`,`delay`]),r(A,{path:`M${150+t*170} 52 V20`,role:`enc`,dur:.9,delay:.6+t*.3},null,8,[`path`,`delay`])])),64)),k[5]||=o(`rect`,{class:`dl-dg-box`,x:`90`,y:`130`,width:`460`,height:`44`,rx:`6`},null,-1),k[6]||=o(`text`,{class:`dl-dg-small`,x:`566`,y:`156`},`self-attention`,-1),e((m(),c(`g`,null,[k[0]||=o(`path`,{class:`dl-dg-line dl-dg-flow is-slow`,d:`M150 152 L320 152 L490 152`},null,-1),k[1]||=o(`path`,{class:`dl-dg-line dl-dg-flow is-slow`,d:`M150 152 C 220 136, 420 136, 490 152`},null,-1),r(A,{path:`M150 152 L320 152 L490 152 L320 152 Z`,dur:3,r:4}),r(A,{path:`M490 152 C 420 136, 220 136, 150 152 C 220 136, 420 136, 490 152`,dur:3.4,r:4}),k[2]||=o(`text`,{class:`dl-dg-small is-good`,x:`320`,y:`169`,"text-anchor":`middle`},`paths depend on each other`,-1)])),[[j]]),(m(),c(l,null,i(3,e=>o(`g`,{key:`f${e}`},[o(`rect`,{class:`dl-dg-box`,x:100+(e-1)*170,y:`54`,width:`100`,height:`40`,rx:`5`},null,8,E),o(`text`,{class:`dl-dg-small`,x:150+(e-1)*170,y:`78`,"text-anchor":`middle`},`feed-forward`,8,D)])),64)),e((m(),c(`g`,null,[...k[3]||=[o(`text`,{class:`dl-dg-small is-good`,x:`320`,y:`112`,"text-anchor":`middle`},`same network, each word alone — run all three at once`,-1)]])),[[j]])]))]),e((m(),c(`div`,O,[...k[7]||=[o(`p`,null,[d(`Each word keeps its `),o(`strong`,null,`own path`),d(` through the encoder. Only self-attention connects the paths.`)],-1)]])),[[j]])]),_:1},16)}}};export{k as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DEIfGkvE.js b/transformer-v2/assets/md-DEIfGkvE.js new file mode 100644 index 0000000000000000000000000000000000000000..69b77c3a7cc57d014d405aaa0491139aa2f2d246 --- /dev/null +++ b/transformer-v2/assets/md-DEIfGkvE.js @@ -0,0 +1,34 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";import{t as b}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var x={class:`grid grid-cols-[1.6fr_1fr] gap-5 items-start`},S={class:`dl-math-xs`},C={class:`dl-ledger dl-tight dl-eq-legend`},w={viewBox:`0 0 260 120`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking's row, i = 1: scaled scores 2.83 and 0.71, exponentials 16.95 and 2.03, weights 0.89 and 0.11`},T=[`y`],E=[`y`],D=[`y`],O=[`y`],k=[`y`],A={class:`dl-callout`},j={__name:`slides.md__slidev_23`,setup(j){let{$slidev:M,$nav:N,$clicksContext:P,$clicks:F,$page:I,$renderContext:L,$frontmatter:R}=g();return P.setup(),(g,j)=>{let M=b,N=y,P=a(`click`);return h(),u(v,m(t(s(_)(s(R),22))),{default:n(()=>[j[6]||=o(`h1`,null,`Reading the equation: one attention weight`,-1),o(`div`,x,[o(`div`,null,[o(`div`,S,[r(M,{ranges:[]},{default:n(()=>[...j[0]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`α`),o(`mrow`,null,[o(`mi`,null,`i`),o(`mi`,null,`j`)])]),o(`mo`,null,`=`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`exp`),o(`mo`,null,`⁡`),o(`mo`,{stretchy:`false`},`(`),o(`msub`,null,[o(`mi`,null,`s`),o(`mrow`,null,[o(`mi`,null,`i`),o(`mi`,null,`j`)])]),o(`mo`,{stretchy:`false`},`)`)]),o(`mrow`,null,[o(`munderover`,null,[o(`mo`,null,`∑`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mo`,null,`=`),o(`mn`,null,`1`)]),o(`mi`,null,`T`)]),o(`mi`,null,`exp`),o(`mo`,null,`⁡`),o(`mo`,{stretchy:`false`},`(`),o(`msub`,null,[o(`mi`,null,`s`),o(`mrow`,null,[o(`mi`,null,`i`),o(`mi`,null,`m`)])]),o(`mo`,{stretchy:`false`},`)`)])]),o(`mo`,{separator:`true`},`,`),o(`mspace`,{width:`2em`}),o(`msub`,null,[o(`mi`,null,`s`),o(`mrow`,null,[o(`mi`,null,`i`),o(`mi`,null,`j`)])]),o(`mo`,null,`=`),o(`mfrac`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`q`),o(`mi`,null,`i`)]),o(`mo`,null,`⋅`),o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`k`),o(`mi`,null,`j`)])]),o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])])]),o(`annotation`,{encoding:`application/x-tex`},`\\alpha_{ij} = \\frac{\\exp(s_{ij})}{\\sum_{m=1}^{T} \\exp(s_{im})}, \\qquad s_{ij} = \\frac{\\mathbf{q}_i \\cdot \\mathbf{k}_j}{\\sqrt{d_k}} `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0037em`}},`α`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0037em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`ij`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`2.5979em`,"vertical-align":`-1.1709em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.427em`}},[o(`span`,{style:{top:`-2.1288em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mop`},[o(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`∑`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.9812em`}},[o(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mrel mtight`},`=`),o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{style:{top:`-3.2029em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`T`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2997em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mop`},`exp`),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`s`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`im`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mclose`},`)`)])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mop`},`exp`),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`s`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`ij`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])]),o(`span`,{class:`mclose`},`)`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.1709em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`2em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`s`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`ij`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`2.3014em`,"vertical-align":`-0.93em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.3714em`}},[o(`span`,{style:{top:`-2.2528em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`q`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`i`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`⋅`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`k`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`j`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.93em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})])])])])])],-1)]]),_:1})]),o(`div`,C,[r(N,null,{default:n(()=>[...j[1]||=[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,null,`symbol`),o(`th`,null,`name`),o(`th`,null,`what it is here`),o(`th`,null,`example`)])]),o(`tbody`,null,[o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`j`)]),o(`annotation`,{encoding:`application/x-tex`},`j`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`)])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`T`)]),o(`annotation`,{encoding:`application/x-tex`},`T`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),o(`td`,null,`word indices, length`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])]),f(` asks, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`j`)]),o(`annotation`,{encoding:`application/x-tex`},`j`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`)])])]),f(` is read, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`T`)]),o(`annotation`,{encoding:`application/x-tex`},`T`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])]),f(` words`)]),o(`td`,null,`1, 2, 2`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`q`),o(`mi`,null,`i`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{q}_i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`q`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`i`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`k`),o(`mi`,null,`j`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{k}_j`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`k`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`j`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`query, key`),o(`td`,null,[f(`learned, length `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])]),o(`annotation`,{encoding:`application/x-tex`},`d_k`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, 1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, 0]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])]),o(`annotation`,{encoding:`application/x-tex`},`d_k`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`key length`),o(`td`,null,`set by hand`),o(`td`,null,`2 (paper 64)`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`s`),o(`mrow`,null,[o(`mi`,null,`i`),o(`mi`,null,`j`)])])]),o(`annotation`,{encoding:`application/x-tex`},`s_{ij}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`s`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`ij`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`scaled score`),o(`td`,null,[f(`dot product `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`÷`),o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])]),o(`annotation`,{encoding:`application/x-tex`},`\\div \\sqrt{d_k}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),o(`span`,{class:`mord`},`÷`),o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])])])]),o(`td`,null,`0.71`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`exp`),o(`mo`,null,`⁡`)]),o(`annotation`,{encoding:`application/x-tex`},`\\exp`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mop`},`exp`)])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mo`,null,`∑`),o(`mi`,null,`m`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\sum_m`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.0497em`,"vertical-align":`-0.2997em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`∑`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.0017em`}},[o(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2997em`}},[o(`span`)])])])])])])])])]),o(`td`,null,[f(`exp, sum over `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`m`)]),o(`annotation`,{encoding:`application/x-tex`},`m`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mord mathnormal`},`m`)])])])]),o(`td`,null,`the softmax`),o(`td`)]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`α`),o(`mrow`,null,[o(`mi`,null,`i`),o(`mi`,null,`j`)])])]),o(`annotation`,{encoding:`application/x-tex`},`\\alpha_{ij}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0037em`}},`α`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3117em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0037em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0572em`}},`ij`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`attention weight`),o(`td`,null,[f(`share of `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`j`)]),o(`annotation`,{encoding:`application/x-tex`},`j`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`)])])]),f(` in `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])]),f(`’s output`)]),o(`td`,null,`0.11`)])])],-1)]]),_:1})])]),o(`div`,null,[j[5]||=o(`p`,null,[f(`How much word `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`i`)]),o(`annotation`,{encoding:`application/x-tex`},`i`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),o(`span`,{class:`mord mathnormal`},`i`)])])]),f(` takes from word `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`j`)]),o(`annotation`,{encoding:`application/x-tex`},`j`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.854em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0572em`}},`j`)])])]),f(`.`)],-1),(h(),c(`svg`,w,[j[2]||=o(`text`,{class:`dl-dg-small`,x:`110`,y:`14`,"text-anchor":`middle`},`j = 1`,-1),j[3]||=o(`text`,{class:`dl-dg-small`,x:`200`,y:`14`,"text-anchor":`middle`},`j = 2`,-1),(h(),c(l,null,i([[`s`,`2.83`,`0.71`],[`exp(s)`,`16.95`,`2.03`],[`α`,`0.89`,`0.11`]],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:`50`,y:42+t*34,"text-anchor":`end`},p(e[0]),9,T),o(`rect`,{class:d(t===2?`dl-dg-box is-accent`:`dl-dg-box`),x:`70`,y:24+t*34,width:`80`,height:`28`,rx:`3`},null,10,E),o(`rect`,{class:d(t===2?`dl-dg-box is-accent`:`dl-dg-box`),x:`160`,y:24+t*34,width:`80`,height:`28`,rx:`3`},null,10,D),o(`text`,{class:`dl-dg-lab is-sm`,x:`110`,y:43+t*34,"text-anchor":`middle`},p(e[1]),9,O),o(`text`,{class:`dl-dg-lab is-sm`,x:`200`,y:43+t*34,"text-anchor":`middle`},p(e[2]),9,k)])),64))])),e((h(),c(`div`,A,[...j[4]||=[o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`s`),o(`mn`,null,`12`)]),o(`mo`,null,`=`),o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`1`),o(`mo`,null,`⋅`),o(`mn`,null,`1`),o(`mo`,null,`+`),o(`mn`,null,`1`),o(`mo`,null,`⋅`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`)`),o(`mi`,{mathvariant:`normal`},`/`),o(`msqrt`,null,[o(`mn`,null,`2`)]),o(`mo`,null,`=`),o(`mn`,null,`0.71`)]),o(`annotation`,{encoding:`application/x-tex`},`s_{12} = (1 \\cdot 1 + 1 \\cdot 0) / \\sqrt{2} = 0.71`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`s`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`12`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`⋅`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`⋅`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.1572em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mord`},`/`),o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.9072em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},`2`)])]),o(`span`,{style:{top:`-2.8672em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1328em`}},[o(`span`)])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.71`)])])])],-1),o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`α`),o(`mn`,null,`12`)]),o(`mo`,null,`=`),o(`mn`,null,`2.03`),o(`mi`,{mathvariant:`normal`},`/`),o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`16.95`),o(`mo`,null,`+`),o(`mn`,null,`2.03`),o(`mo`,{stretchy:`false`},`)`),o(`mo`,null,`=`),o(`mn`,null,`0.11`)]),o(`annotation`,{encoding:`application/x-tex`},`\\alpha_{12} = 2.03 / (16.95 + 2.03) = 0.11`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0037em`}},`α`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0037em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`12`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`2.03/`),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`16.95`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`2.03`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.11`)])])])],-1)]])),[[P]])])])]),_:1},16)}}};export{j as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DFAWAndK2.js b/transformer-v2/assets/md-DFAWAndK2.js new file mode 100644 index 0000000000000000000000000000000000000000..b95f5d2b6e5317236b9c68a772bbf7cc4dc3c11c --- /dev/null +++ b/transformer-v2/assets/md-DFAWAndK2.js @@ -0,0 +1,12 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./Citation-DTpwAx0S.js";import{t as h}from"./TransformerGlyph-XWvPPlsx.js";import{t as g}from"./default-DTdNOfwb.js";var _={class:`grid grid-cols-4 gap-x-4 gap-y-2 mt-2`},v={class:`flex flex-col items-center text-center gap-1`},y={class:`flex flex-col items-center text-center gap-1`},b={class:`flex flex-col items-center text-center gap-1`},x={class:`flex flex-col items-center text-center gap-1`},S={class:`flex flex-col items-center text-center gap-1`},C={class:`flex flex-col items-center text-center gap-1`},w={class:`flex flex-col items-center text-center gap-1`},T={class:`mt-3 dl-callout`},E={class:`mt-2 dl-secondary`},D={__name:`slides.md__slidev_89`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=f();return A.setup(),(f,D)=>{let O=h,k=m,A=i(`click`);return d(),c(g,u(t(o(p)(o(P),88))),{default:n(()=>[D[10]||=a(`h1`,null,`The whole transformer, in one picture`,-1),a(`div`,_,[a(`div`,v,[r(O,{kind:`encdec`,size:70}),D[0]||=a(`span`,{class:`dl-secondary`},`Encoders read, decoders write`,-1)]),a(`div`,y,[r(O,{kind:`qkv`,size:70}),D[1]||=a(`span`,{class:`dl-secondary`},`Score, scale, softmax, sum`,-1)]),a(`div`,b,[r(O,{kind:`heads`,size:70}),D[2]||=a(`span`,{class:`dl-secondary`},`Many heads, joined by $W_O$`,-1)]),a(`div`,x,[r(O,{kind:`position`,size:70}),D[3]||=a(`span`,{class:`dl-secondary`},`Position added to each word`,-1)]),a(`div`,S,[r(O,{kind:`block`,size:70}),D[4]||=a(`span`,{class:`dl-secondary`},`Add and norm around each sub-layer`,-1)]),a(`div`,C,[r(O,{kind:`decoder`,size:70}),D[5]||=a(`span`,{class:`dl-secondary`},`Mask, then read the encoder`,-1)]),a(`div`,w,[r(O,{kind:`train`,size:70}),D[6]||=a(`span`,{class:`dl-secondary`},`Loss: −log p of the right word`,-1)]),D[7]||=a(`div`,{class:`flex flex-col items-center justify-center text-center gap-1 dl-secondary`},[a(`p`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`normal`},`softmax`),a(`mo`,null,`⁡`),a(`mtext`,null,` ⁣`),a(`mrow`,null,[a(`mo`,{fence:`true`},`(`),a(`mfrac`,null,[a(`mrow`,null,[a(`mi`,null,`Q`),a(`msup`,null,[a(`mi`,null,`K`),a(`mi`,{mathvariant:`normal`},`⊤`)])]),a(`msqrt`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])])]),a(`mo`,{fence:`true`},`)`)]),a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}\\!\\left(\\frac{QK^\\top}{\\sqrt{d_k}}\\right)V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.8em`,"vertical-align":`-0.65em`}}),a(`span`,{class:`mop`},[a(`span`,{class:`mord mathrm`},`softmax`)]),a(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`minner`},[a(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[a(`span`,{class:`delimsizing size2`},`(`)]),a(`span`,{class:`mord`},[a(`span`,{class:`mopen nulldelimiter`}),a(`span`,{class:`mfrac`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`1.095em`}},[a(`span`,{style:{top:`-2.5864em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord sqrt mtight`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8622em`}},[a(`span`,{class:`svg-align`,style:{top:`-3em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`mord mtight`,style:{"padding-left":`0.833em`}},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3448em`}},[a(`span`,{style:{top:`-2.3488em`,"margin-left":`0em`,"margin-right":`0.0714em`}},[a(`span`,{class:`pstrut`,style:{height:`2.5em`}}),a(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1512em`}},[a(`span`)])])])])])])]),a(`span`,{style:{top:`-2.8222em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`hide-tail mtight`,style:{"min-width":`0.853em`,height:`1.08em`}},[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[a(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1778em`}},[a(`span`)])])])])])])]),a(`span`,{style:{top:`-3.23em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),a(`span`,{style:{top:`-3.4461em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`},`Q`),a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.927em`}},[a(`span`,{style:{top:`-2.931em`,"margin-right":`0.0714em`}},[a(`span`,{class:`pstrut`,style:{height:`2.5em`}}),a(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[a(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.538em`}},[a(`span`)])])])]),a(`span`,{class:`mclose nulldelimiter`})]),a(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[a(`span`,{class:`delimsizing size2`},`)`)])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])])],-1)]),e((d(),s(`div`,T,[...D[8]||=[a(`p`,null,`Every word reads every other word, in one weighted sum. The rest makes that stackable and trainable.`,-1)]])),[[A]]),a(`div`,E,[r(k,{source:`Alammar, J. (2018). The Illustrated Transformer`,url:`https://jalammar.github.io/illustrated-transformer/`}),D[9]||=l(` · `,-1),r(k,{source:`Vaswani et al. (2017). Attention Is All You Need`,url:`https://arxiv.org/abs/1706.03762`})])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DHzdLo_f2.js b/transformer-v2/assets/md-DHzdLo_f2.js new file mode 100644 index 0000000000000000000000000000000000000000..6ea46f0f3751cebfbef49f002938e4e2f8a132ea --- /dev/null +++ b/transformer-v2/assets/md-DHzdLo_f2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./PollSlide-uaNGIrh8.js";var y={class:`grid grid-cols-[1.7fr_1fr] gap-6 items-start`},b={class:`mt-10`},x={viewBox:`0 0 240 150`,class:`dl-diagram`,role:`img`,"aria-label":`Six equal probability bars, one ringed as the right word`},S=[`x`],C=[`x`],w={class:`mt-4 dl-reveal`},T={class:`mt-2 dl-secondary`},E={__name:`slides.md__slidev_83`,setup(E){let{$slidev:D,$nav:O,$clicksContext:k,$clicks:A,$page:j,$renderContext:M,$frontmatter:N}=h();return k.setup(),(h,E)=>{let D=v,O=a(`click`);return m(),u(_,p(t(s(g)(s(N),82))),{default:n(()=>[o(`div`,y,[o(`div`,null,[r(D,{question:`An untrained model gives all six words the same probability. What is the loss on one word?`,items:[`0, because it has not made a mistake yet`,`1/6 ≈ 0.17`,`log 6 ≈ 1.79`,`6`]})]),o(`div`,b,[(m(),c(`svg`,x,[E[0]||=o(`line`,{class:`dl-dg-split`,x1:`10`,y1:`110`,x2:`230`,y2:`110`},null,-1),(m(),c(l,null,i(6,e=>o(`g`,{key:e},[o(`rect`,{class:d(e===4?`dl-dg-bar is-q`:`dl-dg-bar`),x:e*34-18,y:`80`,width:`26`,height:`30`,rx:`2`},null,10,S),o(`text`,{class:`dl-dg-small`,x:e*34-5,y:`74`,"text-anchor":`middle`},`1/6`,8,C)])),64)),E[1]||=o(`text`,{class:`dl-dg-small is-good`,x:`115`,y:`130`,"text-anchor":`middle`},`the right word gets 1/6 too`,-1)]))])]),e((m(),c(`div`,w,[...E[2]||=[o(`p`,null,`log 6 ≈ 1.79`,-1)]])),[[O]]),e((m(),c(`div`,T,[...E[3]||=[o(`p`,null,[f(`The loss is `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,null,`log`),o(`mo`,null,`⁡`),o(`msub`,null,[o(`mi`,null,`p`),o(`mi`,null,`y`)])]),o(`annotation`,{encoding:`application/x-tex`},`-\\log p_y`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mop`},[f(`lo`),o(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1514em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])]),f(` with `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`p`),o(`mi`,null,`y`)]),o(`mo`,null,`=`),o(`mn`,null,`1`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`6`)]),o(`annotation`,{encoding:`application/x-tex`},`p_y = 1/6`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`p`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1514em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`1/6`)])])]),f(`, and `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,null,`log`),o(`mo`,null,`⁡`),o(`mstyle`,{scriptlevel:`0`,displaystyle:`false`},[o(`mfrac`,null,[o(`mn`,null,`1`),o(`mn`,null,`6`)])]),o(`mo`,null,`=`),o(`mi`,null,`log`),o(`mo`,null,`⁡`),o(`mn`,null,`6`)]),o(`annotation`,{encoding:`application/x-tex`},`-\\log \\tfrac16 = \\log 6`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.1901em`,"vertical-align":`-0.345em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mop`},[f(`lo`),o(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8451em`}},[o(`span`,{style:{top:`-2.655em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`6`)])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.394em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`1`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.345em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mop`},[f(`lo`),o(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`6`)])])]),f(`.`)],-1)]])),[[O]])]),_:1},16)}}};export{E as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DJ9N9dkz.js b/transformer-v2/assets/md-DJ9N9dkz.js new file mode 100644 index 0000000000000000000000000000000000000000..8220c6b7b482e4fae8e9c679869ba649aa1c8ed0 --- /dev/null +++ b/transformer-v2/assets/md-DJ9N9dkz.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./FlowDot-CpcqfMjQ.js";var g={class:`mt-1 flex justify-center`},_={viewBox:`0 0 640 250`,class:`dl-diagram`,role:`img`,"aria-label":`An encoder holds self-attention under a feed-forward network; a decoder holds self-attention, then encoder-decoder attention, then a feed-forward network`},v={class:`mt-1 dl-callout`},y={__name:`slides.md__slidev_9`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=h,x=i(`click`);return d(),c(m,u(t(o(p)(o(E),8))),{default:n(()=>[y[25]||=a(`h1`,null,`Inside one encoder, inside one decoder`,-1),a(`div`,g,[(d(),s(`svg`,_,[y[14]||=a(`defs`,null,[a(`marker`,{id:`tv2s0-inside`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s0-inside-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[15]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`40`,y:`20`,width:`230`,height:`200`,rx:`8`},null,-1),y[16]||=a(`text`,{class:`dl-dg-small is-enc`,x:`155`,y:`40`,"text-anchor":`middle`},`ENCODER`,-1),y[17]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`65`,y:`60`,width:`180`,height:`44`,rx:`5`},null,-1),y[18]||=a(`text`,{class:`dl-dg-in`,x:`155`,y:`87`,"text-anchor":`middle`},`Feed-forward`,-1),y[19]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`65`,y:`150`,width:`180`,height:`44`,rx:`5`},null,-1),y[20]||=a(`text`,{class:`dl-dg-in`,x:`155`,y:`177`,"text-anchor":`middle`},`Self-attention`,-1),y[21]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M155 150 V106`},null,-1),y[22]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M155 244 V196`},null,-1),y[23]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M155 60 V4`},null,-1),r(b,{path:`M155 244 V198`,role:`enc`,dur:1}),r(b,{path:`M155 150 V108`,role:`enc`,dur:1,delay:.33}),r(b,{path:`M155 60 V6`,role:`enc`,dur:1,delay:.66}),e((d(),s(`g`,null,[y[0]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`370`,y:`10`,width:`230`,height:`226`,rx:`8`},null,-1),y[1]||=a(`text`,{class:`dl-dg-small is-dec`,x:`485`,y:`28`,"text-anchor":`middle`},`DECODER`,-1),y[2]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`395`,y:`40`,width:`180`,height:`40`,rx:`5`},null,-1),y[3]||=a(`text`,{class:`dl-dg-in`,x:`485`,y:`65`,"text-anchor":`middle`},`Feed-forward`,-1),y[4]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`395`,y:`106`,width:`180`,height:`40`,rx:`5`},null,-1),y[5]||=a(`text`,{class:`dl-dg-in`,x:`485`,y:`131`,"text-anchor":`middle`},`Encoder–decoder attention`,-1),y[6]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`395`,y:`172`,width:`180`,height:`40`,rx:`5`},null,-1),y[7]||=a(`text`,{class:`dl-dg-in`,x:`485`,y:`197`,"text-anchor":`middle`},`Self-attention`,-1),y[8]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-inside-dec)`,d:`M485 172 V148`},null,-1),y[9]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-inside-dec)`,d:`M485 106 V82`},null,-1),y[10]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-inside-dec)`,d:`M485 244 V214`},null,-1),r(b,{path:`M485 244 V216`,role:`dec`,dur:1}),r(b,{path:`M485 172 V150`,role:`dec`,dur:1,delay:.33}),r(b,{path:`M485 106 V84`,role:`dec`,dur:1,delay:.66}),y[11]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M272 126 H392`},null,-1),r(b,{path:`M272 126 H390`,role:`enc`,dur:1.4}),y[12]||=a(`text`,{class:`dl-dg-small is-enc`,x:`320`,y:`114`,"text-anchor":`middle`},`from the`,-1),y[13]||=a(`text`,{class:`dl-dg-small is-enc`,x:`320`,y:`144`,"text-anchor":`middle`},`top encoder`,-1)])),[[x]])]))]),e((d(),s(`div`,v,[...y[24]||=[a(`p`,null,[l(`Self-attention lets each word `),a(`strong`,null,`look at the other words`),l(`. The feed-forward network then works on `),a(`strong`,null,`each word alone`),l(`.`)],-1)]])),[[x]])]),_:1},16)}}};export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DOh70PNW.js b/transformer-v2/assets/md-DOh70PNW.js new file mode 100644 index 0000000000000000000000000000000000000000..3f8e127ea4e5098936b8ebd6d66290abff6e1fc7 --- /dev/null +++ b/transformer-v2/assets/md-DOh70PNW.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_61`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),60))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The feed-forward network, one word at a time`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`The feed-forward network is a small MLP. It widens each word’s vector, applies ReLU, then narrows it back: 512 → 2048 → 512 in the paper.`),n(`li`,null,[a(`The picture shows `),n(`em`,null,`Thinking`),a(` and `),n(`em`,null,`Machines`),a(` going through copies of `),n(`strong`,null,`one`),a(` network with the same weights. Each moving dot stays in its own column.`)]),n(`li`,null,`No word sees another here, so all words run at once.`),n(`li`,null,[a(`Toy example, with `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mrow`,null,[n(`mi`,null,`m`),n(`mi`,null,`o`),n(`mi`,null,`d`),n(`mi`,null,`e`),n(`mi`,null,`l`)])]),n(`mo`,null,`=`),n(`mn`,null,`2`)]),n(`annotation`,{encoding:`application/x-tex`},`d_{model} = 2`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`},`m`),n(`span`,{class:`mord mathnormal mtight`},`o`),n(`span`,{class:`mord mathnormal mtight`},`d`),n(`span`,{class:`mord mathnormal mtight`},`e`),n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`2`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mrow`,null,[n(`mi`,null,`f`),n(`mi`,null,`f`)])]),n(`mo`,null,`=`),n(`mn`,null,`3`)]),n(`annotation`,{encoding:`application/x-tex`},`d_{ff} = 3`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`),n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`3`)])])]),a(`: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x} = [1, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(` gives `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`msub`,null,[n(`mi`,null,`W`),n(`mn`,null,`1`)]),n(`mo`,null,`+`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`b`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}W_1 + \\mathbf{b}_1 = [1, 1, -1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`b`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,[a(`ReLU turns that into `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1, 1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`. Then `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`×`),n(`msub`,null,[n(`mi`,null,`W`),n(`mn`,null,`2`)]),n(`mo`,null,`+`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`b`),n(`mn`,null,`2`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\times W_2 + \\mathbf{b}_2`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},`×`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`b`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` gives `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2.5`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[2.5, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2.5`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)])])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DPlC9Trn.js b/transformer-v2/assets/md-DPlC9Trn.js new file mode 100644 index 0000000000000000000000000000000000000000..03d0f1247b60a010677def22d47efb56748e453e --- /dev/null +++ b/transformer-v2/assets/md-DPlC9Trn.js @@ -0,0 +1,12 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_71`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),70))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: No looking ahead: the mask`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`In training, the decoder gets the whole correct sentence at once. Without a rule, each position could copy the next word.`),n(`li`,null,[a(`The mask `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`M`)]),n(`annotation`,{encoding:`application/x-tex`},`M`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`M`)])])]),a(` adds `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,{mathvariant:`normal`},`∞`)]),n(`annotation`,{encoding:`application/x-tex`},`-\\infty`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`∞`)])])]),a(` to every score to the right of the diagonal, the pulsing red cells. Their softmax weight becomes `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msup`,null,[n(`mi`,null,`e`),n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,{mathvariant:`normal`},`∞`)])]),n(`mo`,null,`=`),n(`mn`,null,`0`)]),n(`annotation`,{encoding:`application/x-tex`},`e^{-\\infty} = 0`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7713em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`e`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.7713em`}},[n(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`−`),n(`span`,{class:`mord mtight`},`∞`)])])])])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0`)])])]),a(`. The teal cells are the ones a position may read.`)]),n(`li`,null,[a(`So the full line is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`normal`},`softmax`),n(`mo`,null,`⁡`),n(`mo`,{stretchy:`false`},`(`),n(`mi`,null,`Q`),n(`msup`,null,[n(`mi`,null,`K`),n(`mi`,{mathvariant:`normal`},`⊤`)]),n(`mi`,{mathvariant:`normal`},`/`),n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])]),n(`mo`,null,`+`),n(`mi`,null,`M`),n(`mo`,{stretchy:`false`},`)`),n(`mtext`,null,` `),n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}(QK^\\top / \\sqrt{d_k} + M)\\,V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.1072em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mord mathrm`},`softmax`)]),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord mathnormal`},`Q`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8491em`}},[n(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`⊤`)])])])])])])]),n(`span`,{class:`mord`},`/`),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`M`),n(`span`,{class:`mclose`},`)`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(`.`)]),n(`li`,null,[a(`Row 1 (scores `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`3`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mi`,{mathvariant:`normal`},`∞`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mi`,{mathvariant:`normal`},`∞`)]),n(`annotation`,{encoding:`application/x-tex`},`3, -\\infty, -\\infty`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`3`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`∞`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`∞`)])])]),a(`) becomes `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`)]),n(`annotation`,{encoding:`application/x-tex`},`1, 0, 0`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`)])])]),a(`. Row 2 (`),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mi`,{mathvariant:`normal`},`∞`)]),n(`annotation`,{encoding:`application/x-tex`},`1, 1, -\\infty`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`∞`)])])]),a(`) becomes `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`0.5`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.5`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`)]),n(`annotation`,{encoding:`application/x-tex`},`0.5, 0.5, 0`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`0.5`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.5`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`)])])]),a(`.`)]),n(`li`,null,`So the model learns to predict a word from earlier words alone.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DUErez2C2.js b/transformer-v2/assets/md-DUErez2C2.js new file mode 100644 index 0000000000000000000000000000000000000000..16d2c22f2ff9c96d2ed9dfc084bcf2a510b788da --- /dev/null +++ b/transformer-v2/assets/md-DUErez2C2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./FlowDot-CpcqfMjQ.js";var b={class:`mt-1 flex justify-center`},x={viewBox:`0 0 660 230`,class:`dl-diagram`,role:`img`,"aria-label":`X goes into eight heads, each giving a T by 64 output. The eight outputs are put side by side into one T by 512 matrix, then multiplied by W_O, 512 by 512, to give Z, T by 512`},S=[`d`],C=[`y`],w=[`y`],T=[`d`],E=[`x`],D={class:`mt-1 dl-callout`},O={__name:`slides.md__slidev_39`,setup(O){let{$slidev:k,$nav:A,$clicksContext:j,$clicks:M,$page:N,$renderContext:P,$frontmatter:F}=g();return j.setup(),(g,O)=>{let k=y,A=a(`click`);return h(),u(v,m(t(s(_)(s(F),38))),{default:n(()=>[O[15]||=o(`h1`,null,`Eight heads, then glue them back`,-1),o(`div`,b,[(h(),c(`svg`,x,[O[9]||=o(`defs`,null,[o(`marker`,{id:`tv2s2-glue`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),O[10]||=o(`rect`,{class:`dl-dg-box`,x:`10`,y:`82`,width:`56`,height:`60`,rx:`3`},null,-1),O[11]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`38`,y:`117`,"text-anchor":`middle`},`X`,-1),O[12]||=o(`text`,{class:`dl-dg-small`,x:`38`,y:`160`,"text-anchor":`middle`},`T × 512`,-1),(h(),c(l,null,i(8,e=>o(`g`,{key:e},[o(`path`,{class:d([`dl-dg-arrow dl-dg-flow is-slow`,e===1?`is-accent`:e===2?`is-k`:``]),d:`M66 112 L104 ${21+(e-1)*24}`},null,10,S),o(`rect`,{class:d(e===1?`dl-dg-box is-accent`:e===2?`dl-dg-box is-k`:`dl-dg-box`),x:`106`,y:12+(e-1)*24,width:`96`,height:`19`,rx:`3`},null,10,C),o(`text`,{class:`dl-dg-small`,x:`154`,y:26+(e-1)*24,"text-anchor":`middle`},`head `+p(e)+` → Z`+p(e),9,w)])),64)),r(k,{path:`M66 112 L104 21`,role:`accent`,dur:1.2}),r(k,{path:`M66 112 L104 45`,role:`k`,dur:1.2,delay:.6}),O[13]||=o(`text`,{class:`dl-dg-small`,x:`154`,y:`218`,"text-anchor":`middle`},`each Zᵢ is T × 64`,-1),e((h(),c(`g`,null,[(h(),c(l,null,i(8,e=>o(`g`,{key:`c`+e},[o(`path`,{class:d([`dl-dg-arrow dl-dg-flow is-slow`,e===1?`is-accent`:e===2?`is-k`:``]),d:`M202 ${21+(e-1)*24} L${246+(e-1)*22} 92`},null,10,T),o(`rect`,{class:d(e===1?`dl-dg-box is-accent`:e===2?`dl-dg-box is-k`:`dl-dg-box`),x:240+(e-1)*22,y:`94`,width:`22`,height:`40`},null,10,E),r(k,{path:`M202 ${21+(e-1)*24} L${246+(e-1)*22} 92`,role:e===1?`accent`:e===2?`k`:`body`,r:3,dur:1.4,delay:(e-1)*.17},null,8,[`path`,`role`,`delay`])])),64)),O[0]||=o(`text`,{class:`dl-dg-small`,x:`328`,y:`156`,"text-anchor":`middle`},`concatenate: T × 512`,-1)])),[[A]]),e((h(),c(`g`,null,[O[1]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-glue)`,d:`M420 114 H446`},null,-1),O[2]||=o(`rect`,{class:`dl-dg-fill is-muted`,x:`450`,y:`84`,width:`76`,height:`60`,rx:`3`},null,-1),O[3]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`488`,y:`119`,"text-anchor":`middle`},`× W_O`,-1),O[4]||=o(`text`,{class:`dl-dg-small`,x:`488`,y:`160`,"text-anchor":`middle`},`512 × 512, learned`,-1),O[5]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-glue)`,d:`M526 114 H556`},null,-1),r(k,{path:`M420 114 H556`,role:`accent`,dur:1.4}),O[6]||=o(`rect`,{class:`dl-dg-box is-accent`,x:`560`,y:`84`,width:`60`,height:`60`,rx:`3`},null,-1),O[7]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`590`,y:`119`,"text-anchor":`middle`},`Z`,-1),O[8]||=o(`text`,{class:`dl-dg-small`,x:`590`,y:`160`,"text-anchor":`middle`},`T × 512`,-1)])),[[A]])]))]),e((h(),c(`div`,D,[...O[14]||=[o(`p`,null,[f(`Eight outputs of width 64, side by side, are 512 wide. `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`O`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_O`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0278em`}},`O`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` mixes them into one `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`T`),o(`mo`,null,`×`),o(`mn`,null,`512`)]),o(`annotation`,{encoding:`application/x-tex`},`T \\times 512`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`512`)])])]),f(` matrix, the width the next part expects.`)],-1)]])),[[A]])]),_:1},16)}}};export{O as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DURWg7Wl.js b/transformer-v2/assets/md-DURWg7Wl.js new file mode 100644 index 0000000000000000000000000000000000000000..5967b6f9c3c1ee70d931a8a980b0ccf72db9c55e --- /dev/null +++ b/transformer-v2/assets/md-DURWg7Wl.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_19`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),18))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Step 1: three vectors for every word`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`Every word makes three new vectors from its embedding `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`x`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),n(`span`,{class:`mord mathbf`},`x`)])])]),a(`.`)]),n(`li`,null,[a(`On the left is `),n(`em`,null,`Thinking`),a(`’s toy embedding, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_1 = [1, 0, 1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`. Each row multiplies it by one learned matrix.`)]),n(`li`,null,[n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mn`,null,`1`)]),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`Q`)]),n(`mo`,null,`=`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`q`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_1 W_Q = \\mathbf{q}_1 = [1, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`q`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`, the `),n(`strong`,null,`query`),a(` (purple): what this word is looking for.`)]),n(`li`,null,[n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mn`,null,`1`)]),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`K`)]),n(`mo`,null,`=`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`k`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_1 W_K = \\mathbf{k}_1 = [2, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`k`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(`, the `),n(`strong`,null,`key`),a(` (orange): what it offers to be matched.`)]),n(`li`,null,[n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mn`,null,`1`)]),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`V`)]),n(`mo`,null,`=`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`v`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_1 W_V = \\mathbf{v}_1 = [2, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.016em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`, the `),n(`strong`,null,`value`),a(` (blue): what it hands over.`)]),n(`li`,null,[n(`em`,null,`Machines`),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_2 = [0, 1, 0, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`x`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`, gives `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`q`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{q}_2 = [0, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`q`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`k`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{k}_2 = [1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`k`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`v`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{v}_2 = [0, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.016em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,`The same three matrices serve every word. They map 4 numbers to 2 (paper: 512 to 64).`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DYSLXf1o2.js b/transformer-v2/assets/md-DYSLXf1o2.js new file mode 100644 index 0000000000000000000000000000000000000000..cde9df8ee25d1aa39e642c601298ec851f814d22 --- /dev/null +++ b/transformer-v2/assets/md-DYSLXf1o2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,yt as f,z as p}from"./modules/shiki-BFOesOFp.js";import{n as m,t as h}from"./slidev/context-ChHKJoK9.js";import{t as g}from"./default-DTdNOfwb.js";import{t as _}from"./PollSlide-uaNGIrh8.js";var v={class:`grid grid-cols-[1.7fr_1fr] gap-6 items-start`},y={class:`mt-10`},b={viewBox:`0 0 260 170`,class:`dl-diagram`,role:`img`,"aria-label":`Left: eight thin matrices, each 512 rows by 64 columns. Right: one wide matrix, 512 rows by 512 columns`},x=[`x`],S={class:`mt-4 dl-reveal`},C={class:`mt-2 dl-secondary`},w={__name:`slides.md__slidev_43`,setup(w){let{$slidev:T,$nav:E,$clicksContext:D,$clicks:O,$page:k,$renderContext:A,$frontmatter:j}=m();return D.setup(),(m,w)=>{let T=_,E=a(`click`);return p(),u(g,f(t(s(h)(s(j),42))),{default:n(()=>[o(`div`,v,[o(`div`,null,[r(T,{question:`Which needs more weights in W_Q: eight heads of width 64, or one head of width 512?`,items:[`Eight heads of width 64`,`One head of width 512`,`The same number`,`It depends on the sentence length`]})]),o(`div`,y,[(p(),c(`svg`,b,[(p(),c(l,null,i(8,e=>o(`rect`,{key:e,class:`dl-dg-box is-q`,x:8+(e-1)*13,y:`20`,width:`11`,height:`110`},null,8,x)),64)),w[0]||=o(`text`,{class:`dl-dg-small`,x:`58`,y:`150`,"text-anchor":`middle`},`8 × (512 × 64)`,-1),w[1]||=o(`rect`,{class:`dl-dg-box is-q`,x:`150`,y:`20`,width:`104`,height:`110`},null,-1),w[2]||=o(`text`,{class:`dl-dg-small`,x:`202`,y:`150`,"text-anchor":`middle`},`1 × (512 × 512)`,-1),w[3]||=o(`text`,{class:`dl-dg-small`,x:`130`,y:`12`,"text-anchor":`middle`},`W_Q for every head together`,-1)]))])]),e((p(),c(`div`,S,[...w[4]||=[o(`p`,null,[d(`The same: `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`8`),o(`mo`,null,`×`),o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`512`),o(`mo`,null,`×`),o(`mn`,null,`64`),o(`mo`,{stretchy:`false`},`)`),o(`mo`,null,`=`),o(`mn`,null,`512`),o(`mo`,null,`×`),o(`mn`,null,`512`),o(`mo`,null,`=`),o(`mn`,null,`262`),o(`mtext`,null,` `),o(`mn`,null,`144`)]),o(`annotation`,{encoding:`application/x-tex`},`8 \\times (512 \\times 64) = 512 \\times 512 = 262\\,144`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`8`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`512`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`64`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`512`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`512`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`262`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`144`)])])])],-1)]])),[[E]]),e((p(),c(`div`,C,[...w[5]||=[o(`p`,null,`Heads split the width. They do not add weights.`,-1)]])),[[E]])]),_:1},16)}}};export{w as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DeP3xum_.js b/transformer-v2/assets/md-DeP3xum_.js new file mode 100644 index 0000000000000000000000000000000000000000..cc163dfd9feb860c2361aa21bb779a109e0ce998 --- /dev/null +++ b/transformer-v2/assets/md-DeP3xum_.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_17`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),16))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: What does "it" refer to?`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The sentence is `),n(`em`,null,`The animal didn’t cross the street because it was too tired.`),a(` To understand `),n(`em`,null,`it`),a(`, a reader must know it means `),n(`em`,null,`the animal`),a(`.`)]),n(`li`,null,[a(`In the picture, the asking word `),n(`em`,null,`it`),a(` is on the right. A line goes to every word on the left.`)]),n(`li`,null,[a(`Each line is as thick as the `),n(`strong`,null,`attention weight`),a(`: how much `),n(`em`,null,`it`),a(` takes from that word. The thickest line goes to `),n(`em`,null,`animal`),a(` (0.55).`)]),n(`li`,null,`These weights are drawn by hand to show the idea.`),n(`li`,null,[n(`strong`,null,`Self-attention`),a(` means every word looks at every word, and builds its new vector mostly from the words that matter to it.`)])])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DfUOvC0T.js b/transformer-v2/assets/md-DfUOvC0T.js new file mode 100644 index 0000000000000000000000000000000000000000..37a7097290b6b7fae2ee247918e175e3bd748632 --- /dev/null +++ b/transformer-v2/assets/md-DfUOvC0T.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";var g={class:`grid grid-cols-[1.45fr_1fr] gap-5 mt-1 items-start`},_={class:`dl-ledger dl-tight dl-eq-legend`},v={class:`dl-callout`},y={__name:`slides.md__slidev_35`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=h,x=i(`click`);return d(),c(m,u(t(o(p)(o(E),34))),{default:n(()=>[y[3]||=a(`h1`,null,`Reading the equation: the whole layer`,-1),a(`div`,g,[a(`div`,_,[r(b,null,{default:n(()=>[...y[0]||=[a(`table`,null,[a(`thead`,null,[a(`tr`,null,[a(`th`,null,`symbol`),a(`th`,null,`name`),a(`th`,null,`what it is here`),a(`th`,null,`example`)])]),a(`tbody`,null,[a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`)]),a(`annotation`,{encoding:`application/x-tex`},`T`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),a(`td`,null,`sentence length`),a(`td`,null,`number of words`),a(`td`,null,`2`)]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`Q`)]),a(`annotation`,{encoding:`application/x-tex`},`Q`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord mathnormal`},`Q`)])])])]),a(`td`,null,`queries`),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`X`),a(`msub`,null,[a(`mi`,null,`W`),a(`mi`,null,`Q`)])]),a(`annotation`,{encoding:`application/x-tex`},`XW_Q`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3283em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2861em`}},[a(`span`)])])])])])])])]),l(`, one row per word, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`),a(`mo`,null,`×`),a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])]),a(`annotation`,{encoding:`application/x-tex`},`T \\times d_k`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`×`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])]),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,{stretchy:`false`},`[`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`1`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`1`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{separator:`true`},`,`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`0`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`1`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{stretchy:`false`},`]`)]),a(`annotation`,{encoding:`application/x-tex`},`[[1, 1], [0, 1]]`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`[[`),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mclose`},`]`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mopen`},`[`),a(`span`,{class:`mord`},`0`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mclose`},`]]`)])])])])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`K`)]),a(`annotation`,{encoding:`application/x-tex`},`K`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])])]),a(`td`,null,`keys`),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`X`),a(`msub`,null,[a(`mi`,null,`W`),a(`mi`,null,`K`)])]),a(`annotation`,{encoding:`application/x-tex`},`XW_K`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3283em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])]),l(`, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`),a(`mo`,null,`×`),a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])]),a(`annotation`,{encoding:`application/x-tex`},`T \\times d_k`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`×`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])]),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,{stretchy:`false`},`[`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`2`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`2`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{separator:`true`},`,`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`1`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`0`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{stretchy:`false`},`]`)]),a(`annotation`,{encoding:`application/x-tex`},`[[2, 2], [1, 0]]`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`[[`),a(`span`,{class:`mord`},`2`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`2`),a(`span`,{class:`mclose`},`]`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mopen`},`[`),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0`),a(`span`,{class:`mclose`},`]]`)])])])])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])]),a(`td`,null,`values`),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`X`),a(`msub`,null,[a(`mi`,null,`W`),a(`mi`,null,`V`)])]),a(`annotation`,{encoding:`application/x-tex`},`XW_V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3283em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])]),l(`, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`),a(`mo`,null,`×`),a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`v`)])]),a(`annotation`,{encoding:`application/x-tex`},`T \\times d_v`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`×`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1514em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`v`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])]),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,{stretchy:`false`},`[`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`2`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`0`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{separator:`true`},`,`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`0`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`2`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{stretchy:`false`},`]`)]),a(`annotation`,{encoding:`application/x-tex`},`[[2, 0], [0, 2]]`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`[[`),a(`span`,{class:`mord`},`2`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0`),a(`span`,{class:`mclose`},`]`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mopen`},`[`),a(`span`,{class:`mord`},`0`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`2`),a(`span`,{class:`mclose`},`]]`)])])])])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msup`,null,[a(`mi`,null,`K`),a(`mi`,{mathvariant:`normal`},`⊤`)])]),a(`annotation`,{encoding:`application/x-tex`},`K^\\top`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8491em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8491em`}},[a(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])])]),a(`td`,null,`transpose`),a(`td`,null,[l(`rows become columns, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)]),a(`mo`,null,`×`),a(`mi`,null,`T`)]),a(`annotation`,{encoding:`application/x-tex`},`d_k \\times T`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`×`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),a(`td`)]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`Q`),a(`msup`,null,[a(`mi`,null,`K`),a(`mi`,{mathvariant:`normal`},`⊤`)])]),a(`annotation`,{encoding:`application/x-tex`},`QK^\\top`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.0435em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord mathnormal`},`Q`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8491em`}},[a(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])])]),a(`td`,null,`scores`),a(`td`,null,[l(`every query dotted with every key, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`),a(`mo`,null,`×`),a(`mi`,null,`T`)]),a(`annotation`,{encoding:`application/x-tex`},`T \\times T`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`×`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,{stretchy:`false`},`[`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`4`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`1`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{separator:`true`},`,`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`2`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`0`),a(`mo`,{stretchy:`false`},`]`),a(`mo`,{stretchy:`false`},`]`)]),a(`annotation`,{encoding:`application/x-tex`},`[[4, 1], [2, 0]]`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`[[`),a(`span`,{class:`mord`},`4`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mclose`},`]`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mopen`},`[`),a(`span`,{class:`mord`},`2`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0`),a(`span`,{class:`mclose`},`]]`)])])])])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])]),a(`annotation`,{encoding:`application/x-tex`},`d_k`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])]),a(`td`,null,`key width`),a(`td`,null,`set by hand`),a(`td`,null,`2 (paper: 64)`)]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`normal`},`softmax`),a(`mo`,null,`⁡`)]),a(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),a(`span`,{class:`mop`},[a(`span`,{class:`mord mathrm`},`softmax`)])])])])]),a(`td`,null,`softmax, per row`),a(`td`,null,`each row positive, sums to 1`),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mn`,null,`0.89`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`0.11`)]),a(`annotation`,{encoding:`application/x-tex`},`0.89, 0.11`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord`},`0.89`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0.11`)])])])])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`Z`)]),a(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])])]),a(`td`,null,`output`),a(`td`,null,[l(`row `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`i`)]),a(`annotation`,{encoding:`application/x-tex`},`i`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),a(`span`,{class:`mord mathnormal`},`i`)])])]),l(` is `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`z`),a(`mi`,null,`i`)])]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_i`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`z`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3117em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`i`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])]),l(`, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`),a(`mo`,null,`×`),a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`v`)])]),a(`annotation`,{encoding:`application/x-tex`},`T \\times d_v`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`×`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1514em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`v`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])]),a(`td`,null,[l(`row 1: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`1.79`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`0.21`),a(`mo`,{stretchy:`false`},`]`)]),a(`annotation`,{encoding:`application/x-tex`},`[1.79, 0.21]`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`[`),a(`span`,{class:`mord`},`1.79`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0.21`),a(`span`,{class:`mclose`},`]`)])])])])])])],-1)]]),_:1})]),a(`div`,null,[y[2]||=a(`svg`,{viewBox:`0 0 300 120`,class:`dl-diagram`,role:`img`,"aria-label":`Shapes: Q is T by d_k, K transpose is d_k by T, their product is T by T; times V, T by d_v, gives Z, T by d_v`},[a(`rect`,{class:`dl-dg-box is-q`,x:`6`,y:`30`,width:`40`,height:`40`}),a(`text`,{class:`dl-dg-small is-q`,x:`26`,y:`88`,"text-anchor":`middle`},`Q`),a(`text`,{class:`dl-dg-small`,x:`26`,y:`104`,"text-anchor":`middle`},`T × dₖ`),a(`rect`,{class:`dl-dg-box is-k`,x:`58`,y:`30`,width:`40`,height:`40`}),a(`text`,{class:`dl-dg-small is-k`,x:`78`,y:`88`,"text-anchor":`middle`},`Kᵀ`),a(`text`,{class:`dl-dg-small`,x:`78`,y:`104`,"text-anchor":`middle`},`dₖ × T`),a(`text`,{class:`dl-dg-lab is-sm`,x:`114`,y:`56`,"text-anchor":`middle`},`=`),a(`rect`,{class:`dl-dg-box`,x:`128`,y:`30`,width:`40`,height:`40`}),a(`text`,{class:`dl-dg-small`,x:`148`,y:`88`,"text-anchor":`middle`},`scores`),a(`text`,{class:`dl-dg-small`,x:`148`,y:`104`,"text-anchor":`middle`},`T × T`),a(`text`,{class:`dl-dg-lab is-sm`,x:`182`,y:`56`,"text-anchor":`middle`},`×`),a(`rect`,{class:`dl-dg-box is-v`,x:`196`,y:`30`,width:`40`,height:`40`}),a(`text`,{class:`dl-dg-small is-v`,x:`216`,y:`88`,"text-anchor":`middle`},`V`),a(`text`,{class:`dl-dg-small`,x:`216`,y:`104`,"text-anchor":`middle`},`T × dᵥ`),a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`56`,"text-anchor":`middle`},`→`),a(`rect`,{class:`dl-dg-fill`,x:`262`,y:`30`,width:`34`,height:`40`}),a(`text`,{class:`dl-dg-small`,x:`279`,y:`88`,"text-anchor":`middle`},`Z`)],-1),e((d(),s(`div`,v,[...y[1]||=[a(`p`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,{stretchy:`false`},`(`),a(`mi`,null,`Q`),a(`msup`,null,[a(`mi`,null,`K`),a(`mi`,{mathvariant:`normal`},`⊤`)]),a(`msub`,null,[a(`mo`,{stretchy:`false`},`)`),a(`mn`,null,`12`)]),a(`mo`,null,`=`),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`q`),a(`mn`,null,`1`)]),a(`mo`,null,`⋅`),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`k`),a(`mn`,null,`2`)]),a(`mo`,null,`=`),a(`mn`,null,`1`)]),a(`annotation`,{encoding:`application/x-tex`},`(QK^\\top)_{12} = \\mathbf{q}_1 \\cdot \\mathbf{k}_2 = 1`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.0991em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`(`),a(`span`,{class:`mord mathnormal`},`Q`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8491em`}},[a(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`⊤`)])])])])])])]),a(`span`,{class:`mclose`},[a(`span`,{class:`mclose`},`)`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mtight`},`12`)])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`q`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`⋅`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`k`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`2`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`1`)])])])],-1),a(`p`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`z`),a(`mn`,null,`1`)]),a(`mo`,null,`=`),a(`mn`,null,`0.893`),a(`mtext`,null,` `),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`v`),a(`mn`,null,`1`)]),a(`mo`,null,`+`),a(`mn`,null,`0.107`),a(`mtext`,null,` `),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`v`),a(`mn`,null,`2`)])]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1 = 0.893\\,\\mathbf{v}_1 + 0.107\\,\\mathbf{v}_2`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`z`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},`0.893`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.016em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},`0.107`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.016em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`2`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])],-1),a(`p`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mphantom`,null,[a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`z`),a(`mn`,null,`1`)])]),a(`mo`,null,`=`),a(`mo`,{stretchy:`false`},`[`),a(`mn`,null,`1.79`),a(`mo`,{separator:`true`},`,`),a(`mn`,null,`0.21`),a(`mo`,{stretchy:`false`},`]`)]),a(`annotation`,{encoding:`application/x-tex`},`\\phantom{\\mathbf{z}_1} = [1.79, 0.21]`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`,style:{color:`transparent`}},[a(`span`,{class:`mord mathbf`,style:{color:`transparent`}},`z`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`,style:{color:`transparent`}},[a(`span`,{class:`mord mtight`,style:{color:`transparent`}},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mopen`},`[`),a(`span`,{class:`mord`},`1.79`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0.21`),a(`span`,{class:`mclose`},`]`)])])])],-1)]])),[[x]])])])]),_:1},16)}}};export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DjpByc0R.js b/transformer-v2/assets/md-DjpByc0R.js new file mode 100644 index 0000000000000000000000000000000000000000..6fa45f699a447edb596359d9bbcc0e5ce3ce3a21 --- /dev/null +++ b/transformer-v2/assets/md-DjpByc0R.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 660 160`,class:`dl-diagram`,role:`img`,"aria-label":`x goes through self-attention, then add, then normalise, then feed-forward, then add, then normalise. A dashed shortcut carries x around self-attention to the first add, and another carries the normalised vector around the feed-forward network to the second add`},y={class:`mt-1 dl-callout`},b={__name:`slides.md__slidev_54`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=g,S=h,C=i(`click`);return d(),c(m,u(t(o(p)(o(D),53))),{default:n(()=>[b[28]||=a(`h1`,null,`A shortcut around every sub-layer`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[4]||=a(`defs`,null,[a(`marker`,{id:`tv2s4-res`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s4-res-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{d:`M0 0 L7 3.5 L0 7 z`,style:{fill:`var(--dl-accent)`}})])],-1),b[5]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`18`,y:`120`,"text-anchor":`middle`},`x`,-1),b[6]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M28 115 H58`},null,-1),b[7]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`60`,y:`94`,width:`110`,height:`42`,rx:`4`},null,-1),b[8]||=a(`text`,{class:`dl-dg-small`,x:`115`,y:`120`,"text-anchor":`middle`},`self-attention`,-1),b[9]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M170 115 H189`},null,-1),b[10]||=a(`circle`,{class:`dl-dg-op`,cx:`205`,cy:`115`,r:`14`},null,-1),b[11]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`205`,y:`120`,"text-anchor":`middle`},`+`,-1),b[12]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M219 115 H233`},null,-1),b[13]||=a(`rect`,{class:`dl-dg-fill`,x:`235`,y:`94`,width:`76`,height:`42`,rx:`4`},null,-1),b[14]||=a(`text`,{class:`dl-dg-small`,x:`273`,y:`120`,"text-anchor":`middle`},`normalise`,-1),b[15]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M311 115 H333`},null,-1),b[16]||=a(`rect`,{class:`dl-dg-box`,x:`335`,y:`94`,width:`110`,height:`42`,rx:`4`},null,-1),b[17]||=a(`text`,{class:`dl-dg-small`,x:`390`,y:`120`,"text-anchor":`middle`},`feed-forward`,-1),b[18]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M445 115 H464`},null,-1),b[19]||=a(`circle`,{class:`dl-dg-op`,cx:`480`,cy:`115`,r:`14`},null,-1),b[20]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`480`,y:`120`,"text-anchor":`middle`},`+`,-1),b[21]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M494 115 H508`},null,-1),b[22]||=a(`rect`,{class:`dl-dg-fill`,x:`510`,y:`94`,width:`76`,height:`42`,rx:`4`},null,-1),b[23]||=a(`text`,{class:`dl-dg-small`,x:`548`,y:`120`,"text-anchor":`middle`},`normalise`,-1),b[24]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M586 115 H620`},null,-1),b[25]||=a(`text`,{class:`dl-dg-small`,x:`640`,y:`120`,"text-anchor":`middle`},`out`,-1),r(x,{path:`M28 115 H620`,role:`enc`,dur:4}),e((d(),s(`g`,null,[b[0]||=a(`path`,{class:`dl-dg-flow`,d:`M44 115 V56 H205 V99`,"marker-end":`url(#tv2s4-res-acc)`,style:{fill:`none`,stroke:`var(--dl-accent)`,"stroke-width":`2`}},null,-1),b[1]||=a(`path`,{class:`dl-dg-flow`,d:`M323 115 V56 H480 V99`,"marker-end":`url(#tv2s4-res-acc)`,style:{fill:`none`,stroke:`var(--dl-accent)`,"stroke-width":`2`}},null,-1),r(x,{path:`M44 115 V56 H205 V99`,role:`accent`,dur:2.2}),r(x,{path:`M323 115 V56 H480 V99`,role:`accent`,dur:2.2,delay:1.1}),b[2]||=a(`text`,{class:`dl-dg-small is-good`,x:`125`,y:`48`,"text-anchor":`middle`},`shortcut: add x back`,-1),b[3]||=a(`text`,{class:`dl-dg-small is-good`,x:`401`,y:`48`,"text-anchor":`middle`},`shortcut: add its input back`,-1)])),[[C]])]))]),r(S,null,{default:n(()=>[...b[26]||=[a(`ul`,null,[a(`li`,null,[l(`Each sub-layer’s output is `),a(`strong`,null,`added`),l(` to its input: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`bold`},`x`),a(`mo`,null,`+`),a(`mtext`,null,`Sublayer`),a(`mo`,{stretchy:`false`},`(`),a(`mi`,{mathvariant:`bold`},`x`),a(`mo`,{stretchy:`false`},`)`)]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x} + \\text{Sublayer}(\\mathbf{x})`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathbf`},`x`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mord text`},[a(`span`,{class:`mord`},`Sublayer`)]),a(`span`,{class:`mopen`},`(`),a(`span`,{class:`mord mathbf`},`x`),a(`span`,{class:`mclose`},`)`)])])])]),a(`li`,null,[l(`The sub-layer only has to learn a `),a(`strong`,null,`change`),l(` to `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`bold`},`x`)]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),a(`span`,{class:`mord mathbf`},`x`)])])])]),a(`li`,null,[l(`The signal and the gradient get a path with `),a(`strong`,null,`no weight matrix`),l(` on it`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[27]||=[a(`p`,null,`"Add & norm": add the shortcut, then normalise each word’s vector. This is what lets six (or many more) layers stack and still train.`,-1)]])),[[C]])]),_:1},16)}}};export{b as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DmlbZGZu2.js b/transformer-v2/assets/md-DmlbZGZu2.js new file mode 100644 index 0000000000000000000000000000000000000000..b3f74673e82d37541155977540a13f0a34a2bdd2 --- /dev/null +++ b/transformer-v2/assets/md-DmlbZGZu2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";import{t as _}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var v={class:`grid grid-cols-[1.45fr_1fr] gap-5 mt-1 items-start`},y={class:`dl-math-sm`},b={class:`dl-ledger dl-tight dl-eq-legend`},x={viewBox:`0 0 260 150`,class:`dl-diagram`,role:`img`,"aria-label":`Probability 0.17 gives loss 1.79; probability 0.9 gives loss 0.11`},S={class:`dl-callout`},C={__name:`slides.md__slidev_81`,setup(C){let{$slidev:w,$nav:T,$clicksContext:E,$clicks:D,$page:O,$renderContext:k,$frontmatter:A}=f();return E.setup(),(f,C)=>{let w=_,T=h,E=g,D=i(`click`);return d(),c(m,u(t(o(p)(o(A),80))),{default:n(()=>[C[13]||=a(`h1`,null,`Reading the equation: cross-entropy`,-1),a(`div`,v,[a(`div`,null,[C[2]||=a(`p`,null,`One word: minus the log of the right word’s probability. A sentence: add them up.`,-1),a(`div`,y,[r(w,{ranges:[]},{default:n(()=>[...C[0]||=[a(`p`,null,[a(`span`,{class:`katex-display`},[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`L`),a(`mo`,null,`=`),a(`mo`,null,`−`),a(`mi`,null,`log`),a(`mo`,null,`⁡`),a(`msub`,null,[a(`mi`,null,`p`),a(`mi`,null,`y`)]),a(`mo`,{separator:`true`},`,`),a(`mspace`,{width:`2em`}),a(`msub`,null,[a(`mi`,null,`L`),a(`mtext`,null,`sentence`)]),a(`mo`,null,`=`),a(`munderover`,null,[a(`mo`,null,`∑`),a(`mrow`,null,[a(`mi`,null,`t`),a(`mo`,null,`=`),a(`mn`,null,`1`)]),a(`mi`,null,`T`)]),a(`mo`,null,`−`),a(`mi`,null,`log`),a(`mo`,null,`⁡`),a(`msub`,null,[a(`mi`,null,`p`),a(`mi`,null,`t`)]),a(`mo`,{stretchy:`false`},`(`),a(`msub`,null,[a(`mi`,null,`y`),a(`mi`,null,`t`)]),a(`mo`,{stretchy:`false`},`)`)]),a(`annotation`,{encoding:`application/x-tex`},`L = -\\log p_{y}, \\qquad L_{\\text{sentence}} = \\sum_{t=1}^{T} -\\log p_t(y_t) `)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`},`L`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),a(`span`,{class:`mord`},`−`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mop`},[l(`lo`),a(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`p`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1514em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2861em`}},[a(`span`)])])])])]),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`2em`}}),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`L`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2806em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord text mtight`},[a(`span`,{class:`mord mtight`},`sentence`)])])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`3.0954em`,"vertical-align":`-1.2671em`}}),a(`span`,{class:`mop op-limits`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`1.8283em`}},[a(`span`,{style:{top:`-1.8829em`,"margin-left":`0em`}},[a(`span`,{class:`pstrut`,style:{height:`3.05em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`},`t`),a(`span`,{class:`mrel mtight`},`=`),a(`span`,{class:`mord mtight`},`1`)])])]),a(`span`,{style:{top:`-3.05em`}},[a(`span`,{class:`pstrut`,style:{height:`3.05em`}}),a(`span`,null,[a(`span`,{class:`mop op-symbol large-op`},`∑`)])]),a(`span`,{style:{top:`-4.3em`,"margin-left":`0em`}},[a(`span`,{class:`pstrut`,style:{height:`3.05em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`T`)])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`1.2671em`}},[a(`span`)])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`−`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mop`},[l(`lo`),a(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`p`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2806em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`t`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mopen`},`(`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2806em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0359em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`t`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mclose`},`)`)])])])])],-1)]]),_:1})]),a(`div`,b,[r(T,null,{default:n(()=>[...C[1]||=[a(`table`,null,[a(`thead`,null,[a(`tr`,null,[a(`th`,null,`symbol`),a(`th`,null,`name`),a(`th`,null,`what it is here`),a(`th`,null,`example`)])]),a(`tbody`,null,[a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`L`)]),a(`annotation`,{encoding:`application/x-tex`},`L`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`},`L`)])])])]),a(`td`,null,`loss`),a(`td`,null,`one word; whole sentence`),a(`td`,null,`1.79; 1.14`)]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`y`)]),a(`annotation`,{encoding:`application/x-tex`},`y`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`)])])]),l(`, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`y`),a(`mi`,null,`t`)])]),a(`annotation`,{encoding:`application/x-tex`},`y_t`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2806em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0359em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`t`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])]),a(`td`,null,`target word`),a(`td`,null,[l(`the right word (at position `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`t`)]),a(`annotation`,{encoding:`application/x-tex`},`t`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),a(`span`,{class:`mord mathnormal`},`t`)])])]),l(`)`)]),a(`td`,null,[a(`em`,null,`thanks`)])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`p`),a(`mi`,null,`y`)])]),a(`annotation`,{encoding:`application/x-tex`},`p_y`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7167em`,"vertical-align":`-0.2861em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`p`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1514em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0359em`}},`y`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2861em`}},[a(`span`)])])])])])])])]),l(`, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`p`),a(`mi`,null,`t`)]),a(`mo`,{stretchy:`false`},`(`),a(`msub`,null,[a(`mi`,null,`y`),a(`mi`,null,`t`)]),a(`mo`,{stretchy:`false`},`)`)]),a(`annotation`,{encoding:`application/x-tex`},`p_t(y_t)`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`p`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2806em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`t`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mopen`},`(`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.2806em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0359em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`t`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mclose`},`)`)])])])]),a(`td`,null,`its probability`),a(`td`,null,`from the softmax`),a(`td`,null,`0.17`)]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`log`),a(`mo`,null,`⁡`)]),a(`annotation`,{encoding:`application/x-tex`},`\\log`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mop`},[l(`lo`),a(`span`,{style:{"margin-right":`0.0139em`}},`g`)])])])])]),a(`td`,null,`natural log`),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`log`),a(`mo`,null,`⁡`),a(`mn`,null,`1`),a(`mo`,null,`=`),a(`mn`,null,`0`)]),a(`annotation`,{encoding:`application/x-tex`},`\\log 1 = 0`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mop`},[l(`lo`),a(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`0`)])])]),l(`, negative below 1`)]),a(`td`)]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`t`)]),a(`annotation`,{encoding:`application/x-tex`},`t`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),a(`span`,{class:`mord mathnormal`},`t`)])])]),l(`, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`)]),a(`annotation`,{encoding:`application/x-tex`},`T`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),a(`td`,null,`position, length`),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`t`),a(`mo`,null,`=`),a(`mn`,null,`1`),a(`mo`,{separator:`true`},`,`),a(`mo`,null,`…`),a(`mo`,{separator:`true`},`,`),a(`mi`,null,`T`)]),a(`annotation`,{encoding:`application/x-tex`},`t = 1, \\dots, T`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),a(`span`,{class:`mord mathnormal`},`t`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord`},`1`),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`minner`},`…`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`),a(`mo`,null,`=`),a(`mn`,null,`5`)]),a(`annotation`,{encoding:`application/x-tex`},`T = 5`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`5`)])])])])]),a(`tr`,null,[a(`td`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,null,`∑`)]),a(`annotation`,{encoding:`application/x-tex`},`\\sum`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`∑`)])])])]),a(`td`,null,`sum`),a(`td`,null,[l(`add over all `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`T`)]),a(`annotation`,{encoding:`application/x-tex`},`T`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])]),l(` positions`)]),a(`td`)])])],-1)]]),_:1})])]),a(`div`,null,[(d(),s(`svg`,x,[C[3]||=a(`line`,{class:`dl-dg-split`,x1:`20`,y1:`120`,x2:`240`,y2:`120`},null,-1),C[4]||=a(`defs`,null,[a(`marker`,{id:`tv2s6-ce-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),C[5]||=a(`rect`,{class:`dl-dg-bar is-bad`,x:`40`,y:`50`,width:`50`,height:`70`,rx:`2`},null,-1),C[6]||=a(`rect`,{class:`dl-dg-bar is-q`,x:`160`,y:`116`,width:`50`,height:`4`,rx:`2`},null,-1),C[7]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow is-slow`,"marker-end":`url(#tv2s6-ce-acc)`,d:`M96 70 C 130 70, 150 90, 160 104`},null,-1),r(E,{path:`M96 70 C 130 70, 150 90, 160 104`,role:`accent`,dur:2.2}),C[8]||=a(`text`,{class:`dl-dg-small`,x:`65`,y:`44`,"text-anchor":`middle`},`loss 1.79`,-1),C[9]||=a(`text`,{class:`dl-dg-small`,x:`185`,y:`110`,"text-anchor":`middle`},`loss 0.11`,-1),C[10]||=a(`text`,{class:`dl-dg-small`,x:`65`,y:`138`,"text-anchor":`middle`},`p = 0.17`,-1),C[11]||=a(`text`,{class:`dl-dg-small`,x:`185`,y:`138`,"text-anchor":`middle`},`p = 0.90`,-1)])),e((d(),s(`div`,S,[...C[12]||=[a(`p`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mo`,null,`−`),a(`mi`,null,`log`),a(`mo`,null,`⁡`),a(`mstyle`,{scriptlevel:`0`,displaystyle:`false`},[a(`mfrac`,null,[a(`mn`,null,`1`),a(`mn`,null,`6`)])]),a(`mo`,null,`=`),a(`mi`,null,`log`),a(`mo`,null,`⁡`),a(`mn`,null,`6`),a(`mo`,null,`=`),a(`mn`,null,`1.79`)]),a(`annotation`,{encoding:`application/x-tex`},`-\\log \\tfrac{1}{6} = \\log 6 = 1.79`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.1901em`,"vertical-align":`-0.345em`}}),a(`span`,{class:`mord`},`−`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mop`},[l(`lo`),a(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mopen nulldelimiter`}),a(`span`,{class:`mfrac`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8451em`}},[a(`span`,{style:{top:`-2.655em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mtight`},`6`)])])]),a(`span`,{style:{top:`-3.23em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),a(`span`,{style:{top:`-3.394em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mtight`},`1`)])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.345em`}},[a(`span`)])])])]),a(`span`,{class:`mclose nulldelimiter`})]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mop`},[l(`lo`),a(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`6`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`1.79`)])])])],-1),a(`p`,null,[l(`Trained sentence: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mn`,null,`0.22`),a(`mo`,null,`+`),a(`mn`,null,`0.29`),a(`mo`,null,`+`),a(`mn`,null,`0.36`),a(`mo`,null,`+`),a(`mn`,null,`0.16`),a(`mo`,null,`+`),a(`mn`,null,`0.11`),a(`mo`,null,`=`),a(`mn`,null,`1.14`)]),a(`annotation`,{encoding:`application/x-tex`},`0.22 + 0.29 + 0.36 + 0.16 + 0.11 = 1.14`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord`},`0.22`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord`},`0.29`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord`},`0.36`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord`},`0.16`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`0.11`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`1.14`)])])])],-1)]])),[[D]])])])]),_:1},16)}}};export{C as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DrgIGlVp2.js b/transformer-v2/assets/md-DrgIGlVp2.js new file mode 100644 index 0000000000000000000000000000000000000000..debddb56c963d66010c0f7d1b38a86ca8ae07d74 --- /dev/null +++ b/transformer-v2/assets/md-DrgIGlVp2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,V as r,W as i,_ as a,_t as o,b as s,m as c,v as l,vt as u,x as d,xt as f,y as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./FlowDot-CpcqfMjQ.js";var b={class:`mt-2 flex justify-center`},x={viewBox:`0 0 660 220`,class:`dl-diagram`,role:`img`,"aria-label":`Five steps left to right: the words; embed them into X; per head, multiply X by W_Q, W_K and W_V; attention in each head gives Z1 to Z8; concatenate and multiply by W_O to get Z`},S=[`x`],C=[`d`],w=[`x`,`y`],T=[`x`,`y`],E=[`x`,`y`],D=[`x`],O={class:`mt-2 dl-callout`},k={__name:`slides.md__slidev_41`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=g();return M.setup(),(g,k)=>{let A=y,j=i(`click`);return h(),l(v,m(t(o(_)(o(I),40))),{default:n(()=>[k[7]||=a(`h1`,null,`The whole multi-head layer`,-1),a(`div`,b,[(h(),s(`svg`,x,[k[3]||=a(`defs`,null,[a(`marker`,{id:`tv2s2-recap`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(h(),s(c,null,r([`1 · words`,`2 · embed: X`,`3 · per head: Q, K, V`,`4 · attention`,`5 · concat × W_O`],(e,t)=>a(`g`,{key:t},[a(`text`,{class:`dl-dg-small`,x:66+t*132,y:`20`,"text-anchor":`middle`},f(e),9,S),t<4?(h(),s(`path`,{key:0,class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-recap)`,d:`M${116+t*132} 110 H${144+t*132}`},null,8,C)):p(`v-if`,!0),t<4?(h(),l(A,{key:1,path:`M${116+t*132} 110 H${144+t*132}`,role:`accent`,r:3.5,dur:.9,delay:t*.2},null,8,[`path`,`delay`])):p(`v-if`,!0)])),64)),k[4]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`66`,y:`100`,"text-anchor":`middle`},`Thinking`,-1),k[5]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`66`,y:`124`,"text-anchor":`middle`},`Machines`,-1),(h(),s(c,null,r(2,e=>a(`g`,{key:`x`+e},[(h(),s(c,null,r(4,t=>a(`rect`,{key:t,class:`dl-dg-box`,x:156+(t-1)*20,y:86+(e-1)*22,width:`20`,height:`20`},null,8,w)),64))])),64)),e((h(),s(`g`,null,[(h(),s(c,null,r(8,e=>a(`g`,{key:`w`+e},[a(`rect`,{class:u(e===1?`dl-dg-box is-accent`:e===2?`dl-dg-box is-k`:`dl-dg-box`),x:290+(e-1)%4*22,y:56+Math.floor((e-1)/4)*60,width:`18`,height:`48`,rx:`2`},null,10,T)])),64)),k[0]||=a(`text`,{class:`dl-dg-small`,x:`330`,y:`190`,"text-anchor":`middle`},`8 × (W_Q, W_K, W_V)`,-1),(h(),s(c,null,r(8,e=>a(`g`,{key:`z`+e},[a(`rect`,{class:u(e===1?`dl-dg-fill`:e===2?`dl-dg-fill is-k`:`dl-dg-fill is-muted`),x:422+(e-1)%4*22,y:66+Math.floor((e-1)/4)*50,width:`18`,height:`34`,rx:`2`},null,10,E)])),64)),k[1]||=a(`text`,{class:`dl-dg-small`,x:`462`,y:`190`,"text-anchor":`middle`},`Z1 … Z8`,-1)])),[[j]]),e((h(),s(`g`,null,[(h(),s(c,null,r(8,e=>a(`rect`,{key:`c`+e,class:`dl-dg-box`,x:548+(e-1)*7,y:`86`,width:`7`,height:`44`},null,8,D)),64)),k[2]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`576`,y:`156`,"text-anchor":`middle`},`× W_O → Z`,-1)])),[[j]])]))]),e((h(),s(`div`,O,[...k[6]||=[a(`p`,null,[d(`Above the first layer there is no embedding step: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`X`)]),a(`annotation`,{encoding:`application/x-tex`},`X`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),d(` is the output of the layer below.`)],-1)]])),[[j]])]),_:1},16)}}};export{k as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DsnKO94w.js b/transformer-v2/assets/md-DsnKO94w.js new file mode 100644 index 0000000000000000000000000000000000000000..f30b79a52264de8be65bb4b398d15be3029852fc --- /dev/null +++ b/transformer-v2/assets/md-DsnKO94w.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 640 200`,class:`dl-diagram`,role:`img`,"aria-label":`0.89 times v1 = [2,0] gives [1.79, 0]; 0.11 times v2 = [0,2] gives [0, 0.21]; their sum is z1 = [1.79, 0.21]`},y={__name:`slides.md__slidev_25`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=g,x=h,S=i(`click`);return d(),c(m,u(t(o(p)(o(E),24))),{default:n(()=>[y[17]||=a(`h1`,null,`Steps 5 and 6: weigh the values, then add`,-1),a(`div`,_,[(d(),s(`svg`,v,[y[9]||=a(`defs`,null,[a(`marker`,{id:`tv2s1-sum`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-v`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s1-sum-out`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[10]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`44`},`Thinking`,-1),y[11]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`134`},`Machines`,-1),y[12]||=a(`rect`,{class:`dl-dg-box is-v`,x:`90`,y:`24`,width:`90`,height:`32`,rx:`4`},null,-1),y[13]||=a(`text`,{class:`dl-dg-small is-v`,x:`135`,y:`45`,"text-anchor":`middle`},`v₁ [2, 0]`,-1),y[14]||=a(`rect`,{class:`dl-dg-box is-v`,x:`90`,y:`114`,width:`90`,height:`32`,rx:`4`},null,-1),y[15]||=a(`text`,{class:`dl-dg-small is-v`,x:`135`,y:`135`,"text-anchor":`middle`},`v₂ [0, 2]`,-1),e((d(),s(`g`,null,[...y[0]||=[a(`text`,{class:`dl-dg-lab is-sm`,x:`214`,y:`45`,"text-anchor":`middle`},`× 0.893`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`214`,y:`135`,"text-anchor":`middle`},`× 0.107`,-1),a(`rect`,{class:`dl-dg-box is-v`,x:`250`,y:`20`,width:`110`,height:`40`,rx:`4`,style:{"stroke-width":`2.6`}},null,-1),a(`text`,{class:`dl-dg-in is-v`,x:`305`,y:`45`,"text-anchor":`middle`},`[1.79, 0]`,-1),a(`rect`,{class:`dl-dg-box is-v`,x:`250`,y:`110`,width:`110`,height:`40`,rx:`4`,style:{"stroke-width":`0.8`}},null,-1),a(`text`,{class:`dl-dg-small`,x:`305`,y:`135`,"text-anchor":`middle`},`[0, 0.21]`,-1),a(`text`,{class:`dl-dg-small`,x:`305`,y:`176`,"text-anchor":`middle`},`nearly gone`,-1)]])),[[S]]),e((d(),s(`g`,null,[y[1]||=a(`path`,{class:`dl-dg-arrow is-v dl-dg-flow`,"marker-end":`url(#tv2s1-sum)`,d:`M362 40 L440 78`,style:{"stroke-width":`3`}},null,-1),y[2]||=a(`path`,{class:`dl-dg-arrow is-v dl-dg-flow`,"marker-end":`url(#tv2s1-sum)`,d:`M362 130 L440 94`,style:{"stroke-width":`1`}},null,-1),r(b,{path:`M362 40 L438 77`,role:`v`,dur:1.1,r:5.5}),r(b,{path:`M362 130 L438 95`,role:`v`,dur:1.1,delay:.4,r:2.2}),y[3]||=a(`circle`,{class:`dl-dg-op`,cx:`458`,cy:`86`,r:`16`},null,-1),y[4]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`458`,y:`91`,"text-anchor":`middle`},`+`,-1),y[5]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s1-sum-out)`,d:`M474 86 H500`},null,-1),y[6]||=a(`rect`,{class:`dl-dg-box is-accent dl-dg-pulse`,x:`504`,y:`64`,width:`126`,height:`44`,rx:`4`},null,-1),y[7]||=a(`text`,{class:`dl-dg-in`,x:`567`,y:`91`,"text-anchor":`middle`},`z₁ [1.79, 0.21]`,-1),y[8]||=a(`text`,{class:`dl-dg-small`,x:`567`,y:`128`,"text-anchor":`middle`},`Thinking's output`,-1)])),[[S]])]))]),r(x,null,{default:n(()=>[...y[16]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Weigh`),l(`: each value times its weight. Words with tiny weights almost vanish`)]),a(`li`,null,[a(`strong`,null,`Add`),l(`: the sum is the asking word’s output, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`z`),a(`mn`,null,`1`)])]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`z`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])])],-1)]]),_:1})]),_:1},16)}}};export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DtzrSiRi.js b/transformer-v2/assets/md-DtzrSiRi.js new file mode 100644 index 0000000000000000000000000000000000000000..4d07fb9b0f3b87ae04f815d258653ca331f11a2e --- /dev/null +++ b/transformer-v2/assets/md-DtzrSiRi.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_76`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),75))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: From a vector to a word: linear and softmax`,-1),n(`div`,{class:`dl-describe`},[n(`ol`,null,[n(`li`,null,[a(`The top decoder gives one vector `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`h`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),n(`span`,{class:`mord mathbf`},`h`)])])]),a(` of 512 numbers per output position: the tall magenta bar. Moving dots trace it to the word.`)]),n(`li`,null,[a(`A linear layer, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`z`),n(`mo`,null,`=`),n(`mi`,{mathvariant:`bold`},`h`),n(`mtext`,null,` `),n(`msub`,null,[n(`mi`,null,`W`),n(`mrow`,null,[n(`mi`,null,`o`),n(`mi`,null,`u`),n(`mi`,null,`t`)])]),n(`mo`,null,`+`),n(`mi`,{mathvariant:`bold`},`b`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z} = \\mathbf{h}\\,W_{out} + \\mathbf{b}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),n(`span`,{class:`mord mathbf`},`z`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord mathbf`},`h`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2806em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`},`o`),n(`span`,{class:`mord mathnormal mtight`},`u`),n(`span`,{class:`mord mathnormal mtight`},`t`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),n(`span`,{class:`mord mathbf`},`b`)])])]),a(`, makes one score per vocabulary word. These scores are the logits.`)]),n(`li`,null,[a(`Softmax turns the logits into probabilities `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,{mathvariant:`bold`},`p`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{p}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord mathbf`},`p`)])])]),a(`.`)]),n(`li`,null,[a(`Toy example, six words: logits `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`0.5`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2.6`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.4`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`−`),n(`mn`,null,`0.5`)]),n(`annotation`,{encoding:`application/x-tex`},`0.5, 0.2, 2.6, 0.1, 0.4, -0.5`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`0.5`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2.6`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.4`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`0.5`)])])]),a(`. The exponentials add up to 19.54. So `),n(`em`,null,`i`),a(` gets `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`13.46`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`19.54`),n(`mo`,null,`=`),n(`mn`,null,`0.69`)]),n(`annotation`,{encoding:`application/x-tex`},`13.46 / 19.54 = 0.69`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`13.46/19.54`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0.69`)])])]),a(`.`)]),n(`li`,null,[a(`The word with the largest probability, `),n(`em`,null,`i`),a(`, is written.`)])]),n(`p`,null,[a(`With 10 000 words, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mrow`,null,[n(`mi`,null,`o`),n(`mi`,null,`u`),n(`mi`,null,`t`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{out}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2806em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`},`o`),n(`span`,{class:`mord mathnormal mtight`},`u`),n(`span`,{class:`mord mathnormal mtight`},`t`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` is a `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`512`),n(`mo`,null,`×`),n(`mn`,null,`10`),n(`mtext`,null,` `),n(`mn`,null,`000`)]),n(`annotation`,{encoding:`application/x-tex`},`512 \\times 10\\,000`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`512`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`10`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`000`)])])]),a(` matrix.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DuVY9mus2.js b/transformer-v2/assets/md-DuVY9mus2.js new file mode 100644 index 0000000000000000000000000000000000000000..051a46a80abd5e5667aca4af9e7a9125754f09d5 --- /dev/null +++ b/transformer-v2/assets/md-DuVY9mus2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_86`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),85))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: A whole sentence`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The target is `),n(`em`,null,`i am a student ⟨eos⟩`),a(`: five positions.`)]),n(`li`,null,[a(`Each position adds its own loss, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mi`,null,`log`),n(`mo`,null,`⁡`),n(`mi`,null,`p`)]),n(`annotation`,{encoding:`application/x-tex`},`-\\log p`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},[a(`lo`),n(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`},`p`)])])]),a(` of the right word.`)]),n(`li`,null,[a(`An untrained model gives every word `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mi`,{mathvariant:`normal`},`/`),n(`mn`,null,`6`)]),n(`annotation`,{encoding:`application/x-tex`},`1/6`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`1/6`)])])]),a(`, so each position costs 1.79 and the sentence costs `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`5`),n(`mo`,null,`×`),n(`mn`,null,`1.79`),n(`mo`,null,`=`),n(`mn`,null,`8.96`)]),n(`annotation`,{encoding:`application/x-tex`},`5 \\times 1.79 = 8.96`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`5`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1.79`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`8.96`)])])]),a(`.`)]),n(`li`,null,`A trained model gives the right words 0.80, 0.75, 0.70, 0.85 and 0.90. The losses are 0.22, 0.29, 0.36, 0.16 and 0.11: 1.14 in total.`),n(`li`,null,`In training, the decoder is given the right previous words (teacher forcing). With the mask, all positions train at once.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-Dujs-v-n.js b/transformer-v2/assets/md-Dujs-v-n.js new file mode 100644 index 0000000000000000000000000000000000000000..03f0d69fdc75e022d1211ea005d770871761cfa8 --- /dev/null +++ b/transformer-v2/assets/md-Dujs-v-n.js @@ -0,0 +1,34 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_36`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),35))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The whole layer in one line`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[a(`The formula `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Z`),n(`mo`,null,`=`),n(`mi`,{mathvariant:`normal`},`softmax`),n(`mo`,null,`⁡`),n(`mo`,{stretchy:`false`},`(`),n(`mi`,null,`Q`),n(`msup`,null,[n(`mi`,null,`K`),n(`mi`,{mathvariant:`normal`},`⊤`)]),n(`mi`,{mathvariant:`normal`},`/`),n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])]),n(`mo`,{stretchy:`false`},`)`),n(`mtext`,null,` `),n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`Z = \\operatorname{softmax}(QK^\\top / \\sqrt{d_k})\\,V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.1072em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mord mathrm`},`softmax`)]),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord mathnormal`},`Q`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8491em`}},[n(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`⊤`)])])])])])])]),n(`span`,{class:`mord`},`/`),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])]),n(`span`,{class:`mclose`},`)`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(` does steps 2 to 6 for every word at once. Read the picture left to right:`)]),n(`ol`,null,[n(`li`,null,[n(`strong`,null,`Score.`),a(),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Q`),n(`msup`,null,[n(`mi`,null,`K`),n(`mi`,{mathvariant:`normal`},`⊤`)])]),n(`annotation`,{encoding:`application/x-tex`},`QK^\\top`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.0435em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord mathnormal`},`Q`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8491em`}},[n(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])]),a(` holds every query dotted with every key: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`4`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,{separator:`true`},`,`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[[4, 1], [2, 0]]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[[`),n(`span`,{class:`mord`},`4`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]]`)])])]),a(`. Row `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`i`)]),n(`annotation`,{encoding:`application/x-tex`},`i`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),n(`span`,{class:`mord mathnormal`},`i`)])])]),a(` belongs to the word that asks.`)]),n(`li`,null,[n(`strong`,null,`Scale.`),a(` Divide by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msqrt`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mi`,null,`k`)])]),n(`mo`,null,`=`),n(`msqrt`,null,[n(`mn`,null,`2`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k} = \\sqrt{2}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8572em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])]),n(`span`,{style:{top:`-2.8172em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1828em`}},[n(`span`)])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1328em`}}),n(`span`,{class:`mord sqrt`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.9072em`}},[n(`span`,{class:`svg-align`,style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[n(`span`,{class:`mord`},`2`)])]),n(`span`,{style:{top:`-2.8672em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[n(`path`,{d:`M95,702 +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l0 -0 +c5.3,-9.3,12,-14,20,-14 +H400000v40H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M834 80h400000v40h-400000z`})])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1328em`}},[n(`span`)])])])])])])]),a(`: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2.83`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.71`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,{separator:`true`},`,`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.41`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[[2.83, 0.71], [1.41, 0]]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[[`),n(`span`,{class:`mord`},`2.83`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.71`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.41`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]]`)])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Softmax.`),a(` Each row becomes weights that add up to 1: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0.89`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.11`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,{separator:`true`},`,`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0.80`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.20`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[[0.89, 0.11], [0.80, 0.20]]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[[`),n(`span`,{class:`mord`},`0.89`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.11`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0.80`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.20`),n(`span`,{class:`mclose`},`]]`)])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Weighted sum.`),a(` Multiply by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(`. Row 1 of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Z`)]),n(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])]),a(` is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1.79`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.21`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1.79, 0.21]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1.79`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.21`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)])]),n(`p`,null,[a(`Dots run left to right along the arrows to show the order. Row 1 of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Z`)]),n(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])]),a(` is the `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`z`),n(`mn`,null,`1`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`z`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` found by hand.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DxAxCp9K.js b/transformer-v2/assets/md-DxAxCp9K.js new file mode 100644 index 0000000000000000000000000000000000000000..582e259be16f2a7f5dea8c520a55a25089734d7b --- /dev/null +++ b/transformer-v2/assets/md-DxAxCp9K.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 640 230`,class:`dl-diagram`,style:{"max-height":`12rem`},role:`img`,"aria-label":`The decoder position about to write am sends its query down to the three encoder outputs je, suis, étudiant; the line to suis is thickest at 0.8`},y={class:`mt-2 dl-callout`},b={__name:`slides.md__slidev_72`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=g,S=h,C=i(`click`);return d(),c(m,u(t(o(p)(o(D),71))),{default:n(()=>[b[20]||=a(`h1`,null,`Encoder–decoder attention`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[6]||=a(`text`,{class:`dl-dg-small is-dec`,x:`320`,y:`16`,"text-anchor":`middle`},`decoder: the position about to write "am"`,-1),b[7]||=a(`circle`,{class:`dl-dg-dot`,cx:`320`,cy:`44`,r:`13`,style:{fill:`var(--dl-q)`}},null,-1),b[8]||=a(`text`,{class:`dl-dg-in`,x:`320`,y:`49`,"text-anchor":`middle`,style:{fill:`var(--dl-bg)`}},`q`,-1),b[9]||=a(`text`,{class:`dl-dg-small is-q`,x:`346`,y:`48`},`query from the decoder layer below`,-1),e((d(),s(`g`,null,[b[0]||=a(`line`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,x1:`312`,y1:`56`,x2:`140`,y2:`150`,style:{"stroke-width":`1.6`}},null,-1),b[1]||=a(`line`,{class:`dl-dg-line is-q`,x1:`320`,y1:`58`,x2:`320`,y2:`150`,style:{"stroke-width":`9`}},null,-1),b[2]||=a(`line`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,x1:`328`,y1:`56`,x2:`500`,y2:`150`,style:{"stroke-width":`1.6`}},null,-1),r(x,{path:`M320 58 V150`,role:`q`,dur:2,delay:0}),r(x,{path:`M320 150 V58`,role:`v`,dur:2,delay:1,r:`5`}),b[3]||=a(`text`,{class:`dl-dg-small`,x:`214`,y:`98`,"text-anchor":`end`},`0.1`,-1),b[4]||=a(`text`,{class:`dl-dg-small is-good`,x:`332`,y:`110`},`0.8`,-1),b[5]||=a(`text`,{class:`dl-dg-small`,x:`426`,y:`98`},`0.1`,-1)])),[[C]]),b[10]||=a(`rect`,{class:`dl-dg-box is-k`,x:`100`,y:`152`,width:`80`,height:`30`,rx:`4`},null,-1),b[11]||=a(`rect`,{class:`dl-dg-box is-k`,x:`280`,y:`152`,width:`80`,height:`30`,rx:`4`,style:{"stroke-width":`3`}},null,-1),b[12]||=a(`rect`,{class:`dl-dg-box is-k`,x:`460`,y:`152`,width:`80`,height:`30`,rx:`4`},null,-1),b[13]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`140`,y:`172`,"text-anchor":`middle`},`je`,-1),b[14]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`320`,y:`172`,"text-anchor":`middle`},`suis`,-1),b[15]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`500`,y:`172`,"text-anchor":`middle`},`étudiant`,-1),b[16]||=a(`text`,{class:`dl-dg-small`,x:`320`,y:`204`,"text-anchor":`middle`},[a(`tspan`,{style:{fill:`var(--dl-k)`}},`keys`),l(` and `),a(`tspan`,{style:{fill:`var(--dl-v)`}},`values`),l(` from the top encoder's output`)],-1),b[17]||=a(`text`,{class:`dl-dg-small`,x:`320`,y:`222`,"text-anchor":`middle`},`weights drawn to show the idea, not from a trained model`,-1)]))]),r(S,null,{default:n(()=>[...b[18]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Query`),l(`: from the decoder. "What do I need to write next?"`)]),a(`li`,null,[a(`strong`,null,`Keys and values`),l(`: from the encoder’s output. "What did the input say?"`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[19]||=[a(`p`,null,[l(`Same attention. Only the sources differ: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`Q`)]),a(`annotation`,{encoding:`application/x-tex`},`Q`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord mathnormal`},`Q`)])])]),l(` from one stack, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`K`)]),a(`annotation`,{encoding:`application/x-tex`},`K`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),l(` and `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),l(` from the other.`)],-1)]])),[[C]])]),_:1},16)}}};export{b as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DxsAiztQ.js b/transformer-v2/assets/md-DxsAiztQ.js new file mode 100644 index 0000000000000000000000000000000000000000..27a5eb34eab518a5cc36b2843b90ccd09f7b7539 --- /dev/null +++ b/transformer-v2/assets/md-DxsAiztQ.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_50`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),49))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Add a position vector`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`Each word’s input is its embedding (grey) `),n(`strong`,null,`plus`),a(` a position vector (gold) of the same width. Gold dots drop into the sum (accent).`)]),n(`li`,null,[n(`em`,null,`Thinking`),a(` stands at position 0: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,null,`+`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[1, 0, 1, 0] + [0, 1, 0, 1] = [1, 1, 1, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,[n(`em`,null,`Machines`),a(` stands at position 1: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,null,`+`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0.84`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.54`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.01`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1.00`),n(`mo`,{stretchy:`false`},`]`),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0.84`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1.54`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0.01`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2.00`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[0, 1, 0, 1] + [0.84, 0.54, 0.01, 1.00] = [0.84, 1.54, 0.01, 2.00]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0.84`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.54`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.01`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1.00`),n(`span`,{class:`mclose`},`]`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0.84`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1.54`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.01`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2.00`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,[a(`The position vector is not learned. Its even dimensions are `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`sin`),n(`mo`,null,`⁡`),n(`mo`,{stretchy:`false`},`(`),n(`mi`,null,`p`),n(`mi`,null,`o`),n(`mi`,null,`s`),n(`mi`,{mathvariant:`normal`},`/`),n(`msup`,null,[n(`mn`,null,`10000`),n(`mrow`,null,[n(`mn`,null,`2`),n(`mi`,null,`i`),n(`mi`,{mathvariant:`normal`},`/`),n(`msub`,null,[n(`mi`,null,`d`),n(`mrow`,null,[n(`mi`,null,`m`),n(`mi`,null,`o`),n(`mi`,null,`d`),n(`mi`,null,`e`),n(`mi`,null,`l`)])])])]),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`\\sin(pos / 10000^{2i/d_{model}})`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1.138em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mop`},`sin`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord mathnormal`},`p`),n(`span`,{class:`mord mathnormal`},`os`),n(`span`,{class:`mord`},`/1000`),n(`span`,{class:`mord`},[n(`span`,{class:`mord`},`0`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.888em`}},[n(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mtight`},`2`),n(`span`,{class:`mord mathnormal mtight`},`i`),n(`span`,{class:`mord mtight`},`/`),n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3448em`}},[n(`span`,{style:{top:`-2.3488em`,"margin-left":`0em`,"margin-right":`0.0714em`}},[n(`span`,{class:`pstrut`,style:{height:`2.5em`}}),n(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`},`m`),n(`span`,{class:`mord mathnormal mtight`},`o`),n(`span`,{class:`mord mathnormal mtight`},`d`),n(`span`,{class:`mord mathnormal mtight`},`e`),n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.1512em`}},[n(`span`)])])])])])])])])])])])])]),n(`span`,{class:`mclose`},`)`)])])]),a(` and its odd dimensions are the matching `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`cos`),n(`mo`,null,`⁡`)]),n(`annotation`,{encoding:`application/x-tex`},`\\cos`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),n(`span`,{class:`mop`},`cos`)])])]),a(`.`)]),n(`li`,null,[a(`With `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`d`),n(`mrow`,null,[n(`mi`,null,`m`),n(`mi`,null,`o`),n(`mi`,null,`d`),n(`mi`,null,`e`),n(`mi`,null,`l`)])]),n(`mo`,null,`=`),n(`mn`,null,`4`)]),n(`annotation`,{encoding:`application/x-tex`},`d_{model} = 4`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`d`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3361em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},[n(`span`,{class:`mord mathnormal mtight`},`m`),n(`span`,{class:`mord mathnormal mtight`},`o`),n(`span`,{class:`mord mathnormal mtight`},`d`),n(`span`,{class:`mord mathnormal mtight`},`e`),n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`4`)])])]),a(`, position 1 gives `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`sin`),n(`mo`,null,`⁡`),n(`mn`,null,`1`)]),n(`annotation`,{encoding:`application/x-tex`},`\\sin 1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6679em`}}),n(`span`,{class:`mop`},`sin`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`)])])]),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`cos`),n(`mo`,null,`⁡`),n(`mn`,null,`1`)]),n(`annotation`,{encoding:`application/x-tex`},`\\cos 1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mop`},`cos`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`)])])]),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`sin`),n(`mo`,null,`⁡`),n(`mn`,null,`0.01`)]),n(`annotation`,{encoding:`application/x-tex`},`\\sin 0.01`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6679em`}}),n(`span`,{class:`mop`},`sin`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.01`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`cos`),n(`mo`,null,`⁡`),n(`mn`,null,`0.01`)]),n(`annotation`,{encoding:`application/x-tex`},`\\cos 0.01`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mop`},`cos`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.01`)])])]),a(`.`)]),n(`li`,null,`Now the same word at another position has a different input. So the layers can tell word order.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DzgQupA02.js b/transformer-v2/assets/md-DzgQupA02.js new file mode 100644 index 0000000000000000000000000000000000000000..54a528af6eb2b1a86120771d5910fddb9ca22a1a --- /dev/null +++ b/transformer-v2/assets/md-DzgQupA02.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_92`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),91))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Going further`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`Three sources, from easiest to hardest:`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`The Illustrated Transformer`),a(` by Jay Alammar. This deck follows it, and its three examples come from it.`)]),n(`li`,null,[n(`strong`,null,`Attention Is All You Need`),a(` (2017), the paper. Its sections 3.1 to 3.5 describe the architecture covered here.`)]),n(`li`,null,[n(`strong`,null,`The Annotated Transformer`),a(`. The paper again, with working PyTorch code under each part.`)])]),n(`p`,null,`Read the post first, with these slides beside it.`)],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-DzvF9ZKL2.js b/transformer-v2/assets/md-DzvF9ZKL2.js new file mode 100644 index 0000000000000000000000000000000000000000..515f4c25553ce9243be1cf5e4bd0a2579e88f663 --- /dev/null +++ b/transformer-v2/assets/md-DzvF9ZKL2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_79`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),78))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The target, as one-hot vectors`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The columns are the six vocabulary words: `),n(`em`,null,`a, am, i, thanks, student`),a(` and ⟨eos⟩.`)]),n(`li`,null,[a(`The rows are the five positions of the target sentence `),n(`em`,null,`i am a student ⟨eos⟩`),a(`, written in magenta.`)]),n(`li`,null,[a(`Each row is a one-hot vector: a 1 (the teal cell) under the right word and 0 everywhere else. For example, `),n(`em`,null,`am`),a(` is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[0, 1, 0, 0, 0, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`.`)]),n(`li`,null,`A one-hot row is the perfect output: all the probability on the right word. Training pushes the model’s output towards it.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-JC1IoCq-.js b/transformer-v2/assets/md-JC1IoCq-.js new file mode 100644 index 0000000000000000000000000000000000000000..67a9137199af1082593c75a2e05e0ed3b198adff --- /dev/null +++ b/transformer-v2/assets/md-JC1IoCq-.js @@ -0,0 +1 @@ +import{E as e,Q as t,S as n,_ as r,_t as i,v as a,x as o,yt as s,z as c}from"./modules/shiki-BFOesOFp.js";import{n as l,t as u}from"./slidev/context-ChHKJoK9.js";import{t as d}from"./slidev/VClicks-BDQlFH0_.js";import{t as f}from"./interactive-C1KYSeoO.js";import{t as p}from"./DecodeLoop-CNTHEb2K.js";var m={__name:`slides.md__slidev_67`,setup(m){let{$slidev:h,$nav:g,$clicksContext:_,$clicks:v,$page:y,$renderContext:b,$frontmatter:x}=l();return _.setup(),(l,m)=>{let h=p,g=d;return c(),a(f,s(e(i(u)(i(x),66))),{aside:t(e=>[m[1]||=r(`p`,null,[o(`The decoder writes `),r(`strong`,null,`one word per step`),o(`.`)],-1),n(g,null,{default:t(()=>[...m[0]||=[r(`ul`,null,[r(`li`,null,`The word it writes is fed back in as its next input.`),r(`li`,null,`That input is embedded and gets a position vector, as on the encoder side.`),r(`li`,null,`It stops when it writes ⟨eos⟩, "end of sentence".`)],-1)]]),_:1})]),default:t(()=>[n(h,{step:i(v),switchable:!1},null,8,[`step`])]),_:1},16)}}};export{m as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-JKbeikw12.js b/transformer-v2/assets/md-JKbeikw12.js new file mode 100644 index 0000000000000000000000000000000000000000..37633c9c35824d1cdff83b4bb23ed0fc45ead735 --- /dev/null +++ b/transformer-v2/assets/md-JKbeikw12.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_42`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),41))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The whole multi-head layer`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The picture has five steps, left to right; the moving dots on the arrows show the order. Head 1 is teal and head 2 orange.`),n(`ol`,null,[n(`li`,null,[n(`strong`,null,`Words.`),a(),n(`em`,null,`Thinking Machines`),a(`.`)]),n(`li`,null,[n(`strong`,null,`Embed.`),a(` Each word becomes a vector; the vectors are the rows of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`)]),n(`annotation`,{encoding:`application/x-tex`},`X`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Per head.`),a(` Each of the eight heads multiplies `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`)]),n(`annotation`,{encoding:`application/x-tex`},`X`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),a(` by its own `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`Q`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(`, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`K`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`V`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Attention.`),a(` Each head computes its output: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`Z`),n(`mn`,null,`1`)])]),n(`annotation`,{encoding:`application/x-tex`},`Z_1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0715em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` to `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`Z`),n(`mn`,null,`8`)])]),n(`annotation`,{encoding:`application/x-tex`},`Z_8`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0715em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`8`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(`.`)]),n(`li`,null,[n(`strong`,null,`Glue.`),a(` Put the eight outputs side by side and multiply by `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`O`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_O`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0278em`}},`O`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` to get `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Z`)]),n(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])]),a(`.`)])]),n(`p`,null,`Only the first layer starts from embeddings. A layer higher up starts from the output of the layer below it.`)],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-JhK7xqvk.js b/transformer-v2/assets/md-JhK7xqvk.js new file mode 100644 index 0000000000000000000000000000000000000000..023ccf4a385917bced38464118ac153d94d9470b --- /dev/null +++ b/transformer-v2/assets/md-JhK7xqvk.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_21`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),20))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Step 2: score every word`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The asking word is `),n(`em`,null,`Thinking`),a(`. Its query is the purple box, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`q`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`1`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{q}_1 = [1, 1]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`q`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mclose`},`]`)])])]),a(`. The orange boxes are the keys.`)]),n(`li`,null,[a(`The `),n(`strong`,null,`score`),a(` of a word is the asking word’s query dotted with that word’s key: multiply element by element, then add.`)]),n(`li`,null,[a(`With its own key, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`k`),n(`mn`,null,`1`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`2`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`2`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{k}_1 = [2, 2]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`k`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`1`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mclose`},`]`)])])]),a(`: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mo`,null,`⋅`),n(`mn`,null,`2`),n(`mo`,null,`+`),n(`mn`,null,`1`),n(`mo`,null,`⋅`),n(`mn`,null,`2`),n(`mo`,null,`=`),n(`mn`,null,`4`)]),n(`annotation`,{encoding:`application/x-tex`},`1 \\cdot 2 + 1 \\cdot 2 = 4`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`⋅`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`⋅`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`2`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`4`)])])]),a(`.`)]),n(`li`,null,[a(`With `),n(`em`,null,`Machines`),a(`’ key, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`k`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mo`,{stretchy:`false`},`[`),n(`mn`,null,`1`),n(`mo`,{separator:`true`},`,`),n(`mn`,null,`0`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{k}_2 = [1, 0]`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`k`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3011em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mtight`},`2`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mopen`},`[`),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mclose`},`]`)])])]),a(`: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`),n(`mo`,null,`⋅`),n(`mn`,null,`1`),n(`mo`,null,`+`),n(`mn`,null,`1`),n(`mo`,null,`⋅`),n(`mn`,null,`0`),n(`mo`,null,`=`),n(`mn`,null,`1`)]),n(`annotation`,{encoding:`application/x-tex`},`1 \\cdot 1 + 1 \\cdot 0 = 1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`⋅`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`+`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`⋅`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`0`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1`)])])]),a(`.`)]),n(`li`,null,`A large score means the query and the key point the same way: a good match.`),n(`li`,null,`The asking word always scores itself as well.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-Jxei1Krr2.js b/transformer-v2/assets/md-Jxei1Krr2.js new file mode 100644 index 0000000000000000000000000000000000000000..2b931b6c844de57bd09a15544fdd788c968ca511 --- /dev/null +++ b/transformer-v2/assets/md-Jxei1Krr2.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./slidev/VClicks-BDQlFH0_.js";import{t as h}from"./interactive-C1KYSeoO.js";import{t as g}from"./ItAttention-C9htn_5o.js";var _={class:`mt-2 dl-callout`},v={__name:`slides.md__slidev_37`,setup(v){let{$slidev:y,$nav:b,$clicksContext:x,$clicks:S,$page:C,$renderContext:w,$frontmatter:T}=f();return x.setup(),(f,v)=>{let y=g,b=m,x=i(`click`);return d(),c(h,u(t(o(p)(o(T),36))),{aside:n(t=>[v[2]||=a(`p`,null,[l(`One softmax gives `),a(`strong`,null,`one`),l(` set of weights. `),a(`em`,null,`It`),l(` needs two: `),a(`strong`,null,`who`),l(` is it, and `),a(`strong`,null,`what`),l(` is it?`)],-1),r(b,null,{default:n(()=>[...v[0]||=[a(`ul`,null,[a(`li`,null,[l(`Head 1 puts 0.55 on `),a(`em`,null,`animal`)]),a(`li`,null,[l(`Head 2 puts 0.45 on `),a(`em`,null,`tired`)]),a(`li`,null,`Each head has its own query, key and value weights`)],-1)]]),_:1}),e((d(),s(`div`,_,[...v[1]||=[a(`p`,null,`Several heads look in several places at once.`,-1)]])),[[x]])]),default:n(()=>[r(y,{head:`both`,switchable:!0})]),_:1},16)}}};export{v as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-LhxTbmEd2.js b/transformer-v2/assets/md-LhxTbmEd2.js new file mode 100644 index 0000000000000000000000000000000000000000..a2879bdb4490f92bfba7591f53f2afec148f4fd4 --- /dev/null +++ b/transformer-v2/assets/md-LhxTbmEd2.js @@ -0,0 +1 @@ +import{E as e,Q as t,S as n,V as r,_ as i,_t as a,b as o,m as s,v as c,vt as l,x as u,xt as d,yt as f,z as p}from"./modules/shiki-BFOesOFp.js";import{n as m,t as h}from"./slidev/context-ChHKJoK9.js";import{t as g}from"./default-DTdNOfwb.js";import{t as _}from"./slidev/VClicks-BDQlFH0_.js";var v={class:`mt-1 flex justify-center`},y={viewBox:`0 0 560 224`,class:`dl-diagram`,role:`img`,"aria-label":`Five rows, one per target word i am a student eos, six columns, one per vocabulary word; each row has a single filled cell`},b=[`x`],x=[`y`],S=[`y`],C=[`x`,`y`],w=[`x`,`y`],T={__name:`slides.md__slidev_78`,setup(T){let{$slidev:E,$nav:D,$clicksContext:O,$clicks:k,$page:A,$renderContext:j,$frontmatter:M}=m();return O.setup(),(m,T)=>{let E=_;return p(),c(g,f(e(a(h)(a(M),77))),{default:t(()=>[T[1]||=i(`h1`,null,`The target, as one-hot vectors`,-1),i(`div`,v,[(p(),o(`svg`,y,[(p(),o(s,null,r([`a`,`am`,`i`,`thanks`,`student`,`⟨eos⟩`],(e,t)=>i(`text`,{key:`h`+t,class:`dl-dg-small`,x:196+t*58,y:`18`,"text-anchor":`middle`},d(e),9,b)),64)),(p(),o(s,null,r([2,1,0,4,5],(e,t)=>i(`g`,{key:t},[i(`text`,{class:`dl-dg-small`,x:`10`,y:48+t*38},`position `+d(t+1),9,x),i(`text`,{class:`dl-dg-lab is-sm is-dec`,x:`150`,y:48+t*38,"text-anchor":`end`},d([`i`,`am`,`a`,`student`,`⟨eos⟩`][t]),9,S),(p(),o(s,null,r(6,n=>i(`g`,{key:n},[i(`rect`,{class:l(n-1===e?`dl-dg-box is-accent dl-dg-pulse`:`dl-dg-box`),x:170+(n-1)*58,y:28+t*38,width:`52`,height:`30`,rx:`3`},null,10,C),i(`text`,{class:l(n-1===e?`dl-dg-lab is-sm`:`dl-dg-small`),x:196+(n-1)*58,y:48+t*38,"text-anchor":`middle`},d(+(n-1===e)),11,w)])),64))])),64))]))]),n(E,null,{default:t(()=>[...T[0]||=[i(`ul`,null,[i(`li`,null,`Output vocabulary of six words. In practice: 30 000 to 50 000`),i(`li`,null,[u(`Each right word is a `),i(`strong`,null,`one-hot`),u(` vector: a single 1 in its own column. `),i(`em`,null,`am`),u(` is `),i(`span`,{class:`katex`},[i(`span`,{class:`katex-mathml`},[i(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[i(`semantics`,null,[i(`mrow`,null,[i(`mo`,{stretchy:`false`},`[`),i(`mn`,null,`0`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`1`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`0`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`0`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`0`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`0`),i(`mo`,{stretchy:`false`},`]`)]),i(`annotation`,{encoding:`application/x-tex`},`[0, 1, 0, 0, 0, 0]`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),i(`span`,{class:`mopen`},`[`),i(`span`,{class:`mord`},`0`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`1`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`0`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`0`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`0`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`0`),i(`span`,{class:`mclose`},`]`)])])])])],-1)]]),_:1})]),_:1},16)}}};export{T as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-YtqeGDdO.js b/transformer-v2/assets/md-YtqeGDdO.js new file mode 100644 index 0000000000000000000000000000000000000000..f4940fe48d80ac7f09289b4f9a00b4cc2742038a --- /dev/null +++ b/transformer-v2/assets/md-YtqeGDdO.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DTdNOfwb.js";import{t as h}from"./slidev/VClicks-BDQlFH0_.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 660 200`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking Machines gives Thinking 1.79 0.21 and Machines 1.61 0.39. Machines Thinking gives the same two vectors, just in the other order`},y={class:`mt-2 dl-callout`},b={__name:`slides.md__slidev_46`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=g,S=h,C=i(`click`);return d(),c(m,u(t(o(p)(o(D),45))),{default:n(()=>[b[28]||=a(`h1`,null,`Attention does not see order`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[24]||=a(`defs`,null,[a(`marker`,{id:`tv2s3-order`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),a(`g`,null,[b[0]||=a(`text`,{class:`dl-dg-small`,x:`160`,y:`16`,"text-anchor":`middle`},`“Thinking Machines”`,-1),b[1]||=a(`rect`,{class:`dl-dg-box`,x:`40`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[2]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`95`,y:`170`,"text-anchor":`middle`},`Thinking`,-1),b[3]||=a(`rect`,{class:`dl-dg-box`,x:`170`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[4]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`225`,y:`170`,"text-anchor":`middle`},`Machines`,-1),b[5]||=a(`rect`,{class:`dl-dg-fill`,x:`40`,y:`86`,width:`240`,height:`34`,rx:`4`},null,-1),b[6]||=a(`text`,{class:`dl-dg-in`,x:`160`,y:`108`,"text-anchor":`middle`},`self-attention`,-1),b[7]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s3-order)`,d:`M95 150 V122 M225 150 V122 M95 86 V62 M225 86 V62`},null,-1),r(x,{path:`M95 150 V62`,role:`accent`,dur:1.6}),r(x,{path:`M225 150 V62`,role:`accent`,dur:1.6,delay:.8}),b[8]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`40`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[9]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`95`,y:`50`,"text-anchor":`middle`},`[1.79, 0.21]`,-1),b[10]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`170`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[11]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`225`,y:`50`,"text-anchor":`middle`},`[1.61, 0.39]`,-1)]),b[25]||=a(`line`,{class:`dl-dg-split`,x1:`330`,y1:`10`,x2:`330`,y2:`190`},null,-1),e((d(),s(`g`,null,[b[12]||=a(`text`,{class:`dl-dg-small`,x:`500`,y:`16`,"text-anchor":`middle`},`“Machines Thinking”`,-1),b[13]||=a(`rect`,{class:`dl-dg-box`,x:`380`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[14]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`435`,y:`170`,"text-anchor":`middle`},`Machines`,-1),b[15]||=a(`rect`,{class:`dl-dg-box`,x:`510`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[16]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`565`,y:`170`,"text-anchor":`middle`},`Thinking`,-1),b[17]||=a(`rect`,{class:`dl-dg-fill`,x:`380`,y:`86`,width:`240`,height:`34`,rx:`4`},null,-1),b[18]||=a(`text`,{class:`dl-dg-in`,x:`500`,y:`108`,"text-anchor":`middle`},`self-attention`,-1),b[19]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s3-order)`,d:`M435 150 V122 M565 150 V122 M435 86 V62 M565 86 V62`},null,-1),r(x,{path:`M435 150 V62`,role:`accent`,dur:1.6}),r(x,{path:`M565 150 V62`,role:`accent`,dur:1.6,delay:.8}),b[20]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`380`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[21]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`435`,y:`50`,"text-anchor":`middle`},`[1.61, 0.39]`,-1),b[22]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`510`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[23]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`565`,y:`50`,"text-anchor":`middle`},`[1.79, 0.21]`,-1)])),[[C]])]))]),r(S,null,{default:n(()=>[...b[26]||=[a(`ul`,null,[a(`li`,null,[l(`Same words, other order: the `),a(`strong`,null,`same`),l(` two outputs, only swapped`)]),a(`li`,null,[l(`Each word’s output depends on `),a(`strong`,null,`which`),l(` words are there, not `),a(`strong`,null,`where`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[27]||=[a(`p`,null,[l(`Word order changes meaning, so it has to go `),a(`strong`,null,`into the vectors`),l(`.`)],-1)]])),[[C]])]),_:1},16)}}};export{b as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-aadRBhSJ.js b/transformer-v2/assets/md-aadRBhSJ.js new file mode 100644 index 0000000000000000000000000000000000000000..9765003db6d7d8e7fabe3602fd4f129b24c31386 --- /dev/null +++ b/transformer-v2/assets/md-aadRBhSJ.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DTdNOfwb.js";import{t as y}from"./slidev/VClicks-BDQlFH0_.js";var b={class:`grid grid-cols-[1.45fr_1fr] gap-5 mt-1 items-start`},x={class:`dl-ledger dl-tight dl-eq-legend`},S={viewBox:`0 0 250 150`,class:`dl-diagram`,role:`img`,"aria-label":`1, 2 becomes 1, 1, minus 1; ReLU gives 1, 1, 0; then 2.5, 1`},C=[`y`],w=[`x`,`y`],T=[`x`,`y`],E={class:`dl-callout`},D={__name:`slides.md__slidev_60`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=g();return A.setup(),(g,D)=>{let O=y,k=a(`click`);return h(),u(v,m(t(s(_)(s(P),59))),{default:n(()=>[D[2]||=o(`h1`,null,`Reading the equation: the feed-forward network`,-1),o(`div`,b,[o(`div`,x,[r(O,null,{default:n(()=>[...D[0]||=[o(`table`,null,[o(`thead`,null,[o(`tr`,null,[o(`th`,null,`symbol`),o(`th`,null,`name`),o(`th`,null,`what it is here`),o(`th`,null,`example (toy)`)])]),o(`tbody`,null,[o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`x`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),o(`span`,{class:`mord mathbf`},`x`)])])])]),o(`td`,null,`input`),o(`td`,null,[f(`one word’s vector, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`2`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, 2]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mn`,null,`1`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`first weights`),o(`td`,null,[f(`learned, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])]),o(`mo`,null,`×`),o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`f`),o(`mi`,null,`f`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model} \\times d_{ff}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])])]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`),o(`mo`,{separator:`true`},`,`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[[1, 0, 1], [0, 1, -1]]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`b`),o(`mn`,null,`1`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{b}_1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`first bias`),o(`td`,null,[f(`learned, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`f`),o(`mi`,null,`f`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{ff}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])]),f(` numbers`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[0, -1, 0]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`max`),o(`mo`,null,`⁡`),o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`⋅`),o(`mo`,{stretchy:`false`},`)`)]),o(`annotation`,{encoding:`application/x-tex`},`\\max(0, \\cdot)`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mop`},`max`),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`⋅`),o(`span`,{class:`mclose`},`)`)])])])]),o(`td`,null,`ReLU`),o(`td`,null,`negatives become 0, element-wise`),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,null,`→`),o(`mn`,null,`0`)]),o(`annotation`,{encoding:`application/x-tex`},`-1 \\to 0`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`→`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mn`,null,`2`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_2`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`2`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`second weights`),o(`td`,null,[f(`learned, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`f`),o(`mi`,null,`f`)])]),o(`mo`,null,`×`),o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{ff} \\times d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`),o(`mo`,{separator:`true`},`,`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`),o(`mo`,{separator:`true`},`,`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`2`),o(`mo`,{stretchy:`false`},`]`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[[1, 0], [1, 1], [1, 2]]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`2`),o(`span`,{class:`mclose`},`]]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`b`),o(`mn`,null,`2`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{b}_2`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`2`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`second bias`),o(`td`,null,[f(`learned, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`m`),o(`mi`,null,`o`),o(`mi`,null,`d`),o(`mi`,null,`e`),o(`mi`,null,`l`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{model}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`},`m`),o(`span`,{class:`mord mathnormal mtight`},`o`),o(`span`,{class:`mord mathnormal mtight`},`d`),o(`span`,{class:`mord mathnormal mtight`},`e`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0197em`}},`l`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` numbers`)]),o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`0.5`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[0.5, 0]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`0.5`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`)])])])])]),o(`tr`,null,[o(`td`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mrow`,null,[o(`mi`,null,`f`),o(`mi`,null,`f`)])])]),o(`annotation`,{encoding:`application/x-tex`},`d_{ff}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9805em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`),o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1076em`}},`f`)])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])])]),o(`td`,null,`hidden width`),o(`td`,null,`set by hand`),o(`td`,null,`3 (paper: 2048)`)])])],-1)]]),_:1})]),o(`div`,null,[(h(),c(`svg`,S,[(h(),c(l,null,i([[`x`,[`1`,`2`]],[`xW₁ + b₁`,[`1`,`1`,`−1`]],[`ReLU`,[`1`,`1`,`0`]],[`out`,[`2.5`,`1`]]],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:`80`,y:27+t*34,"text-anchor":`end`},p(e[0]),9,C),(h(!0),c(l,null,i(e[1],(e,n)=>(h(),c(`g`,{key:n},[o(`rect`,{class:d(t===3?`dl-dg-box is-accent`:`dl-dg-box`),x:90+n*46,y:8+t*34,width:`46`,height:`28`},null,10,w),o(`text`,{class:`dl-dg-lab is-sm`,x:113+n*46,y:27+t*34,"text-anchor":`middle`},p(e),9,T)]))),128))])),64))])),e((h(),c(`div`,E,[...D[1]||=[o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`x`),o(`msub`,null,[o(`mi`,null,`W`),o(`mn`,null,`1`)]),o(`mo`,null,`+`),o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`b`),o(`mn`,null,`1`)]),o(`mo`,null,`=`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mo`,null,`−`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}W_1 + \\mathbf{b}_1 = [1, 1, -1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord mathbf`},`x`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])])],-1),o(`p`,null,[f(`ReLU: `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1, 1, 0]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mclose`},`]`)])])])],-1),o(`p`,null,[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`×`),o(`msub`,null,[o(`mi`,null,`W`),o(`mn`,null,`2`)]),o(`mo`,null,`+`),o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`b`),o(`mn`,null,`2`)]),o(`mo`,null,`=`),o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`2.5`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`1`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`\\times W_2 + \\mathbf{b}_2 = [2.5, 1]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},`×`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`2`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`2`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`2.5`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`1`),o(`span`,{class:`mclose`},`]`)])])])],-1)]])),[[k]])])])]),_:1},16)}}};export{D as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-c1b1hiln.js b/transformer-v2/assets/md-c1b1hiln.js new file mode 100644 index 0000000000000000000000000000000000000000..169958331699d569119593280ae8ae893dcaf20d --- /dev/null +++ b/transformer-v2/assets/md-c1b1hiln.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_63`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),62))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The full picture, two layers deep`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`Encoders are green, decoders magenta. Dots climb each stack and run along the orange key–value wire.`),n(`li`,null,`The left column is two encoder layers. Each has self-attention and a feed-forward network, and each of those is followed by "add & norm".`),n(`li`,null,[a(`The right column is two decoder layers. Each has `),n(`strong`,null,`three`),a(` sub-layers: self-attention, encoder–decoder attention and a feed-forward network.`)]),n(`li`,null,[a(`The top encoder’s output goes to the encoder–decoder attention of every decoder layer. It provides the keys `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`K`)]),n(`annotation`,{encoding:`application/x-tex`},`K`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),a(` and values `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`V`)]),n(`annotation`,{encoding:`application/x-tex`},`V`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),a(`.`)]),n(`li`,null,`A linear layer and a softmax on top choose the next word.`),n(`li`,null,`The paper stacks six of each, not two.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-fvfttbwL.js b/transformer-v2/assets/md-fvfttbwL.js new file mode 100644 index 0000000000000000000000000000000000000000..426cd91be97e85a3cea9a561e892b2ea200b9e9a --- /dev/null +++ b/transformer-v2/assets/md-fvfttbwL.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,yt as f,z as p}from"./modules/shiki-BFOesOFp.js";import{n as m,t as h}from"./slidev/context-ChHKJoK9.js";import{t as g}from"./default-DTdNOfwb.js";import{t as _}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var v={class:`grid grid-cols-2 gap-6 mt-1 items-center`},y={viewBox:`0 0 320 170`,class:`dl-diagram`,role:`img`,"aria-label":`Bars 2 0 2 0 with a mean line at 1 become bars 1 minus 1 1 minus 1 around zero`},b=[`x`,`y`,`height`],x=[`x`,`y`,`height`],S={class:`dl-math-sm`},C={class:`dl-secondary`},w={class:`mt-2 dl-callout`},T={__name:`slides.md__slidev_56`,setup(T){let{$slidev:E,$nav:D,$clicksContext:O,$clicks:k,$page:A,$renderContext:j,$frontmatter:M}=m();return O.setup(),(m,T)=>{let E=_,D=a(`click`);return p(),u(g,f(t(s(h)(s(M),55))),{default:n(()=>[T[11]||=o(`h1`,null,`Layer normalisation`,-1),T[12]||=o(`p`,null,[d(`Rescale `),o(`strong`,null,`each word’s vector on its own`),d(`: subtract its mean, divide by its standard deviation.`)],-1),o(`div`,v,[o(`div`,null,[(p(),c(`svg`,y,[T[3]||=o(`text`,{class:`dl-dg-small`,x:`70`,y:`14`,"text-anchor":`middle`},`x + Sublayer(x)`,-1),T[4]||=o(`line`,{class:`dl-dg-split`,x1:`10`,y1:`130`,x2:`140`,y2:`130`},null,-1),(p(),c(l,null,i([2,0,2,0],(e,t)=>o(`rect`,{key:`a`+t,class:`dl-dg-bar`,x:18+t*30,y:130-e*40,width:`22`,height:e*40},null,8,b)),64)),T[5]||=o(`line`,{x1:`10`,y1:`90`,x2:`140`,y2:`90`,style:{stroke:`var(--dl-accent)`,"stroke-width":`1.5`,"stroke-dasharray":`4 3`}},null,-1),T[6]||=o(`text`,{class:`dl-dg-small is-good`,x:`143`,y:`86`},`mean 1`,-1),T[7]||=o(`text`,{class:`dl-dg-small`,x:`75`,y:`150`,"text-anchor":`middle`},`[2, 0, 2, 0]`,-1),e((p(),c(`g`,null,[T[0]||=o(`text`,{class:`dl-dg-small`,x:`245`,y:`14`,"text-anchor":`middle`},`normalised`,-1),T[1]||=o(`line`,{class:`dl-dg-split`,x1:`180`,y1:`90`,x2:`310`,y2:`90`},null,-1),(p(),c(l,null,i([1,-1,1,-1],(e,t)=>o(`rect`,{key:`b`+t,class:`dl-dg-bar is-q`,x:188+t*30,y:e>0?90-e*40:90,width:`22`,height:Math.abs(e)*40},null,8,x)),64)),T[2]||=o(`text`,{class:`dl-dg-small`,x:`245`,y:`150`,"text-anchor":`middle`},`[1, −1, 1, −1]`,-1)])),[[D]])]))]),o(`div`,S,[r(E,{ranges:[]},{default:n(()=>[...T[8]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mtext`,null,`LayerNorm`),o(`mo`,{stretchy:`false`},`(`),o(`mi`,{mathvariant:`bold`},`v`),o(`mo`,{stretchy:`false`},`)`),o(`mo`,null,`=`),o(`mi`,{mathvariant:`bold-italic`},`γ`),o(`mo`,null,`⊙`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold`},`v`),o(`mo`,null,`−`),o(`mi`,null,`μ`)]),o(`mi`,null,`σ`)]),o(`mo`,null,`+`),o(`mi`,{mathvariant:`bold-italic`},`β`)]),o(`annotation`,{encoding:`application/x-tex`},`\\text{LayerNorm}(\\mathbf{v}) = \\boldsymbol{\\gamma} \\odot \\frac{\\mathbf{v} - \\mu}{\\sigma} + \\boldsymbol{\\beta} `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord text`},[o(`span`,{class:`mord`},`LayerNorm`)]),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7778em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.0639em`}},`γ`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`⊙`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1.9463em`,"vertical-align":`-0.686em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.2603em`}},[o(`span`,{style:{top:`-2.314em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`σ`)])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`,style:{"margin-right":`0.016em`}},`v`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`−`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord mathnormal`},`μ`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.686em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.034em`}},`β`)])])])])])])],-1)]]),_:1}),e((p(),c(`div`,C,[...T[9]||=[o(`p`,null,[d(`Every word’s vector ends with mean 0 and standard deviation 1, before `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold-italic`},`γ`)]),o(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\gamma}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.0639em`}},`γ`)])])])])]),d(` and `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`bold-italic`},`β`)]),o(`annotation`,{encoding:`application/x-tex`},`\\boldsymbol{\\beta}`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord`},[o(`span`,{class:`mord boldsymbol`,style:{"margin-right":`0.034em`}},`β`)])])])])]),d(`.`)],-1)]])),[[D]])])]),e((p(),c(`div`,w,[...T[10]||=[o(`p`,null,`Each word is normalised on its own, so the sentence length does not matter.`,-1)]])),[[D]])]),_:1},16)}}};export{T as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-gM39Vny3.js b/transformer-v2/assets/md-gM39Vny3.js new file mode 100644 index 0000000000000000000000000000000000000000..6d7c8c1dc9dc1fb5883e00f0e0e547ce7cbf7141 --- /dev/null +++ b/transformer-v2/assets/md-gM39Vny3.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 660 200`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking at position 0: 1 0 1 0 plus 0 1 0 1 equals 1 1 1 1. Machines at position 1: 0 1 0 1 plus 0.84 0.54 0.01 1.00 equals 0.84 1.54 0.01 2.00`},x=[`x`],S=[`x`],C=[`x`],w=[`x`],T=[`x`],E=[`x`],D={class:`dl-dg-small is-good`,x:`330`,y:`190`,"text-anchor":`middle`},O={class:`mt-1 dl-callout`},k={__name:`slides.md__slidev_48`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=h();return M.setup(),(h,k)=>{let A=v,j=a(`click`);return m(),u(_,p(t(s(g)(s(I),47))),{default:n(()=>[k[7]||=o(`h1`,null,`Add a position vector`,-1),k[8]||=o(`p`,null,[d(`Before the first layer, add a fixed `),o(`strong`,null,`position vector`),d(` to each word’s embedding. Same width, so nothing else changes.`)],-1),o(`div`,y,[(m(),c(`svg`,b,[k[1]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`54`},`embedding`,-1),k[2]||=o(`text`,{class:`dl-dg-small is-pos`,x:`10`,y:`104`},`+ position`,-1),k[3]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`154`},`= input`,-1),k[4]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`218`,y:`20`,"text-anchor":`middle`},`Thinking · position 0`,-1),k[5]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`498`,y:`20`,"text-anchor":`middle`},`Machines · position 1`,-1),(m(),c(l,null,i([[[1,0,1,0],[0,1,0,1],[1,1,1,1]],[[0,1,0,1],[`0.84`,`0.54`,`0.01`,`1.00`],[`0.84`,`1.54`,`0.01`,`2.00`]]],(t,n)=>o(`g`,{key:n},[(m(),c(l,null,i(4,e=>o(`g`,{key:`e`+e},[o(`rect`,{class:`dl-dg-box`,x:120+n*280+(e-1)*49,y:`34`,width:`49`,height:`28`},null,8,x),o(`text`,{class:`dl-dg-lab is-sm`,x:144+n*280+(e-1)*49,y:`53`,"text-anchor":`middle`},f(t[0][e-1]),9,S)])),64)),e((m(),c(`g`,null,[(m(),c(l,null,i(4,e=>o(`g`,{key:`p`+e},[o(`rect`,{class:`dl-dg-fill is-pos`,x:120+n*280+(e-1)*49,y:`84`,width:`49`,height:`28`},null,8,C),o(`text`,{class:`dl-dg-lab is-sm`,x:144+n*280+(e-1)*49,y:`103`,"text-anchor":`middle`},f(t[1][e-1]),9,w)])),64))])),[[j,1]]),e((m(),c(`g`,null,[(m(),c(l,null,i(4,e=>r(A,{key:`d`+e,path:`M${144+n*280+(e-1)*49} 112 V134`,role:`pos`,r:3.5,dur:1.1,delay:(e-1)*.25},null,8,[`path`,`delay`])),64)),(m(),c(l,null,i(4,e=>o(`g`,{key:`s`+e},[o(`rect`,{class:`dl-dg-box is-accent`,x:120+n*280+(e-1)*49,y:`134`,width:`49`,height:`28`},null,8,T),o(`text`,{class:`dl-dg-lab is-sm`,x:144+n*280+(e-1)*49,y:`153`,"text-anchor":`middle`},f(t[2][e-1]),9,E)])),64))])),[[j,2]])])),64)),e((m(),c(`text`,D,[...k[0]||=[d(`the input now says what the word is and where it stands`,-1)]])),[[j,2]])]))]),e((m(),c(`div`,O,[...k[6]||=[o(`p`,null,[d(`The position vectors are `),o(`strong`,null,`not learned`),d(`. Each one follows a fixed pattern of sine and cosine waves.`)],-1)]])),[[j,3]])]),_:1},16)}}};export{k as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-hSb063-Y2.js b/transformer-v2/assets/md-hSb063-Y2.js new file mode 100644 index 0000000000000000000000000000000000000000..d75e269cad3d7ac010769d56ad5c77189b5c6549 --- /dev/null +++ b/transformer-v2/assets/md-hSb063-Y2.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_40`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),39))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Eight heads, then glue them back`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`Head 1 is drawn teal and head 2 orange; moving dots show the data flowing left to right.`),n(`ol`,null,[n(`li`,null,[a(`The input `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`X`)]),n(`annotation`,{encoding:`application/x-tex`},`X`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),a(` has one row per word and 512 columns (`),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`T`),n(`mo`,null,`×`),n(`mn`,null,`512`)]),n(`annotation`,{encoding:`application/x-tex`},`T \\times 512`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`512`)])])]),a(`).`)]),n(`li`,null,[a(`Eight heads each run the one-line attention formula with their own weights. Each gives an output `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`Z`),n(`mi`,null,`i`)])]),n(`annotation`,{encoding:`application/x-tex`},`Z_i`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3117em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0715em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`i`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` of shape `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`T`),n(`mo`,null,`×`),n(`mn`,null,`64`)]),n(`annotation`,{encoding:`application/x-tex`},`T \\times 64`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`64`)])])]),a(`.`)]),n(`li`,null,[a(`The eight outputs are put side by side (concatenated). Since `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`8`),n(`mo`,null,`×`),n(`mn`,null,`64`),n(`mo`,null,`=`),n(`mn`,null,`512`)]),n(`annotation`,{encoding:`application/x-tex`},`8 \\times 64 = 512`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`8`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`64`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`512`)])])]),a(`, the result is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`T`),n(`mo`,null,`×`),n(`mn`,null,`512`)]),n(`annotation`,{encoding:`application/x-tex`},`T \\times 512`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`512`)])])]),a(`.`)]),n(`li`,null,[a(`One more learned matrix, `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`O`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_O`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0278em`}},`O`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),a(` (`),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`512`),n(`mo`,null,`×`),n(`mn`,null,`512`)]),n(`annotation`,{encoding:`application/x-tex`},`512 \\times 512`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`512`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`512`)])])]),a(`), mixes what the heads found. The result `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`Z`)]),n(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])]),a(` is `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mi`,null,`T`),n(`mo`,null,`×`),n(`mn`,null,`512`)]),n(`annotation`,{encoding:`application/x-tex`},`T \\times 512`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`512`)])])]),a(`.`)])]),n(`p`,null,`So the output has the same shape as the input.`)],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-n-O9BiQw.js b/transformer-v2/assets/md-n-O9BiQw.js new file mode 100644 index 0000000000000000000000000000000000000000..db6287217b213ac7dbefdcf6ec3b34918aeb42fd --- /dev/null +++ b/transformer-v2/assets/md-n-O9BiQw.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_44`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),43))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Poll: eight small heads or one big one?`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The question compares the query weights `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`Q`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t vlist-t2`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.3283em`}},[n(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[n(`span`,{class:`pstrut`,style:{height:`2.7em`}}),n(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[n(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2861em`}},[n(`span`)])])])])])])])]),a(` of two designs, drawn in purple, the colour of queries.`)]),n(`li`,null,[a(`Eight heads of width 64 need eight `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`512`),n(`mo`,null,`×`),n(`mn`,null,`64`)]),n(`annotation`,{encoding:`application/x-tex`},`512 \\times 64`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`512`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`64`)])])]),a(` matrices.`)]),n(`li`,null,[a(`Together: `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`8`),n(`mo`,null,`×`),n(`mn`,null,`512`),n(`mo`,null,`×`),n(`mn`,null,`64`),n(`mo`,null,`=`),n(`mn`,null,`262`),n(`mtext`,null,` `),n(`mn`,null,`144`)]),n(`annotation`,{encoding:`application/x-tex`},`8 \\times 512 \\times 64 = 262\\,144`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`8`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`512`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`64`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`262`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`144`)])])]),a(` weights.`)]),n(`li`,null,[a(`One head of width 512 needs one matrix of `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`512`),n(`mo`,null,`×`),n(`mn`,null,`512`),n(`mo`,null,`=`),n(`mn`,null,`262`),n(`mtext`,null,` `),n(`mn`,null,`144`)]),n(`annotation`,{encoding:`application/x-tex`},`512 \\times 512 = 262\\,144`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`512`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),n(`span`,{class:`mbin`},`×`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`512`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),n(`span`,{class:`mrel`},`=`),n(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`262`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`144`)])])]),a(` weights.`)]),n(`li`,null,[a(`So the answer is `),n(`strong`,null,`the same`),a(`. The heads split the 512 columns into eight slices of 64.`)]),n(`li`,null,`The sentence length does not change the number of weights. It only changes the size of the score table, which is computed, not learned.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-nm6wRbKQ.js b/transformer-v2/assets/md-nm6wRbKQ.js new file mode 100644 index 0000000000000000000000000000000000000000..aa37fb0144517107d2e191d44ac6cf14a760d48a --- /dev/null +++ b/transformer-v2/assets/md-nm6wRbKQ.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_73`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),72))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: Encoder–decoder attention`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,[a(`The purple dot at the top is the query of one decoder position: the one about to write `),n(`em`,null,`am`),a(`. It comes from the decoder layer below.`)]),n(`li`,null,[a(`The three orange boxes at the bottom are the encoder’s outputs for `),n(`em`,null,`je`),a(`, `),n(`em`,null,`suis`),a(` and `),n(`em`,null,`étudiant`),a(`. They supply the keys and the values.`)]),n(`li`,null,`A purple dot travels down to the keys; a blue dot carries the value back up.`),n(`li`,null,[a(`Each line is as thick as its attention weight: 0.1, 0.8 and 0.1. To write `),n(`em`,null,`am`),a(`, the decoder reads mostly `),n(`em`,null,`suis`),a(`. The weights are drawn, not trained.`)]),n(`li`,null,`It is ordinary attention, with no mask: the whole input is known.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-pDvaI0qJ.js b/transformer-v2/assets/md-pDvaI0qJ.js new file mode 100644 index 0000000000000000000000000000000000000000..9378dabd9c089fe06405450f29bec88bd9b34f53 --- /dev/null +++ b/transformer-v2/assets/md-pDvaI0qJ.js @@ -0,0 +1 @@ +import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./default-DTdNOfwb.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";import{t as y}from"./slidev/KaTexBlockWrapper-DlEiKh25.js";var b={class:`grid grid-cols-[1.3fr_1fr] gap-6 mt-1 items-center`},x={viewBox:`0 0 360 190`,class:`dl-diagram`,role:`img`,"aria-label":`z1 for Thinking and z2 for Machines each go through a copy of the same feed-forward network, 512 wide, then 2048, then 512, and come out as r1 and r2`},S=[`x`],C=[`d`],w=[`points`],T=[`points`],E=[`x`],D=[`x`],O=[`d`],k=[`x`],A={class:`dl-math-sm`},j={class:`dl-secondary`},M={class:`mt-2 dl-callout`},N={__name:`slides.md__slidev_59`,setup(N){let{$slidev:P,$nav:F,$clicksContext:I,$clicks:L,$page:R,$renderContext:z,$frontmatter:B}=h();return I.setup(),(h,N)=>{let P=v,F=y,I=a(`click`);return m(),u(_,p(t(s(g)(s(B),58))),{default:n(()=>[N[6]||=o(`h1`,null,`The feed-forward network, one word at a time`,-1),N[7]||=o(`p`,null,[d(`A small MLP (multilayer perceptron): widen, ReLU, narrow back. The `),o(`strong`,null,`same`),d(` weights for every word.`)],-1),o(`div`,b,[o(`div`,null,[(m(),c(`svg`,x,[N[0]||=o(`defs`,null,[o(`marker`,{id:`tv2s4-ffn`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(m(),c(l,null,i([`Thinking`,`Machines`],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:90+t*180,y:`182`,"text-anchor":`middle`},`z`+f(t+1)+` · `+f(e),9,S),o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s4-ffn)`,d:`M${90+t*180} 168 V146`},null,8,C),o(`polygon`,{class:`dl-dg-net`,points:`${60+t*180},144 ${120+t*180},144 ${150+t*180},104 ${30+t*180},104`},null,8,w),o(`polygon`,{class:`dl-dg-net`,points:`${30+t*180},100 ${150+t*180},100 ${120+t*180},60 ${60+t*180},60`},null,8,T),o(`text`,{class:`dl-dg-small`,x:90+t*180,y:`128`,"text-anchor":`middle`},`512 → 2048`,8,E),o(`text`,{class:`dl-dg-small`,x:90+t*180,y:`84`,"text-anchor":`middle`},`2048 → 512`,8,D),o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s4-ffn)`,d:`M${90+t*180} 58 V36`},null,8,O),r(P,{path:`M${90+t*180} 168 V36`,role:`accent`,dur:2,delay:t*1},null,8,[`path`,`delay`]),o(`text`,{class:`dl-dg-small`,x:90+t*180,y:`26`,"text-anchor":`middle`},`r`+f(t+1),9,k)])),64)),N[1]||=o(`text`,{class:`dl-dg-small is-good`,x:`180`,y:`102`,"text-anchor":`middle`},`same`,-1),N[2]||=o(`text`,{class:`dl-dg-small is-good`,x:`180`,y:`116`,"text-anchor":`middle`},`weights`,-1)]))]),o(`div`,A,[r(F,{ranges:[]},{default:n(()=>[...N[3]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mtext`,null,`FFN`),o(`mo`,{stretchy:`false`},`(`),o(`mi`,{mathvariant:`bold`},`x`),o(`mo`,{stretchy:`false`},`)`),o(`mo`,null,`=`),o(`mi`,null,`max`),o(`mo`,null,`⁡`),o(`mo`,{stretchy:`false`},`(`),o(`mn`,null,`0`),o(`mo`,{separator:`true`},`,`),o(`mtext`,null,` `),o(`mi`,{mathvariant:`bold`},`x`),o(`msub`,null,[o(`mi`,null,`W`),o(`mn`,null,`1`)]),o(`mo`,null,`+`),o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`b`),o(`mn`,null,`1`)]),o(`mo`,{stretchy:`false`},`)`),o(`mtext`,null,` `),o(`msub`,null,[o(`mi`,null,`W`),o(`mn`,null,`2`)]),o(`mo`,null,`+`),o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`b`),o(`mn`,null,`2`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\text{FFN}(\\mathbf{x}) = \\max(0,\\, \\mathbf{x}W_1 + \\mathbf{b}_1)\\, W_2 + \\mathbf{b}_2 `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord text`},[o(`span`,{class:`mord`},`FFN`)]),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord mathbf`},`x`),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mop`},`max`),o(`span`,{class:`mopen`},`(`),o(`span`,{class:`mord`},`0`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathbf`},`x`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mclose`},`)`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`2`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`b`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`2`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])])])],-1)]]),_:1}),e((m(),c(`div`,j,[...N[4]||=[o(`p`,null,`No word sees another word here. Only self-attention mixes words.`,-1)]])),[[I]])])]),e((m(),c(`div`,M,[...N[5]||=[o(`p`,null,`Every word goes through the FFN (feed-forward network) on its own, so all words run in parallel.`,-1)]])),[[I]])]),_:1},16)}}};export{N as default}; \ No newline at end of file diff --git a/transformer-v2/assets/md-v3n1Uq5B.js b/transformer-v2/assets/md-v3n1Uq5B.js new file mode 100644 index 0000000000000000000000000000000000000000..c53a95545137c9828c7cf6679ff559efb63b3f4c --- /dev/null +++ b/transformer-v2/assets/md-v3n1Uq5B.js @@ -0,0 +1 @@ +import{E as e,Q as t,_ as n,_t as r,v as i,x as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./default-DTdNOfwb.js";var d={__name:`slides.md__slidev_52`,setup(d){let{$slidev:f,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=c();return m.setup(),(c,d)=>(s(),i(u,o(e(r(l)(r(v),51))),{default:t(()=>[...d[0]||=[n(`h1`,null,`In words: The pattern over many positions`,-1),n(`div`,{class:`dl-describe`},[n(`ul`,null,[n(`li`,null,`The heat map shows the position vectors for twelve positions. Each row is one position; each column is one of sixteen dimensions.`),n(`li`,null,[a(`Each cell is a number between `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mo`,null,`−`),n(`mn`,null,`1`)]),n(`annotation`,{encoding:`application/x-tex`},`-1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`−`),n(`span`,{class:`mord`},`1`)])])]),a(` and `),n(`span`,{class:`katex`},[n(`span`,{class:`katex-mathml`},[n(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[n(`semantics`,null,[n(`mrow`,null,[n(`mn`,null,`1`)]),n(`annotation`,{encoding:`application/x-tex`},`1`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),n(`span`,{class:`mord`},`1`)])])]),a(`. The colour shows its sign and the strength shows its size.`)]),n(`li`,null,`The left columns are fast waves. They change a lot from one row to the next.`),n(`li`,null,`The right columns are slow waves. They barely change over twelve rows.`),n(`li`,null,`Together they give every position its own pattern.`),n(`li`,null,`Because the vectors come from a formula, any position has one, even in a sentence longer than those used in training.`)])],-1)]]),_:1},16))}};export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/404-Bx_SkrwT.js b/transformer-v2/assets/slidev/404-Bx_SkrwT.js new file mode 100644 index 0000000000000000000000000000000000000000..5e2d5e3494ae4d9584aea4d9058d91a7a1e8bc4b --- /dev/null +++ b/transformer-v2/assets/slidev/404-Bx_SkrwT.js @@ -0,0 +1 @@ +import{Q as e,U as t,_ as n,_t as r,b as i,g as a,v as o,w as s,x as c,xt as l,y as u,z as d}from"../modules/shiki-BFOesOFp.js";import{t as f}from"../useNav-B1TSwKuf.js";import{t as p}from"../_plugin-vue_export-helper-BDNMzG2s.js";import{B as m}from"../modules/vue-CXhtJkbE.js";var h={class:`grid justify-center text-center pt-15% gap-5`},g={class:`text-2xl`},_={class:`op-60`},v={class:`mt-3 flex flex-col gap-2 max-w-xs mx-auto w-full`},y=p(s({__name:`404`,setup(s){let p=/\d+/,{currentRoute:y}=m(),{total:b}=f(),x=a(()=>{let e=y.value.path.match(p);if(e){let t=+e[0];if(t>0&&t<=b.value)return t}return null});return(a,s)=>{let f=t(`RouterLink`);return d(),i(`div`,h,[n(`div`,null,[s[2]||=n(`h1`,{class:`text-9xl font-light`},` 404 `,-1),n(`p`,g,[s[0]||=c(` Page `,-1),n(`code`,_,l(r(y).path),1),s[1]||=c(` not found `,-1)])]),n(`div`,v,[x.value===1?u(`v-if`,!0):(d(),o(f,{key:0,to:`/`,class:`page-link`},{default:e(()=>[...s[3]||=[c(` Go Home `,-1)]]),_:1})),x.value?(d(),o(f,{key:1,to:`/${x.value}`,class:`page-link`},{default:e(()=>[c(` Go to Slide `+l(x.value),1)]),_:1},8,[`to`])):u(`v-if`,!0)])])}}}),[[`__scopeId`,`data-v-b584852f`]]);export{y as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/DrawingControls--3fQRT-C.js b/transformer-v2/assets/slidev/DrawingControls--3fQRT-C.js new file mode 100644 index 0000000000000000000000000000000000000000..a82a8f50bd7c1f1c431875cd02360e7906530f5c --- /dev/null +++ b/transformer-v2/assets/slidev/DrawingControls--3fQRT-C.js @@ -0,0 +1 @@ +import{n as e}from"../rolldown-runtime-hePW80VL.js";import{$ as t,H as n,Q as r,S as i,V as a,_ as o,_t as s,b as c,bt as l,l as u,lt as d,m as f,r as p,u as m,v as h,vt as g,w as _,xt as v,y,z as b}from"../modules/shiki-BFOesOFp.js";import{h as x,u as S}from"../modules/vue-CXhtJkbE.js";import{t as C}from"../useDrawings-Dnt5VfKs.js";import{t as w}from"./IconButton-B5keGFol.js";import{t as T}from"./VerticalDivider-D_ScNBWw.js";var E=_({__name:`Draggable`,props:{storageKey:{},initial:{}},setup(e){let t=e,r=d(null),i=t.initial??{x:0,y:0},a=t.storageKey?x(t.storageKey,i):d(i),{style:o}=S(r,{initialValue:a});return(e,t)=>(b(),c(`div`,{ref_key:`el`,ref:r,class:`fixed`,style:l(s(o))},[n(e.$slots,`default`)],4))}}),D={class:`flex bg-main p-2`},O={class:`inline-block w-7 text-center`},k={class:`pt-.5`},A={class:`i-carbon:pin-filled transform -rotate-45`},j={class:`i-carbon:pin`},M={class:`i-carbon:error`},N={class:`i-carbon:close-outline`},P=_({__name:`DrawingControls`,setup(e){let{brush:n,canClear:_,canRedo:x,canUndo:S,clear:P,drauu:F,drawingEnabled:I,drawingMode:L,drawingPinned:R,brushColors:z}=C(),B=d(!1);function V(e){e.preventDefault(),e.stopPropagation(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{B.value=!0})})}function H(e){e.pointerType!==`mouse`&&V(e)}function U(){F.undo()}function W(){F.redo()}let G=`stylus`;function K(e){L.value=e,I.value=!0,e!==`eraseLine`&&(G=e)}function q(e){n.value.color=e,I.value=!0,L.value=G}return(e,d)=>s(I)||s(R)?(b(),h(E,{key:0,class:g([`flex flex-wrap text-xl p-2 gap-1 rounded-md bg-main shadow transition-opacity duration-200 z-nav border border-main`,!s(I)&&s(R)?`opacity-40 hover:opacity-90`:``]),"storage-key":`slidev-drawing-pos`,"initial-x":10,"initial-y":10},{default:r(()=>[i(w,{title:`Draw with stylus`,class:g({shallow:s(L)!==`stylus`}),onClick:d[0]||=e=>K(`stylus`)},{default:r(()=>[...d[14]||=[o(`div`,{class:`i-carbon:pen`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Draw a line`,class:g({shallow:s(L)!==`line`}),onClick:d[1]||=e=>K(`line`)},{default:r(()=>[...d[15]||=[o(`svg`,{width:`1em`,height:`1em`,class:`-mt-0.5`,preserveAspectRatio:`xMidYMid meet`,viewBox:`0 0 24 24`},[o(`path`,{d:`M21.71 3.29a1 1 0 0 0-1.42 0l-18 18a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l18-18a1 1 0 0 0 0-1.42z`,fill:`currentColor`})],-1)]]),_:1},8,[`class`]),i(w,{title:`Draw an arrow`,class:g({shallow:s(L)!==`arrow`}),onClick:d[2]||=e=>K(`arrow`)},{default:r(()=>[...d[16]||=[o(`div`,{class:`i-carbon:arrow-up-right`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Draw an ellipse`,class:g({shallow:s(L)!==`ellipse`}),onClick:d[3]||=e=>K(`ellipse`)},{default:r(()=>[...d[17]||=[o(`div`,{class:`i-carbon:radio-button`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Draw a rectangle`,class:g({shallow:s(L)!==`rectangle`}),onClick:d[4]||=e=>K(`rectangle`)},{default:r(()=>[...d[18]||=[o(`div`,{class:`i-carbon:checkbox`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Erase`,class:g({shallow:s(L)!==`eraseLine`}),onClick:d[5]||=e=>K(`eraseLine`)},{default:r(()=>[...d[19]||=[o(`div`,{class:`i-carbon:erase`},null,-1)]]),_:1},8,[`class`]),i(T),i(s(p),{shown:B.value,"onUpdate:shown":d[8]||=e=>B.value=e,triggers:[]},{popper:r(()=>[o(`div`,D,[o(`div`,O,v(s(n).size),1),o(`div`,k,[t(o(`input`,{"onUpdate:modelValue":d[6]||=e=>s(n).size=e,type:`range`,min:`1`,max:`15`,onChange:d[7]||=e=>L.value=s(G)},null,544),[[u,s(n).size]])])])]),default:r(()=>[i(w,{title:`Adjust stroke width`,class:g({shallow:s(L)===`eraseLine`}),onClick:V,onPointerdown:H,onPointerup:H,onTouchend:V},{default:r(()=>[...d[20]||=[o(`svg`,{viewBox:`0 0 32 32`,width:`1.2em`,height:`1.2em`},[o(`line`,{x1:`2`,y1:`15`,x2:`22`,y2:`4`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`}),o(`line`,{x1:`2`,y1:`24`,x2:`28`,y2:`10`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`}),o(`line`,{x1:`7`,y1:`31`,x2:`29`,y2:`19`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`})],-1)]]),_:1},8,[`class`])]),_:1},8,[`shown`]),(b(!0),c(f,null,a(s(z),e=>(b(),h(w,{key:e,title:`Set brush color`,class:g(s(n).color===e&&s(L)!==`eraseLine`?`active`:`shallow`),onClick:t=>q(e)},{default:r(()=>[o(`div`,{class:g([`w-6 h-6 transition-all transform border`,s(n).color===e?`rounded-md border-gray-300/50`:`rounded-1/2 scale-85 border-white`]),style:l(s(I)?{background:e}:{borderColor:e})},null,6)]),_:2},1032,[`class`,`onClick`]))),128)),i(T),i(w,{title:`Undo`,class:g({disabled:!s(S)}),onClick:d[9]||=e=>U()},{default:r(()=>[...d[21]||=[o(`div`,{class:`i-carbon:undo`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Redo`,class:g({disabled:!s(x)}),onClick:d[10]||=e=>W()},{default:r(()=>[...d[22]||=[o(`div`,{class:`i-carbon:redo`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Delete`,class:g({disabled:!s(_)}),onClick:d[11]||=e=>s(P)()},{default:r(()=>[...d[23]||=[o(`div`,{class:`i-carbon:trash-can`},null,-1)]]),_:1},8,[`class`]),i(T),i(w,{title:s(R)?`Unpin drawing`:`Pin drawing`,class:g({shallow:!s(R)}),onClick:d[12]||=e=>R.value=!s(R)},{default:r(()=>[t(o(`div`,A,null,512),[[m,s(R)]]),t(o(`div`,j,null,512),[[m,!s(R)]])]),_:1},8,[`title`,`class`]),s(I)?(b(),h(w,{key:0,title:s(R)?`Drawing pinned`:`Drawing unpinned`,class:g({shallow:!s(I)}),onClick:d[13]||=e=>I.value=!s(I)},{default:r(()=>[t(o(`div`,M,null,512),[[m,s(R)]]),t(o(`div`,N,null,512),[[m,!s(R)]])]),_:1},8,[`title`,`class`])):y(`v-if`,!0)]),_:1},8,[`class`])):y(`v-if`,!0)}}),F=e({default:()=>I}),I=P;export{F as n,I as t}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/DrawingLayer-BVIfdu9B.js b/transformer-v2/assets/slidev/DrawingLayer-BVIfdu9B.js new file mode 100644 index 0000000000000000000000000000000000000000..f587f5bdf519c4958abee4aebf6b74cfca794228 --- /dev/null +++ b/transformer-v2/assets/slidev/DrawingLayer-BVIfdu9B.js @@ -0,0 +1 @@ +import{F as e,L as t,Y as n,_t as r,b as i,lt as a,vt as o,w as s,z as c}from"../modules/shiki-BFOesOFp.js";import{n as l}from"./context-ChHKJoK9.js";import{t as u}from"../useDrawings-Dnt5VfKs.js";var d=s({__name:`DrawingLayer`,setup(s){let{drauu:d,drawingEnabled:f,loadCanvas:p}=u(),m=l().$scale,h=a();return t(()=>{d.mount(h.value,h.value.parentElement),n(m,e=>d.options.coordinateScale=1/e,{immediate:!0}),p()}),e(()=>{d.unmount()}),(e,t)=>(c(),i(`svg`,{ref_key:`svg`,ref:h,class:o([`w-full h-full absolute top-0`,{"pointer-events-none":!r(f),"touch-none":r(f)}])},null,2))}});export{d as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/KaTexBlockWrapper-DlEiKh25.js b/transformer-v2/assets/slidev/KaTexBlockWrapper-DlEiKh25.js new file mode 100644 index 0000000000000000000000000000000000000000..5a2dec32807e37d8aa775028d721dfc3661c6523 --- /dev/null +++ b/transformer-v2/assets/slidev/KaTexBlockWrapper-DlEiKh25.js @@ -0,0 +1 @@ +import{H as e,L as t,R as n,X as r,b as i,g as a,lt as o,w as s,z as c}from"../modules/shiki-BFOesOFp.js";import{H as l}from"../useNav-B1TSwKuf.js";import{a as u,c as d,l as f,n as p}from"./context-ChHKJoK9.js";import{u as m}from"../index-DBl9KyFJ.js";var h=`.mtable > [class*=col-align]`,g=`:scope > .vlist-t > .vlist-r > .vlist > span > .mord`;function _(e){let t=Array.from(e.querySelectorAll(h)).filter(e=>!e.parentElement?.closest(h)),n=[];for(let e of t)Array.from(e.querySelectorAll(g)).forEach((e,t)=>{e&&(Array.isArray(n[t])?n[t].push(e):n[t]=[e])});return n}var v=s({__name:`KaTexBlockWrapper`,props:{ranges:{type:Array,default:()=>[]},finally:{type:[String,Number],default:`last`},startLine:{type:Number,default:1},at:{type:[String,Number],default:`+1`}},setup(s){let h=s,{$clicksContext:g}=p(),v=o(),y=m();return n(()=>{g.unregister(y)}),t(()=>{if(!g||!h.ranges?.length)return;let e=g.calculateSince(h.at,h.ranges.length-1);g.register(y,e);let t=a(()=>e?Math.max(0,g.current-e.start+1):f),n=a(()=>h.finally===`last`?h.ranges.at(-1):h.finally.toString());r(()=>{if(!v.value)return;let e=h.ranges[t.value]??n.value,r=e===`hide`;v.value.classList.toggle(u,r),r&&(e=h.ranges[t.value+1]??n.value);let i=_(v.value);if(!i.length)return;let a=h.startLine,o=l(i.length+a-1,e);i.forEach((e,t)=>{let n=o.includes(t+a);e.forEach(e=>{e.classList.toggle(d,!0),e.classList.toggle(`highlighted`,n),e.classList.toggle(`dishonored`,!n)})})})}),(t,n)=>(c(),i(`div`,{ref_key:`el`,ref:v,class:`slidev-katex-wrapper`},[e(t.$slots,`default`)],512))}});export{v as t}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/NoteDisplay-DHqEdDda.js b/transformer-v2/assets/slidev/NoteDisplay-DHqEdDda.js new file mode 100644 index 0000000000000000000000000000000000000000..4901bc77306783f6179066a0a0f17cebda79fd3c --- /dev/null +++ b/transformer-v2/assets/slidev/NoteDisplay-DHqEdDda.js @@ -0,0 +1 @@ +import{L as e,N as t,V as n,X as r,Y as i,_ as a,_t as o,b as s,bt as c,g as l,it as u,lt as d,m as f,vt as p,w as m,xt as h,y as g,z as _}from"../modules/shiki-BFOesOFp.js";import{nt as v,rt as y}from"../useNav-B1TSwKuf.js";import{l as b}from"./context-ChHKJoK9.js";var x=[`title`],S={key:0,"flex-auto":``},C={"text-primary":``},w={op50:``,"text-sm":``},T={key:0,absolute:``,"inset-y-0":``,"right-0":``,"w-0.5":``,"bg-primary":``,"z-1":``},E=m({__name:`ClicksSlider`,props:{clicksContext:{},readonly:{type:Boolean},active:{type:Boolean,default:!0},resettable:{type:Boolean},compact:{type:Boolean},attached:{type:Boolean}},emits:[`activate`,`reset`],setup(e,{emit:t}){let r=e,i=t,m=l(()=>r.clicksContext.total),E=l(()=>v(0,r.clicksContext.clicksStart,m.value)),D=l(()=>m.value-E.value+1),O=l({get(){return r.resettable&&!r.active||r.clicksContext.current>m.value?-1:r.clicksContext.current},set(e){if(r.resettable&&e<0){i(`reset`),r.clicksContext.current=b;return}i(`activate`),r.clicksContext.current=e}}),k=l(()=>r.resettable&&O.value<0),A=l(()=>y(E.value,m.value+1)),j=d(),M;function N(e){let t=j.value.getBoundingClientRect();return(e.clientX-t.left)/Math.max(1,t.width)}function P(e,t){if(r.readonly||!j.value||!t&&!(e.buttons&1))return;let n=N(e);if(r.resettable&&n<0){O.value=-1;return}let i=v(0,n,t?.999999:1)*D.value,a=v(0,O.value-E.value,D.value-1),o=t?E.value+Math.floor(i):O.value;!t&&i>=a+1.5?o=E.value+Math.floor(i-.5):!t&&i(_(),s(`div`,{class:p([`flex gap-1 select-none`,[e.attached?`items-end`:`items-center`,D.value&&r.clicksContext.isMounted?``:`op50`]]),title:`Clicks in this slide: ${D.value}`},[a(`div`,{class:p([`flex items-center font-mono`,[e.compact?`gap-1 min-w-0 mr0`:`gap-0.2 min-w-16 mr1`,e.attached?`h-[22px]`:``]])},[a(`div`,{class:p([`i-carbon:cursor-1 text-sm op50`,e.compact?`ml-1`:``])},null,2),O.value>=0&&O.value!==o(999999)&&e.active?(_(),s(f,{key:0},[e.compact?g(`v-if`,!0):(_(),s(`div`,S)),a(`span`,null,[a(`span`,C,h(O.value),1),i[2]||=a(`span`,{op25:``,"text-sm":``},`/`,-1),a(`span`,w,h(m.value),1)])],64)):(_(),s(`div`,{key:1,op50:``,class:p(e.compact?``:`flex-auto pl1`)},[a(`span`,{class:p(e.compact?`inline-block text-center`:``),style:c(e.compact?{width:`${String(m.value).length*2+1}ch`,marginLeft:`-0.25ch`}:void 0)},h(m.value),7)],2))],2),a(`div`,{ref_key:`sliderEl`,ref:j,relative:``,"flex-auto":``,"font-mono":``,flex:`~`,"touch-none":``,class:p([e.attached?`h-[22px]`:`h5`,k.value?`op80`:``]),onPointerdownCapture:F,onPointermove:I,onPointerup:i[0]||=e=>u(M)?M.value=void 0:M=void 0,onPointercancel:i[1]||=e=>u(M)?M.value=void 0:M=void 0},[(_(!0),s(f,null,n(A.value,t=>(_(),s(`div`,{key:t,border:`y main`,"of-hidden":``,relative:``,class:p([t===0?`border-l`:``,t===0?e.attached?`rounded-tl`:`rounded-l`:``,t===m.value?`border-r`:``,t===m.value&&+t!=+O.value?e.attached?`rounded-tr`:`rounded-r`:``,e.attached?`border-b-0`:``]),style:c({width:D.value>0?`${1/D.value*100}%`:`100%`})},[a(`div`,{absolute:``,"inset-0":``,class:p(t<=O.value&&e.active?`bg-primary op15`:``)},null,2),+t==+O.value&&e.active?(_(),s(`div`,T)):g(`v-if`,!0),a(`div`,{class:p([+t==+O.value&&e.active?`text-primary font-bold op100`:`op30`,t===m.value?``:`border-r-2 border-main`]),"w-full":``,"h-full":``,"text-xs":``,flex:``,"items-center":``,"justify-center":``,"z-1":``},h(t),3)],6))),128))],34)],10,x))}}),D=[`innerHTML`],O=[`textContent`],k=[`textContent`],A=`slidev-note-fade`,j=`slidev-note-click-mark`,M=m({__name:`NoteDisplay`,props:{class:{},noteHtml:{},note:{},highlight:{type:Boolean,default:!0},placeholder:{},clicksContext:{},autoScroll:{type:Boolean}},emits:[`markerDblclick`,`markerClick`],setup(n,{emit:o}){let c=n,u=o,f=l(()=>c.clicksContext!=null&&c.noteHtml?.includes(j)),m=d(null);function g(){if(!m.value||!f.value)return;let e=Array.from(m.value.querySelectorAll(`.${j}`)),t=new Map,n=new Map,r=0;for(let i of e){let e=Number(i.dataset.clicks);t.set(i,e);let a=i,o=i.parentElement;for(;o&&a!==m.value;)n.has(o)||n.set(o,[[null,r]]),n.get(o).push([a,e]),a=o,o=o.parentElement;r=e}let i=new Map;for(let[e,t]of n){let n=!1,r=0;for(let a of Array.from(e.childNodes)){let o=!1;for(;a===t[r+1]?.[0];)o=!0,r++;if(o)continue;let s=a;if(a.nodeType===3){if(!a.textContent?.trim())continue;s=document.createElement(`span`),s.textContent=a.textContent,e.insertBefore(s,a),a.remove()}n||=r===0,i.set(s,t[r][1])}n||(t[0][1]=-1)}return e=>{let r=c.highlight;for(let[t,i]of n)t.classList.toggle(A,r&&!i.some(([t,n])=>n===e));for(let[t,n]of i)t.classList.toggle(A,r&&n!==e);for(let[n,i]of t)n.classList.remove(A),n.classList.toggle(`${j}-past`,r&&ie+1),n.ondblclick=e=>{r&&(u(`markerDblclick`,e,i),!e.defaultPrevented&&(c.clicksContext.current=i,e.stopPropagation(),e.stopImmediatePropagation()))},n.onclick=e=>{r&&u(`markerClick`,e,i)},r&&c.autoScroll&&i===e&&n.scrollIntoView({block:`center`,behavior:`smooth`})}}let v=d();return i(()=>[c.noteHtml,c.highlight],()=>{t(()=>{v.value=g()})},{immediate:!0}),e(()=>{g()}),r(()=>{let e=c.clicksContext?.current??999999;v.value?.(e)}),(e,t)=>n.noteHtml?(_(),s(`div`,{key:0,ref_key:`noteDisplay`,ref:m,class:p([`prose dark:prose-invert overflow-auto outline-none slidev-note`,[c.class,f.value?`slidev-note-with-clicks`:``]]),innerHTML:n.noteHtml},null,10,D)):n.note?(_(),s(`div`,{key:1,class:p([`prose dark:prose-invert overflow-auto outline-none slidev-note`,c.class])},[a(`p`,{textContent:h(n.note)},null,8,O)],2)):(_(),s(`div`,{key:2,class:p([`prose dark:prose-invert overflow-auto outline-none opacity-50 italic select-none slidev-note`,c.class])},[a(`p`,{textContent:h(c.placeholder||`No notes.`)},null,8,k)],2))}});export{E as n,M as t}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/NoteEditable-B2cQNQfC.js b/transformer-v2/assets/slidev/NoteEditable-B2cQNQfC.js new file mode 100644 index 0000000000000000000000000000000000000000..8fa60637ecca54a7505ff344e62e6ae07d50c84f --- /dev/null +++ b/transformer-v2/assets/slidev/NoteEditable-B2cQNQfC.js @@ -0,0 +1 @@ +import{$ as e,N as t,X as n,Y as r,_t as i,b as a,bt as o,d as s,l as c,lt as l,mt as u,v as d,vt as f,w as p,z as m}from"../modules/shiki-BFOesOFp.js";import{O as h,S as g,o as _}from"../modules/vue-CXhtJkbE.js";import{t as v}from"../index-DBl9KyFJ.js";import{t as y}from"./NoteDisplay-DHqEdDda.js";var b=[`placeholder`],x=p({__name:`NoteEditable`,props:{no:{type:Number,required:!0},class:{default:``},editing:{default:!1},style:{default:()=>({})},placeholder:{default:`No notes for this slide`},clicksContext:{type:Object},highlight:{default:!0},autoHeight:{default:!1}},emits:[`update:editing`,`markerDblclick`,`markerClick`],setup(p,{emit:x}){let S=p,C=x,w=g(S,`editing`,C,{passive:!0}),{info:T,update:E}=v(u(S,`no`)),D=l(``),O,{ignoreUpdates:k}=h(D,e=>{if(!w.value)return;let t=S.no;clearTimeout(O),O=setTimeout(()=>{E({note:e},t)},500)});r(()=>T.value?.note,(e=``)=>{w.value||(clearTimeout(O),k(()=>{D.value=e}))},{immediate:!0,flush:`sync`});let A=l(),j=l();n(()=>{w.value&&A.value?.focus()}),_(A,()=>{w.value=!1});function M(){!S.autoHeight||!A.value||!w.value||A.value.scrollHeight>A.value.clientHeight&&(A.value.style.height=`${A.value.scrollHeight}px`)}function N(e){w.value&&e.metaKey&&e.key===`s`&&(e.preventDefault(),E({note:D.value},S.no))}return r([D,w],()=>{t(()=>{M()})},{flush:`post`,immediate:!0}),(t,n)=>i(w)?e((m(),a(`textarea`,{key:1,ref_key:`inputEl`,ref:A,"onUpdate:modelValue":n[2]||=e=>D.value=e,class:f([`prose dark:prose-invert resize-none overflow-auto outline-none bg-transparent block border-primary border-2 slidev-note placeholder:op25`,[S.class,D.value?``:`italic`]]),style:o([S.style,j.value==null?{}:{height:`${j.value}px`}]),placeholder:p.placeholder,onKeydown:[n[3]||=s(e=>w.value=!1,[`esc`]),N]},null,46,b)),[[c,D.value]]):(m(),d(y,{key:0,class:f([`border-transparent border-2`,[S.class,D.value?``:`opacity-25 italic select-none`]]),style:o(S.style),note:D.value||p.placeholder,"note-html":i(T)?.noteHTML,"clicks-context":p.clicksContext,"auto-scroll":!p.autoHeight,highlight:S.highlight,onMarkerClick:n[0]||=(e,t)=>C(`markerClick`,e,t),onMarkerDblclick:n[1]||=(e,t)=>C(`markerDblclick`,e,t)},null,8,[`class`,`style`,`note`,`note-html`,`clicks-context`,`auto-scroll`,`highlight`]))}});export{x as t}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/TimerBar-CibTdbOq.js b/transformer-v2/assets/slidev/TimerBar-CibTdbOq.js new file mode 100644 index 0000000000000000000000000000000000000000..8a292e77ca8214fea8271116432da53313e90e9f --- /dev/null +++ b/transformer-v2/assets/slidev/TimerBar-CibTdbOq.js @@ -0,0 +1 @@ +import{Q as e,S as t,V as n,_t as r,a as i,b as a,bt as o,g as s,m as c,mt as l,st as u,vt as d,w as f,y as p,z as m}from"../modules/shiki-BFOesOFp.js";import{U as h,t as g,tt as _}from"../useNav-B1TSwKuf.js";import{P as v}from"../modules/vue-CXhtJkbE.js";import{o as y}from"../index-DBl9KyFJ.js";var b={class:`relative flex gap-px`},x=f({__name:`CurrentProgressBar`,props:{clicksContext:{},current:{}},setup(l){let u=l,f=g(),h=s(()=>u.clicksContext??f.clicksContext.value),_=s(()=>u.current??f.currentSlideNo.value),{total:v}=f;return(s,l)=>(m(),a(`div`,b,[(m(!0),a(c,null,n(r(v)-1,n=>(m(),a(`div`,{key:n,class:d([`border-x border-b border-main h-4px transition-all`,n<_.value?`bg-primary border-primary`:``]),style:o({width:`${1/(r(v)-1)*100}%`})},[t(i,{name:`fade`},{default:e(()=>[n===_.value?(m(),a(`div`,{key:0,class:`h-full bg-primary op75 transition-all`,style:o({width:`${h.value.total===0?0:h.value.current/(h.value.total+1)*100}%`})},null,4)):p(`v-if`,!0)]),_:2},1024)],6))),128))]))}});function S(){let e=s(()=>_.timer||`stopwatch`),t=s(()=>h(_.duration).seconds),n=v(100,{controls:!0}),r=l(y,`timer`),i=s(()=>r.value?.status),a=s(()=>(n.counter.value,r.value.status===`stopped`||!r.value.startedAt?0:r.value.status===`paused`?r.value.pausedAt-r.value.startedAt:Date.now()-r.value.startedAt)),o=s(()=>a.value/1e3),c=s(()=>o.value/t.value*100),u=s(()=>{if(e.value===`stopwatch`&&(r.value.status===`stopped`||!r.value.startedAt))return{h:``,m:`-`,s:`--`,ms:`-`};let n=e.value===`countdown`?t.value*1e3-a.value:a.value,i=Math.floor(n/1e3/60/60).toString();i===`0`&&(i=``);let o=Math.floor(n/1e3/60%60).toString();i&&(o=o.padStart(2,`0`));let s=Math.floor(n/1e3%60).toString().padStart(2,`0`),c=Math.floor(n%1e3/100).toString();return{h:i,m:o,s,ms:c}});function d(){n.pause(),r.value={status:`stopped`,slides:{},startedAt:0,pausedAt:0}}function f(){r.value&&(r.value?.status===`stopped`?(r.value.status=`running`,r.value.startedAt=Date.now()):r.value.status===`paused`&&(r.value.status=`running`,r.value.startedAt=Date.now()-(r.value.pausedAt-r.value.startedAt)),n.resume())}function p(){r.value.status=`paused`,r.value.pausedAt=Date.now(),n.pause()}function m(){r.value.status===`running`?p():f()}return{state:r,status:i,timer:u,reset:d,toggle:m,resume:f,pause:p,passed:o,percentage:c,duration:t,mode:e}}var C={class:`border-b mt-px border-main relative flex h-4px`},w=f({__name:`TimerBar`,setup(e){let t=u(S()),n=s(()=>t.status===`stopped`?`op50`:t.status===`paused`?`bg-blue`:t.percentage>100?`bg-red`:t.percentage>80?`bg-yellow`:`bg-green`);return(e,r)=>(m(),a(`div`,C,[t.status===`stopped`?p(`v-if`,!0):(m(),a(`div`,{key:0,class:d([`h-4px`,n.value]),style:o({width:`${t.percentage}%`})},null,6)),p(` {{ timesplits }} `)]))}});export{S as n,x as r,w as t}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/VClicks-BDQlFH0_.js b/transformer-v2/assets/slidev/VClicks-BDQlFH0_.js new file mode 100644 index 0000000000000000000000000000000000000000..8d4840185c7284cb425fc62fcb133864bcab13ac --- /dev/null +++ b/transformer-v2/assets/slidev/VClicks-BDQlFH0_.js @@ -0,0 +1 @@ +import{$ as e,A as t,D as n,L as r,R as i,S as a,W as o,m as s,p as c,v as l,w as u,z as d}from"../modules/shiki-BFOesOFp.js";import{K as f,it as p}from"../useNav-B1TSwKuf.js";import{n as m}from"./context-ChHKJoK9.js";import{u as h}from"../index-DBl9KyFJ.js";var g=u({__name:`VClickGap`,props:{size:{type:[String,Number],default:1}},setup(e){let t=e,{$clicksContext:n}=m(),a=h(),o=+t.size;return Number.isNaN(o)&&(console.warn(`[slidev] Invalid size for VClickGap: ${t.size}`),o=1),r(()=>{let e=n.currentOffset+o-1;n.register(a,{max:e,delta:o})}),i(()=>{n.unregister(a)}),(e,t)=>(d(),l(s))}}),_=[`ul`,`ol`],v=/[\s,]+/,y=u({props:{depth:{type:[Number,String],default:1},every:{type:[Number,String],default:1},at:{type:[Number,String],default:`+1`},hide:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},animation:{type:[String,Array],default:void 0},handleSpecialElements:{type:Boolean,default:!0}},render(){let r=+this.every,i=f(this.at),s=typeof i==`string`,l=this.$slots.default?.();if(i==null||!l)return l;let u=o(`click`),d=(t,n)=>{let r={hide:this.hide};return typeof this.animation==`string`?this.animation.split(v).forEach(e=>{e&&(r[e]=!0)}):Array.isArray(this.animation)&&this.animation.forEach(e=>r[e]=!0),this.fade&&(r.fade=!0),e(t,[[u,n,``,r]])},m=e=>e.flatMap(e=>t(e)&&typeof e.type==`symbol`&&Array.isArray(e.children)?m(e.children):[e]);l=m(p(l));let h=(e,r=1)=>m(e).map(e=>{if(!t(e))return e;if(_.includes(e.type)&&Array.isArray(e.children)){let t=x(e.children,r+1);return n(e,{},t)}return n(e)}),y=1,b=0,x=(e,a=1)=>m(e).map(e=>{if(!t(e)||e.type===c)return e;let o=+i+Math.ceil(y++/r)-1,l;l=a<+this.depth&&Array.isArray(e.children)?n(e,{},h(e.children,a)):n(e);let u=o-b;return b=o,d(l,s?u>=0?`+${u}`:`${u}`:o)}),S=()=>a(g,{size:+i+Math.ceil((y-1)/r)-1-b});if(this.handleSpecialElements){if(l.length===1&&_.includes(l[0].type)&&Array.isArray(l[0].children))return n(l[0],{},[...x(l[0].children),S()]);if(l.length===1&&l[0].type===`table`){let e=l[0];if(Array.isArray(e.children))return n(e,{},e.children.map(e=>t(e)?e.type===`tbody`&&Array.isArray(e.children)?n(e,{},[...x(e.children),S()]):n(e):e))}}return[...x(l),S()]}});export{y as t}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/client-seyoTamJ.js b/transformer-v2/assets/slidev/client-seyoTamJ.js new file mode 100644 index 0000000000000000000000000000000000000000..f1646290573e6113207769947d662bbde88e0ebe --- /dev/null +++ b/transformer-v2/assets/slidev/client-seyoTamJ.js @@ -0,0 +1 @@ +import"../useNav-B1TSwKuf.js";import"./context-ChHKJoK9.js";import"../syncState-BrWO1mSt.js";import"../index-DBl9KyFJ.js";import"../useDrawings-Dnt5VfKs.js"; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/notes-B1c7N93j.js b/transformer-v2/assets/slidev/notes-B1c7N93j.js new file mode 100644 index 0000000000000000000000000000000000000000..229134cfded14bd6f72977f90e09a8118f2fb6be --- /dev/null +++ b/transformer-v2/assets/slidev/notes-B1c7N93j.js @@ -0,0 +1 @@ +import{Q as e,S as t,Y as n,_ as r,_t as i,b as a,bt as o,g as s,lt as c,m as l,w as u,x as d,xt as f,z as p}from"../modules/shiki-BFOesOFp.js";import{$ as m,W as h,t as g,u as _}from"../useNav-B1TSwKuf.js";import{h as v}from"../modules/vue-CXhtJkbE.js";import{m as y,o as b}from"../index-DBl9KyFJ.js";import{t as x}from"./IconButton-B5keGFol.js";import{t as S}from"./Modal-BkELU18P.js";import{n as C,t as w}from"./NoteDisplay-DHqEdDda.js";import{r as T,t as E}from"./TimerBar-CibTdbOq.js";var D={class:`flex my-1`},O={class:`h-full flex flex-col`},k={class:`flex-none border-t border-main`,px3:``,py2:``},A={class:`flex-none border-t border-main`},j={class:`flex gap-1 items-center px-6 py-3`},M={key:0,class:`i-carbon:minimize`},N={key:1,class:`i-carbon:maximize`},P={class:`px2 my-auto`},F={class:`text-lg`},I={class:`opacity-50 text-sm`},L=u({__name:`notes`,setup(u){y({title:`Notes - ${m}`});let{slides:L,total:R}=g(),{isFullscreen:z,toggle:B}=_,V=c(),H=v(`slidev-notes-font-size`,18),U=s(()=>b.page),W=c(!1),G=s(()=>L.value.find(e=>e.no===U.value));n(U,()=>{V.value?.scrollTo({left:0,top:0,behavior:`smooth`}),window.scrollTo({left:0,top:0,behavior:`smooth`})});function K(){H.value+=1}function q(){--H.value}let J=s(()=>{let e=b.clicks,t=b.clicksTotal;return h(c(e),void 0,t)});return(n,s)=>(p(),a(l,null,[t(S,{modelValue:W.value,"onUpdate:modelValue":s[1]||=e=>W.value=e,class:`px-6 py-4 flex flex-col gap-2`},{default:e(()=>[s[3]||=r(`div`,{class:`flex gap-2 text-xl`},[r(`div`,{class:`i-carbon:information my-auto`}),d(` Help `)],-1),s[4]||=r(`div`,{class:`prose dark:prose-invert`},[r(`p`,null,`This is the hands-free live notes viewer.`),r(`p`,null,`It's designed to be used in a separate view or device. The progress is controlled by and auto synced with the main presenter or slide.`)],-1),r(`div`,D,[r(`button`,{class:`slidev-form-button`,onClick:s[0]||=e=>W.value=!1},` Close `)])]),_:1},8,[`modelValue`]),r(`div`,O,[t(T,{"clicks-context":J.value,current:U.value},null,8,[`clicks-context`,`current`]),t(E),r(`div`,{ref_key:`scroller`,ref:V,class:`px-5 py-3 flex-auto h-full overflow-auto`,style:o({fontSize:`${i(H)}px`})},[t(w,{note:G.value?.meta.slide.note,"note-html":G.value?.meta.slide.noteHTML,placeholder:`No notes for Slide ${U.value}.`,"clicks-context":J.value,"auto-scroll":!0},null,8,[`note`,`note-html`,`placeholder`,`clicks-context`])],4),r(`div`,k,[t(C,{"clicks-context":J.value,readonly:``},null,8,[`clicks-context`])]),r(`div`,A,[r(`div`,j,[t(x,{title:i(z)?`Close fullscreen`:`Enter fullscreen`,onClick:i(B)},{default:e(()=>[i(z)?(p(),a(`div`,M)):(p(),a(`div`,N))]),_:1},8,[`title`,`onClick`]),t(x,{title:`Increase font size`,onClick:K},{default:e(()=>[...s[5]||=[r(`div`,{class:`i-carbon:zoom-in`},null,-1)]]),_:1}),t(x,{title:`Decrease font size`,onClick:q},{default:e(()=>[...s[6]||=[r(`div`,{class:`i-carbon:zoom-out`},null,-1)]]),_:1}),t(x,{title:`Edit notes`,to:`/notes-edit`,target:`_blank`},{default:e(()=>[...s[7]||=[r(`div`,{class:`i-carbon:edit`},null,-1)]]),_:1}),t(x,{title:`Help`,class:`rounded-full`,onClick:s[2]||=e=>W.value=!0},{default:e(()=>[...s[8]||=[r(`div`,{class:`i-carbon:help`},null,-1)]]),_:1}),s[9]||=r(`div`,{class:`flex-auto`},null,-1),r(`div`,P,[r(`span`,F,f(U.value),1),r(`span`,I,` / `+f(i(R)),1)])])])])],64))}});export{L as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/notes-edit-Df8w7NFL.js b/transformer-v2/assets/slidev/notes-edit-Df8w7NFL.js new file mode 100644 index 0000000000000000000000000000000000000000..c5052f8bb036e9e847b15f2c263d480d59815a09 --- /dev/null +++ b/transformer-v2/assets/slidev/notes-edit-Df8w7NFL.js @@ -0,0 +1,2 @@ +import{$ as e,Q as t,S as n,_ as r,b as i,l as a,lt as o,m as s,w as c,x as l,z as u}from"../modules/shiki-BFOesOFp.js";import{$ as d,t as f}from"../useNav-B1TSwKuf.js";import{D as p}from"../modules/vue-CXhtJkbE.js";import{m,t as h}from"../index-DBl9KyFJ.js";import{t as g}from"./IconButton-B5keGFol.js";import{t as _}from"./Modal-BkELU18P.js";var v={class:`flex my-1`},y={class:`h-full`},b={class:`slidev-glass-effect fixed bottom-5 right-5 rounded-full border border-main`},x=c({__name:`notes-edit`,setup(c){let x=/^---\s*#(\d+)\s*$/;m({title:`Notes Edit - ${d}`});let{slides:S}=f(),C=o(!1),w=o(T(S.value));function T(e){let t=[];for(let n of e)n.meta.slide.note?.trim()&&(t.push(`--- #${n.no}`),t.push(``),t.push(n.meta.slide.note),t.push(``));return t.join(` +`)}function E(e,t){let n=e.split(/^(---\s*#\d+\s*)$/gm);n.forEach((e,r)=>{let i=e.match(x);if(i){let e=Number.parseInt(i[1]),a=n[r+1].trim(),o=t.find(t=>t.no===e);o&&(o.meta.slide.note=a,h(e).update({note:a}))}})}return p(w,e=>{E(e,S.value)},{debounce:300}),(o,c)=>(u(),i(s,null,[n(_,{modelValue:C.value,"onUpdate:modelValue":c[1]||=e=>C.value=e,class:`px-6 py-4 flex flex-col gap-2`},{default:t(()=>[c[4]||=r(`div`,{class:`flex gap-2 text-xl`},[r(`div`,{class:`i-carbon:information my-auto`}),l(` Help `)],-1),c[5]||=r(`div`,{class:`prose dark:prose-invert`},[r(`p`,null,`This is the batch notes editor. You can edit the notes for all the slides at once here.`),r(`p`,null,[l(`The note for each slide are separated by `),r(`code`,null,`--- #[no]`),l(` lines, you might want to keep them while editing.`)])],-1),r(`div`,v,[r(`button`,{class:`slidev-form-button`,onClick:c[0]||=e=>C.value=!1},` Close `)])]),_:1},8,[`modelValue`]),r(`div`,y,[r(`div`,b,[n(g,{title:`Help`,class:`rounded-full`,onClick:c[2]||=e=>C.value=!0},{default:t(()=>[...c[6]||=[r(`div`,{class:`i-carbon:help text-2xl`},null,-1)]]),_:1})]),e(r(`textarea`,{"onUpdate:modelValue":c[3]||=e=>w.value=e,class:`prose dark:prose-invert resize-none p5 outline-none bg-transparent block h-full w-full! max-w-full! max-h-full! min-h-full! min-w-full!`},null,512),[[a,w.value]])])],64))}});export{x as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/overview-BcBOtip-.js b/transformer-v2/assets/slidev/overview-BcBOtip-.js new file mode 100644 index 0000000000000000000000000000000000000000..ca251df9ab01ea5e47b3de9af6f9da95433a5954 --- /dev/null +++ b/transformer-v2/assets/slidev/overview-BcBOtip-.js @@ -0,0 +1 @@ +import{L as e,N as t,Q as n,R as r,S as i,V as a,_ as o,_t as s,b as c,bt as l,ft as u,g as d,lt as f,m as p,st as m,v as h,vt as g,w as ee,xt as _,y as v,z as y}from"../modules/shiki-BFOesOFp.js";import{$ as te,B as b,G as ne,R as x,X as re,Y as S,t as ie}from"../useNav-B1TSwKuf.js";import{t as C}from"../_plugin-vue_export-helper-BDNMzG2s.js";import{B as ae,z as oe}from"../modules/vue-CXhtJkbE.js";import{l as w}from"./context-ChHKJoK9.js";import{d as se,f as T,m as ce,p as le}from"../index-DBl9KyFJ.js";import{t as E}from"./IconButton-B5keGFol.js";import{n as D}from"./NoteDisplay-DHqEdDda.js";import{n as ue,r as de}from"../modules/unplugin-icons-Btg0kt9H.js";import{i as fe,o as pe,t as me}from"../SlideWrapper-CbvN8YIq.js";import{t as he}from"./NoteEditable-B2cQNQfC.js";var ge={class:`h-screen w-screen of-hidden flex`},_e={key:0,class:`grid grid-rows-[auto_max-content] border-r border-main select-none max-h-full h-full`},ve={class:`relative`},ye={class:`absolute left-0 top-0 bottom-0 w-200 flex flex-col flex-auto items-end group p-6px md:p-10px gap-1 max-h-full of-x-visible of-y-auto`,style:{direction:`rtl`}},be=[`onClick`],xe={p2:``,border:`t main`},Se={class:`flex flex-col gap-1 mx-1 items-end`},Ce={key:0,class:`flex items-end gap-2`},we=[`onClick`],Te=[`onDblclick`],Ee={key:2,class:`select-none absolute bottom-0 right-0 bg-main rounded-tl p2 op35 text-xs`},De={key:1,class:`absolute z-2 top-0 right-0 px3 py1.5 border-b border-l rounded-lb bg-main/80 backdrop-blur border-main select-none`},Oe={class:`text-xs op50`},O=450,k=C(ee({__name:`overview`,setup(ee){ce({title:`Overview - ${te}`});let C=oe(),k=ae(),{openInEditor:ke,slides:A,isEmbedded:j}=ie(),M=d(()=>C.query.mode===`preview`),N=d(()=>M.value&&j.value),P=d(()=>M.value?N.value?Math.max(0,x.width.value-16):Math.min(900,Math.max(320,x.width.value-160)):O),Ae=d(()=>P.value/re.value),F=m(new Map),I=m(new Map),L=f([]),R=f(),z=f(null),B=0,V,H,U=d(()=>A.value.map(e=>Pe(e.meta?.slide?.note||``))),je=d(()=>U.value.reduce((e,t)=>e+t,0)),Me=d(()=>A.value.map(e=>q(e)).reduce((e,t)=>e+t,0)),Ne=d(()=>String(Math.max(1,A.value.length)).length),W=u(),G=new WeakMap;function K(e){return G.has(e)||G.set(e,ne(e,w)),G.get(e)}function q(e){return e.meta?.clicks||K(e)?.total}function J(e){W.value===e?W.value=void 0:W.value=e}function Pe(e){let t=e.match(/[\w`'\-\u0392-\u03C9\u00C0-\u00FF\u0600-\u06FF\u0400-\u04FF]+|[\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u3040-\u309F\uAC00-\uD7AF]+/g),n=0;if(!t)return 0;for(let e=0;e=19968?n+=t[e].length:n+=1;return n}function Fe(){let e=window.innerHeight||document.documentElement.clientHeight,t,n=[];for(let[r,i]of F.entries()){let a=i.getBoundingClientRect(),o=Math.max(0,Math.min(a.bottom,e)-Math.max(a.top,0));o!==0&&(o>=a.height&&n.push(r),(!t||o>t.visibleHeight)&&(t={idx:r,visibleHeight:o}))}L.value=n.length?n:t?[t.idx]:[]}function Y(e){let t=document.createElement(`a`);t.target=`_blank`,t.href=S+e.slice(1),t.click()}function Ie(e){let t=new URL(S+e.slice(1),location.href).href;if(j.value){window.parent.postMessage({target:`slidev`,sender:`slidev`,type:`open-external`,url:t},`*`);return}Y(e)}function Le(e){let t=F.get(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})}function X(e){let t=I.get(e)||F.get(e);if(!t||!R.value)return null;let n=R.value.getBoundingClientRect();return t.getBoundingClientRect().top-n.top+R.value.scrollTop}function Z(e){if(!R.value||A.value.length===0)return;let t=Math.min(Math.max(e,1),A.value.length),n=Math.floor(t)-1,r=t-(n+1),i=X(n),a=X(n+1);if(i==null)return;let o=i+(a==null?0:(a-i)*r)-R.value.clientHeight*.5;Math.abs(R.value.scrollTop-o)<1||R.value.scrollTo({top:o})}function Re(){let e=C.query.slideNo,t=Number(Array.isArray(e)?e[0]:e);return Number.isFinite(t)&&t>0?t:void 0}function Q(e){if(!N.value)return;let t=Number(e.toFixed(3)).toString();C.query.slideNo!==t&&k.replace({query:{...C.query,slideNo:t}})}function ze(){if(!R.value||A.value.length===0)return null;let e=R.value.scrollTop+R.value.clientHeight*.5,t=A.value.map((e,t)=>X(t)).filter(e=>e!=null);if(t.length===0)return null;if(t.length===1||e<=t[0])return 1;for(let n=1;n{H=void 0;let e=V;V=void 0,e!=null&&(Q(e),!(Date.now()0&&(B=Date.now()+300,V=void 0,Q(t),Z(t))}function He(e,t,n){let r=K(n);r.current=r.current===t?w:t,e.preventDefault()}function Ue(e,t){if(e.ctrlKey||e.metaKey){e.preventDefault(),Ie(b(t,!1));return}let n=t.meta?.slide;n&&window.parent.postMessage({target:`slidev`,type:`command`,command:`goto`,args:[n.filepath,n.sourceIndex]},`*`)}return e(()=>{window.addEventListener(`message`,$);let e=N.value?Re():void 0;e!=null&&(B=Date.now()+300,Z(e)),t(()=>{e!=null&&Z(e),Fe()})}),r(()=>{window.removeEventListener(`message`,$),H&&clearTimeout(H)}),(e,t)=>{let r=ue,u=de;return y(),c(`div`,ge,[s(j)?v(`v-if`,!0):(y(),c(`nav`,_e,[o(`div`,ve,[o(`div`,ye,[(y(!0),c(p,null,a(s(A),(e,t)=>(y(),c(`div`,{key:e.no,class:`relative`,style:{direction:`ltr`}},[o(`button`,{class:g([`relative transition duration-300 w-8 h-8 rounded hover:bg-active hover:op100`,L.value.includes(t)?`op100 text-primary bg-gray:5`:`op20`]),onClick:e=>Le(t)},[o(`div`,null,_(t+1),1)],10,be),e.meta?.slide?.title?(y(),c(`div`,{key:0,class:g([`pointer-events-none select-none absolute left-110% top-50% translate-y--50% ws-nowrap z-label px2 slidev-glass-effect transition duration-400 op0 group-hover:op100`,L.value.includes(t)?`text-primary`:`text-main important-text-op-50`])},_(e.meta?.slide?.title),3)):v(`v-if`,!0)]))),128))])]),o(`div`,xe,[s(se)?(y(),h(E,{key:1,title:s(T)?`Dark mode`:`Light mode`,"pointer-events-none":``,op50:``},{default:n(()=>[s(T)?(y(),h(r,{key:0})):(y(),h(u,{key:1}))]),_:1},8,[`title`])):(y(),h(E,{key:0,title:s(T)?`Switch to light mode theme`:`Switch to dark mode theme`,onClick:t[0]||=e=>s(le)()},{default:n(()=>[s(T)?(y(),h(r,{key:0})):(y(),h(u,{key:1}))]),_:1},8,[`title`]))])])),o(`main`,{ref_key:`scroller`,ref:R,class:`flex-1 h-full of-auto`,style:l(`grid-template-columns: repeat(auto-fit,minmax(${O}px,1fr))`),onScroll:Ve},[(y(!0),c(p,null,a(s(A),(e,r)=>(y(),c(`div`,{key:e.no,ref_for:!0,ref:e=>F.set(r,e),class:g([`overview-slide-block relative of-hidden flex gap-4 min-h-50`,[r===0&&!N.value?`pt2`:``,N.value?`justify-center`:`border-t border-main`]])},[N.value?v(`v-if`,!0):(y(),c(`div`,{key:0,class:g([`select-none text-right my5 flex flex-col justify-between items-end`,M.value?`w-9`:`w-13`]),style:l({height:`${Ae.value}px`})},[o(`div`,{class:`self-center text-3xl op20 mb2 text-center mr--14px tabular-nums`,style:l({width:`${Ne.value}ch`})},_(r+1),5),o(`div`,Se,[i(E,{class:g([`overview-slide-action mr--4 op0`,M.value?`text-lg`:``]),title:`Play in new tab`,onClick:t=>Y(s(b)(e,!1))},{default:n(()=>[...t[4]||=[o(`div`,{class:`i-carbon:presentation-file`},null,-1)]]),_:1},8,[`class`,`onClick`]),v(`v-if`,!0)])],6)),o(`div`,{class:g([`flex flex-col`,N.value?`my1 gap-0`:`my5 gap-2`]),style:l({width:`${P.value}px`})},[N.value?(y(),c(`div`,Ce,[o(`button`,{type:`button`,class:`select-none pl-1 text-lg leading-tight op60 tabular-nums hover:op90 hover:underline underline-offset-2`,onClick:t=>Ue(t,e)},_(r+1),9,we),q(e)?(y(),h(D,{key:0,active:W.value===e,"clicks-context":K(e),resettable:``,compact:``,attached:``,class:`ml-auto w-88 min-w-[70%] max-w-[calc(100%-3rem)]`,onDblclick:t=>J(e),onActivate:t=>W.value=e,onReset:t[1]||=e=>W.value=void 0},null,8,[`active`,`clicks-context`,`onDblclick`,`onActivate`])):v(`v-if`,!0)])):v(`v-if`,!0),o(`div`,{ref_for:!0,ref:e=>I.set(r,e),class:g([`border rounded border-main overflow-hidden bg-main h-max`,[N.value&&q(e)?`rounded-tr-0`:``,N.value?``:`select-none`]]),onDblclick:t=>!N.value&&Y(s(b)(e,!1))},[(y(),h(fe,{key:e.no,width:P.value,class:g(N.value?``:`pointer-events-none important:[&_*]:select-none`)},{default:n(()=>[i(me,{"clicks-context":K(e),route:e,"render-context":`overview`},null,8,[`clicks-context`,`route`]),i(pe,{page:e.no},null,8,[`page`])]),_:2},1032,[`width`,`class`]))],42,Te),q(e)&&!N.value?(y(),h(D,{key:1,active:W.value===e,"clicks-context":K(e),resettable:``,class:g([`ml-1 w-[calc(100%-0.25rem)]`,M.value?``:`mt-2`]),onDblclick:t=>J(e),onActivate:t=>W.value=e,onReset:t[2]||=e=>W.value=void 0},null,8,[`active`,`clicks-context`,`class`,`onDblclick`,`onActivate`])):v(`v-if`,!0)],6),M.value?v(`v-if`,!0):(y(),h(he,{key:1,no:e.no,class:`relative z-1 max-w-250 w-250 text-lg rounded p3`,"auto-height":!0,highlight:W.value===e,editing:z.value===e.no,"clicks-context":K(e),onDblclick:t=>z.value===e.no?null:z.value=e.no,"onUpdate:editing":t[3]||=e=>z.value=null,onMarkerClick:(t,n)=>He(t,n,e)},null,8,[`no`,`highlight`,`editing`,`clicks-context`,`onDblclick`,`onMarkerClick`])),!M.value&&U.value[r]>0?(y(),c(`div`,Ee,_(U.value[r])+` words `,1)):v(`v-if`,!0)],2))),128))],36),s(j)?v(`v-if`,!0):(y(),c(`div`,De,[o(`div`,Oe,_(s(A).length)+` slides · `+_(Me.value+s(A).length-1)+` clicks · `+_(je.value)+` words `,1)]))])}}}),[[`__scopeId`,`data-v-47f32601`]]);export{k as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/play-BqFUT58m.js b/transformer-v2/assets/slidev/play-BqFUT58m.js new file mode 100644 index 0000000000000000000000000000000000000000..bdf8089c79ede8d1b88e045751bbf810a9ecb3d2 --- /dev/null +++ b/transformer-v2/assets/slidev/play-BqFUT58m.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DrawingControls--3fQRT-C.js","../rolldown-runtime-hePW80VL.js","../modules/shiki-BFOesOFp.js","../modules/shiki-BrmBd2_v.css","../modules/vue-CXhtJkbE.js","../useDrawings-Dnt5VfKs.js","../useNav-B1TSwKuf.js","../_plugin-vue_export-helper-BDNMzG2s.js","./context-ChHKJoK9.js","../index-DBl9KyFJ.js","../syncState-BrWO1mSt.js","../index-DmzORiUY.css","./IconButton-B5keGFol.js","./VerticalDivider-D_ScNBWw.js","../DrawingControls-Dhbx0szf.css"])))=>i.map(i=>d[i]); +import{Q as e,S as t,Y as n,_ as r,_t as i,b as a,bt as o,ft as s,g as c,it as l,lt as u,m as d,ot as f,v as p,vt as m,w as h,x as g,y as _,z as v}from"../modules/shiki-BFOesOFp.js";import{E as y,F as b,I as x,f as S,h as C,k as w,q as T,t as E,tt as D,v as O,w as k}from"../useNav-B1TSwKuf.js";import{S as A,p as j}from"../modules/vue-CXhtJkbE.js";import{o as M}from"../index-DBl9KyFJ.js";import{t as N}from"../useDrawings-Dnt5VfKs.js";import{t as P}from"./Modal-BkELU18P.js";import{t as F}from"../modules/unplugin-icons-Btg0kt9H.js";import{i as I}from"../SlideWrapper-CbvN8YIq.js";import{a as L,c as R,d as z,f as B,l as V,n as H,r as U,s as W,t as G,u as K}from"./shortcuts-C1z9JmOm.js";var q=2e3;function J(e){let t=c(()=>e.value&&S.value);function r(){document.body.style.cursor=`none`}function i(){document.body.style.cursor=``}let a=null;n(t,e=>{e||(i(),a&&clearTimeout(a),a=null)}),f(()=>{i(),a&&clearTimeout(a),a=null}),j(document.body,[`pointermove`,`pointerdown`],()=>{i(),a&&clearTimeout(a),a=t.value?setTimeout(r,q):null},{passive:!0})}``+new URL(`../logo-BYkHSa_O.png`,import.meta.url).href;var Y={class:`slidev-info-dialog slidev-layout flex flex-col gap-4 text-base`},X=[`innerHTML`],Z=h({__name:`InfoDialog`,props:{modelValue:{default:!1}},emits:[`update:modelValue`],setup(t,{emit:n}){let o=A(t,`modelValue`,n),s=c(()=>typeof D.info==`string`);return(t,n)=>(v(),p(P,{modelValue:i(o),"onUpdate:modelValue":n[0]||=e=>l(o)?o.value=e:null,class:`px-6 py-4`},{default:e(()=>[r(`div`,Y,[s.value?(v(),a(`div`,{key:0,class:`mb-4`,innerHTML:i(D).info},null,8,X)):_(`v-if`,!0),n[1]||=r(`a`,{href:`https://github.com/slidevjs/slidev`,target:`_blank`,class:`!opacity-100 !border-none !text-current`},[r(`div`,{class:`flex gap-1 children:my-auto`},[r(`div`,{class:`opacity-50 text-sm mr-2`},`Powered by`),r(`img`,{class:`w-5 h-5`,src:``+new URL(`../logo-BYkHSa_O.png`,import.meta.url).href,alt:`Slidev logo`}),r(`div`,{style:{color:`#2082A6`}},[r(`b`,null,`Sli`),g(`dev `)])])],-1)])]),_:1},8,[`modelValue`]))}}),Q=h({__name:`Controls`,setup(e){let{isEmbedded:n}=E(),r=!D.drawings.presenterOnly&&!n.value,o=s();r&&T(()=>import(`./DrawingControls--3fQRT-C.js`).then(e=>e.n).then(e=>o.value=e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);let c=s(),u=s();return(e,n)=>(v(),a(d,null,[o.value?(v(),p(i(o),{key:0})):_(`v-if`,!0),t(W),t(R),c.value?(v(),p(i(c),{key:1})):_(`v-if`,!0),u.value?(v(),p(i(u),{key:2,modelValue:i(w),"onUpdate:modelValue":n[0]||=e=>l(w)?w.value=e:null},null,8,[`modelValue`])):_(`v-if`,!0),i(D).info?(v(),p(Z,{key:3,modelValue:i(y),"onUpdate:modelValue":n[1]||=e=>l(y)?y.value=e:null},null,8,[`modelValue`])):_(`v-if`,!0),t(V)],64))}}),$={key:0,class:`absolute top-0 left-0 right-0 bottom-0 pointer-events-none text-xl`},ee=h({__name:`PresenterMouse`,setup(e){return(e,n)=>{let r=F;return i(M).cursor?.style===`cursor`?(v(),a(`div`,$,[t(r,{class:`absolute stroke-white dark:stroke-black`,style:o({left:`${i(M).cursor.x}%`,top:`${i(M).cursor.y}%`,strokeWidth:16})},null,8,[`style`])])):_(`v-if`,!0)}}}),te=h({__name:`play`,setup(n){let{next:o,prev:l,isPrintMode:f,isPlaying:h,isEmbedded:g}=E(),{isDrawing:y}=N(),S=u();function w(e){k.value||e.button===0&&e.target?.id===`slide-container`&&(e.pageX/window.innerWidth>.5?o():l())}B(S),G(),z(),J(c(()=>h.value&&!g.value&&!k.value));let T=c(()=>O.value||k.value),D=s(),A=c(()=>{let e=``;return b.value.brightness!==x.brightness&&(e+=`brightness(${b.value.brightness}) `),b.value.contrast!==x.contrast&&(e+=`contrast(${b.value.contrast}) `),b.value.sepia!==x.sepia&&(e+=`sepia(${b.value.sepia}) `),b.value.hueRotate!==x.hueRotate&&(e+=`hue-rotate(${b.value.hueRotate}deg) `),b.value.invert&&(e+=`invert(1) `),{filter:e}});return(n,o)=>(v(),a(d,null,[r(`div`,{id:`page-root`,ref_key:`root`,ref:S,class:m([`grid`,i(C)?`grid-rows-[1fr_max-content]`:`grid-cols-[1fr_max-content]`])},[t(I,{style:{background:`var(--slidev-slide-container-background, black)`},"is-main":``,"content-style":A.value,onPointerdown:w,onContextmenu:i(K)},{default:e(()=>[t(H,{"render-context":`slide`}),t(ee),t(L)]),controls:e(()=>[i(f)?_(`v-if`,!0):(v(),a(`div`,{key:0,class:m([`absolute bottom-0 left-0 transition duration-300 opacity-0 hover:opacity-100 focus-within:opacity-100 focus-visible:opacity-100`,[T.value?`!opacity-100 right-0`:`opacity-0 p-2`,i(y)?`pointer-events-none`:``]])},[t(U,{persist:T.value},null,8,[`persist`])],2))]),_:1},8,[`content-style`,`onContextmenu`]),D.value&&i(k)?(v(),p(i(D),{key:0,resize:!0})):_(`v-if`,!0)],2),i(f)?_(`v-if`,!0):(v(),p(Q,{key:0})),o[0]||=r(`div`,{id:`twoslash-container`},null,-1)],64))}});export{te as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/presenter-DzmhzatR.js b/transformer-v2/assets/slidev/presenter-DzmhzatR.js new file mode 100644 index 0000000000000000000000000000000000000000..5dd82a73e98d8ac216fd92dbb5901a4503e9ded0 --- /dev/null +++ b/transformer-v2/assets/slidev/presenter-DzmhzatR.js @@ -0,0 +1 @@ +import{$ as e,J as t,L as n,Q as r,S as i,X as a,Y as o,_ as s,_t as c,b as l,bt as u,ft as d,g as f,it as ee,lt as p,m as te,u as ne,v as m,vt as h,w as g,x as _,xt as v,y,z as b}from"../modules/shiki-BFOesOFp.js";import{$ as re,O as ie,W as ae,a as oe,b as x,m as se,o as ce,t as le,w as ue,x as de}from"../useNav-B1TSwKuf.js";import{t as S}from"../_plugin-vue_export-helper-BDNMzG2s.js";import{_ as C,h as w,p as T,w as fe}from"../modules/vue-CXhtJkbE.js";import{m as pe,n as E,o as me}from"../index-DBl9KyFJ.js";import{t as he}from"../useDrawings-Dnt5VfKs.js";import{t as ge}from"./DrawingControls--3fQRT-C.js";import{t as _e}from"./IconButton-B5keGFol.js";import{n as ve,t as D}from"./NoteDisplay-DHqEdDda.js";import{n as O,r as ye,t as be}from"./TimerBar-CibTdbOq.js";import{i as k,t as xe}from"../SlideWrapper-CbvN8YIq.js";import"./NoteEditable-B2cQNQfC.js";import{a as Se,c as Ce,d as we,f as Te,i as Ee,l as De,n as Oe,o as ke,r as Ae,s as je,t as Me,u as Ne}from"./shortcuts-C1z9JmOm.js";var Pe=g({__name:`NoteStatic`,props:{no:{},class:{},clicksContext:{}},setup(e){let t=e,{info:n}=E(t.no);return(r,i)=>(b(),m(D,{class:h(t.class),note:c(n)?.note,"note-html":c(n)?.noteHTML,"clicks-context":e.clicksContext},null,8,[`class`,`note`,`note-html`,`clicks-context`]))}}),A={"h-full":``,"w-full":``},j={key:0,"w-full":``,"h-full":``,flex:`~ col gap-4 items-center justify-center`},Fe=g({__name:`ScreenCaptureMirror`,setup(n){let r=t(`video`),i=d(null),a=d(!1);async function o(){i.value=await navigator.mediaDevices.getDisplayMedia({video:{cursor:`always`},audio:!1,selfBrowserSurface:`include`,preferCurrentTab:!1}),r.value.srcObject=i.value,r.value.play(),a.value=!0,i.value.addEventListener(`inactive`,()=>{r.value.srcObject=null,a.value=!1}),i.value.addEventListener(`ended`,()=>{r.value.srcObject=null,a.value=!1})}return(t,n)=>(b(),l(`div`,A,[e(s(`video`,{ref_key:`video`,ref:r,class:`w-full h-full object-contain`},null,512),[[ne,a.value]]),a.value?y(`v-if`,!0):(b(),l(`div`,j,[n[0]||=s(`div`,{op50:``},[_(` Use screen capturing to mirror your main screen back to presenter view.`),s(`br`),_(` Click the button below and `),s(`b`,null,`select your other monitor or window`),_(`. `)],-1),s(`button`,{class:`slidev-form-button`,onClick:o},` Start Screen Mirroring `)]))]))}}),M={class:`w-22px cursor-pointer`},N={class:`group-not-hover:hidden flex flex-col items-center`},P={key:0,class:`i-carbon:pause text-lg`},F={key:1,class:`i-carbon:play`},I={class:`text-3xl px-3 my-auto font-mono`},Ie=g({__name:`TimerInlined`,setup(e){let{status:t,percentage:n,mode:r,timer:i,reset:a,toggle:o}=O(),u=f(()=>t.value===`stopped`?`op50`:t.value===`paused`?`text-blue6 dark:text-blue3`:n.value>100?`text-red6 dark:text-red3`:n.value>80?`text-yellow6 dark:text-yellow3`:`text-green6 dark:text-green3`);return(e,n)=>(b(),l(`div`,{class:h([`group flex items-center justify-center pl-4 select-none`,u.value])},[s(`div`,M,[s(`div`,{class:h([`group-hover:hidden text-2xl`,c(r)===`countdown`?`i-carbon:timer`:`i-carbon:time`])},null,2),s(`div`,N,[s(`div`,{class:`relative op-80 hover:op-100`,onClick:n[0]||=(...e)=>c(o)&&c(o)(...e)},[c(t)===`running`?(b(),l(`div`,P)):(b(),l(`div`,F))]),s(`div`,{class:`op-80 hover:op-100`,onClick:n[1]||=(...e)=>c(a)&&c(a)(...e)},[...n[2]||=[s(`div`,{class:`i-carbon:renew`},null,-1)]])])]),s(`div`,I,[c(i).h?(b(),l(te,{key:0},[s(`span`,null,v(c(i).h),1),n[3]||=s(`span`,{op50:``},`:`,-1)],64)):y(`v-if`,!0),s(`span`,null,v(c(i).m),1),n[4]||=s(`span`,{op50:``},`:`,-1),s(`span`,null,v(c(i).s),1)])],2))}}),Le={class:`bg-main h-full slidev-presenter grid grid-rows-[max-content_1fr] of-hidden`},Re={flex:`~ gap-4 items-center`,border:`b main`,p1:``},ze={class:`relative grid-section next flex flex-col p-2 lg:p-4`},Be={key:2,class:`h-full flex justify-center items-center`},Ve={key:3,class:`h-full grid grid-rows-[1fr_min-content]`},L=S(g({__name:`presenter`,setup(t){let g=fe(),_=p(),v=p(),S=p(),E=p();Me(),Te(_),we();let{clicksContext:D,currentSlideNo:O,currentSlideRoute:A,hasNext:j,nextRoute:M,slides:N,getPrimaryClicks:P}=le(),{isDrawing:F}=he();pe({title:`Presenter - ${re}`}),p(!1);let I=f(()=>N.value.map(e=>{let t=p(0);return{context:ae(t,e?.meta.slide?.frontmatter.clicksStart??0,e?.meta.clicks),clicks:t}})),L=f(()=>D.value.currentL.value&&I.value[L.value[0].no-1]);o(L,()=>{R.value&&L.value&&(R.value.clicks.value=L.value[1])},{immediate:!0});let z=w(`slidev-presenter-main-slide-mode`,`slides`),B=w(`slidev-presenter-notes-width`,360),V=w(`slidev-presenter-notes-row-size`,280),He=p(0),H=p(!1),U=p(!1),Ue=p(0),W=p(360),We=p(0),G=p(280),K={minNotesWidth:240,maxNotesWidth:720,minNotesRowSize:160,maxNotesWidthRatio:.7,maxNotesRowHeightRatio:.75},Ge=C(`(min-aspect-ratio: 1/1)`),q=C(`(max-aspect-ratio: 3/5)`),J=f(()=>x.value===1&&Ge.value),Y=f(()=>!(x.value===1&&q.value)),X=f(()=>x.value===1&&!q.value||x.value===2||x.value===3),Ke=f(()=>x.value===1&&!q.value);function qe(e){return Number.isFinite(e)?Math.max(K.minNotesWidth,Math.min(K.maxNotesWidth,Math.round(e))):K.minNotesWidth}function Je(e){let t=v.value;if(!t)return;let n=t.getBoundingClientRect(),r=e-Ue.value,i=qe(J.value?W.value-r:W.value+r),a=Math.round(n.width*K.maxNotesWidthRatio);B.value=Math.min(i,Math.max(K.minNotesWidth,a))}function Z(e){Y.value&&e.button===0&&(e.preventDefault(),Ue.value=e.clientX,W.value=B.value,H.value=!0)}function Q(e){return Number.isFinite(e)?Math.max(K.minNotesRowSize,Math.round(e)):K.minNotesRowSize}function Ye(e){let t=v.value;if(!t)return;let n=t.getBoundingClientRect(),r=e-We.value,i=Ke.value?G.value-r:G.value+r,a=Math.round(n.height*K.maxNotesRowHeightRatio);V.value=Math.min(Q(i),Math.max(K.minNotesRowSize,a))}function Xe(e){if(!X.value||e.button!==0)return;e.preventDefault();let t=x.value===2?_.value?.getBoundingClientRect().height:S.value?.getBoundingClientRect().height;We.value=e.clientY,G.value=Q(t??V.value),U.value=!0}function Ze(){let e=E.value;e&&(He.value=Math.round(e.getBoundingClientRect().height))}function Qe(){H.value=!1,U.value=!1}function $e(){Ze(),et()}T(window,`pointermove`,e=>{H.value&&Je(e.clientX),U.value&&Ye(e.clientY)}),T(window,`pointerup`,Qe),T(window,`pointercancel`,Qe),n(()=>{$e()}),T(window,`resize`,()=>{$e()});function et(){B.value=qe(B.value),V.value=Q(V.value);let e=v.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.round(t.width*K.maxNotesWidthRatio),r=Math.round(t.height*K.maxNotesRowHeightRatio);B.value=Math.min(B.value,Math.max(K.minNotesWidth,n)),V.value=Math.min(V.value,Math.max(K.minNotesRowSize,r))}let $=d();return n(()=>{let e=ke(),t=fe();a(()=>{!e.value||!t.value||F.value||!ie.value?me.cursor=void 0:me.cursor={...e.value,style:oe.value}})}),(t,n)=>(b(),l(te,null,[s(`div`,Le,[s(`div`,null,[i(ye),i(be)]),s(`div`,{ref_key:`gridContainer`,ref:v,class:h([`grid-container`,`layout${c(x)}`]),style:u({"--slidev-presenter-notes-width":`${c(B)}px`,"--slidev-presenter-notes-row-size":`${c(V)}px`,"--slidev-presenter-bottom-height":`${He.value}px`})},[y(` Unified vertical resizer for wide layout `),Y.value&&J.value?(b(),l(`div`,{key:0,class:`notes-vertical-resizer`,role:`separator`,"aria-orientation":`vertical`,title:`Resize notes panel`,onPointerdown:Z},null,32)):y(`v-if`,!0),y(` Unified vertical resizer for layout 3 `),Y.value&&c(x)===3?(b(),l(`div`,{key:1,class:`notes-vertical-resizer-left`,role:`separator`,"aria-orientation":`vertical`,title:`Resize notes panel`,onPointerdown:Z},null,32)):y(`v-if`,!0),s(`div`,{ref_key:`main`,ref:_,class:`relative grid-section main flex flex-col`},[s(`div`,Re,[n[3]||=s(`span`,{op50:``,px2:``},`Current`,-1),n[4]||=s(`div`,{"flex-auto":``},null,-1),i(Ee,{modelValue:c(z),"onUpdate:modelValue":n[0]||=e=>ee(z)?z.value=e:null,options:[{label:`Slides`,value:`slides`},{label:`Screen Mirror`,value:`mirror`}]},null,8,[`modelValue`])]),c(z)===`mirror`?(b(),m(Fe,{key:0})):y(`v-if`,!0),y(` We use v-show here to still infer the clicks context `),e(i(k,{key:`main`,class:`p-2 lg:p-4 flex-auto`,"is-main":``,onContextmenu:c(Ne)},{default:r(()=>[i(Oe,{"render-context":`presenter`}),i(Se)]),_:1},8,[`onContextmenu`]),[[ne,c(z)===`slides`]]),(b(),m(ve,{key:c(A)?.no,"clicks-context":c(P)(c(A)),class:`w-full pb2 px4 flex-none`},null,8,[`clicks-context`]))],512),s(`div`,ze,[X.value&&c(x)===2?(b(),l(`div`,{key:0,class:`notes-row-resizer top-[-6px]`,role:`separator`,"aria-orientation":`horizontal`,title:`Resize notes panel height`,onPointerdown:Xe},null,32)):y(`v-if`,!0),L.value&&R.value?(b(),m(k,{key:`next`},{default:r(()=>[(b(),m(xe,{key:L.value[0].no,"clicks-context":R.value.context,route:L.value[0],"render-context":`previewNext`},null,8,[`clicks-context`,`route`]))]),_:1})):(b(),l(`div`,Be,[...n[5]||=[s(`div`,{class:`text-gray-500`},` End of the presentation `,-1)]])),n[6]||=s(`div`,{class:`absolute left-0 top-0 bg-main border-b border-r border-main px2 py1 op50 text-sm`},` Next `,-1)]),s(`div`,{ref_key:`noteSection`,ref:S,class:`relative grid-section note overflow-hidden`},[Y.value&&!J.value&&c(x)!==3?(b(),l(`div`,{key:0,class:`notes-resizer right-[-6px]`,role:`separator`,"aria-orientation":`vertical`,title:`Resize notes panel`,onPointerdown:Z},null,32)):y(`v-if`,!0),X.value&&c(x)!==2?(b(),l(`div`,{key:1,class:h([`notes-row-resizer`,Ke.value?`top-[-6px]`:`bottom-[-6px]`]),role:`separator`,"aria-orientation":`horizontal`,title:`Resize notes panel height`,onPointerdown:Xe},null,34)):y(`v-if`,!0),$.value&&c(ue)?(b(),m(c($),{key:2,class:`h-full`})):(b(),l(`div`,Ve,[(b(),m(Pe,{key:`static-${c(O)}`,no:c(O),class:`w-full max-w-full h-full overflow-auto p-2 lg:p-4`,style:u({fontSize:`${c(de)}em`}),"clicks-context":c(D)},null,8,[`no`,`style`,`clicks-context`])),n[10]||=s(`div`,{"border-t":``,"border-main":``},null,-1),s(`div`,{class:h([`py-1 px-2 text-sm transition`,c(g)?``:`op25`])},[i(_e,{title:`Increase font size`,onClick:c(se)},{default:r(()=>[...n[7]||=[s(`div`,{class:`i-carbon:zoom-in`},null,-1)]]),_:1},8,[`onClick`]),i(_e,{title:`Decrease font size`,onClick:c(ce)},{default:r(()=>[...n[8]||=[s(`div`,{class:`i-carbon:zoom-out`},null,-1)]]),_:1},8,[`onClick`]),y(`v-if`,!0)],2)]))],512),s(`div`,{ref_key:`bottomSection`,ref:E,class:`grid-section bottom flex`},[i(Ae,{persist:!0,class:h([`transition`,c(g)?``:`op25`])},null,8,[`class`]),n[11]||=s(`div`,{"flex-auto":``},null,-1),i(Ie)],512),(b(),m(ge,{key:2}))],6)]),i(Ce),i(je),i(De)],64))}}),[[`__scopeId`,`data-v-e7a794bf`]]);export{L as default}; \ No newline at end of file diff --git a/transformer-v2/assets/slidev/shortcuts-C1z9JmOm.js b/transformer-v2/assets/slidev/shortcuts-C1z9JmOm.js new file mode 100644 index 0000000000000000000000000000000000000000..d3ff4d87245f107935de11d28e54cea8110e46c4 --- /dev/null +++ b/transformer-v2/assets/slidev/shortcuts-C1z9JmOm.js @@ -0,0 +1,4 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DrawingLayer-BVIfdu9B.js","../modules/shiki-BFOesOFp.js","../rolldown-runtime-hePW80VL.js","../modules/shiki-BrmBd2_v.css","./context-ChHKJoK9.js","../modules/vue-CXhtJkbE.js","../useDrawings-Dnt5VfKs.js","../useNav-B1TSwKuf.js","../_plugin-vue_export-helper-BDNMzG2s.js","../index-DBl9KyFJ.js","../syncState-BrWO1mSt.js","../index-DmzORiUY.css"])))=>i.map(i=>d[i]); +import{$ as e,E as t,G as n,H as r,K as i,L as a,M as o,Q as s,S as c,V as l,X as u,Y as d,_ as f,_t as p,a as m,b as h,bt as g,c as _,d as v,f as y,ft as b,g as x,h as S,i as C,it as w,j as T,k as ee,l as E,lt as D,m as O,n as te,o as ne,u as re,v as k,vt as A,w as j,x as ie,xt as M,y as N,yt as P,z as F}from"../modules/shiki-BFOesOFp.js";import{A as ae,C as oe,D as I,E as se,F as L,G as ce,I as R,L as le,M as ue,N as de,O as fe,P as pe,Q as me,R as he,S as ge,T as z,V as _e,Y as ve,Z as ye,_ as be,a as xe,b as Se,d as Ce,f as we,g as Te,i as Ee,j as B,n as De,nt as Oe,p as ke,q as Ae,r as je,s as Me,t as V,tt as H,u as Ne,w as Pe,y as Fe,z as Ie}from"../useNav-B1TSwKuf.js";import{t as Le}from"../_plugin-vue_export-helper-BDNMzG2s.js";import{B as Re,C as ze,F as Be,N as Ve,S as He,d as Ue,n as U,o as We,p as Ge,r as Ke,s as qe,t as W,v as Je,w as Ye,y as Xe}from"../modules/vue-CXhtJkbE.js";import{_ as Ze,l as Qe,n as $e}from"./context-ChHKJoK9.js";import{d as et,f as tt,i as nt,o as rt,p as it,r as at,t as ot}from"../index-DBl9KyFJ.js";import{t as st}from"../useDrawings-Dnt5VfKs.js";import{t as G}from"./IconButton-B5keGFol.js";import{t as ct}from"./VerticalDivider-D_ScNBWw.js";import{a as lt,i as ut,n as dt,o as ft,r as pt,t as mt}from"../SlideWrapper-CbvN8YIq.js";function ht(e){let{next:t,nextSlide:n,prev:r,prevSlide:i}=V(),{isDrawing:a}=st(),o=D(0),{direction:s,distanceX:c,distanceY:l}=Xe(e,{pointerTypes:[`touch`],onSwipeStart(){a.value||(o.value=Ve())},onSwipeEnd(){if(!o.value||a.value)return;let e=Math.abs(c.value),u=Math.abs(l.value);e/window.innerWidth>.3||e>75?s.value===`left`?t():r():(u/window.innerHeight>.4||u>200)&&(s.value===`down`?i():n())}})}function gt(){let{request:e,release:t}=ze();d(le,n=>{n?e(`screen`):t()},{immediate:!0})}var _t=Object.assign({}),vt=Object.assign({}),yt=Object.assign({}),bt=[Object.values(_t)[0],Object.values(vt)[0],Object.values(yt)[0]].filter(Boolean),xt,St=()=>{if(xt)return xt;let{next:e,nextSlide:t,prev:n,prevSlide:r,hasNext:i,hasPrev:a,currentPage:o,total:s,isPresenter:c,enterPresenter:l,exitPresenter:u,isEmbedded:d,isPresenterAvailable:f}=V(),{drawingEnabled:p}=st(),{isFullscreen:m,toggle:h}=Ne;return xt=bt.reduce((e,t)=>t(e),x(()=>[{small:!0,icon:`i-carbon:arrow-left`,label:`Previous Click`,action:n,disabled:!a.value},{small:!0,icon:`i-carbon:arrow-right`,label:`Next Click`,action:e,disabled:!i.value},{small:!0,icon:`i-carbon:arrow-up`,label:`Previous Slide`,action:r,disabled:o.value<=1},{small:!0,icon:`i-carbon:arrow-down`,label:`Next Slide`,action:t,disabled:o.value>=s.value},`separator`,{icon:`i-carbon:text-annotation-toggle`,label:Pe.value?`Hide editor`:`Show editor`,action:()=>Pe.value=!Pe.value,show:!1},{icon:`i-carbon:pen`,label:p.value?`Hide drawing toolbar`:`Show drawing toolbar`,action:()=>p.value=!p.value},{icon:`i-carbon:apps`,label:`Show slide overview`,action:ue},c.value&&{icon:`i-carbon:presentation-file`,label:`Exit Presenter Mode`,action:u},f.value&&{icon:`i-carbon:user-speaker`,label:`Enter Presenter Mode`,action:l},!d.value&&{icon:m.value?`i-carbon:minimize`:`i-carbon:maximize`,label:m.value?`Close fullscreen`:`Enter fullscreen`,action:h}].filter(Boolean)))},Ct=b(null);function wt(e,t){Ct.value={x:e,y:t,items:St()}}function Tt(){Ct.value=null}function Et(e){if(H.contextMenu!==!0&&H.contextMenu!=null&&H.contextMenu!==`build`||e.shiftKey||e.defaultPrevented)return;let{isEmbedded:t}=V();t.value||(wt(e.pageX,e.pageY),e.preventDefault(),e.stopPropagation())}var Dt=[`title`,`onClick`],Ot=[`onClick`],kt={class:`mx-auto flex`},At={key:0},jt={class:`w-full text-xs p2`},Mt={class:`text-main text-opacity-50!`},Nt=j({__name:`ContextMenu`,setup(e){let t=D();We(t,Tt),Ge(document,`mousedown`,e=>{e.buttons&2&&Tt()},{passive:!0,capture:!0});let r=x(()=>H.contextMenu!=null),i=Ye();d(i,e=>{e||Tt()}),ot(1);let{width:a,height:o}=Ue(t),s=x(()=>{let e=Ct.value?.x;return e?e+a.value>he.width.value?he.width.value-a.value:e:0}),c=x(()=>{let e=Ct.value?.y;return e?e+o.value>he.height.value?he.height.value-o.value:e:0});return(e,i)=>p(Ct)?(F(),h(`div`,{key:0,ref_key:`container`,ref:t,style:g(`left:${s.value}px;top:${c.value}px`),class:`slidev-glass-effect fixed z-context-menu w-60 flex flex-wrap justify-items-start p-1 animate-fade-in animate-duration-100 rounded-md shadow overflow-hidden select-none`,onContextmenu:i[1]||=y(()=>{},[`prevent`]),onClick:i[2]||=(...e)=>p(Tt)&&p(Tt)(...e)},[(F(!0),h(O,null,l(p(Ct).items.value,(e,t)=>(F(),h(O,{key:t},[e===`separator`?(F(),h(`div`,{key:t,class:`w-full my1 border-t border-main`})):e.show??!0?(F(),h(O,{key:1},[e.small?(F(),h(`div`,{key:0,class:A([`p-2 w-[40px] h-[40px] inline-block text-center cursor-pointer rounded flex`,e.disabled?`op40`:`hover:bg-active`]),title:e.label,onClick:e.action},[typeof e.icon==`string`?(F(),h(`div`,{key:0,class:A([e.icon,`text-1.2em ma`])},null,2)):(F(),k(n(e.icon),{key:1}))],10,Dt)):(F(),h(`div`,{key:1,class:A([`w-full grid grid-cols-[35px_1fr] p-2 pl-0 cursor-pointer rounded`,e.disabled?`op40`:`hover:bg-active`]),onClick:e.action},[f(`div`,kt,[typeof e.icon==`string`?(F(),h(`div`,{key:0,class:A([e.icon,`text-1.2em ma`])},null,2)):(F(),k(n(e.icon),{key:1}))]),typeof e.label==`string`?(F(),h(`div`,At,M(e.label),1)):(F(),k(n(e.label),{key:1}))],10,Ot))],64)):N(`v-if`,!0)],64))),128)),r.value?N(`v-if`,!0):(F(),h(O,{key:0},[i[6]||=f(`div`,{class:`w-full my1 border-t border-main`},null,-1),f(`div`,jt,[f(`div`,Mt,[i[3]||=ie(` Hold `,-1),i[4]||=f(`kbd`,{class:`border px1 py0.5 border-main rounded text-primary`},`Shift`,-1),i[5]||=ie(` and right click to open the native context menu `,-1),N(`v-if`,!0)])])],64))],36)):N(`v-if`,!0)}});function K(e){return Array.isArray?Array.isArray(e):Vt(e)===`[object Array]`}function Pt(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Ft(e){return e==null?``:Pt(e)}function q(e){return typeof e==`string`}function It(e){return typeof e==`number`}function Lt(e){return e===!0||e===!1||zt(e)&&Vt(e)==`[object Boolean]`}function Rt(e){return typeof e==`object`}function zt(e){return Rt(e)&&e!==null}function J(e){return e!=null}function Bt(e){return!e.trim().length}function Vt(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ht=`Incorrect 'index' type`,Ut=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,Wt=e=>`Invalid value for key ${e}`,Gt=e=>`Pattern length exceeds max of ${e}.`,Kt=e=>`Missing ${e} property in key`,qt=e=>`Property 'weight' in key '${e}' must be a positive integer`,Jt=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,Yt=Object.prototype.hasOwnProperty,Xt=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=Zt(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Zt(e){let t=null,n=null,r=null,i=1,a=null;if(q(e)||K(e))r=e,t=Qt(e),n=$t(e);else{if(!Yt.call(e,`name`))throw Error(Kt(`name`));let o=e.name;if(r=o,Yt.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(qt($t(o)));t=Qt(o),n=$t(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function Qt(e){return K(e)?e:e.split(`.`)}function $t(e){return K(e)?e.join(`.`):e}function en(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(J(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!J(s))return;if(a===t.length-1&&(q(s)||It(s)||Lt(s)||typeof s==`bigint`))n.push(o===void 0?Ft(s):{v:Ft(s),i:o});else if(K(s)){r=!0;for(let e=0,n=s.length;ee.score===t.score?e.idx=9&&e<=13||e===32||e===160}function sn(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(q(this.docs[0]))for(let n=0;ne&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t>>1;n[i]t),records:this.records}}};function ln(e,t,{getFn:n=Y.getFn,fieldNormWeight:r=Y.fieldNormWeight}={}){let i=new cn({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Zt)),i.setSources(t),i.create(),i}function un(e,{getFn:t=Y.getFn,fieldNormWeight:n=Y.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new cn({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function dn(e=[],t=Y.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function fn(e,t,n,{location:r=Y.location,distance:i=Y.distance,threshold:a=Y.threshold,findAllMatches:o=Y.findAllMatches,minMatchCharLength:s=Y.minMatchCharLength,includeMatches:c=Y.includeMatches,ignoreLocation:l=Y.ignoreLocation}={}){if(t.length>32)throw Error(Gt(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=dn(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function pn(e){let t={};for(let n=0,r=e.length;ne[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;ne.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(gn,e=>hn[e]):e=>e,vn=class{constructor(e,{location:t=Y.location,threshold:n=Y.threshold,distance:r=Y.distance,includeMatches:i=Y.includeMatches,findAllMatches:a=Y.findAllMatches,minMatchCharLength:o=Y.minMatchCharLength,isCaseSensitive:s=Y.isCaseSensitive,ignoreDiacritics:c=Y.ignoreDiacritics,ignoreLocation:l=Y.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?_n(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:pn(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e{let{isMatch:m,score:h,indices:g}=fn(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=mn(u)),p}},yn=new Set([`fuzzy`,`include`]);function bn(e){return e.startsWith(`inverse`)}var xn=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new vn(e,{location:t.location??Y.location,threshold:t.threshold??Y.threshold,distance:t.distance??Y.distance,includeMatches:t.includeMatches??Y.includeMatches,findAllMatches:t.findAllMatches??Y.findAllMatches,minMatchCharLength:t.minMatchCharLength??Y.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??Y.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??Y.ignoreDiacritics,ignoreLocation:t.ignoreLocation??Y.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],Sn=xn.length,Cn=`\0`,wn=`|`;function Tn(e){let t=[],n=e.length,r=0;for(;r=n)break;let i=r;for(;i=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i{let n=Tn(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e!!(e[Mn.AND]||e[Mn.OR]),Fn=e=>!!e[Nn.PATH],In=e=>!K(e)&&Rt(e)&&!Pn(e),Ln=e=>({[Mn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Rn(e,t,{auto:n=!0}={}){let r=e=>{if(q(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=jn(e,t)),r}let i=Object.keys(e),a=Fn(e);if(!a&&i.length>1&&!Pn(e))return r(Ln(e));if(In(e)){let r=a?e[Nn.PATH]:i[0],o=a?e[Nn.PATTERN]:e[r];if(!q(o))throw Error(Wt(r));let s={keyId:$t(r),pattern:o};return n&&(s.searcher=jn(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];K(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return Pn(e)||(e=Ln(e)),r(e)}function zn(e,{ignoreFieldNorm:t=Y.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function Bn(e,{ignoreFieldNorm:t=Y.ignoreFieldNorm}){e.forEach(e=>{e.score=zn(e.matches,{ignoreFieldNorm:t})})}var Vn=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i0&&(r=i),a0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function Hn(e){let t=[];return e.matches.forEach(e=>{if(!J(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function Un(e,t,{includeMatches:n=Y.includeMatches,includeScore:r=Y.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=Hn(e)),r&&(a.score=e.score),a})}var Wn=/[\p{L}\p{M}\p{N}_]+/gu,Gn=new WeakSet;function Kn(e){Gn.has(e)||(Gn.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function qn(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||Kn(e),t=>t.match(e)||[]):e=>e.match(Wn)||[]}function Jn({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=qn(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=_n(n)),r(n)}}}var Yn=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Jn({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new vn(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=mn(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function Xn(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function Zn(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){Xn(e,a,i,r);return}if(o)for(let t=0;te-t);for(let t of n)er(e,t);let r=e=>{let t=0,r=n.length;for(;t>>1;n[i]i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var X=class{constructor(e,t,n){this.options={...Y,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Xt(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=jn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof cn))throw Error(Ht);if(this._myIndex=t||ln(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=Jn({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Qn(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!J(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=Jn({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});$n(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(Ut);this._invertedIndex&&tr(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(q(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return It(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&It(n)&&n>0&&q(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new Vn(n,u);q(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=q(e)?q(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Bn(d,{ignoreFieldNorm:s}),a&&d.sort(q(e)?u:l),It(n)&&n>-1&&(d=d.slice(0,n));return Un(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!J(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=zn(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=Rn(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e{if(J(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!J(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=zn(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!J(t))return[];let r=[];if(K(t))t.forEach(({v:t,i,n:a})=>{if(!J(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;tAn(e))};var nr=X,rr={key:0},ir={key:1},ar={key:2},or={key:3},sr={key:4},cr={key:5},lr={key:6},ur={key:7},dr={key:8},fr={key:9},pr={key:10},mr={key:11},hr={key:12},gr={key:13},_r={key:14},vr={key:15},yr={key:16},br={key:17},xr={key:18},Sr={key:19},Cr={key:20},wr={key:21},Tr={key:22},Er={key:23},Dr={key:24},Or={key:25},kr={key:26},Ar={key:27},jr={key:28},Mr={key:29},Nr={key:30},Pr={key:31},Fr={key:32},Ir={key:33},Lr={key:34},Rr={key:35},zr={key:36},Br={key:37},Vr={key:38},Hr={key:39},Ur={key:40},Wr={key:41},Gr={key:42},Kr={key:43},qr={key:44},Jr={key:45},Yr={key:46},Xr={key:47},Zr={key:48},Qr={key:49},$r={key:50},ei={key:51},ti={key:52},ni={key:53},ri={key:54},ii={key:55},ai={key:56},oi={key:57},si={key:58},ci={key:59},li={key:60},ui={key:61},di={key:62},fi={key:63},pi={key:64},mi={key:65},hi={key:66},gi={key:67},_i={key:68},vi={key:69},yi={key:70},bi={key:71},xi={key:72},Si={key:73},Ci={key:74},wi={key:75},Ti={key:76},Ei={key:77},Di={key:78},Oi={key:79},ki={key:80},Ai={key:81},ji={key:82},Mi={key:83},Ni={key:84},Pi={key:85},Fi={key:86},Ii={key:87},Li={key:88},Ri={key:89},zi={key:90},Bi={key:91},Vi={key:92},Hi=j({__name:`title-renderer`,props:{no:{}},setup(e){let t=e,{$page:n}=$e(),r=x(()=>+(t.no??n.value));return(e,t)=>(F(),h(`div`,null,[r.value===1?(F(),h(`p`,rr,`Transformer v2: The Illustrated Transformer`)):r.value===2?(F(),h(`p`,ir,`Today, in eight parts`)):r.value===3?(F(),h(`p`,ar,`In words: Today, in eight parts`)):r.value===4?(F(),h(`p`,or,`The big picture`)):r.value===5?(F(),h(`p`,sr,`A black box that translates`)):r.value===6?(F(),h(`p`,cr,`In words: A black box that translates`)):r.value===7?(F(),h(`p`,lr,`Six encoders, six decoders`)):r.value===8?(F(),h(`p`,ur,`In words: Six encoders, six decoders`)):r.value===9?(F(),h(`p`,dr,`Inside one encoder, inside one decoder`)):r.value===10?(F(),h(`p`,fr,`In words: Inside one encoder, inside one decoder`)):r.value===11?(F(),h(`p`,pr,`Refresher: a word becomes a vector`)):r.value===12?(F(),h(`p`,mr,`In words: Refresher: a word becomes a vector`)):r.value===13?(F(),h(`p`,hr,`A list of vectors flows up the stack`)):r.value===14?(F(),h(`p`,gr,`In words: A list of vectors flows up the stack`)):r.value===15?(F(),h(`p`,_r,`Self-attention`)):r.value===16?(F(),h(`p`,vr,`What does "it" refer to?`)):r.value===17?(F(),h(`p`,yr,`In words: What does "it" refer to?`)):r.value===18?(F(),h(`p`,br,`Step 1: three vectors for every word`)):r.value===19?(F(),h(`p`,xr,`In words: Step 1: three vectors for every word`)):r.value===20?(F(),h(`p`,Sr,`Step 2: score every word`)):r.value===21?(F(),h(`p`,Cr,`In words: Step 2: score every word`)):r.value===22?(F(),h(`p`,wr,`Steps 3 and 4: scale, then softmax`)):r.value===23?(F(),h(`p`,Tr,`Reading the equation: one attention weight`)):r.value===24?(F(),h(`p`,Er,`In words: Steps 3 and 4: scale, then softmax`)):r.value===25?(F(),h(`p`,Dr,`Steps 5 and 6: weigh the values, then add`)):r.value===26?(F(),h(`p`,Or,`In words: Steps 5 and 6: weigh the values, then add`)):r.value===27?(F(),h(`p`,kr,`All six steps, for either word`)):r.value===28?(F(),h(`p`,Ar,`In words: All six steps, for either word`)):r.value===29?(F(),h(`p`,jr,`Poll: does a word attend most to itself?`)):r.value===30?(F(),h(`p`,Mr,`In words: Poll: does a word attend most to itself?`)):r.value===31?(F(),h(`p`,Nr,`Matrices and many heads`)):r.value===32?(F(),h(`p`,Pr,`Every word at once: matrices`)):r.value===33?(F(),h(`p`,Fr,`In words: Every word at once: matrices`)):r.value===34?(F(),h(`p`,Ir,`The whole layer in one line`)):r.value===35?(F(),h(`p`,Lr,`Reading the equation: the whole layer`)):r.value===36?(F(),h(`p`,Rr,`In words: The whole layer in one line`)):r.value===37?(F(),h(`p`,zr,`Many heads: one question each`)):r.value===38?(F(),h(`p`,Br,`In words: Many heads: one question each`)):r.value===39?(F(),h(`p`,Vr,`Eight heads, then glue them back`)):r.value===40?(F(),h(`p`,Hr,`In words: Eight heads, then glue them back`)):r.value===41?(F(),h(`p`,Ur,`The whole multi-head layer`)):r.value===42?(F(),h(`p`,Wr,`In words: The whole multi-head layer`)):r.value===43?(F(),h(`p`,Gr,`Poll: eight small heads or one big one?`)):r.value===44?(F(),h(`p`,Kr,`In words: Poll: eight small heads or one big one?`)):r.value===45?(F(),h(`p`,qr,`Word order`)):r.value===46?(F(),h(`p`,Jr,`Attention does not see order`)):r.value===47?(F(),h(`p`,Yr,`In words: Attention does not see order`)):r.value===48?(F(),h(`p`,Xr,`Add a position vector`)):r.value===49?(F(),h(`p`,Zr,`Reading the equation: positional encoding`)):r.value===50?(F(),h(`p`,Qr,`In words: Add a position vector`)):r.value===51?(F(),h(`p`,$r,`The pattern over many positions`)):r.value===52?(F(),h(`p`,ei,`In words: The pattern over many positions`)):r.value===53?(F(),h(`p`,ti,`Add, norm, feed-forward`)):r.value===54?(F(),h(`p`,ni,`A shortcut around every sub-layer`)):r.value===55?(F(),h(`p`,ri,`In words: A shortcut around every sub-layer`)):r.value===56?(F(),h(`p`,ii,`Layer normalisation`)):r.value===57?(F(),h(`p`,ai,`Reading the equation: layer normalisation`)):r.value===58?(F(),h(`p`,oi,`In words: Layer normalisation`)):r.value===59?(F(),h(`p`,si,`The feed-forward network, one word at a time`)):r.value===60?(F(),h(`p`,ci,`Reading the equation: the feed-forward network`)):r.value===61?(F(),h(`p`,li,`In words: The feed-forward network, one word at a time`)):r.value===62?(F(),h(`p`,ui,`The full picture, two layers deep`)):r.value===63?(F(),h(`p`,di,`In words: The full picture, two layers deep`)):r.value===64?(F(),h(`p`,fi,`The decoder side`)):r.value===65?(F(),h(`p`,pi,`The encoder hands over keys and values`)):r.value===66?(F(),h(`p`,mi,`In words: The encoder hands over keys and values`)):r.value===67?(F(),h(`p`,hi,`One word per step`)):r.value===68?(F(),h(`p`,gi,`In words: One word per step`)):r.value===69?(F(),h(`p`,_i,`No looking ahead: the mask`)):r.value===70?(F(),h(`p`,vi,`Reading the equation: the mask`)):r.value===71?(F(),h(`p`,yi,`In words: No looking ahead: the mask`)):r.value===72?(F(),h(`p`,bi,`Encoder–decoder attention`)):r.value===73?(F(),h(`p`,xi,`In words: Encoder–decoder attention`)):r.value===74?(F(),h(`p`,Si,`From a vector to a word: linear and softmax`)):r.value===75?(F(),h(`p`,Ci,`Reading the equation: the output layer`)):r.value===76?(F(),h(`p`,wi,`In words: From a vector to a word: linear and softmax`)):r.value===77?(F(),h(`p`,Ti,`Training and decoding`)):r.value===78?(F(),h(`p`,Ei,`The target, as one-hot vectors`)):r.value===79?(F(),h(`p`,Di,`In words: The target, as one-hot vectors`)):r.value===80?(F(),h(`p`,Oi,`The loss on one word: merci → thanks`)):r.value===81?(F(),h(`p`,ki,`Reading the equation: cross-entropy`)):r.value===82?(F(),h(`p`,Ai,`In words: The loss on one word: merci → thanks`)):r.value===83?(F(),h(`p`,ji,`Poll: the loss of a model that knows nothing`)):r.value===84?(F(),h(`p`,Mi,`In words: Poll: the loss of a model that knows nothing`)):r.value===85?(F(),h(`p`,Ni,`A whole sentence`)):r.value===86?(F(),h(`p`,Pi,`In words: A whole sentence`)):r.value===87?(F(),h(`p`,Fi,`Greedy or beam search`)):r.value===88?(F(),h(`p`,Ii,`In words: Greedy or beam search`)):r.value===89?(F(),h(`p`,Li,`The whole transformer, in one picture`)):r.value===90?(F(),h(`p`,Ri,`In words: The whole transformer, in one picture`)):r.value===91?(F(),h(`p`,zi,`Going further`)):r.value===92?(F(),h(`p`,Bi,`In words: Going further`)):r.value===93?(F(),h(`p`,Vi,`Questions?`)):N(`v-if`,!0)]))}}),Ui={class:`bg-main transform`,shadow:`~`,p:`x-4 y-2`,border:`~ transparent rounded dark:main`},Wi=[`value`,`disabled`],Gi={table:``,"w-full":``,"border-collapse":``},Ki=[`border`,`onClick`],qi={"text-right":``,op50:``,"text-sm":``,"table-cell":``,"py-2":``,"pl-4":``,"pr-3":``,"vertical-middle":``},Ji=Le(j({__name:`Goto`,setup(e){let t=D(),n=D(),r=D(),i=D(),a=D(``),o=D(0),{go:s,slides:u}=V();function m(e){return e!=null}let g=x(()=>new nr(u.value.map(e=>e.meta?.slide).filter(m),{keys:[`no`,`title`],threshold:.3,shouldSort:!0,minMatchCharLength:1})),_=x(()=>a.value.startsWith(`/`)?a.value.substring(1):a.value),b=x(()=>_.value?g.value.search(_.value).map(e=>e.item):[]),S=x(()=>!!b.value.length);function C(){if(S.value){let e=b.value.at(o.value||0);e&&s(e.no)}w()}function w(){a.value=``,z.value=!1}function T(e){e.preventDefault(),o.value++,o.value>=b.value.length&&(o.value=0),E()}function ee(e){e.preventDefault(),o.value--,o.value<=-2&&(o.value=b.value.length-1),E()}function E(){let e=i.value?.[o.value];e&&r.value&&(e.offsetTop+e.offsetHeight>r.value.offsetHeight+r.value.scrollTop?r.value.scrollTo({behavior:`smooth`,top:e.offsetTop+e.offsetHeight-r.value.offsetHeight+1}):e.offsetTop{e?(a.value=``,o.value=0,setTimeout(()=>n.value?.focus(),0)):n.value?.blur()}),d(je,()=>{t.value?.contains(je.value)||w()}),(e,s)=>(F(),h(`div`,{id:`slidev-goto-dialog`,ref_key:`container`,ref:t,class:A([`fixed right-5 transition-all`,p(z)?`top-5`:`-top-20 op0 pointer-events-none`]),"w-90":``,"max-w-90":``,"min-w-90":``},[f(`div`,Ui,[f(`input`,{id:`slidev-goto-input`,ref_key:`input`,ref:n,value:a.value,type:`text`,disabled:!p(z),class:A([`outline-none bg-transparent`,{"text-red-400":!S.value&&a.value}]),placeholder:`Goto...`,onKeydown:[v(C,[`enter`]),v(w,[`escape`]),v(T,[`down`]),v(ee,[`up`])],onInput:te},null,42,Wi)]),p(z)&&b.value.length>0?(F(),h(`div`,{key:0,ref_key:`list`,ref:r,class:`autocomplete-list`,shadow:`~`,border:`~ transparent rounded dark:main`},[f(`ul`,Gi,[(F(!0),h(O,null,l(b.value,(e,t)=>(F(),h(`li`,{ref_for:!0,ref_key:`items`,ref:i,key:e.id,role:`button`,tabindex:`0`,"cursor-pointer":``,hover:`op100`,"table-row":``,"items-center":``,border:t===0?void 0:`t main`,class:A(o.value===t?`bg-active op100`:`op80`),onClick:y(t=>ne(e.no),[`stop`,`prevent`])},[f(`div`,qi,M(e.no),1),c(p(Hi),{"table-cell":``,"py-2":``,"pr-4":``,"w-full":``,no:e.no},null,8,[`no`])],10,Ki))),128))])],512)):N(`v-if`,!0)],2))}}),[[`__scopeId`,`data-v-61e41ebd`]]),Yi=D(1),Xi=x(()=>_e.value.length),Z=D(0),Zi=D(0);function Qi(){Z.value>Yi.value&&--Z.value}function $i(){Z.valueYi.value){let e=Z.value-Zi.value;eXi.value&&(e=Xi.value),Z.value=e}}var na=[`onClick`],ra={class:`text-green font-bold`},ia={class:`opacity-50`},aa={key:1,class:`opacity-50`},oa={class:`fixed top-4 right-4 z-modal text-gray-400 flex flex-col items-center gap-2`},sa=128,ca=32,la=j({__name:`QuickOverview`,setup(t){let{currentSlideNo:n,go:r,slides:i}=V();function a(){I.value=!1}function o(e){r(e),a()}function d(e){return e===Z.value}let _=Ee.smaller(`xs`),v=Ee.smaller(`sm`),y=x(()=>_.value?he.width.value-sa:v.value?(he.width.value-sa-ca)/2:300),b=x(()=>Math.floor((he.width.value-sa)/(y.value+ca))),S=D(``);return Ge(`keypress`,e=>{if(!I.value){S.value=``;return}if(e.key===`Enter`){e.preventDefault(),S.value?(o(+S.value),S.value=``):o(Z.value);return}let t=Number.parseInt(e.key.replace(/\D/g,``));if(Number.isNaN(t)){S.value=``;return}if(!S.value&&t===0)return;if(S.value+=String(t),+S.value>i.value.length){S.value=``;return}let n=i.value.findIndex(e=>`/${e.no}`===S.value);n!==-1&&(Z.value=n+1),S.value*10>i.value.length&&(o(+S.value),S.value=``)}),u(()=>{Z.value=n.value,Zi.value=b.value}),(t,n)=>(F(),h(O,null,[c(m,{"enter-active-class":`duration-150 ease-out`,"enter-from-class":`opacity-0 scale-102 !backdrop-blur-0px`,"leave-active-class":`duration-200 ease-in`,"leave-to-class":`opacity-0 scale-102 !backdrop-blur-0px`},{default:s(()=>[p(I)?(F(),h(`div`,{key:0,class:`fixed left-0 right-0 top-0 h-[calc(var(--vh,1vh)*100)] z-modal bg-main !bg-opacity-75 p-16 py-20 overflow-y-auto backdrop-blur-5px select-none`,onClick:a},[f(`div`,{class:`grid gap-y-4 gap-x-8 w-full`,style:g(`grid-template-columns: repeat(auto-fit,minmax(${y.value}px,1fr))`)},[(F(!0),h(O,null,l(p(i),(e,t)=>(F(),h(`div`,{key:e.no,class:`relative`},[f(`div`,{class:A([`inline-block border rounded overflow-hidden bg-main hover:border-primary transition`,d(t+1)||p(Z)===t+1?`border-primary`:`border-main`]),onClick:t=>o(e.no)},[(F(),k(ut,{key:e.no,no:e.no,"use-snapshot":!0,width:y.value,class:`pointer-events-none`},{default:s(()=>[c(mt,{"clicks-context":p(ce)(e,p(Qe)),route:e,"render-context":`overview`},null,8,[`clicks-context`,`route`]),c(ft,{page:e.no},null,8,[`page`])]),_:2},1032,[`no`,`width`]))],10,na),f(`div`,{class:`absolute top-0`,style:g(`left: ${y.value+5}px`)},[S.value&&String(t+1).startsWith(S.value)?(F(),h(O,{key:0},[f(`span`,ra,M(S.value),1),f(`span`,ia,M(String(t+1).slice(S.value.length)),1)],64)):(F(),h(`span`,aa,M(t+1),1))],4)]))),128))],4)])):N(`v-if`,!0)]),_:1}),e(f(`div`,oa,[c(G,{title:`Close`,class:`text-2xl`,onClick:a},{default:s(()=>[...n[0]||=[f(`div`,{class:`i-carbon:close`},null,-1)]]),_:1}),(F(),k(G,{key:0,as:`a`,title:`Slides Overview`,target:`_blank`,href:`${p(ve)}overview`,"tab-index":`-1`,class:`text-2xl`},{default:s(()=>[...n[1]||=[f(`div`,{class:`i-carbon:list-boxes`},null,-1)]]),_:1},8,[`href`])),N(`v-if`,!0)],512),[[re,p(I)]])],64))}});function ua(){let e=Je();return x(()=>{let t=lt.value?.getBoundingClientRect();if(!t)return;let n=(e.x.value-t.left)/t.width*100,r=(e.y.value-t.top)/t.height*100;if(!(n<0||n>100||r<0||r>100))return{x:n,y:r}})}var da={key:0,class:`absolute top-0 left-0 right-0 bottom-0 pointer-events-none text-xl`},fa=Le(j({__name:`LaserPointer`,setup(e){let t=ua(),{isPresenter:n}=V(),r=x(()=>!n.value&&rt.cursor?.style===`laser`?rt.cursor:xe.value===`laser`?t.value:null);return a(()=>{u(()=>{document.body.classList.toggle(`slidev-self-laser-active`,xe.value===`laser`&&!!r.value)})}),(e,t)=>r.value?(F(),h(`div`,da,[f(`div`,{class:`laser-pointer`,style:g({left:`${r.value.x}%`,top:`${r.value.y}%`})},null,4)])):N(`v-if`,!0)}}),[[`__scopeId`,`data-v-1d1438ab`]]),pa={render:()=>[]},ma={key:0,class:`bg-main text-main shadow-xl absolute bottom-10 left-0 z-menu py2`,border:`~ main rounded-md`},ha=j({__name:`MenuButton`,props:{modelValue:{default:!1},disabled:{default:!1}},setup(e,{emit:t}){let n=He(e,`modelValue`,t,{passive:!0}),i=D();return We(i,()=>{n.value=!1}),(t,a)=>(F(),h(`div`,{ref_key:`el`,ref:i,class:`flex relative`},[f(`button`,{class:A({disabled:e.disabled}),onClick:a[0]||=e=>n.value=!p(n)},[r(t.$slots,`button`,{value:p(n),class:A({disabled:e.disabled})})],2),(F(),k(S,null,[p(n)?(F(),h(`div`,ma,[r(t.$slots,`menu`)])):N(`v-if`,!0)],1024))],512))}}),ga={border:`~ main rounded`,flex:`~ gap-2 items-center`,relative:``,"h-5":``,"w-5":``,"p0.5":``,"hover:bg-active":``,p1:``},_a=[`disabled`],va=j({__name:`FormCheckbox`,props:T({disabled:{type:Boolean}},{modelValue:{type:Boolean,type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let n=i(t,`modelValue`);return(r,i)=>(F(),h(`div`,ga,[f(`div`,{"i-ri-check-line":``,class:A(n.value?``:`op0`)},null,2),e(f(`input`,{"onUpdate:modelValue":i[0]||=e=>n.value=e,type:`checkbox`,absolute:``,"inset-0":``,"opacity-10":``,disabled:t.disabled},null,8,_a),[[_,n.value]])]))}}),ya={"w-30":``,"h-8":``,flex:`~ gap-1 items-center`},ba={key:0,"w-1.5":``,"h-1.5":``,"bg-primary":``,rounded:``,absolute:``,"top-0":``,"right--2":``},xa={key:0,"w-1.5":``,"h-1.5":``,"bg-primary":``,rounded:``,absolute:``,"top-0":``,"right--2":``},Sa=[`innerHTML`],Q=j({__name:`FormItem`,props:{title:{},nested:{type:[Boolean,Number]},div:{type:Boolean},description:{},dot:{type:Boolean}},emits:[`reset`],setup(e,{emit:t}){let i=t;function a(){i(`reset`)}return(t,i)=>(F(),k(n(e.div?`div`:`label`),{flex:`~ row gap-2 items-center`,"select-none":``},{default:s(()=>[f(`div`,ya,[e.nested?(F(),h(`div`,{key:0,"i-ri-corner-down-right-line":``,op40:``,style:g(typeof e.nested==`number`?{marginLeft:`${e.nested*.5+.5}rem`}:{marginLeft:`0.25rem`})},null,4)):N(`v-if`,!0),e.description?(F(),k(p(te),{key:2,distance:`10`},{popper:s(()=>[f(`div`,{"text-sm":``,"min-w-90":``,innerHTML:e.description},null,8,Sa)]),default:s(()=>[f(`div`,{op75:``,"text-right":``,relative:``,onDblclick:a},[ie(M(e.title)+` `,1),e.dot?(F(),h(`div`,xa)):N(`v-if`,!0)],32)]),_:1})):(F(),h(`div`,{key:1,op75:``,relative:``,onDblclick:a},[ie(M(e.title)+` `,1),e.dot?(F(),h(`div`,ba)):N(`v-if`,!0)],32))]),r(t.$slots,`default`)]),_:3}))}}),Ca={relative:``,"h-22px":``},wa={key:0,"pointer-events-none":``,absolute:``,"right-1":``,"top-0.5":``,"text-xs":``,op25:``},Ta=j({__name:`FormSlider`,props:T({max:{},min:{},step:{},unit:{},default:{}},{modelValue:{type:Number},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let n=t,r=i(t,`modelValue`);return(i,a)=>(F(),h(O,null,[f(`div`,{relative:``,"h-22px":``,"w-60":``,"flex-auto":``,onDblclick:a[1]||=e=>n.default===void 0?null:r.value=n.default},[e(f(`input`,o({"onUpdate:modelValue":a[0]||=e=>r.value=e,type:`range`,class:`slider`},n,{absolute:``,"bottom-0":``,"left-0":``,"right-0":``,"top-0":``,"z-10":``,"w-full":``,"align-top":``}),null,16),[[E,r.value,void 0,{number:!0}]]),n.default==null?N(`v-if`,!0):(F(),h(`span`,{key:0,border:`r main`,absolute:``,"bottom-0":``,"top-0":``,"h-full":``,"w-1px":``,op75:``,style:g({left:`${(n.default-t.min)/(t.max-t.min)*100}%`})},null,4))],32),f(`div`,Ca,[e(f(`input`,o({"onUpdate:modelValue":a[2]||=e=>r.value=e,type:`number`},n,{border:`~ main rounded`,m0:``,"w-20":``,"bg-gray:5":``,pl2:``,"align-top":``,"text-sm":``}),null,16),[[E,r.value,void 0,{number:!0}]]),n.unit?(F(),h(`span`,wa,M(n.unit),1)):N(`v-if`,!0)])],64))}}),Ea={error:0,client:60,Light:60,Dark:240};function Da(e,t=1){if(Ea[e])return Oa(Ea[e],t);let n=0;for(let t=0;t!t.text||t.color===!1?{}:{color:typeof t.color==`number`?Oa(t.color):Da(t.text),background:typeof t.color==`number`?Oa(t.color,.1):Da(t.text,.1)}),a=x(()=>(t.size||`sm`)===`sm`?`px-1.5 text-11px leading-1.6em`:``);return(o,c)=>(F(),k(n(e.as||`span`),{"ws-nowrap":``,rounded:``,class:A(a.value),style:g(i.value)},{default:s(()=>[r(o.$slots,`default`,{},()=>[f(`span`,{textContent:M(t.text)},null,8,ka)])]),_:3},8,[`class`,`style`]))}}),ja={flex:`~ gap-1 items-center`,rounded:``,"bg-gray:4":``,p1:``,"m--1":``},Ma=j({__name:`SegmentControl`,props:{options:{},modelValue:{}},emits:[`update:modelValue`],setup(e){return(t,n)=>(F(),h(`div`,ja,[(F(!0),h(O,null,l(e.options,n=>(F(),k(Aa,{key:n.value,class:A([`px-2 py-1 text-xs font-mono`,n.value===e.modelValue?``:`op50`]),color:n.value===e.modelValue,"aria-pressed":n.value===e.modelValue,size:`none`,text:n.label,as:`button`,onClick:e=>t.$emit(`update:modelValue`,n.value)},null,8,[`class`,`color`,`aria-pressed`,`text`,`onClick`]))),128))]))}}),Na={"text-sm":``,"select-none":``,flex:`~ col gap-1`,"min-w-30":``,px4:``},Pa=j({__name:`Settings`,setup(e){let{isPresenter:t}=V(),{isSupported:n}=ze();return(e,r)=>(F(),h(`div`,Na,[c(Q,{title:`Invert`,dot:p(L).invert!==p(R).invert,onReset:r[1]||=e=>p(L).invert=p(R).invert},{default:s(()=>[c(va,{modelValue:p(L).invert,"onUpdate:modelValue":r[0]||=e=>p(L).invert=e},null,8,[`modelValue`])]),_:1},8,[`dot`]),c(Q,{title:`Brightness`,dot:p(L).brightness!==p(R).brightness,onReset:r[3]||=e=>p(L).brightness=p(R).brightness},{default:s(()=>[c(Ta,{modelValue:p(L).brightness,"onUpdate:modelValue":r[2]||=e=>p(L).brightness=e,max:1.5,min:.5,step:.02,default:p(R).brightness},null,8,[`modelValue`,`default`])]),_:1},8,[`dot`]),c(Q,{title:`Contrast`,dot:p(L).contrast!==p(R).contrast,onReset:r[5]||=e=>p(L).contrast=p(R).contrast},{default:s(()=>[c(Ta,{modelValue:p(L).contrast,"onUpdate:modelValue":r[4]||=e=>p(L).contrast=e,max:1.5,min:.5,step:.02,default:p(R).contrast},null,8,[`modelValue`,`default`])]),_:1},8,[`dot`]),c(Q,{title:`Saturation`,dot:p(L).saturate!==p(R).saturate,onReset:r[7]||=e=>p(L).saturate=p(R).saturate},{default:s(()=>[c(Ta,{modelValue:p(L).saturate,"onUpdate:modelValue":r[6]||=e=>p(L).saturate=e,max:1.5,min:.5,step:.02,default:p(R).saturate},null,8,[`modelValue`,`default`])]),_:1},8,[`dot`]),c(Q,{title:`Sepia`,dot:p(L).sepia!==p(R).sepia,onReset:r[9]||=e=>p(L).sepia=p(R).sepia},{default:s(()=>[c(Ta,{modelValue:p(L).sepia,"onUpdate:modelValue":r[8]||=e=>p(L).sepia=e,max:2,min:-2,step:.02,default:p(R).sepia},null,8,[`modelValue`,`default`])]),_:1},8,[`dot`]),c(Q,{title:`Hue Rotate`,dot:p(L).hueRotate!==p(R).hueRotate,onReset:r[11]||=e=>p(L).hueRotate=p(R).hueRotate},{default:s(()=>[c(Ta,{modelValue:p(L).hueRotate,"onUpdate:modelValue":r[10]||=e=>p(L).hueRotate=e,max:180,min:-180,step:.1,default:p(R).hueRotate},null,8,[`modelValue`,`default`])]),_:1},8,[`dot`]),r[16]||=f(`div`,{class:`h-1px opacity-5 bg-current w-full my2`},null,-1),c(Q,{title:`Cursor Style`},{default:s(()=>[c(Ma,{modelValue:p(xe),"onUpdate:modelValue":r[12]||=e=>w(xe)?xe.value=e:null,options:[{label:`Cursor`,value:`cursor`},{label:`Laser`,value:`laser`}]},null,8,[`modelValue`])]),_:1}),p(t)?N(`v-if`,!0):(F(),k(Q,{key:0,title:`Slide Scale`},{default:s(()=>[c(Ma,{modelValue:p(ae),"onUpdate:modelValue":r[13]||=e=>w(ae)?ae.value=e:null,options:[{label:`Fit`,value:0},{label:`1:1`,value:1}]},null,8,[`modelValue`])]),_:1})),p(n)?(F(),k(Q,{key:1,title:`Wake Lock`},{default:s(()=>[c(va,{modelValue:p(le),"onUpdate:modelValue":r[14]||=e=>w(le)?le.value=e:null},null,8,[`modelValue`])]),_:1})):N(`v-if`,!0),p(t)?N(`v-if`,!0):(F(),k(Q,{key:2,title:`Hide Idle Cursor`},{default:s(()=>[c(va,{modelValue:p(we),"onUpdate:modelValue":r[15]||=e=>w(we)?we.value=e:null},null,8,[`modelValue`])]),_:1}))]))}}),Fa={class:`select-list`},Ia={class:`title`},La={class:`items`},Ra=[`onClick`],za=Le(j({__name:`SelectList`,props:{modelValue:{type:[Object,String,Number,Boolean]},title:{type:String},items:{type:Array}},setup(e,{emit:t}){let n=He(e,`modelValue`,t,{passive:!0});return(t,r)=>(F(),h(`div`,Fa,[f(`div`,Ia,M(e.title),1),f(`div`,La,[(F(!0),h(O,null,l(e.items,e=>(F(),h(`div`,{key:e.value,class:A([`item`,{active:p(n)===e.value}]),onClick:()=>{n.value=e.value,e.onClick?.()}},[f(`div`,{class:A([`i-carbon:checkmark text-green-500 mya`,{"opacity-0":p(n)!==e.value}])},null,2),f(`div`,{class:A({"opacity-50":p(n)!==e.value})},M(e.display||e.value),3)],10,Ra))),128))])]))}}),[[`__scopeId`,`data-v-aa3b28a6`]]),Ba={"text-sm":``,flex:`~ col gap-2`},Va={px3:``,"ws-nowrap":``},Ha={"font-bold":``,"text-primary":``},Ua=j({__name:`SyncControls`,setup(e){let{isPresenter:t}=V(),n=x({get:()=>t.value?B.value.presenterReceive:B.value.viewerReceive,set(e){t.value?B.value.presenterReceive=e:B.value.viewerReceive=e}}),r=x({get:()=>t.value?B.value.presenterSend:B.value.viewerSend,set(e){t.value?B.value.presenterSend=e:B.value.viewerSend=e}}),i=x({get:()=>n.value&&r.value?`bidirectional`:n.value&&!r.value?`receive-only`:!n.value&&r.value?`send-only`:`off`,set(e){switch(e){case`bidirectional`:n.value=!0,r.value=!0;break;case`receive-only`:n.value=!0,r.value=!1;break;case`send-only`:n.value=!1,r.value=!0;break;case`off`:n.value=!1,r.value=!1}}});return(e,a)=>(F(),k(ha,null,{button:s(()=>[c(G,{title:`Change sync settings`},{default:s(()=>[f(`div`,{class:A([`i-ph:arrow-up-bold mx--1.2 scale-x-80`,r.value?`text-green6 dark:text-green`:`op30`])},null,2),f(`div`,{class:A([`i-ph:arrow-down-bold mx--1.2 scale-x-80`,n.value?`text-green6 dark:text-green`:`op30`])},null,2)]),_:1})]),menu:s(()=>[f(`div`,Ba,[f(`div`,Va,[a[1]||=f(`span`,{op75:``},`Slides navigation syncing for `,-1),f(`span`,Ha,M(p(t)?`presenter`:`viewer`),1)]),a[2]||=f(`div`,{class:`h-1px opacity-10 bg-current w-full`},null,-1),c(za,{modelValue:i.value,"onUpdate:modelValue":a[0]||=e=>i.value=e,title:`Sync Mode`,items:[{value:`bidirectional`,display:`Bidirectional Sync`},{value:`receive-only`,display:`Receive Only`},{value:`send-only`,display:`Send Only`},{value:`off`,display:`Disable`}]},null,8,[`modelValue`])])]),_:1}))}}),Wa={key:0,class:`i-carbon:minimize`},Ga={key:1,class:`i-carbon:maximize`},Ka={key:0,class:`i-carbon-moon`},qa={key:1,class:`i-carbon-sun`},Ja={key:0,class:`i-carbon-magic-wand-filled color-red-600 dark:color-red-400`},Ya={key:1,class:`i-carbon-magic-wand`},Xa={key:0,class:`i-ph-cursor-fill`},Za={key:1,class:`i-ph-cursor-duotone`},Qa={key:0,"w-2":``,"h-2":``,"bg-primary":``,"rounded-full":``,absolute:``,"top-0.5":``,"right-0.5":``},$a={class:`px2 my-auto`},eo={class:`text-lg`},to={class:`opacity-50 text-sm`},no=j({__name:`NavControls`,props:{persist:{default:!1}},setup(e){let t=e,{currentSlideNo:n,hasNext:r,hasPrev:i,isEmbedded:a,isPresenter:o,isPresenterAvailable:l,next:u,prev:d,total:m,enterPresenter:_,exitPresenter:v}=V(),{brush:y,drawingEnabled:S}=st(),C=Ee.smaller(`md`),{isFullscreen:w,toggle:T}=Ne,ee=D();function E(){ee.value&&je.value&&ee.value.contains(je.value)&&je.value.blur()}let te=x(()=>t.persist?`text-$slidev-controls-foreground bg-transparent`:`rounded-md bg-main shadow-xl border border-main`),ne=b();return(e,t)=>(F(),h(`nav`,{ref_key:`root`,ref:ee,class:`flex flex-col`},[f(`div`,{class:A([`flex flex-wrap-reverse text-xl gap-0.5 p-1 lg:p-2`,te.value]),onMouseleave:E},[p(a)?N(`v-if`,!0):(F(),k(G,{key:0,title:p(w)?`Close fullscreen`:`Enter fullscreen`,onClick:p(T)},{default:s(()=>[p(w)?(F(),h(`div`,Wa)):(F(),h(`div`,Ga))]),_:1},8,[`title`,`onClick`])),c(G,{disabled:!p(i),title:`Go to previous slide`,onClick:p(d)},{default:s(()=>[...t[6]||=[f(`div`,{class:`i-carbon:arrow-left`},null,-1)]]),_:1},8,[`disabled`,`onClick`]),c(G,{disabled:!p(r),title:`Go to next slide`,onClick:p(u)},{default:s(()=>[...t[7]||=[f(`div`,{class:`i-carbon:arrow-right`},null,-1)]]),_:1},8,[`disabled`,`onClick`]),p(a)?N(`v-if`,!0):(F(),k(G,{key:1,title:`Show slide overview`,onClick:t[0]||=e=>p(ue)()},{default:s(()=>[...t[8]||=[f(`div`,{class:`i-carbon:apps`},null,-1)]]),_:1})),p(et)?N(`v-if`,!0):(F(),k(G,{key:2,title:p(tt)?`Switch to light mode theme`:`Switch to dark mode theme`,onClick:t[1]||=e=>p(it)()},{default:s(()=>[p(tt)?(F(),h(`div`,Ka)):(F(),h(`div`,qa))]),_:1},8,[`title`])),c(ct),p(a)?N(`v-if`,!0):(F(),h(O,{key:3},[!p(o)&&!p(C)&&ne.value?(F(),h(O,{key:0},[c(p(ne)),c(ct)],64)):N(`v-if`,!0),p(o)?(F(),k(G,{key:1,title:p(xe)===`laser`?p(fe)?`Disable laser pointer`:`Enable laser pointer`:p(fe)?`Hide presenter cursor`:`Show presenter cursor`,active:p(fe),onClick:t[2]||=e=>p(de)()},{default:s(()=>[p(xe)===`laser`?(F(),h(O,{key:0},[p(fe)?(F(),h(`div`,Ja)):(F(),h(`div`,Ya))],64)):(F(),h(O,{key:1},[p(fe)?(F(),h(`div`,Xa)):(F(),h(`div`,Za))],64))]),_:1},8,[`title`,`active`])):N(`v-if`,!0),!p(H).drawings.presenterOnly||p(o)?(F(),k(G,{key:2,class:`relative`,title:p(S)?`Hide drawing toolbar`:`Show drawing toolbar`,active:p(S),onClick:t[3]||=e=>S.value=!p(S)},{default:s(()=>[t[9]||=f(`div`,{class:`i-carbon:pen`},null,-1),p(S)?(F(),h(`div`,{key:0,class:`absolute left-1 right-1 bottom-0 h-0.7 rounded-full`,style:g({background:p(y).color})},null,4)):N(`v-if`,!0)]),_:1},8,[`title`,`active`])):N(`v-if`,!0),c(ct),p(o)?(F(),k(G,{key:3,title:`Play Mode`,onClick:p(v)},{default:s(()=>[...t[10]||=[f(`div`,{class:`i-carbon:presentation-file`},null,-1)]]),_:1},8,[`onClick`])):N(`v-if`,!0),p(l)?(F(),k(G,{key:4,title:`Presenter Mode`,onClick:p(_)},{default:s(()=>[...t[11]||=[f(`div`,{class:`i-carbon:user-speaker`},null,-1)]]),_:1},8,[`onClick`])):N(`v-if`,!0),N(`v-if`,!0)],64)),(F(),h(O,{key:4},[p(H).download?(F(),k(G,{key:0,title:`Download as PDF`,onClick:p(nt)},{default:s(()=>[...t[13]||=[f(`div`,{class:`i-carbon:download`},null,-1)]]),_:1},8,[`onClick`])):N(`v-if`,!0)],64)),N(`v-if`,!0),!p(o)&&p(H).info&&!p(a)?(F(),k(G,{key:6,title:`Show info`,onClick:t[5]||=e=>se.value=!p(se)},{default:s(()=>[...t[15]||=[f(`div`,{class:`i-carbon:information`},null,-1)]]),_:1})):N(`v-if`,!0),p(a)?N(`v-if`,!0):(F(),h(O,{key:7},[c(ct),p(o)?(F(),k(G,{key:0,title:`Toggle Presenter Layout`,class:`aspect-ratio-initial flex items-center`,onClick:p(pe)},{default:s(()=>[t[16]||=f(`div`,{class:`i-carbon:template`},null,-1),ie(` `+M(p(Se)),1)]),_:1},8,[`onClick`])):N(`v-if`,!0),(F(),k(Ua,{key:1})),c(ha,null,{button:s(({value:e})=>[c(G,{title:`More Options`,active:e},{default:s(()=>[t[17]||=f(`div`,{class:`i-carbon:settings-adjust`},null,-1),p(Ce)?(F(),h(`div`,Qa)):N(`v-if`,!0)]),_:1},8,[`active`])]),menu:s(()=>[c(Pa)]),_:1})],64)),p(a)?N(`v-if`,!0):(F(),k(ct,{key:8})),f(`div`,$a,[f(`span`,eo,M(p(n)),1),f(`span`,to,` / `+M(p(m)),1)]),c(p(pa))],34)],512))}}),ro=new Set,io=new Set,ao=/\/$/;function oo(e){return e.startsWith(`http`)||e.startsWith(`//`)?e:`${`./`.replace(ao,``)}${e.startsWith(`/`)?e:`/${e}`}`}var so=2,co=new Map,lo=D(0),uo=D(0),fo=x(()=>uo.value===0?1:lo.value/uo.value);x(()=>fo.value>=1);function po(e){let t=oo(e);if(ro.has(t)||io.has(t))return;io.add(t);let n=new Image;n.onload=()=>{io.delete(t),ro.add(t),co.delete(t),lo.value=ro.size},n.onerror=()=>{io.delete(t);let n=co.get(t)??0;n{let e=r.value;if(!e?.length)return;let t=new Set;for(let n of e)for(let e of n.meta?.slide?.images??[])t.add(oo(e));uo.value=t.size}),u(()=>{let i=e.value,o=r.value;if(!i||!o?.length)return;mo(i),mo(t.value),mo(n.value);let s=i.no-1;for(let e=1;e<=a;e++){let t=s+e;t{let t=r.value,n=setTimeout(()=>{if(t?.length)for(let e of t)mo(e)},3e3);e(()=>clearTimeout(n))})}function go(){let e=Re(),t=D(!1),n,r,i=typeof document<`u`&&`startViewTransition`in document;return e.beforeResolve((e,a)=>{let o=Ie(a.params.no)?.meta,s=Ie(e.params.no)?.meta,c=o?.slide?.no,l=s?.slide?.no;if((c!=null&&l!=null&&c!==l&&((c{n=e,r=t}),d,f=new Promise(e=>d=e);return setTimeout(()=>{document.startViewTransition(()=>(d(),u))},50),f}),i&&e.afterEach(()=>{n?.(),r?.()}),t}var _o=[`data-drag-id`],$=10,vo=10,yo=`absolute border border-gray bg-gray dark:border-gray-500 dark:bg-gray-800 bg-opacity-30 `,bo=20,xo=j({__name:`DragControl`,props:{data:{}},setup(e){let{dragId:n,zoom:r,autoHeight:i,x0:a,y0:o,width:s,height:c,rotate:l,isArrow:d}=e.data,m=ee(Ze,D(1)),_=x(()=>m.value*r.value),{left:v,top:y}=at(),b=d?-1/0:40,S=x(()=>l.value*Math.PI/180),C=x(()=>Math.sin(S.value)),w=x(()=>Math.cos(S.value)),T=x(()=>s.value*w.value+c.value*C.value),E=x(()=>s.value*C.value+c.value*w.value),te=x(()=>a.value-T.value/2),ne=x(()=>o.value-E.value/2),re=x(()=>a.value+T.value/2),k=x(()=>o.value+E.value/2),j=x(()=>d&&s.value<0),ie=x(()=>d&&c.value<0),M=null;function ae(e){if(e.buttons!==1)return;e.preventDefault(),e.stopPropagation();let t=e.target.getBoundingClientRect(),n=s.value*w.value-c.value*C.value,r=s.value*C.value+c.value*w.value,i=s.value*w.value+c.value*C.value,u=-s.value*C.value+c.value*w.value;M={x0:a.value,y0:o.value,width:s.value,height:c.value,rotate:l.value,dx0:e.clientX-(t.left+t.right)/2,dy0:e.clientY-(t.top+t.bottom)/2,ltx:a.value-n/2,lty:o.value-r/2,rtx:a.value+i/2,rty:o.value-u/2,lbx:a.value-i/2,lby:o.value+u/2,rbx:a.value+n/2,rby:o.value+r/2},e.currentTarget.setPointerCapture(e.pointerId)}function oe(e){if(!M||e.buttons!==1)return;e.preventDefault(),e.stopPropagation();let t=(e.clientX-v.value-M.dx0)/_.value,n=(e.clientY-y.value-M.dy0)/_.value;a.value=Oe(t,-T.value/2+vo,me.value+T.value/2-vo),o.value=Oe(n,-E.value/2+vo,ye.value+E.value/2-vo)}function I(e){M&&=(e.preventDefault(),e.stopPropagation(),null)}function se(e,t){return{onPointerdown:ae,onPointermove:n=>{if(!M||n.buttons!==1)return;n.preventDefault(),n.stopPropagation();let r=(n.clientX-v.value)/_.value,i=(n.clientY-y.value)/_.value,{ltx:l,lty:u,rtx:d,rty:f,lbx:p,lby:m,rbx:h,rby:g}=M,x=M.width/M.height,S=Math.max(b,b*x);function T(e,t){if(n.shiftKey){let n=Math.max(e,t*x,S);return{w:n,h:n/x}}return{w:Math.max(e,b),h:Math.max(t,b)}}if(e){if(t){let{w:e,h:t}=T((h-r)*w.value+(g-i)*C.value,-(h-r)*C.value+(g-i)*w.value);r=h-e*w.value+t*C.value,i=g-e*C.value-t*w.value}else{let{w:e,h:t}=T((d-r)*w.value-(i-f)*C.value,(d-r)*C.value+(i-f)*w.value);r=d-e*w.value-t*C.value,i=f-e*C.value+t*w.value}}else if(t){let{w:e,h:t}=T((r-p)*w.value-(m-i)*C.value,(r-p)*C.value+(m-i)*w.value);r=p+e*w.value+t*C.value,i=m+e*C.value-t*w.value}else{let{w:e,h:t}=T((r-l)*w.value+(i-u)*C.value,-(r-l)*C.value+(i-u)*w.value);r=l+e*w.value-t*C.value,i=u+e*C.value+t*w.value}e?t?(a.value=(r+h)/2,o.value=(i+g)/2,s.value=(h-r)*w.value+(g-i)*C.value,c.value=-(h-r)*C.value+(g-i)*w.value):(a.value=(r+d)/2,o.value=(i+f)/2,s.value=(d-r)*w.value-(i-f)*C.value,c.value=(d-r)*C.value+(i-f)*w.value):t?(a.value=(r+p)/2,o.value=(i+m)/2,s.value=(r-p)*w.value-(m-i)*C.value,c.value=(r-p)*C.value+(m-i)*w.value):(a.value=(r+l)/2,o.value=(i+u)/2,s.value=(r-l)*w.value+(i-u)*C.value,c.value=-(r-l)*C.value+(i-u)*w.value)},onPointerup:I,style:{width:`${$}px`,height:`${$}px`,margin:`-${$/2}px`,left:e===j.value?void 0:`0`,right:e===j.value?`0`:void 0,top:t===ie.value?void 0:`0`,bottom:t===ie.value?`0`:void 0,cursor:d?`move`:+e+ +t==1?`nesw-resize`:`nwse-resize`,borderRadius:d?`50%`:void 0},class:yo}}function L(e){return{onPointerdown:ae,onPointermove:t=>{if(!M||t.buttons!==1)return;t.preventDefault(),t.stopPropagation();let n=(t.clientX-v.value)/_.value,r=(t.clientY-y.value)/_.value,{ltx:i,lty:l,rtx:u,rty:d,lbx:f,lby:p,rbx:m,rby:h}=M;if(e===`l`){let e=(u+m)/2,t=(d+h)/2;s.value=Math.max((e-n)*w.value+(t-r)*C.value,b),a.value=e-s.value*w.value/2,o.value=t-s.value*C.value/2}else if(e===`r`){let e=(i+f)/2,t=(l+p)/2;s.value=Math.max((n-e)*w.value+(r-t)*C.value,b),a.value=e+s.value*w.value/2,o.value=t+s.value*C.value/2}else if(e===`t`){let e=(f+m)/2,t=(p+h)/2;c.value=Math.max((t-r)*w.value-(e-n)*C.value,b),a.value=e+c.value*C.value/2,o.value=t-c.value*w.value/2}else if(e===`b`){let e=(i+u)/2,t=(l+d)/2;c.value=Math.max((r-t)*w.value-(n-e)*C.value,b),a.value=e-c.value*C.value/2,o.value=t+c.value*w.value/2}},onPointerup:I,style:{width:`${$}px`,height:`${$}px`,margin:`-${$/2}px`,left:e===`l`?`0`:e===`r`?`100%`:`50%`,top:e===`t`?`0`:e===`b`?`100%`:`50%`,cursor:`lr`.includes(e)?`ew-resize`:`ns-resize`,borderRadius:`50%`},class:yo}}function ce(){return{onPointerdown:ae,onPointermove:e=>{if(!M||e.buttons!==1)return;e.preventDefault(),e.stopPropagation();let t=(e.clientX-v.value-M.dx0)/_.value-$/4,n=(e.clientY-y.value-M.dy0)/_.value-$/4,r=Math.atan2(n-o.value,t-a.value)*180/Math.PI+90;for(let e of[0,90,180,270,360])if(Math.abs(r-e)<5){r=e%360;break}l.value=r},onPointerup:I,style:{width:`${$}px`,height:`${$}px`,margin:`-${$/2}px`,left:`50%`,top:`-20px`,cursor:`grab`,borderRadius:`50%`},class:yo}}let R={immediate:!1,immediateCallback:!1},le=Be(()=>{re.value<=vo||a.value--},bo,R),ue=Be(()=>{te.value>=me.value-vo||a.value++},bo,R),de=Be(()=>{k.value<=vo||o.value--},bo,R),fe=Be(()=>{ne.value>=ye.value-vo||o.value++},bo,R);return u(()=>{function e(e,t){Fe[e].value?t.resume():t.pause()}e(`left`,le),e(`right`,ue),e(`up`,de),e(`down`,fe)}),(e,u)=>Number.isFinite(p(a))?(F(),h(`div`,{key:0,id:`drag-control-container`,"data-drag-id":p(n),style:g({position:`absolute`,zIndex:100,left:`${p(r)*(p(a)-Math.abs(p(s))/2)}px`,top:`${p(r)*(p(o)-Math.abs(p(c))/2)}px`,width:`${p(r)*Math.abs(p(s))}px`,height:`${p(r)*Math.abs(p(c))}px`,transformOrigin:`center center`,transform:`rotate(${p(l)}deg)`}),onPointerdown:ae,onPointermove:oe,onPointerup:I},[f(`div`,{class:A([`absolute inset-0 z-nav dark:b-gray-400`,p(d)?``:`b b-dark`])},[p(i)?N(`v-if`,!0):(F(),h(O,{key:0},[f(`div`,P(t(se(!0,!0))),null,16),f(`div`,P(t(se(!1,!1))),null,16),p(d)?N(`v-if`,!0):(F(),h(O,{key:0},[f(`div`,P(t(se(!0,!1))),null,16),f(`div`,P(t(se(!1,!0))),null,16)],64))],64)),p(d)?N(`v-if`,!0):(F(),h(O,{key:1},[f(`div`,P(t(L(`l`))),null,16),f(`div`,P(t(L(`r`))),null,16),p(i)?N(`v-if`,!0):(F(),h(O,{key:0},[f(`div`,P(t(L(`t`))),null,16),f(`div`,P(t(L(`b`))),null,16)],64)),f(`div`,P(t(ce())),null,16),f(`div`,{class:`absolute -top-15px w-0 b b-dashed b-dark dark:b-gray-400`,style:g({left:`calc(50% - 1px)`,height:p(i)?`14px`:`10px`})},null,4)],64))],2)],44,_o)):N(`v-if`,!0)}}),So=Le(j({__name:`SlidesShow`,props:{renderContext:{}},setup(t){let{currentSlideRoute:r,currentTransition:i,getPrimaryClicks:a,prevRoute:d,nextRoute:f,slides:m,isPrintMode:g,isPrintWithClicks:_,clicksDirection:v,printRange:y}=V();function S(e){e.meta.preload!==!1&&(e.meta.__preloaded=!0,e.load())}u(()=>{S(r.value),S(d.value),S(f.value)}),u(e=>{let t=m.value,n=setTimeout(()=>{t.forEach(S)},3e3);e(()=>clearTimeout(n))}),ho(r,d,f,m);let w=go(),T=b();Ae(()=>import(`./DrawingLayer-BVIfdu9B.js`).then(e=>T.value=e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);let ee=x(()=>g.value?y.value.map(e=>m.value[e-1]):m.value.filter(e=>e.meta?.__preloaded||e===r.value));function E(){ke.value=!0,C()}return(u,d)=>(F(),h(O,null,[N(` Global Bottom `),c(p(dt)),N(` Slides `),(F(),k(n(p(w)&&!p(g)&&!p(ke)&&!p(Me)?`div`:ne),o(p(ke)||p(Me)||p(g)?{}:p(i),{id:`slideshow`,tag:`div`,class:{"slidev-nav-go-forward":p(v)>0,"slidev-nav-go-backward":p(v)<0},onAfterLeave:E}),{default:s(()=>[(F(!0),h(O,null,l(ee.value,n=>e((F(),k(mt,{key:n.no,"clicks-context":p(g)&&!p(_)?p(ce)(n,p(Qe)):p(a)(n),route:n,"render-context":t.renderContext},null,8,[`clicks-context`,`route`,`render-context`])),[[re,n===p(r)]])),128))]),_:1},16,[`class`])),p(De)?(F(),k(xo,{key:0,data:p(De)},null,8,[`data`])):N(`v-if`,!0),N(` Global Top `),c(p(pt)),T.value?(F(),k(p(T),{key:1})):N(`v-if`,!0)],64))}}),[[`__scopeId`,`data-v-835d2635`]]),Co=Object.assign({}),wo=Object.assign({}),To=Object.assign({}),Eo=[Object.values(Co)[0],Object.values(wo)[0],Object.values(To)[0]].filter(Boolean);function Do(){let{go:e,goFirst:t,goLast:n,next:r,nextSlide:i,prev:a,prevSlide:o}=V(),{drawingEnabled:s}=st(),{escape:c,space:l,shift:u,left:d,right:f,up:p,down:m,enter:h,d:g,g:_,o:v,"`":y}=Fe,b={next:r,prev:a,nextSlide:i,prevSlide:o,go:e,goFirst:t,goLast:n,downloadPDF:nt,toggleDark:it,toggleOverview:ue,toggleDrawing:()=>s.value=!s.value,escapeOverview:()=>I.value=!1,showGotoDialog:()=>z.value=!z.value},x=W(U(I),U(De)),S=[{name:`next_space`,key:W(l,U(u)),fn:r,autoRepeat:!0},{name:`prev_space`,key:W(l,u),fn:a,autoRepeat:!0},{name:`next_right`,key:W(f,U(u),x),fn:r,autoRepeat:!0},{name:`prev_left`,key:W(d,U(u),x),fn:a,autoRepeat:!0},{name:`next_page_key`,key:`pageDown`,fn:r,autoRepeat:!0},{name:`prev_page_key`,key:`pageUp`,fn:a,autoRepeat:!0},{name:`next_down`,key:W(m,x),fn:i,autoRepeat:!0},{name:`prev_up`,key:W(p,x),fn:o,autoRepeat:!0},{name:`next_shift`,key:W(f,u),fn:i,autoRepeat:!0},{name:`prev_shift`,key:W(d,u),fn:o,autoRepeat:!0},{name:`toggle_dark`,key:W(g,U(s)),fn:it},{name:`toggle_overview`,key:W(Ke(v,y),U(s)),fn:ue},{name:`hide_overview`,key:W(c,U(s)),fn:()=>I.value=!1},{name:`goto`,key:W(_,U(s)),fn:()=>z.value=!z.value},{name:`next_overview`,key:W(f,I),fn:$i},{name:`prev_overview`,key:W(d,I),fn:Qi},{name:`up_overview`,key:W(p,I),fn:ea},{name:`down_overview`,key:W(m,I),fn:ta},{name:`goto_from_overview`,key:W(h,I),fn:()=>{e(Z.value),I.value=!1}}],C=new Set(S.map(e=>e.name));for(let e of Eo)S=e(b,S);if(S.filter(e=>e.name&&C.has(e.name)).length===0){let e=[`========== WARNING ==========`,`defineShortcutsSetup did not return any of the base shortcuts.`,`See https://sli.dev/custom/config-shortcuts.html for migration.`,`If it is intentional, return at least one shortcut with one of the base names (e.g. name:"goto").`].join(` + +`);alert(e),console.warn(e)}return S}function Oo(){let{isPrintMode:e}=V(),t=W(U(Te),U(be),U(e),ge,U(oe)),n=Do();new Map(n.map(e=>[e.key,e])).forEach(e=>{e.fn&&r(e.key,e.fn,e.autoRepeat)}),i(`f`,()=>Ne.toggle());function r(e,n,r=!1){typeof e==`string`&&(e=Fe[e]);let i=W(e,t),a=0,o,s=()=>{if(clearTimeout(o),!i.value){a=0;return}r&&(o=setTimeout(s,Math.max(1e3-a*250,150)),a++),n()};return d(i,s,{flush:`sync`})}function i(e,n){return qe(e,e=>{t.value&&(e.repeat||n())})}}export{fa as a,Ji as c,gt as d,ht as f,Ma as i,Nt as l,So as n,ua as o,no as r,la as s,Oo as t,Et as u}; \ No newline at end of file diff --git a/transformer-v2/assets/useDrawings-Dnt5VfKs.js b/transformer-v2/assets/useDrawings-Dnt5VfKs.js new file mode 100644 index 0000000000000000000000000000000000000000..30e579f5af151f69c0815d09d80dd97afe30ec9a --- /dev/null +++ b/transformer-v2/assets/useDrawings-Dnt5VfKs.js @@ -0,0 +1 @@ +import{N as e,Y as t,at as n,g as r,lt as i,st as a}from"./modules/shiki-BFOesOFp.js";import{g as o,t as s,tt as c}from"./useNav-B1TSwKuf.js";import{E as l,h as u}from"./modules/vue-CXhtJkbE.js";import{c as d,l as f,s as p}from"./index-DBl9KyFJ.js";var m=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r{this.events[e]=this.events[e]?.filter(e=>t!==e)}}});function h(e,t){return e-t}function g(e){return e<0?-1:1}function _(e){return[Math.abs(e),g(e)]}function v(){let e=()=>((1+Math.random())*65536|0).toString(16).substring(1);return`${e()+e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}var y=2;function b(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`defs`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`marker`),i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return i.setAttribute(`fill`,t),r.setAttribute(`id`,e),r.setAttribute(`viewBox`,`0 -5 10 10`),r.setAttribute(`refX`,`5`),r.setAttribute(`refY`,`0`),r.setAttribute(`markerWidth`,`4`),r.setAttribute(`markerHeight`,`4`),r.setAttribute(`orient`,`auto`),i.setAttribute(`d`,`M0,-5L10,0L0,5`),r.appendChild(i),n.appendChild(r),n}function x(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function S(e,t,n){let r=t.x,i=t.y,a=n.x-r,o=n.y-i;if(a!==0||o!==0){let t=((e.x-r)*a+(e.y-i)*o)/(a*a+o*o);t>1?(r=n.x,i=n.y):t>0&&(r+=a*t,i+=o*t)}return a=e.x-r,o=e.y-i,a*a+o*o}function C(e,t){let n=e[0],r=[n],i;for(let a=1,o=e.length;at&&(r.push(i),n=i);return n!==i&&i&&r.push(i),r}function w(e,t,n,r,i){let a=r,o=0;for(let r=t+1;ra&&(o=r,a=i)}a>r&&(o-t>1&&w(e,t,o,r,i),i.push(e[o]),n-o>1&&w(e,o,n,r,i))}function T(e,t){let n=e.length-1,r=[e[0]];return w(e,0,n,t,r),r.push(e[n]),r}function E(e,t,n=!1){if(e.length<=2)return e;let r=t===void 0?1:t*t;return e=n?e:C(e,r),e=T(e,r),e}var D=class{constructor(e){this.drauu=e,this.event=void 0,this.point=void 0,this.start=void 0,this.el=null}onSelected(e){}onUnselected(){}onStart(e){}onMove(e){return!1}onEnd(e){}get brush(){return this.drauu.brush}get shiftPressed(){return this.drauu.shiftPressed}get altPressed(){return this.drauu.altPressed}get svgElement(){return this.drauu.el}getMousePosition(e){let t=this.drauu.el,n=this.drauu.options.cssZoom??1,r=this.drauu.options.coordinateScale??1,i=this.drauu.options.offset??{x:0,y:0};if(this.drauu.options.coordinateTransform===!1){let t=this.drauu.el.getBoundingClientRect();return{x:(e.pageX/n-t.left+i.x)*r,y:(e.pageY/n-t.top+i.y)*r,pressure:e.pressure}}{let a=this.drauu.svgPoint;a.x=e.clientX/n+i.x,a.y=e.clientY/n+i.y;let o=a.matrixTransform(t.getScreenCTM()?.inverse());return{x:o.x*r,y:o.y*r,pressure:e.pressure}}}createElement(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,e),r=t?{...this.brush,...t}:this.brush;return n.setAttribute(`fill`,r.fill??`transparent`),n.setAttribute(`stroke`,r.color),n.setAttribute(`stroke-width`,r.size.toString()),n.setAttribute(`stroke-linecap`,`round`),r.dasharray&&n.setAttribute(`stroke-dasharray`,r.dasharray),n}attr(e,t){this.el.setAttribute(e,typeof t==`string`?t:t.toFixed(y))}_setEvent(e){this.event=e,this.point=this.getMousePosition(e)}_eventDown(e){return this._setEvent(e),this.start=this.point,this.onStart(this.point)}_eventMove(e){return this._setEvent(e),this.onMove(this.point)}_eventUp(e){return this._setEvent(e),this.onEnd(this.point)}},O=class e extends D{constructor(...e){super(...e),this.points=[],this.count=0}onStart(e){if(this.el=this.createElement(`path`,{fill:`transparent`}),this.points=[e],this.brush.arrowEnd){this.arrowId=v();let e=b(this.arrowId,this.brush.color);this.el.appendChild(e)}return this.el}onMove(t){return this.el||this.onStart(t),this.points[this.points.length-1]!==t&&(this.points.push(t),this.count+=1),this.count>5&&(this.points=E(this.points,1,!0),this.count=0),this.attr(`d`,e.toSvgData(this.points)),!0}onEnd(){let t=this.el;if(this.el=null,!t)return!1;if(t.setAttribute(`d`,e.toSvgData(E(this.points,1,!0))),!t.getTotalLength()){let{x:e,y:n}=this.points[0],r=this.brush.size/2;t.setAttribute(`d`,`M ${e-r} ${n} a ${r},${r} 0 1,0 ${r*2},0 a ${r},${r} 0 1,0 ${-r*2},0`),t.setAttribute(`fill`,this.brush.color),t.setAttribute(`stroke-width`,`0`)}return!0}static line(e,t){let n=t.x-e.x,r=t.y-e.y;return{length:Math.sqrt(n**2+r**2),angle:Math.atan2(r,n)}}static controlPoint(t,n,r,i){let a=n||t,o=r||t,s=e.line(a,o),c=s.angle+(i?Math.PI:0),l=s.length*.2;return{x:t.x+Math.cos(c)*l,y:t.y+Math.sin(c)*l}}static bezierCommand(t,n,r){let i=e.controlPoint(r[n-1],r[n-2],t),a=e.controlPoint(t,r[n-1],r[n+1],!0);return`C ${i.x.toFixed(y)},${i.y.toFixed(y)} ${a.x.toFixed(y)},${a.y.toFixed(y)} ${t.x.toFixed(y)},${t.y.toFixed(y)}`}static toSvgData(t){return t.reduce((t,n,r,i)=>r===0?`M ${n.x.toFixed(y)},${n.y.toFixed(y)}`:`${t} ${e.bezierCommand(n,r,i)}`,``)}},k=class extends D{onStart(e){return this.el=this.createElement(`ellipse`),this.attr(`cx`,e.x),this.attr(`cy`,e.y),this.el}onMove(e){if(!this.el||!this.start)return!1;let[t,n]=_(e.x-this.start.x),[r,i]=_(e.y-this.start.y);if(this.shiftPressed){let e=Math.min(t,r);t=e,r=e}if(this.altPressed)this.attr(`cx`,this.start.x),this.attr(`cy`,this.start.y),this.attr(`rx`,t),this.attr(`ry`,r);else{let[e,a]=[this.start.x,this.start.x+t*n].sort(h),[o,s]=[this.start.y,this.start.y+r*i].sort(h);this.attr(`cx`,(e+a)/2),this.attr(`cy`,(o+s)/2),this.attr(`rx`,(a-e)/2),this.attr(`ry`,(s-o)/2)}return!0}onEnd(){let e=this.el;if(this.el=null,!e)return!1;try{if(!e.getTotalLength())return!1}catch{return!1}return!0}},A=class extends D{constructor(...e){super(...e),this.pathSubFactor=20,this.pathFragments=[],this._erased=[]}onSelected(e){let t=(e,n)=>{if(e&&e.length)for(let r=0;re.forEach(e=>this.drauu._restoreNode(e)),redo:()=>e.forEach(e=>this.drauu._removeNode(e))}}checkAndEraseElement(){if(this.pathFragments.length)for(let e=0;e!this._erased.includes(e.element))),this._erased.length>0}lineLineIntersect(e,t){let n=e.x1,r=e.x2,i=t.x1,a=t.x2,o=e.y1,s=e.y2,c=t.y1,l=t.y2,u=(n-r)*(c-l)-(o-s)*(i-a),d=(n*s-o*r)*(i-a)-(n-r)*(i*l-c*a),f=(n*s-o*r)*(c-l)-(o-s)*(i*l-c*a),p=(e,t,n)=>e>=t&&e<=n||e>=n&&e<=t;if(u===0)return!1;{let e={x:d/u,y:f/u};return p(e.x,n,r)&&p(e.y,o,s)&&p(e.x,i,a)&&p(e.y,c,l)}}},j=class extends D{onStart(e){if(this.el=this.createElement(`line`,{fill:`transparent`}),this.attr(`x1`,e.x),this.attr(`y1`,e.y),this.attr(`x2`,e.x),this.attr(`y2`,e.y),this.brush.arrowEnd){let e=v(),t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return t.append(b(e,this.brush.color)),t.append(this.el),this.attr(`marker-end`,`url(#${e})`),t}return this.el}onMove(e){if(!this.el)return!1;let{x:t,y:n}=e;if(this.shiftPressed){let r=e.x-this.start.x,i=e.y-this.start.y;if(i!==0){let e=r/i;e=Math.round(e),Math.abs(e)<=1?(t=this.start.x+i*e,n=this.start.y+i):(t=this.start.x+r,n=this.start.y)}}return this.altPressed?(this.attr(`x1`,this.start.x*2-t),this.attr(`y1`,this.start.y*2-n),this.attr(`x2`,t),this.attr(`y2`,n)):(this.attr(`x1`,this.start.x),this.attr(`y1`,this.start.y),this.attr(`x2`,t),this.attr(`y2`,n)),!0}onEnd(){let e=this.el;if(this.el=null,!e)return!1;try{if(e.getTotalLength()<5)return!1}catch{return!1}return!0}},M=class extends D{onStart(e){return this.el=this.createElement(`rect`),this.brush.cornerRadius&&(this.attr(`rx`,this.brush.cornerRadius),this.attr(`ry`,this.brush.cornerRadius)),this.attr(`x`,e.x),this.attr(`y`,e.y),this.el}onMove(e){if(!this.el||!this.start)return!1;let[t,n]=_(e.x-this.start.x),[r,i]=_(e.y-this.start.y);if(this.shiftPressed){let e=Math.min(t,r);t=e,r=e}if(this.altPressed)this.attr(`x`,this.start.x-t),this.attr(`y`,this.start.y-r),this.attr(`width`,t*2),this.attr(`height`,r*2);else{let[e,a]=[this.start.x,this.start.x+t*n].sort(h),[o,s]=[this.start.y,this.start.y+r*i].sort(h);this.attr(`x`,e),this.attr(`y`,o),this.attr(`width`,a-e),this.attr(`height`,s-o)}return!0}onEnd(){let e=this.el;if(this.el=null,!e)return!1;try{if(!e.getTotalLength())return!1}catch{return!1}return!0}};function N(e,t,n,r=e=>e){return e*r(.5-t*(.5-n))}function P(e){return[-e[0],-e[1]]}function F(e,t){return[e[0]+t[0],e[1]+t[1]]}function I(e,t){return[e[0]-t[0],e[1]-t[1]]}function L(e,t){return[e[0]*t,e[1]*t]}function R(e,t){return[e[0]/t,e[1]/t]}function z(e){return[e[1],-e[0]]}function B(e,t){return e[0]*t[0]+e[1]*t[1]}function V(e,t){return e[0]===t[0]&&e[1]===t[1]}function H(e){return Math.hypot(e[0],e[1])}function U(e){return e[0]*e[0]+e[1]*e[1]}function W(e,t){return U(I(e,t))}function G(e){return R(e,H(e))}function K(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function q(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=e[0]-t[0],o=e[1]-t[1],s=a*i-o*r,c=a*r+o*i;return[s+t[0],c+t[1]]}function J(e,t,n){return F(e,L(I(t,e),n))}function Y(e,t,n){return F(e,L(t,n))}var{min:X,PI:Z}=Math,Q=.275,$=Z+1e-4;function ee(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:a=!0,easing:o=e=>e,start:s={},end:c={},last:l=!1}=t,{cap:u=!0,easing:d=e=>e*(2-e)}=s,{cap:f=!0,easing:p=e=>--e*e*e+1}=c;if(e.length===0||n<=0)return[];let m=e[e.length-1].runningLength,h=s.taper===!1?0:s.taper===!0?Math.max(n,m):s.taper,g=c.taper===!1?0:c.taper===!0?Math.max(n,m):c.taper,_=(n*r)**2,v=[],y=[],b=e.slice(0,10).reduce((e,t)=>{let r=t.pressure;if(a){let i=X(1,t.distance/n);r=X(1,e+(X(1,1-i)-e)*(i*Q))}return(e+r)/2},e[0].pressure),x=N(n,i,e[e.length-1].pressure,o),S,C=e[0].vector,w=e[0].point,T=w,E=w,D=T,O=!1;for(let t=0;t_)&&(v.push(E),w=E),D=F(s,R),(t<=1||W(T,D)>_)&&(y.push(D),T=D),b=r,C=c}let k=e[0].point.slice(0,2),A=e.length>1?e[e.length-1].point.slice(0,2):F(e[0].point,[1,1]),j=[],M=[];if(e.length===1){if(!(h||g)||l){let e=Y(k,G(z(I(k,A))),-(S||x)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(q(e,k,$*2*r));return t}}else{if(!(h||g&&e.length===1)){if(u)for(let e=1/13,t=e;t<=1;t+=e){let e=q(y[0],k,$*t);j.push(e)}else{let e=I(v[0],y[0]),t=L(e,.5),n=L(e,.51);j.push(I(k,t),I(k,n),F(k,n),F(k,t))}}let t=z(P(e[e.length-1].vector));if(g||h&&e.length===1)M.push(A);else if(f){let e=Y(A,t,x);for(let t=1/29,n=t;n<1;n+=t)M.push(q(e,A,$*3*n))}else M.push(F(A,L(t,x)),F(A,L(t,x*.99)),I(A,L(t,x*.99)),I(A,L(t,x)))}return v.concat(M,y.reverse(),j)}function te(e,t={}){let{streamline:n=.5,size:r=16,last:i=!1}=t;if(e.length===0)return[];let a=.15+(1-n)*.85,o=Array.isArray(e[0])?e:e.map(({x:e,y:t,pressure:n=.5})=>[e,t,n]);if(o.length===2){let e=o[1];o=o.slice(0,-1);for(let t=1;t<5;t++)o.push(J(o[0],e,t/4))}o.length===1&&(o=[...o,[...F(o[0],[1,1]),...o[0].slice(2)]]);let s=[{point:[o[0][0],o[0][1]],pressure:o[0][2]>=0?o[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,l=0,u=s[0],d=o.length-1;for(let e=1;e=0?o[e][2]:.5,vector:G(I(u.point,t)),distance:n,runningLength:l},s.push(u)}return s[0].vector=s[1]?.vector||[0,0],s}function ne(e,t={}){return ee(te(e,t),t)}var re=class e extends D{constructor(...e){super(...e),this.points=[]}onStart(e){return this.el=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),this.points=[e],this.attr(`fill`,this.brush.color),this.attr(`d`,this.getSvgData(this.points)),this.el}onMove(e){return this.el||this.onStart(e),this.points[this.points.length-1]!==e&&this.points.push(e),this.attr(`d`,this.getSvgData(this.points)),!0}onEnd(){let e=this.el;return this.el=null,!!e}getSvgData(t){return e.getSvgData(t,this.brush)}static getSvgData(e,t){let n=ne(e,{size:t.size,thinning:.9,simulatePressure:!1,start:{taper:5},end:{taper:5},...t.stylusOptions});if(!n.length)return``;let r=n.reduce((e,[t,n],r,i)=>{let[a,o]=i[(r+1)%i.length];return e.push(t,n,(t+a)/2,(n+o)/2),e},[`M`,...n[0],`Q`]);return r.push(`Z`),r.map(e=>typeof e==`number`?e.toFixed(2):e).join(` `)}};function ie(e){return{draw:new O(e),stylus:new re(e),line:new j(e),rectangle:new M(e),ellipse:new k(e),eraseLine:new A(e)}}var ae=class{constructor(e={}){this.options=e,this.el=null,this.svgPoint=null,this.eventEl=null,this.shiftPressed=!1,this.altPressed=!1,this.drawing=!1,this._emitter=m(),this._originalPointerId=null,this._models=ie(this),this._opStack=[],this._opIndex=0,this._disposables=[],this._elements=[],this.options.brush||(this.options.brush={color:`black`,size:3,mode:`stylus`}),e.el&&this.mount(e.el,e.eventTarget,e.window)}get model(){return this._models[this.mode]}get mounted(){return!!this.el}get mode(){return this.options.brush.mode||`stylus`}set mode(e){this._models[this.mode].onUnselected(),this.options.brush.mode=e,this.model.onSelected(this.el)}get brush(){return this.options.brush}set brush(e){this.options.brush=e}resolveSelector(e){return typeof e==`string`?document.querySelector(e):e||null}mount(e,t,n=window){if(this.el)throw Error(`[drauu] already mounted, unmount previous target first`);if(this.el=this.resolveSelector(e),!this.el)throw Error(`[drauu] target element not found`);if(this.el.tagName.toLocaleLowerCase()!==`svg`)throw Error(`[drauu] can only mount to a SVG element`);if(!this.el.createSVGPoint)throw Error(`[drauu] SVG element must be create by document.createElementNS('http://www.w3.org/2000/svg', 'svg')`);this.svgPoint=this.el.createSVGPoint();let r=this.resolveSelector(t)||this.el,i=this.eventStart.bind(this),a=this.eventMove.bind(this),o=this.eventEnd.bind(this),s=this.eventKeyboard.bind(this),c=this.touchMove.bind(this);r.addEventListener(`pointerdown`,i,{passive:!1}),n.addEventListener(`pointermove`,a,{passive:!1}),n.addEventListener(`pointerup`,o,{passive:!1}),n.addEventListener(`pointercancel`,o,{passive:!1}),n.addEventListener(`keydown`,s,!1),n.addEventListener(`keyup`,s,!1),n.addEventListener(`touchmove`,c,{passive:!1}),this._disposables.push(()=>{r.removeEventListener(`pointerdown`,i),n.removeEventListener(`pointermove`,a),n.removeEventListener(`pointerup`,o),n.removeEventListener(`pointercancel`,o),n.removeEventListener(`keydown`,s,!1),n.removeEventListener(`keyup`,s,!1),n.removeEventListener(`touchmove`,c)}),this._emitter.emit(`mounted`)}unmount(){this._disposables.forEach(e=>e()),this._disposables.length=0,this._elements.length=0,this.el=null,this._emitter.emit(`unmounted`)}on(e,t){return this._emitter.on(e,t)}undo(){return!this.canUndo()||this.drawing?!1:(this._opStack[--this._opIndex].undo(),this._emitter.emit(`changed`),!0)}redo(){return!this.canRedo()||this.drawing?!1:(this._opStack[this._opIndex++].redo(),this._emitter.emit(`changed`),!0)}canRedo(){return this._opIndex0}eventMove(e){!this.acceptsInput(e)||!this.drawing||this.model._eventMove(e)&&(e.stopPropagation(),e.preventDefault(),this._emitter.emit(`changed`))}eventStart(e){this.acceptsInput(e)&&(e.stopPropagation(),e.preventDefault(),this._currentNode&&this.cancel(),this.drawing=!0,this._originalPointerId=e.pointerId,this._emitter.emit(`start`),this._currentNode=this.model._eventDown(e),this._currentNode&&this.mode!==`eraseLine`&&this.el.appendChild(this._currentNode),this._emitter.emit(`changed`))}eventEnd(e){if(!this.acceptsInput(e)||!this.drawing)return;let t=this.model._eventUp(e);if(!t)this.cancel();else if(t===!0){let e=this._currentNode;e&&(this._appendNode(e),this.commit({undo:()=>this._removeNode(e),redo:()=>this._restoreNode(e)}))}else this.commit(t);this.drawing=!1,this._emitter.emit(`end`),this._emitter.emit(`changed`),this._originalPointerId=null}touchMove(e){Array.from(e.touches).some(e=>e.touchType===`stylus`&&e.identifier===this._originalPointerId)&&e.preventDefault()}acceptsInput(e){return(!this.options.acceptsInputTypes||this.options.acceptsInputTypes.includes(e.pointerType))&&!(this._originalPointerId&&this._originalPointerId!==e.pointerId)}eventKeyboard(e){(this.shiftPressed!==e.shiftKey||this.altPressed!==e.altKey)&&(this.shiftPressed=e.shiftKey,this.altPressed=e.altKey,this.model.point&&this.model.onMove(this.model.point)&&this._emitter.emit(`changed`))}commit(e){this._opStack.length=this._opIndex,this._opStack.push(e),this._opIndex++;let t=this._currentNode;this._currentNode=void 0,this._emitter.emit(`committed`,t)}clear(){this._opStack.length=0,this._opIndex=0,this._elements=[],this.cancel(),this.el.innerHTML=``,this._emitter.emit(`changed`)}cancel(){this._currentNode&&(this.el.removeChild(this._currentNode),this._currentNode=void 0,this._emitter.emit(`canceled`))}dump(){return this.el.innerHTML}load(e){this.clear(),this.el.innerHTML=e}_appendNode(e){let t=this._elements.at(-1);t?t.after(e):this.el.append(e);let n=this._elements.push(e)-1;e.dataset.drauu_index=n.toString()}_removeNode(e){e.remove(),this._elements[+e.dataset.drauu_index]=null}_restoreNode(e){let t=+e.dataset.drauu_index;this._elements[t]=e;for(let n=t-1;n>=0;n--){let t=this._elements[n];if(t){t.after(e);return}}this.el.prepend(e)}};function oe(e){return new ae(e)}var se=l(()=>{let{currentSlideNo:l,isPresenter:m}=s(),h=[`#ff595e`,`#ffca3a`,`#8ac926`,`#1982c4`,`#6a4c93`,`#ffffff`,`#000000`],g=u(`slidev-drawing-enabled`,!1),_=u(`slidev-drawing-pinned`,!1),v=u(`slidev-drawing-brush`,{color:h[0],size:4,mode:`stylus`}),y=i(!1),b=i(!1),x=i(!1),S=i(!1),C=i(`stylus`),w=r(()=>c.drawings.syncAll||m.value),T=!1,E=r({get(){return C.value},set(e){C.value=e,e===`arrow`?(O.mode=`line`,v.value.arrowEnd=!0):(O.mode=e,v.value.arrowEnd=!1)}}),D=a({brush:v,acceptsInputTypes:r(()=>g.value&&(!c.drawings.presenterOnly||m.value)?void 0:[`pen`]),coordinateTransform:!1}),O=n(oe(D));function k(){O.clear(),w.value&&f(l.value,``)}function A(){x.value=O.canRedo(),b.value=O.canUndo(),S.value=!!O.el?.children.length}function j(e){T=!0;let t=p[e||l.value];t==null?O.clear():O.load(t),A(),T=!1}return O.on(`changed`,()=>{if(A(),!T){let e=O.dump(),t=l.value;(p[t]||``)!==e&&w.value&&f(t,O.dump())}}),d(e=>{T=!0,e[l.value]!=null&&O.load(e[l.value]||``),T=!1,A()}),e(()=>{t(l,()=>{O.mounted&&j()},{immediate:!0})}),O.on(`start`,()=>y.value=!0),O.on(`end`,()=>y.value=!1),window.addEventListener(`keydown`,e=>{if(!g.value||o.value)return;let t=!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey,n=!0;e.code===`KeyZ`&&(e.ctrlKey||e.metaKey)?e.shiftKey?O.redo():O.undo():e.code===`Escape`?g.value=!1:e.code===`KeyL`&&t?E.value=`line`:e.code===`KeyA`&&t?E.value=`arrow`:e.code===`KeyS`&&t?E.value=`stylus`:e.code===`KeyR`&&t?E.value=`rectangle`:e.code===`KeyE`&&t?E.value=`ellipse`:e.code===`KeyC`&&t?k():e.code.startsWith(`Digit`)&&t&&+e.code[5]<=h.length?v.value.color=h[e.code[5]-1]:n=!1,n&&(e.preventDefault(),e.stopPropagation())},!1),{brush:v,brushColors:h,canClear:S,canRedo:x,canUndo:b,clear:k,drauu:O,drauuOptions:D,drawingEnabled:g,drawingMode:E,drawingPinned:_,drawingState:p,isDrawing:y,loadCanvas:j}});export{se as t}; \ No newline at end of file diff --git a/transformer-v2/assets/useNav-B1TSwKuf.js b/transformer-v2/assets/useNav-B1TSwKuf.js new file mode 100644 index 0000000000000000000000000000000000000000..e19b281b416f6809977354cff064b7ee60439b75 --- /dev/null +++ b/transformer-v2/assets/useNav-B1TSwKuf.js @@ -0,0 +1,249 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./md-DTeIdT5u.js","./modules/shiki-BFOesOFp.js","./rolldown-runtime-hePW80VL.js","./modules/shiki-BrmBd2_v.css","./_plugin-vue_export-helper-BDNMzG2s.js","./slidev/context-ChHKJoK9.js","./modules/vue-CXhtJkbE.js","./Citation-DTpwAx0S.js","./Citation-rca7ok54.css","./TransformerGlyph-XWvPPlsx.js","./TransformerGlyph-BK20oEGr.css","./md-CYXxUBJM.css","./md-CE--CYvf.js","./default-DTdNOfwb.js","./DeckFooter-CDGyhr7n.js","./slidev/client-seyoTamJ.js","./syncState-BrWO1mSt.js","./index-DBl9KyFJ.js","./index-DmzORiUY.css","./useDrawings-Dnt5VfKs.js","./DeckFooter-B6vKMo6W.css","./default-DFJXHcku.css","./md-CV0LbJ3U2.js","./md-Cq-m9sQz2.js","./section-YCe7iaDx.js","./section-BZ9Dfv_4.css","./md-BUwdHoCB.js","./slidev/VClicks-BDQlFH0_.js","./FlowDot-CpcqfMjQ.js","./FlowDot-DhuTnWHT.css","./md-CW77YPMv.js","./md-BT1hbqH6.js","./md-D2cNEyY32.js","./md-DJ9N9dkz.js","./md-D2UfMBGR.js","./md-BWt5EuMf.js","./md-CDcgbbik.js","./md-DE54QcLZ.js","./md-D8sbaEtQ.js","./md-Df1KxXuS.js","./md-D-b0YBoE.js","./interactive-C1KYSeoO.js","./interactive-BZ2_NsFq.css","./ItAttention-C9htn_5o.js","./useIllustrated-CloGYVoH.js","./useAttention-B502Bcm9.js","./ItAttention-DcmGpltA.css","./md-DeP3xum_.js","./md-BRvTXwre.js","./md-DURWg7Wl.js","./md-BkwHwcNT.js","./md-JhK7xqvk.js","./md-BcztEDTt.js","./md-DEIfGkvE.js","./slidev/KaTexBlockWrapper-DlEiKh25.js","./md-BVyRYzwm.js","./md-DsnKO94w.js","./md-CG5Sy8Ts.js","./md-B_GNIk3O.js","./useConvolution-qO1u8ksh.js","./md-BnB9SH19.css","./md-Cil9bYLP.js","./md-CBiwiAUN2.js","./PollSlide-uaNGIrh8.js","./PollSlide-C7CHIzYm.css","./md-CKe0B4NX2.js","./md-DBAOYXyd.js","./md-C4csASMu2.js","./md-ClA16Aez.js","./md-CIEPxxCW.js","./md-DfUOvC0T.js","./md-Dujs-v-n.js","./md-Jxei1Krr2.js","./md-DA_krWYn2.js","./md-DUErez2C2.js","./md-hSb063-Y2.js","./md-DrgIGlVp2.js","./md-JKbeikw12.js","./md-DYSLXf1o2.js","./md-n-O9BiQw.js","./md-nMkiMiwP.js","./md-YtqeGDdO.js","./md-CaP1nPh7.js","./md-gM39Vny3.js","./md-BgWTBxyL.js","./md-DxsAiztQ.js","./md-D-DRW-H6.js","./md-Dth3J5pw.css","./md-v3n1Uq5B.js","./md-DFuumq9u.js","./md-DjpByc0R.js","./md-DByKDP8J.js","./md-fvfttbwL.js","./md-B2eT1_4x.js","./md-CChSOWnD.js","./md-pDvaI0qJ.js","./md-aadRBhSJ.js","./md-DOh70PNW.js","./md-B5YzwuK5.js","./md-c1b1hiln.js","./md-geNSqxeK.js","./md-Bf5Oits0.js","./md-BmDYNuWL.js","./md-JC1IoCq-.js","./DecodeLoop-CNTHEb2K.js","./DecodeLoop-BEpyTQUC.css","./md-CBx0Em09.js","./md-DD7CU7HJ.js","./md-CacrcamQ.js","./md-DPlC9Trn.js","./md-DxAxCp9K.js","./md-nm6wRbKQ.js","./md-BE6SL9lC.js","./md-Bt-qs18d.js","./md-DtzrSiRi.js","./md-DC_yLTgh.js","./md-LhxTbmEd2.js","./md-DzvF9ZKL2.js","./md-C68rt1Jx2.js","./md-CrzPctyJ.css","./md-DmlbZGZu2.js","./md-CLNMUNew2.js","./md-DHzdLo_f2.js","./md-DCToEkhh2.js","./md-CqT2jAjy2.js","./md-DuVY9mus2.js","./md-CNTV1QrC2.js","./md-BUsztF6n2.js","./md-DFAWAndK2.js","./md-DAKQJiBX2.js","./md-4y3kr0IX2.js","./md-DhZ23yU-.css","./md-DzgQupA02.js","./md-3Q8XeZQo2.js","./md-DE2QGCpb.css"])))=>i.map(i=>d[i]); +import{C as e,L as t,N as n,O as r,R as i,Y as a,_ as o,_t as s,b as c,ft as l,g as u,gt as ee,lt as d,m as f,pt as te,rt as ne,st as p,ut as m,w as re,xt as ie,y as ae,z as oe}from"./modules/shiki-BFOesOFp.js";import{t as se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{A as ce,B as le,E as ue,I as de,T as fe,a as pe,c as me,g as he,h,k as ge,l as _e,m as ve,z as ye}from"./modules/vue-CXhtJkbE.js";import{l as be,y as xe}from"./slidev/context-ChHKJoK9.js";function Se(e,t,n){return Math.min(n,Math.max(t,e))}function Ce(...e){return Te(e).reduce((e,t)=>e+t,0)}function we(e){return e??=[],Array.isArray(e)?e:[e]}function Te(e){return we(e).flat(1)}function Ee(e){return Array.from(new Set(e))}function De(...e){let t,n,r;e.length===1?(t=0,r=1,[n]=e):[t,n,r=1]=e;let i=[],a=t;for(;at(e,n)).filter(Oe))}var g={theme:`dl2026`,title:`Transformer v2: The Illustrated Transformer`,titleTemplate:`%s - Slidev`,addons:[`dl2026`],remoteAssets:!1,monaco:!0,monacoTypesSource:`local`,monacoTypesAdditionalPackages:[],monacoTypesIgnorePackages:[],monacoRunAdditionalDeps:[],monacoRunUseStrict:!0,download:`./slides.pdf`,export:{},info:`

PGR207 Deep Learning 2026 — Transformer v2, after Jay Alammar's The Illustrated Transformer

+`,highlighter:`shiki`,twoslash:!0,lineNumbers:!1,colorSchema:`auto`,routerMode:`hash`,aspectRatio:1.7777777777777777,canvasWidth:980,exportFilename:``,selectable:!1,themeConfig:{courseCode:`PGR207`,lectureTitle:`Transformer v2: The Illustrated Transformer`},fonts:{sans:[`"Inter"`,`ui-sans-serif`,`system-ui`,`-apple-system`,`BlinkMacSystemFont`,`"Segoe UI"`,`Roboto`,`"Helvetica Neue"`,`Arial`,`"Noto Sans"`,`sans-serif`,`"Apple Color Emoji"`,`"Segoe UI Emoji"`,`"Segoe UI Symbol"`,`"Noto Color Emoji"`],serif:[`"Source Serif 4"`,`ui-serif`,`Georgia`,`Cambria`,`"Times New Roman"`,`Times`,`serif`],mono:[`"JetBrains Mono"`,`ui-monospace`,`SFMono-Regular`,`Menlo`,`Monaco`,`Consolas`,`"Liberation Mono"`,`"Courier New"`,`monospace`],webfonts:[`Inter`,`Source Serif 4`,`JetBrains Mono`],provider:`google`,local:[],italic:!1,weights:[`200`,`400`,`600`]},favicon:`https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png`,drawings:{enabled:!0,persist:!1,presenterOnly:!1,syncAll:!0},plantUmlServer:`https://www.plantuml.com/plantuml`,codeCopy:!0,magicMoveCopy:!0,author:`Vajira Thambawita`,record:`dev`,css:`unocss`,presenter:!0,browserExporter:`dev`,htmlAttrs:{},transition:`slide-left`,editor:!0,mcp:!0,contextMenu:null,wakeLock:!0,pwa:!1,mdc:!0,comark:!1,seoMeta:{},notesAutoRuby:{},duration:`30min`,timer:`stopwatch`,magicMoveDuration:800,preloadImages:!0,clickAnimation:``,layout:`title`,courseCode:`PGR207`,email:`vajira@simula.no`,slidesTitle:`Transformer v2: The Illustrated Transformer - Slidev`},Ae=`build`,je=u(()=>g.aspectRatio),Me=u(()=>g.canvasWidth),Ne=u(()=>Math.ceil(Me.value/je.value)),Pe=u(()=>ke(g.themeConfig||{},(e,t)=>[`--slidev-theme-${e}`,t])),Fe=g.slidesTitle,Ie=`./#/`,Le=`modulepreload`,Re=function(e,t){return new URL(e,t).href},ze={},_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Re(t,n),t=s(t),t in ze)return;ze[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Le,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function Be(e){if(e===!1||e===`false`)return null;if(e==null||e===!0||e===`true`)return`+1`;if(typeof e==`string`&&`+-`.includes(e[0]))return e;let t=+e;return Number.isNaN(t)?(console.error(`Invalid "at" prop value: ${e}`),null):t<=0?(console.warn(`[Slidev] "at" prop value must be greater than 0, but got ${e}, has been set to 1`),1):t}function Ve(e){return Array.isArray(e)?[Be(e[0]),Be(e[1])]:null}function He(e,n=0,r){let a=d(!1),o=new Map,s=new Map,c={get current(){return Se(+e.value,n,c.total)},set current(t){e.value=a.value?Se(t,n,c.total):t},clicksStart:n,get relativeSizeMap(){return o},get maxMap(){return s},get isMounted(){return a.value},setup(){t(()=>{a.value=!0,s=m(s),ne(e)||(c.current=e.value)}),i(()=>{a.value=!1,o=new Map,s=new Map})},calculateSince(e,t=1){let n=Be(e);if(n==null)return null;let r,i,a;if(typeof n==`string`){let e=c.currentOffset,o=+n;r=e+o,i=e+o+t-1,a=o+t-1}else r=n,i=n+t-1,a=0;return{start:r,end:1/0,max:i,delta:a,currentOffset:u(()=>c.current-r),isCurrent:u(()=>c.current===r),isActive:u(()=>c.current>=r)}},calculateRange(e){let t=Ve(e);if(t==null)return null;let[n,r]=t,i,a,o;return typeof n==`string`?(i=c.currentOffset+ +n,o=+n):(i=n,o=0),typeof r==`string`?(a=i+ +r,o+=+r):a=r,{start:i,end:a,max:a,delta:o,currentOffset:u(()=>c.current-i),isCurrent:u(()=>c.current===i),isActive:u(()=>i<=c.current&&c.currentee(t),e=>{r.value=Math.max(e,n)}),He(r,n,e?.meta?.clicks)}var We=/[a-z]/i;function Ge(e){if(typeof e==`number`)return{seconds:e,relative:!1};let t=e.startsWith(`+`);t&&(e=e.slice(1));let n=0;if(e.includes(`:`)){let t=e.split(`:`).map(Number),r=0,i=0,a=0;if(t.length===3)r=t[0],i=t[1],a=t[2];else if(t.length===2)i=t[0],a=t[1];else if(t.length===1)a=t[0];else throw TypeError(`Invalid timestamp format`);if(Number.isNaN(r)||Number.isNaN(i)||Number.isNaN(a))throw TypeError(`Invalid timestamp format`);n=(r||0)*3600+(i||0)*60+(a||0)}else if(!We.test(e))n=Number(e);else{let t={s:1,sec:1,secs:1,m:60,min:60,mins:60,h:3600,hr:3600,hrs:3600,hour:3600,hours:3600,day:86400,days:86400,week:604800,weeks:604800,month:2629746,months:2629746,year:31556952,years:31556952},r=/([\d.]+)([a-z]+)/gi,i=e.matchAll(r);if(i)for(let e of i){let r=Number(e[1]);if(Number.isNaN(r))throw TypeError(`Invalid timestamp value: ${e[1]}`);let i=e[2].toLowerCase();if(!(i in t))throw TypeError(`Invalid timestamp unit: ${i}`);n+=r*t[i]}let a=e.replace(r,``).trim();if(a)throw TypeError(`Unknown timestamp remaining: ${a}`)}return{seconds:n,relative:t}}function Ke(e,t){if(!t||t===`all`||t===`*`)return De(1,e+1);if(t===`none`)return[];let n=[];for(let r of t.split(/[,;]/g))if(!r.includes(`-`))n.push(+r);else{let[t,i]=r.split(`-`,2);n.push(...De(+t,i?+i+1:e+1))}return Ee(n).filter(t=>t<=e).sort((e,t)=>e-t)}var qe={},Je={class:`px-4 py-10 text-center text-red-700 dark:text-red-500 font-bold font-mono`};function Ye(e,t){return oe(),c(`div`,Je,ie(`Failed to fetch this slide. Please check your network connection.`))}var v=se(qe,[[`render`,Ye]]),Xe={class:`h-full w-full flex items-center justify-center gap-2 slidev-slide-loading`},Ze=re({__name:`SlideLoading`,setup(e){let n=d(!1);return t(()=>{setTimeout(()=>{n.value=!0},200)}),(e,t)=>(oe(),c(`div`,Xe,[n.value?(oe(),c(f,{key:0},[t[0]||=o(`div`,{class:`i-svg-spinners-90-ring-with-bg text-xl`},null,-1),t[1]||=o(`div`,null,`Loading slide...`,-1)],64)):ae(`v-if`,!0)]))}}),y=p({theme:`dl2026`,addons:[`dl2026`],title:`Transformer v2: The Illustrated Transformer`,info:`PGR207 Deep Learning 2026 — Transformer v2, after Jay Alammar's The Illustrated Transformer`,author:`Vajira Thambawita`,routerMode:`hash`,transition:`slide-left`,mdc:!0,themeConfig:{courseCode:`PGR207`,lectureTitle:`Transformer v2: The Illustrated Transformer`},layout:`title`,courseCode:`PGR207`,email:`vajira@simula.no`}),Qe=m({get layout(){return y.layout},get transition(){return y.transition},get class(){return y.class},get clicks(){return y.clicks},get name(){return y.name},get preload(){return y.preload},slide:{content:``,revision:`kakq45`,frontmatterRaw:`theme: dl2026 +addons: + - dl2026 +title: "Transformer v2: The Illustrated Transformer" +info: PGR207 Deep Learning 2026 — Transformer v2, after Jay Alammar's The Illustrated Transformer +author: Vajira Thambawita +routerMode: hash +transition: slide-left +mdc: true +themeConfig: + courseCode: PGR207 + lectureTitle: "Transformer v2: The Illustrated Transformer" +layout: title +courseCode: PGR207 +email: vajira@simula.no +`,note:``,title:`Transformer v2: The Illustrated Transformer`,index:0,noteHTML:``,images:[],raw:``,frontmatter:y,filepath:``,start:0,sourceIndex:0,id:0,no:1},__clicksContext:null,__preloaded:!1}),b=p({layout:`default`,core:!0,title:`Today, in eight parts`}),$e=m({get layout(){return b.layout},get transition(){return b.transition},get class(){return b.class},get clicks(){return b.clicks},get name(){return b.name},get preload(){return b.preload},slide:{content:``,revision:`-mqevd3`,frontmatterRaw:`layout: default +core: true +title: Today, in eight parts +`,note:``,title:`Today, in eight parts`,index:1,noteHTML:``,images:[],raw:``,frontmatter:b,filepath:``,start:59,sourceIndex:1,id:1,no:2},__clicksContext:null,__preloaded:!1}),x=p({layout:`default`,title:`In words: Today, in eight parts`}),et=m({get layout(){return x.layout},get transition(){return x.transition},get class(){return x.class},get clicks(){return x.clicks},get name(){return x.name},get preload(){return x.preload},slide:{content:``,revision:`aw5nts`,frontmatterRaw:`layout: default +title: "In words: Today, in eight parts" +`,note:``,title:`In words: Today, in eight parts`,index:2,noteHTML:``,images:[],raw:``,frontmatter:x,filepath:``,start:129,sourceIndex:2,id:2,no:3},__clicksContext:null,__preloaded:!1}),S=p({layout:`section`,index:`00`}),tt=m({get layout(){return S.layout},get transition(){return S.transition},get class(){return S.class},get clicks(){return S.clicks},get name(){return S.name},get preload(){return S.preload},slide:{content:``,revision:`-la2vk`,frontmatterRaw:`layout: section +index: "00" +`,note:``,title:`The big picture`,level:1,index:3,noteHTML:``,images:[],raw:``,frontmatter:S,filepath:``,start:155,sourceIndex:3,id:3,no:4},__clicksContext:null,__preloaded:!1}),C=p({layout:`default`,core:!0,title:`A black box that translates`}),nt=m({get layout(){return C.layout},get transition(){return C.transition},get class(){return C.class},get clicks(){return C.clicks},get name(){return C.name},get preload(){return C.preload},slide:{content:``,revision:`-8qoapw`,frontmatterRaw:`layout: default +core: true +title: A black box that translates +`,note:``,title:`A black box that translates`,index:4,noteHTML:``,images:[],raw:``,frontmatter:C,filepath:``,start:176,sourceIndex:4,id:4,no:5},__clicksContext:null,__preloaded:!1}),w=p({layout:`default`,title:`In words: A black box that translates`}),rt=m({get layout(){return w.layout},get transition(){return w.transition},get class(){return w.class},get clicks(){return w.clicks},get name(){return w.name},get preload(){return w.preload},slide:{content:``,revision:`z6suj6`,frontmatterRaw:`layout: default +title: "In words: A black box that translates" +`,note:``,title:`In words: A black box that translates`,index:5,noteHTML:``,images:[],raw:``,frontmatter:w,filepath:``,start:258,sourceIndex:5,id:5,no:6},__clicksContext:null,__preloaded:!1}),T=p({layout:`default`,core:!0,title:`Six encoders, six decoders`}),it=m({get layout(){return T.layout},get transition(){return T.transition},get class(){return T.class},get clicks(){return T.clicks},get name(){return T.name},get preload(){return T.preload},slide:{content:``,revision:`lwga5w`,frontmatterRaw:`layout: default +core: true +title: Six encoders, six decoders +`,note:``,title:`Six encoders, six decoders`,index:6,noteHTML:``,images:[],raw:``,frontmatter:T,filepath:``,start:284,sourceIndex:6,id:6,no:7},__clicksContext:null,__preloaded:!1}),E=p({layout:`default`,title:`In words: Six encoders, six decoders`}),at=m({get layout(){return E.layout},get transition(){return E.transition},get class(){return E.class},get clicks(){return E.clicks},get name(){return E.name},get preload(){return E.preload},slide:{content:``,revision:`-xze0zj`,frontmatterRaw:`layout: default +title: "In words: Six encoders, six decoders" +`,note:``,title:`In words: Six encoders, six decoders`,index:7,noteHTML:``,images:[],raw:``,frontmatter:E,filepath:``,start:364,sourceIndex:7,id:7,no:8},__clicksContext:null,__preloaded:!1}),D=p({layout:`default`,core:!0,title:`Inside one encoder, inside one decoder`}),ot=m({get layout(){return D.layout},get transition(){return D.transition},get class(){return D.class},get clicks(){return D.clicks},get name(){return D.name},get preload(){return D.preload},slide:{content:``,revision:`7521zs`,frontmatterRaw:`layout: default +core: true +title: Inside one encoder, inside one decoder +`,note:``,title:`Inside one encoder, inside one decoder`,index:8,noteHTML:``,images:[],raw:``,frontmatter:D,filepath:``,start:390,sourceIndex:8,id:8,no:9},__clicksContext:null,__preloaded:!1}),O=p({layout:`default`,title:`In words: Inside one encoder, inside one decoder`}),st=m({get layout(){return O.layout},get transition(){return O.transition},get class(){return O.class},get clicks(){return O.clicks},get name(){return O.name},get preload(){return O.preload},slide:{content:``,revision:`8upvl2`,frontmatterRaw:`layout: default +title: "In words: Inside one encoder, inside one decoder" +`,note:``,title:`In words: Inside one encoder, inside one decoder`,index:9,noteHTML:``,images:[],raw:``,frontmatter:O,filepath:``,start:473,sourceIndex:9,id:9,no:10},__clicksContext:null,__preloaded:!1}),k=p({layout:`default`,core:!0,title:`Refresher: a word becomes a vector`}),ct=m({get layout(){return k.layout},get transition(){return k.transition},get class(){return k.class},get clicks(){return k.clicks},get name(){return k.name},get preload(){return k.preload},slide:{content:``,revision:`6wm0sv`,frontmatterRaw:`layout: default +core: true +title: "Refresher: a word becomes a vector" +`,note:``,title:`Refresher: a word becomes a vector`,index:10,noteHTML:``,images:[],raw:``,frontmatter:k,filepath:``,start:499,sourceIndex:10,id:10,no:11},__clicksContext:null,__preloaded:!1}),A=p({layout:`default`,title:`In words: Refresher: a word becomes a vector`}),lt=m({get layout(){return A.layout},get transition(){return A.transition},get class(){return A.class},get clicks(){return A.clicks},get name(){return A.name},get preload(){return A.preload},slide:{content:``,revision:`m93ae4`,frontmatterRaw:`layout: default +title: "In words: Refresher: a word becomes a vector" +`,note:``,title:`In words: Refresher: a word becomes a vector`,index:11,noteHTML:``,images:[],raw:``,frontmatter:A,filepath:``,start:572,sourceIndex:11,id:11,no:12},__clicksContext:null,__preloaded:!1}),j=p({layout:`default`,core:!0,title:`A list of vectors flows up the stack`}),ut=m({get layout(){return j.layout},get transition(){return j.transition},get class(){return j.class},get clicks(){return j.clicks},get name(){return j.name},get preload(){return j.preload},slide:{content:``,revision:`hjd2wr`,frontmatterRaw:`layout: default +core: true +title: A list of vectors flows up the stack +`,note:``,title:`A list of vectors flows up the stack`,index:12,noteHTML:``,images:[],raw:``,frontmatter:j,filepath:``,start:598,sourceIndex:12,id:12,no:13},__clicksContext:null,__preloaded:!1}),M=p({layout:`default`,title:`In words: A list of vectors flows up the stack`}),dt=m({get layout(){return M.layout},get transition(){return M.transition},get class(){return M.class},get clicks(){return M.clicks},get name(){return M.name},get preload(){return M.preload},slide:{content:``,revision:`fh8osa`,frontmatterRaw:`layout: default +title: "In words: A list of vectors flows up the stack" +`,note:``,title:`In words: A list of vectors flows up the stack`,index:13,noteHTML:``,images:[],raw:``,frontmatter:M,filepath:``,start:678,sourceIndex:13,id:13,no:14},__clicksContext:null,__preloaded:!1}),N=p({layout:`section`,index:`01`}),ft=m({get layout(){return N.layout},get transition(){return N.transition},get class(){return N.class},get clicks(){return N.clicks},get name(){return N.name},get preload(){return N.preload},slide:{content:``,revision:`-h34bi6`,frontmatterRaw:`layout: section +index: "01" +`,note:``,title:`Self-attention`,level:1,index:14,noteHTML:``,images:[],raw:``,frontmatter:N,filepath:``,start:704,sourceIndex:14,id:14,no:15},__clicksContext:null,__preloaded:!1}),P=p({layout:`interactive`,core:!0,heading:`What does "it" refer to?`,title:`What does "it" refer to?`,"aside-width":`16rem`}),pt=m({get layout(){return P.layout},get transition(){return P.transition},get class(){return P.class},get clicks(){return P.clicks},get name(){return P.name},get preload(){return P.preload},slide:{content:``,revision:`-cdc3ec`,frontmatterRaw:`layout: interactive +core: true +heading: What does "it" refer to? +title: What does "it" refer to? +aside-width: 16rem +`,note:``,title:`What does "it" refer to?`,index:15,noteHTML:``,images:[],raw:``,frontmatter:P,filepath:``,start:726,sourceIndex:15,id:15,no:16},__clicksContext:null,__preloaded:!1}),F=p({layout:`default`,title:`In words: What does "it" refer to?`}),mt=m({get layout(){return F.layout},get transition(){return F.transition},get class(){return F.class},get clicks(){return F.clicks},get name(){return F.name},get preload(){return F.preload},slide:{content:``,revision:`-unfv1t`,frontmatterRaw:`layout: default +title: 'In words: What does "it" refer to?' +`,note:``,title:`In words: What does "it" refer to?`,index:16,noteHTML:``,images:[],raw:``,frontmatter:F,filepath:``,start:776,sourceIndex:16,id:16,no:17},__clicksContext:null,__preloaded:!1}),I=p({layout:`default`,core:!0,title:`Step 1: three vectors for every word`}),ht=m({get layout(){return I.layout},get transition(){return I.transition},get class(){return I.class},get clicks(){return I.clicks},get name(){return I.name},get preload(){return I.preload},slide:{content:``,revision:`-rbqn6f`,frontmatterRaw:`layout: default +core: true +title: "Step 1: three vectors for every word" +`,note:``,title:`Step 1: three vectors for every word`,index:17,noteHTML:``,images:[],raw:``,frontmatter:I,filepath:``,start:802,sourceIndex:17,id:17,no:18},__clicksContext:null,__preloaded:!1}),L=p({layout:`default`,title:`In words: Step 1: three vectors for every word`}),gt=m({get layout(){return L.layout},get transition(){return L.transition},get class(){return L.class},get clicks(){return L.clicks},get name(){return L.name},get preload(){return L.preload},slide:{content:``,revision:`-27fmv9`,frontmatterRaw:`layout: default +title: "In words: Step 1: three vectors for every word" +`,note:``,title:`In words: Step 1: three vectors for every word`,index:18,noteHTML:``,images:[],raw:``,frontmatter:L,filepath:``,start:883,sourceIndex:18,id:18,no:19},__clicksContext:null,__preloaded:!1}),R=p({layout:`default`,core:!0,title:`Step 2: score every word`}),_t=m({get layout(){return R.layout},get transition(){return R.transition},get class(){return R.class},get clicks(){return R.clicks},get name(){return R.name},get preload(){return R.preload},slide:{content:``,revision:`xycvbn`,frontmatterRaw:`layout: default +core: true +title: "Step 2: score every word" +`,note:``,title:`Step 2: score every word`,index:19,noteHTML:``,images:[],raw:``,frontmatter:R,filepath:``,start:909,sourceIndex:19,id:19,no:20},__clicksContext:null,__preloaded:!1}),z=p({layout:`default`,title:`In words: Step 2: score every word`}),vt=m({get layout(){return z.layout},get transition(){return z.transition},get class(){return z.class},get clicks(){return z.clicks},get name(){return z.name},get preload(){return z.preload},slide:{content:``,revision:`-qqu32t`,frontmatterRaw:`layout: default +title: "In words: Step 2: score every word" +`,note:``,title:`In words: Step 2: score every word`,index:20,noteHTML:``,images:[],raw:``,frontmatter:z,filepath:``,start:990,sourceIndex:20,id:20,no:21},__clicksContext:null,__preloaded:!1}),B=p({layout:`default`,core:!0,title:`Steps 3 and 4: scale, then softmax`}),yt=m({get layout(){return B.layout},get transition(){return B.transition},get class(){return B.class},get clicks(){return B.clicks},get name(){return B.name},get preload(){return B.preload},slide:{content:``,revision:`-rqfdwx`,frontmatterRaw:`layout: default +core: true +title: "Steps 3 and 4: scale, then softmax" +`,note:``,title:`Steps 3 and 4: scale, then softmax`,index:21,noteHTML:``,images:[],raw:``,frontmatter:B,filepath:``,start:1015,sourceIndex:21,id:21,no:22},__clicksContext:null,__preloaded:!1}),V=p({layout:`default`,title:`Reading the equation: one attention weight`}),bt=m({get layout(){return V.layout},get transition(){return V.transition},get class(){return V.class},get clicks(){return V.clicks},get name(){return V.name},get preload(){return V.preload},slide:{content:``,revision:`7a9sj2`,frontmatterRaw:`layout: default +title: "Reading the equation: one attention weight" +`,note:``,title:`Reading the equation: one attention weight`,index:22,noteHTML:``,images:[],raw:``,frontmatter:V,filepath:``,start:1107,sourceIndex:22,id:22,no:23},__clicksContext:null,__preloaded:!1}),H=p({layout:`default`,title:`In words: Steps 3 and 4: scale, then softmax`}),xt=m({get layout(){return H.layout},get transition(){return H.transition},get class(){return H.class},get clicks(){return H.clicks},get name(){return H.name},get preload(){return H.preload},slide:{content:``,revision:`4wlloz`,frontmatterRaw:`layout: default +title: "In words: Steps 3 and 4: scale, then softmax" +`,note:``,title:`In words: Steps 3 and 4: scale, then softmax`,index:23,noteHTML:``,images:[],raw:``,frontmatter:H,filepath:``,start:1195,sourceIndex:23,id:23,no:24},__clicksContext:null,__preloaded:!1}),U=p({layout:`default`,core:!0,title:`Steps 5 and 6: weigh the values, then add`}),St=m({get layout(){return U.layout},get transition(){return U.transition},get class(){return U.class},get clicks(){return U.clicks},get name(){return U.name},get preload(){return U.preload},slide:{content:``,revision:`-o916xi`,frontmatterRaw:`layout: default +core: true +title: "Steps 5 and 6: weigh the values, then add" +`,note:``,title:`Steps 5 and 6: weigh the values, then add`,index:24,noteHTML:``,images:[],raw:``,frontmatter:U,filepath:``,start:1222,sourceIndex:24,id:24,no:25},__clicksContext:null,__preloaded:!1}),W=p({layout:`default`,title:`In words: Steps 5 and 6: weigh the values, then add`}),Ct=m({get layout(){return W.layout},get transition(){return W.transition},get class(){return W.class},get clicks(){return W.clicks},get name(){return W.name},get preload(){return W.preload},slide:{content:``,revision:`-d5v9g1`,frontmatterRaw:`layout: default +title: "In words: Steps 5 and 6: weigh the values, then add" +`,note:``,title:`In words: Steps 5 and 6: weigh the values, then add`,index:25,noteHTML:``,images:[],raw:``,frontmatter:W,filepath:``,start:1309,sourceIndex:25,id:25,no:26},__clicksContext:null,__preloaded:!1}),G=p({layout:`interactive`,core:!0,heading:`All six steps, for either word`,title:`All six steps, for either word`,"aside-width":`16rem`,clicks:6}),wt=m({get layout(){return G.layout},get transition(){return G.transition},get class(){return G.class},get clicks(){return G.clicks},get name(){return G.name},get preload(){return G.preload},slide:{content:``,revision:`xp8ay9`,frontmatterRaw:`layout: interactive +core: true +heading: All six steps, for either word +title: All six steps, for either word +aside-width: 16rem +clicks: 6 +`,note:``,title:`All six steps, for either word`,index:26,noteHTML:``,images:[],raw:``,frontmatter:G,filepath:``,start:1337,sourceIndex:26,id:26,no:27},__clicksContext:null,__preloaded:!1}),K=p({layout:`default`,title:`In words: All six steps, for either word`}),Tt=m({get layout(){return K.layout},get transition(){return K.transition},get class(){return K.class},get clicks(){return K.clicks},get name(){return K.name},get preload(){return K.preload},slide:{content:``,revision:`yvvtn6`,frontmatterRaw:`layout: default +title: "In words: All six steps, for either word" +`,note:``,title:`In words: All six steps, for either word`,index:27,noteHTML:``,images:[],raw:``,frontmatter:K,filepath:``,start:1393,sourceIndex:27,id:27,no:28},__clicksContext:null,__preloaded:!1}),q=p({layout:`default`,core:!0,title:`Poll: does a word attend most to itself?`}),Et=m({get layout(){return q.layout},get transition(){return q.transition},get class(){return q.class},get clicks(){return q.clicks},get name(){return q.name},get preload(){return q.preload},slide:{content:``,revision:`htdphi`,frontmatterRaw:`layout: default +core: true +title: "Poll: does a word attend most to itself?" +`,note:``,title:`Poll: does a word attend most to itself?`,index:28,noteHTML:``,images:[],raw:``,frontmatter:q,filepath:``,start:1422,sourceIndex:28,id:28,no:29},__clicksContext:null,__preloaded:!1}),J=p({layout:`default`,title:`In words: Poll: does a word attend most to itself?`}),Dt=m({get layout(){return J.layout},get transition(){return J.transition},get class(){return J.class},get clicks(){return J.clicks},get name(){return J.name},get preload(){return J.preload},slide:{content:``,revision:`-iixkff`,frontmatterRaw:`layout: default +title: "In words: Poll: does a word attend most to itself?" +`,note:``,title:`In words: Poll: does a word attend most to itself?`,index:29,noteHTML:``,images:[],raw:``,frontmatter:J,filepath:``,start:1501,sourceIndex:29,id:29,no:30},__clicksContext:null,__preloaded:!1}),Y=p({layout:`section`,index:`02`}),Ot=m({get layout(){return Y.layout},get transition(){return Y.transition},get class(){return Y.class},get clicks(){return Y.clicks},get name(){return Y.name},get preload(){return Y.preload},slide:{content:``,revision:`6bw9w6`,frontmatterRaw:`layout: section +index: "02" +`,note:``,title:`Matrices and many heads`,level:1,index:30,noteHTML:``,images:[],raw:``,frontmatter:Y,filepath:``,start:1527,sourceIndex:30,id:30,no:31},__clicksContext:null,__preloaded:!1}),kt=p({layout:`default`,core:!0,title:`Every word at once: matrices`}),At=m({get layout(){return kt.layout},get transition(){return kt.transition},get class(){return kt.class},get clicks(){return kt.clicks},get name(){return kt.name},get preload(){return kt.preload},slide:{content:``,revision:`-5rojkx`,frontmatterRaw:`layout: default +core: true +title: "Every word at once: matrices" +`,note:``,title:`Every word at once: matrices`,index:31,noteHTML:``,images:[],raw:``,frontmatter:kt,filepath:``,start:1550,sourceIndex:31,id:31,no:32},__clicksContext:null,__preloaded:!1}),jt=p({layout:`default`,title:`In words: Every word at once: matrices`}),Mt=m({get layout(){return jt.layout},get transition(){return jt.transition},get class(){return jt.class},get clicks(){return jt.clicks},get name(){return jt.name},get preload(){return jt.preload},slide:{content:``,revision:`-7y96p3`,frontmatterRaw:`layout: default +title: "In words: Every word at once: matrices" +`,note:``,title:`In words: Every word at once: matrices`,index:32,noteHTML:``,images:[],raw:``,frontmatter:jt,filepath:``,start:1664,sourceIndex:32,id:32,no:33},__clicksContext:null,__preloaded:!1}),Nt=p({layout:`default`,core:!0,title:`The whole layer in one line`}),Pt=m({get layout(){return Nt.layout},get transition(){return Nt.transition},get class(){return Nt.class},get clicks(){return Nt.clicks},get name(){return Nt.name},get preload(){return Nt.preload},slide:{content:``,revision:`-nypa0l`,frontmatterRaw:`layout: default +core: true +title: The whole layer in one line +`,note:``,title:`The whole layer in one line`,index:33,noteHTML:``,images:[],raw:``,frontmatter:Nt,filepath:``,start:1691,sourceIndex:33,id:33,no:34},__clicksContext:null,__preloaded:!1}),Ft=p({layout:`default`,title:`Reading the equation: the whole layer`}),It=m({get layout(){return Ft.layout},get transition(){return Ft.transition},get class(){return Ft.class},get clicks(){return Ft.clicks},get name(){return Ft.name},get preload(){return Ft.preload},slide:{content:``,revision:`-87a65e`,frontmatterRaw:`layout: default +title: "Reading the equation: the whole layer" +`,note:``,title:`Reading the equation: the whole layer`,index:34,noteHTML:``,images:[],raw:``,frontmatter:Ft,filepath:``,start:1779,sourceIndex:34,id:34,no:35},__clicksContext:null,__preloaded:!1}),Lt=p({layout:`default`,title:`In words: The whole layer in one line`}),Rt=m({get layout(){return Lt.layout},get transition(){return Lt.transition},get class(){return Lt.class},get clicks(){return Lt.clicks},get name(){return Lt.name},get preload(){return Lt.preload},slide:{content:``,revision:`-3ci5a8`,frontmatterRaw:`layout: default +title: "In words: The whole layer in one line" +`,note:``,title:`In words: The whole layer in one line`,index:35,noteHTML:``,images:[],raw:``,frontmatter:Lt,filepath:``,start:1866,sourceIndex:35,id:35,no:36},__clicksContext:null,__preloaded:!1}),zt=p({layout:`interactive`,core:!0,heading:`Many heads: one question each`,title:`Many heads: one question each`,"aside-width":`17rem`}),Bt=m({get layout(){return zt.layout},get transition(){return zt.transition},get class(){return zt.class},get clicks(){return zt.clicks},get name(){return zt.name},get preload(){return zt.preload},slide:{content:``,revision:`4kqc85`,frontmatterRaw:`layout: interactive +core: true +heading: "Many heads: one question each" +title: "Many heads: one question each" +aside-width: 17rem +`,note:``,title:`Many heads: one question each`,index:36,noteHTML:``,images:[],raw:``,frontmatter:zt,filepath:``,start:1895,sourceIndex:36,id:36,no:37},__clicksContext:null,__preloaded:!1}),Vt=p({layout:`default`,title:`In words: Many heads: one question each`}),Ht=m({get layout(){return Vt.layout},get transition(){return Vt.transition},get class(){return Vt.class},get clicks(){return Vt.clicks},get name(){return Vt.name},get preload(){return Vt.preload},slide:{content:``,revision:`i10zc0`,frontmatterRaw:`layout: default +title: "In words: Many heads: one question each" +`,note:``,title:`In words: Many heads: one question each`,index:37,noteHTML:``,images:[],raw:``,frontmatter:Vt,filepath:``,start:1958,sourceIndex:37,id:37,no:38},__clicksContext:null,__preloaded:!1}),Ut=p({layout:`default`,core:!0,title:`Eight heads, then glue them back`}),Wt=m({get layout(){return Ut.layout},get transition(){return Ut.transition},get class(){return Ut.class},get clicks(){return Ut.clicks},get name(){return Ut.name},get preload(){return Ut.preload},slide:{content:``,revision:`-wn1gce`,frontmatterRaw:`layout: default +core: true +title: Eight heads, then glue them back +`,note:``,title:`Eight heads, then glue them back`,index:38,noteHTML:``,images:[],raw:``,frontmatter:Ut,filepath:``,start:1985,sourceIndex:38,id:38,no:39},__clicksContext:null,__preloaded:!1}),Gt=p({layout:`default`,title:`In words: Eight heads, then glue them back`}),Kt=m({get layout(){return Gt.layout},get transition(){return Gt.transition},get class(){return Gt.class},get clicks(){return Gt.clicks},get name(){return Gt.name},get preload(){return Gt.preload},slide:{content:``,revision:`vv4sb8`,frontmatterRaw:`layout: default +title: "In words: Eight heads, then glue them back" +`,note:``,title:`In words: Eight heads, then glue them back`,index:39,noteHTML:``,images:[],raw:``,frontmatter:Gt,filepath:``,start:2070,sourceIndex:39,id:39,no:40},__clicksContext:null,__preloaded:!1}),qt=p({layout:`default`,title:`The whole multi-head layer`}),Jt=m({get layout(){return qt.layout},get transition(){return qt.transition},get class(){return qt.class},get clicks(){return qt.clicks},get name(){return qt.name},get preload(){return qt.preload},slide:{content:``,revision:`v75zzu`,frontmatterRaw:`layout: default +title: The whole multi-head layer +`,note:``,title:`The whole multi-head layer`,index:40,noteHTML:``,images:[],raw:``,frontmatter:qt,filepath:``,start:2099,sourceIndex:40,id:40,no:41},__clicksContext:null,__preloaded:!1}),Yt=p({layout:`default`,title:`In words: The whole multi-head layer`}),Xt=m({get layout(){return Yt.layout},get transition(){return Yt.transition},get class(){return Yt.class},get clicks(){return Yt.clicks},get name(){return Yt.name},get preload(){return Yt.preload},slide:{content:``,revision:`-ezg00c`,frontmatterRaw:`layout: default +title: "In words: The whole multi-head layer" +`,note:``,title:`In words: The whole multi-head layer`,index:41,noteHTML:``,images:[],raw:``,frontmatter:Yt,filepath:``,start:2168,sourceIndex:41,id:41,no:42},__clicksContext:null,__preloaded:!1}),Zt=p({layout:`default`,title:`Poll: eight small heads or one big one?`}),Qt=m({get layout(){return Zt.layout},get transition(){return Zt.transition},get class(){return Zt.class},get clicks(){return Zt.clicks},get name(){return Zt.name},get preload(){return Zt.preload},slide:{content:``,revision:`t3v8ma`,frontmatterRaw:`layout: default +title: "Poll: eight small heads or one big one?" +`,note:``,title:`Poll: eight small heads or one big one?`,index:42,noteHTML:``,images:[],raw:``,frontmatter:Zt,filepath:``,start:2197,sourceIndex:42,id:42,no:43},__clicksContext:null,__preloaded:!1}),$t=p({layout:`default`,title:`In words: Poll: eight small heads or one big one?`}),en=m({get layout(){return $t.layout},get transition(){return $t.transition},get class(){return $t.class},get clicks(){return $t.clicks},get name(){return $t.name},get preload(){return $t.preload},slide:{content:``,revision:`b0fscl`,frontmatterRaw:`layout: default +title: "In words: Poll: eight small heads or one big one?" +`,note:``,title:`In words: Poll: eight small heads or one big one?`,index:43,noteHTML:``,images:[],raw:``,frontmatter:$t,filepath:``,start:2262,sourceIndex:43,id:43,no:44},__clicksContext:null,__preloaded:!1}),tn=p({layout:`section`,index:`03`}),nn=m({get layout(){return tn.layout},get transition(){return tn.transition},get class(){return tn.class},get clicks(){return tn.clicks},get name(){return tn.name},get preload(){return tn.preload},slide:{content:``,revision:`bv2h1`,frontmatterRaw:`layout: section +index: "03" +`,note:``,title:`Word order`,level:1,index:44,noteHTML:``,images:[],raw:``,frontmatter:tn,filepath:``,start:2288,sourceIndex:44,id:44,no:45},__clicksContext:null,__preloaded:!1}),rn=p({layout:`default`,core:!0,title:`Attention does not see order`}),an=m({get layout(){return rn.layout},get transition(){return rn.transition},get class(){return rn.class},get clicks(){return rn.clicks},get name(){return rn.name},get preload(){return rn.preload},slide:{content:``,revision:`-vt8h7a`,frontmatterRaw:`layout: default +core: true +title: Attention does not see order +`,note:``,title:`Attention does not see order`,index:45,noteHTML:``,images:[],raw:``,frontmatter:rn,filepath:``,start:2309,sourceIndex:45,id:45,no:46},__clicksContext:null,__preloaded:!1}),on=p({layout:`default`,title:`In words: Attention does not see order`}),sn=m({get layout(){return on.layout},get transition(){return on.transition},get class(){return on.class},get clicks(){return on.clicks},get name(){return on.name},get preload(){return on.preload},slide:{content:``,revision:`-gi97bh`,frontmatterRaw:`layout: default +title: "In words: Attention does not see order" +`,note:``,title:`In words: Attention does not see order`,index:46,noteHTML:``,images:[],raw:``,frontmatter:on,filepath:``,start:2400,sourceIndex:46,id:46,no:47},__clicksContext:null,__preloaded:!1}),cn=p({layout:`default`,core:!0,title:`Add a position vector`}),ln=m({get layout(){return cn.layout},get transition(){return cn.transition},get class(){return cn.class},get clicks(){return cn.clicks},get name(){return cn.name},get preload(){return cn.preload},slide:{content:``,revision:`l08hkz`,frontmatterRaw:`layout: default +core: true +title: Add a position vector +`,note:``,title:`Add a position vector`,index:47,noteHTML:``,images:[],raw:``,frontmatter:cn,filepath:``,start:2428,sourceIndex:47,id:47,no:48},__clicksContext:null,__preloaded:!1}),un=p({layout:`default`,title:`Reading the equation: positional encoding`}),dn=m({get layout(){return un.layout},get transition(){return un.transition},get class(){return un.class},get clicks(){return un.clicks},get name(){return un.name},get preload(){return un.preload},slide:{content:``,revision:`-5int5x`,frontmatterRaw:`layout: default +title: "Reading the equation: positional encoding" +`,note:``,title:`Reading the equation: positional encoding`,index:48,noteHTML:``,images:[],raw:``,frontmatter:un,filepath:``,start:2508,sourceIndex:48,id:48,no:49},__clicksContext:null,__preloaded:!1}),fn=p({layout:`default`,title:`In words: Add a position vector`}),pn=m({get layout(){return fn.layout},get transition(){return fn.transition},get class(){return fn.class},get clicks(){return fn.clicks},get name(){return fn.name},get preload(){return fn.preload},slide:{content:``,revision:`zga2lk`,frontmatterRaw:`layout: default +title: "In words: Add a position vector" +`,note:``,title:`In words: Add a position vector`,index:49,noteHTML:``,images:[],raw:``,frontmatter:fn,filepath:``,start:2587,sourceIndex:49,id:49,no:50},__clicksContext:null,__preloaded:!1}),mn=p({layout:`interactive`,heading:`The pattern over many positions`,title:`The pattern over many positions`,"aside-width":`17rem`}),hn=m({get layout(){return mn.layout},get transition(){return mn.transition},get class(){return mn.class},get clicks(){return mn.clicks},get name(){return mn.name},get preload(){return mn.preload},slide:{content:``,revision:`dho3r8`,frontmatterRaw:`layout: interactive +heading: The pattern over many positions +title: The pattern over many positions +aside-width: 17rem +`,note:``,title:`The pattern over many positions`,index:50,noteHTML:``,images:[],raw:``,frontmatter:mn,filepath:``,start:2614,sourceIndex:50,id:50,no:51},__clicksContext:null,__preloaded:!1}),gn=p({layout:`default`,title:`In words: The pattern over many positions`}),_n=m({get layout(){return gn.layout},get transition(){return gn.transition},get class(){return gn.class},get clicks(){return gn.clicks},get name(){return gn.name},get preload(){return gn.preload},slide:{content:``,revision:`ibaaq5`,frontmatterRaw:`layout: default +title: "In words: The pattern over many positions" +`,note:``,title:`In words: The pattern over many positions`,index:51,noteHTML:``,images:[],raw:``,frontmatter:gn,filepath:``,start:2668,sourceIndex:51,id:51,no:52},__clicksContext:null,__preloaded:!1}),vn=p({layout:`section`,index:`04`}),yn=m({get layout(){return vn.layout},get transition(){return vn.transition},get class(){return vn.class},get clicks(){return vn.clicks},get name(){return vn.name},get preload(){return vn.preload},slide:{content:``,revision:`ocd1ay`,frontmatterRaw:`layout: section +index: "04" +`,note:``,title:`Add, norm, feed-forward`,level:1,index:52,noteHTML:``,images:[],raw:``,frontmatter:vn,filepath:``,start:2695,sourceIndex:52,id:52,no:53},__clicksContext:null,__preloaded:!1}),bn=p({layout:`default`,core:!0,title:`A shortcut around every sub-layer`}),xn=m({get layout(){return bn.layout},get transition(){return bn.transition},get class(){return bn.class},get clicks(){return bn.clicks},get name(){return bn.name},get preload(){return bn.preload},slide:{content:``,revision:`-d69j7c`,frontmatterRaw:`layout: default +core: true +title: A shortcut around every sub-layer +`,note:``,title:`A shortcut around every sub-layer`,index:53,noteHTML:``,images:[],raw:``,frontmatter:bn,filepath:``,start:2718,sourceIndex:53,id:53,no:54},__clicksContext:null,__preloaded:!1}),Sn=p({layout:`default`,title:`In words: A shortcut around every sub-layer`}),Cn=m({get layout(){return Sn.layout},get transition(){return Sn.transition},get class(){return Sn.class},get clicks(){return Sn.clicks},get name(){return Sn.name},get preload(){return Sn.preload},slide:{content:``,revision:`mnminp`,frontmatterRaw:`layout: default +title: "In words: A shortcut around every sub-layer" +`,note:``,title:`In words: A shortcut around every sub-layer`,index:54,noteHTML:``,images:[],raw:``,frontmatter:Sn,filepath:``,start:2818,sourceIndex:54,id:54,no:55},__clicksContext:null,__preloaded:!1}),wn=p({layout:`default`,title:`Layer normalisation`}),Tn=m({get layout(){return wn.layout},get transition(){return wn.transition},get class(){return wn.class},get clicks(){return wn.clicks},get name(){return wn.name},get preload(){return wn.preload},slide:{content:``,revision:`2yb735`,frontmatterRaw:`layout: default +title: Layer normalisation +`,note:``,title:`Layer normalisation`,index:55,noteHTML:``,images:[],raw:``,frontmatter:wn,filepath:``,start:2848,sourceIndex:55,id:55,no:56},__clicksContext:null,__preloaded:!1}),En=p({layout:`default`,title:`Reading the equation: layer normalisation`}),Dn=m({get layout(){return En.layout},get transition(){return En.transition},get class(){return En.class},get clicks(){return En.clicks},get name(){return En.name},get preload(){return En.preload},slide:{content:``,revision:`fok2kb`,frontmatterRaw:`layout: default +title: "Reading the equation: layer normalisation" +`,note:``,title:`Reading the equation: layer normalisation`,index:56,noteHTML:``,images:[],raw:``,frontmatter:En,filepath:``,start:2924,sourceIndex:56,id:56,no:57},__clicksContext:null,__preloaded:!1}),On=p({layout:`default`,title:`In words: Layer normalisation`}),kn=m({get layout(){return On.layout},get transition(){return On.transition},get class(){return On.class},get clicks(){return On.clicks},get name(){return On.name},get preload(){return On.preload},slide:{content:``,revision:`-cifomr`,frontmatterRaw:`layout: default +title: "In words: Layer normalisation" +`,note:``,title:`In words: Layer normalisation`,index:57,noteHTML:``,images:[],raw:``,frontmatter:On,filepath:``,start:2992,sourceIndex:57,id:57,no:58},__clicksContext:null,__preloaded:!1}),An=p({layout:`default`,title:`The feed-forward network, one word at a time`}),jn=m({get layout(){return An.layout},get transition(){return An.transition},get class(){return An.class},get clicks(){return An.clicks},get name(){return An.name},get preload(){return An.preload},slide:{content:``,revision:`-ku1648`,frontmatterRaw:`layout: default +title: The feed-forward network, one word at a time +`,note:``,title:`The feed-forward network, one word at a time`,index:58,noteHTML:``,images:[],raw:``,frontmatter:An,filepath:``,start:3019,sourceIndex:58,id:58,no:59},__clicksContext:null,__preloaded:!1}),Mn=p({layout:`default`,title:`Reading the equation: the feed-forward network`}),Nn=m({get layout(){return Mn.layout},get transition(){return Mn.transition},get class(){return Mn.class},get clicks(){return Mn.clicks},get name(){return Mn.name},get preload(){return Mn.preload},slide:{content:``,revision:`-h81vfo`,frontmatterRaw:`layout: default +title: "Reading the equation: the feed-forward network" +`,note:``,title:`Reading the equation: the feed-forward network`,index:59,noteHTML:``,images:[],raw:``,frontmatter:Mn,filepath:``,start:3104,sourceIndex:59,id:59,no:60},__clicksContext:null,__preloaded:!1}),Pn=p({layout:`default`,title:`In words: The feed-forward network, one word at a time`}),Fn=m({get layout(){return Pn.layout},get transition(){return Pn.transition},get class(){return Pn.class},get clicks(){return Pn.clicks},get name(){return Pn.name},get preload(){return Pn.preload},slide:{content:``,revision:`x5wnvs`,frontmatterRaw:`layout: default +title: "In words: The feed-forward network, one word at a time" +`,note:``,title:`In words: The feed-forward network, one word at a time`,index:60,noteHTML:``,images:[],raw:``,frontmatter:Pn,filepath:``,start:3174,sourceIndex:60,id:60,no:61},__clicksContext:null,__preloaded:!1}),In=p({layout:`default`,core:!0,title:`The full picture, two layers deep`}),Ln=m({get layout(){return In.layout},get transition(){return In.transition},get class(){return In.class},get clicks(){return In.clicks},get name(){return In.name},get preload(){return In.preload},slide:{content:``,revision:`-xgvy9s`,frontmatterRaw:`layout: default +core: true +title: The full picture, two layers deep +`,note:``,title:`The full picture, two layers deep`,index:61,noteHTML:``,images:[],raw:``,frontmatter:In,filepath:``,start:3200,sourceIndex:61,id:61,no:62},__clicksContext:null,__preloaded:!1}),Rn=p({layout:`default`,title:`In words: The full picture, two layers deep`}),zn=m({get layout(){return Rn.layout},get transition(){return Rn.transition},get class(){return Rn.class},get clicks(){return Rn.clicks},get name(){return Rn.name},get preload(){return Rn.preload},slide:{content:``,revision:`-68f73f`,frontmatterRaw:`layout: default +title: "In words: The full picture, two layers deep" +`,note:``,title:`In words: The full picture, two layers deep`,index:62,noteHTML:``,images:[],raw:``,frontmatter:Rn,filepath:``,start:3303,sourceIndex:62,id:62,no:63},__clicksContext:null,__preloaded:!1}),Bn=p({layout:`section`,index:`05`}),Vn=m({get layout(){return Bn.layout},get transition(){return Bn.transition},get class(){return Bn.class},get clicks(){return Bn.clicks},get name(){return Bn.name},get preload(){return Bn.preload},slide:{content:``,revision:`-net7yk`,frontmatterRaw:`layout: section +index: "05" +`,note:``,title:`The decoder side`,level:1,index:63,noteHTML:``,images:[],raw:``,frontmatter:Bn,filepath:``,start:3330,sourceIndex:63,id:63,no:64},__clicksContext:null,__preloaded:!1}),Hn=p({layout:`default`,core:!0,title:`The encoder hands over keys and values`}),Un=m({get layout(){return Hn.layout},get transition(){return Hn.transition},get class(){return Hn.class},get clicks(){return Hn.clicks},get name(){return Hn.name},get preload(){return Hn.preload},slide:{content:``,revision:`-wq08z4`,frontmatterRaw:`layout: default +core: true +title: The encoder hands over keys and values +`,note:``,title:`The encoder hands over keys and values`,index:64,noteHTML:``,images:[],raw:``,frontmatter:Hn,filepath:``,start:3354,sourceIndex:64,id:64,no:65},__clicksContext:null,__preloaded:!1}),Wn=p({layout:`default`,title:`In words: The encoder hands over keys and values`}),Gn=m({get layout(){return Wn.layout},get transition(){return Wn.transition},get class(){return Wn.class},get clicks(){return Wn.clicks},get name(){return Wn.name},get preload(){return Wn.preload},slide:{content:``,revision:`-mk28ng`,frontmatterRaw:`layout: default +title: "In words: The encoder hands over keys and values" +`,note:``,title:`In words: The encoder hands over keys and values`,index:65,noteHTML:``,images:[],raw:``,frontmatter:Wn,filepath:``,start:3460,sourceIndex:65,id:65,no:66},__clicksContext:null,__preloaded:!1}),Kn=p({layout:`interactive`,core:!0,heading:`One word per step`,title:`One word per step`,"aside-width":`16rem`,clicks:5}),qn=m({get layout(){return Kn.layout},get transition(){return Kn.transition},get class(){return Kn.class},get clicks(){return Kn.clicks},get name(){return Kn.name},get preload(){return Kn.preload},slide:{content:``,revision:`-m7o4o6`,frontmatterRaw:`layout: interactive +core: true +heading: One word per step +title: One word per step +aside-width: 16rem +clicks: 5 +`,note:``,title:`One word per step`,index:66,noteHTML:``,images:[],raw:``,frontmatter:Kn,filepath:``,start:3485,sourceIndex:66,id:66,no:67},__clicksContext:null,__preloaded:!1}),Jn=p({layout:`default`,title:`In words: One word per step`}),Yn=m({get layout(){return Jn.layout},get transition(){return Jn.transition},get class(){return Jn.class},get clicks(){return Jn.clicks},get name(){return Jn.name},get preload(){return Jn.preload},slide:{content:``,revision:`i704kq`,frontmatterRaw:`layout: default +title: "In words: One word per step" +`,note:``,title:`In words: One word per step`,index:67,noteHTML:``,images:[],raw:``,frontmatter:Jn,filepath:``,start:3544,sourceIndex:67,id:67,no:68},__clicksContext:null,__preloaded:!1}),Xn=p({layout:`default`,core:!0,title:`No looking ahead: the mask`}),Zn=m({get layout(){return Xn.layout},get transition(){return Xn.transition},get class(){return Xn.class},get clicks(){return Xn.clicks},get name(){return Xn.name},get preload(){return Xn.preload},slide:{content:``,revision:`uspg4u`,frontmatterRaw:`layout: default +core: true +title: "No looking ahead: the mask" +`,note:``,title:`No looking ahead: the mask`,index:68,noteHTML:``,images:[],raw:``,frontmatter:Xn,filepath:``,start:3570,sourceIndex:68,id:68,no:69},__clicksContext:null,__preloaded:!1}),Qn=p({layout:`default`,title:`Reading the equation: the mask`}),$n=m({get layout(){return Qn.layout},get transition(){return Qn.transition},get class(){return Qn.class},get clicks(){return Qn.clicks},get name(){return Qn.name},get preload(){return Qn.preload},slide:{content:``,revision:`-eri03o`,frontmatterRaw:`layout: default +title: "Reading the equation: the mask" +`,note:``,title:`Reading the equation: the mask`,index:69,noteHTML:``,images:[],raw:``,frontmatter:Qn,filepath:``,start:3666,sourceIndex:69,id:69,no:70},__clicksContext:null,__preloaded:!1}),er=p({layout:`default`,title:`In words: No looking ahead: the mask`}),tr=m({get layout(){return er.layout},get transition(){return er.transition},get class(){return er.class},get clicks(){return er.clicks},get name(){return er.name},get preload(){return er.preload},slide:{content:``,revision:`-lgu0z2`,frontmatterRaw:`layout: default +title: "In words: No looking ahead: the mask" +`,note:``,title:`In words: No looking ahead: the mask`,index:70,noteHTML:``,images:[],raw:``,frontmatter:er,filepath:``,start:3736,sourceIndex:70,id:70,no:71},__clicksContext:null,__preloaded:!1}),nr=p({layout:`default`,core:!0,title:`Encoder–decoder attention`}),rr=m({get layout(){return nr.layout},get transition(){return nr.transition},get class(){return nr.class},get clicks(){return nr.clicks},get name(){return nr.name},get preload(){return nr.preload},slide:{content:``,revision:`-95vqpg`,frontmatterRaw:`layout: default +core: true +title: Encoder–decoder attention +`,note:``,title:`Encoder–decoder attention`,index:71,noteHTML:``,images:[],raw:``,frontmatter:nr,filepath:``,start:3763,sourceIndex:71,id:71,no:72},__clicksContext:null,__preloaded:!1}),ir=p({layout:`default`,title:`In words: Encoder–decoder attention`}),ar=m({get layout(){return ir.layout},get transition(){return ir.transition},get class(){return ir.class},get clicks(){return ir.clicks},get name(){return ir.name},get preload(){return ir.preload},slide:{content:``,revision:`er8eob`,frontmatterRaw:`layout: default +title: "In words: Encoder–decoder attention" +`,note:``,title:`In words: Encoder–decoder attention`,index:72,noteHTML:``,images:[],raw:``,frontmatter:ir,filepath:``,start:3841,sourceIndex:72,id:72,no:73},__clicksContext:null,__preloaded:!1}),or=p({layout:`default`,core:!0,title:`From a vector to a word: linear and softmax`}),sr=m({get layout(){return or.layout},get transition(){return or.transition},get class(){return or.class},get clicks(){return or.clicks},get name(){return or.name},get preload(){return or.preload},slide:{content:``,revision:`h9gbvs`,frontmatterRaw:`layout: default +core: true +title: "From a vector to a word: linear and softmax" +`,note:``,title:`From a vector to a word: linear and softmax`,index:73,noteHTML:``,images:[],raw:``,frontmatter:or,filepath:``,start:3866,sourceIndex:73,id:73,no:74},__clicksContext:null,__preloaded:!1}),cr=p({layout:`default`,title:`Reading the equation: the output layer`}),lr=m({get layout(){return cr.layout},get transition(){return cr.transition},get class(){return cr.class},get clicks(){return cr.clicks},get name(){return cr.name},get preload(){return cr.preload},slide:{content:``,revision:`-ga3nq2`,frontmatterRaw:`layout: default +title: "Reading the equation: the output layer" +`,note:``,title:`Reading the equation: the output layer`,index:74,noteHTML:``,images:[],raw:``,frontmatter:cr,filepath:``,start:3963,sourceIndex:74,id:74,no:75},__clicksContext:null,__preloaded:!1}),ur=p({layout:`default`,title:`In words: From a vector to a word: linear and softmax`}),dr=m({get layout(){return ur.layout},get transition(){return ur.transition},get class(){return ur.class},get clicks(){return ur.clicks},get name(){return ur.name},get preload(){return ur.preload},slide:{content:``,revision:`-4y2grz`,frontmatterRaw:`layout: default +title: "In words: From a vector to a word: linear and softmax" +`,note:``,title:`In words: From a vector to a word: linear and softmax`,index:75,noteHTML:``,images:[],raw:``,frontmatter:ur,filepath:``,start:4040,sourceIndex:75,id:75,no:76},__clicksContext:null,__preloaded:!1}),fr=p({layout:`section`,index:`06`}),pr=m({get layout(){return fr.layout},get transition(){return fr.transition},get class(){return fr.class},get clicks(){return fr.clicks},get name(){return fr.name},get preload(){return fr.preload},slide:{content:``,revision:`8n18xj`,frontmatterRaw:`layout: section +index: "06" +`,note:``,title:`Training and decoding`,level:1,index:76,noteHTML:``,images:[],raw:``,frontmatter:fr,filepath:``,start:4068,sourceIndex:76,id:76,no:77},__clicksContext:null,__preloaded:!1}),mr=p({layout:`default`,title:`The target, as one-hot vectors`}),hr=m({get layout(){return mr.layout},get transition(){return mr.transition},get class(){return mr.class},get clicks(){return mr.clicks},get name(){return mr.name},get preload(){return mr.preload},slide:{content:``,revision:`le5v1p`,frontmatterRaw:`layout: default +title: The target, as one-hot vectors +`,note:``,title:`The target, as one-hot vectors`,index:77,noteHTML:``,images:[],raw:``,frontmatter:mr,filepath:``,start:4090,sourceIndex:77,id:77,no:78},__clicksContext:null,__preloaded:!1}),gr=p({layout:`default`,title:`In words: The target, as one-hot vectors`}),_r=m({get layout(){return gr.layout},get transition(){return gr.transition},get class(){return gr.class},get clicks(){return gr.clicks},get name(){return gr.name},get preload(){return gr.preload},slide:{content:``,revision:`-8r5fef`,frontmatterRaw:`layout: default +title: "In words: The target, as one-hot vectors" +`,note:``,title:`In words: The target, as one-hot vectors`,index:78,noteHTML:``,images:[],raw:``,frontmatter:gr,filepath:``,start:4138,sourceIndex:78,id:78,no:79},__clicksContext:null,__preloaded:!1}),vr=p({layout:`interactive`,core:!0,heading:`The loss on one word: merci → thanks`,title:`The loss on one word: merci → thanks`,"aside-width":`15rem`}),yr=m({get layout(){return vr.layout},get transition(){return vr.transition},get class(){return vr.class},get clicks(){return vr.clicks},get name(){return vr.name},get preload(){return vr.preload},slide:{content:``,revision:`rcbvbm`,frontmatterRaw:`layout: interactive +core: true +heading: "The loss on one word: merci → thanks" +title: "The loss on one word: merci → thanks" +aside-width: 15rem +`,note:``,title:`The loss on one word: merci → thanks`,index:79,noteHTML:``,images:[],raw:``,frontmatter:vr,filepath:``,start:4164,sourceIndex:79,id:79,no:80},__clicksContext:null,__preloaded:!1}),br=p({layout:`default`,title:`Reading the equation: cross-entropy`}),xr=m({get layout(){return br.layout},get transition(){return br.transition},get class(){return br.class},get clicks(){return br.clicks},get name(){return br.name},get preload(){return br.preload},slide:{content:``,revision:`-o5hlhh`,frontmatterRaw:`layout: default +title: "Reading the equation: cross-entropy" +`,note:``,title:`Reading the equation: cross-entropy`,index:80,noteHTML:``,images:[],raw:``,frontmatter:br,filepath:``,start:4225,sourceIndex:80,id:80,no:81},__clicksContext:null,__preloaded:!1}),Sr=p({layout:`default`,title:`In words: The loss on one word: merci → thanks`}),Cr=m({get layout(){return Sr.layout},get transition(){return Sr.transition},get class(){return Sr.class},get clicks(){return Sr.clicks},get name(){return Sr.name},get preload(){return Sr.preload},slide:{content:``,revision:`-z6twyc`,frontmatterRaw:`layout: default +title: "In words: The loss on one word: merci → thanks" +`,note:``,title:`In words: The loss on one word: merci → thanks`,index:81,noteHTML:``,images:[],raw:``,frontmatter:Sr,filepath:``,start:4320,sourceIndex:81,id:81,no:82},__clicksContext:null,__preloaded:!1}),wr=p({layout:`default`,title:`Poll: the loss of a model that knows nothing`}),Tr=m({get layout(){return wr.layout},get transition(){return wr.transition},get class(){return wr.class},get clicks(){return wr.clicks},get name(){return wr.name},get preload(){return wr.preload},slide:{content:``,revision:`-sypzqs`,frontmatterRaw:`layout: default +title: "Poll: the loss of a model that knows nothing" +`,note:``,title:`Poll: the loss of a model that knows nothing`,index:82,noteHTML:``,images:[],raw:``,frontmatter:wr,filepath:``,start:4349,sourceIndex:82,id:82,no:83},__clicksContext:null,__preloaded:!1}),Er=p({layout:`default`,title:`In words: Poll: the loss of a model that knows nothing`}),Dr=m({get layout(){return Er.layout},get transition(){return Er.transition},get class(){return Er.class},get clicks(){return Er.clicks},get name(){return Er.name},get preload(){return Er.preload},slide:{content:``,revision:`87o4dj`,frontmatterRaw:`layout: default +title: "In words: Poll: the loss of a model that knows nothing" +`,note:``,title:`In words: Poll: the loss of a model that knows nothing`,index:83,noteHTML:``,images:[],raw:``,frontmatter:Er,filepath:``,start:4422,sourceIndex:83,id:83,no:84},__clicksContext:null,__preloaded:!1}),Or=p({layout:`interactive`,core:!0,heading:`A whole sentence`,title:`A whole sentence`,"aside-width":`16rem`,clicks:5}),kr=m({get layout(){return Or.layout},get transition(){return Or.transition},get class(){return Or.class},get clicks(){return Or.clicks},get name(){return Or.name},get preload(){return Or.preload},slide:{content:``,revision:`5az2ug`,frontmatterRaw:`layout: interactive +core: true +heading: A whole sentence +title: A whole sentence +aside-width: 16rem +clicks: 5 +`,note:``,title:`A whole sentence`,index:84,noteHTML:``,images:[],raw:``,frontmatter:Or,filepath:``,start:4447,sourceIndex:84,id:84,no:85},__clicksContext:null,__preloaded:!1}),Ar=p({layout:`default`,title:`In words: A whole sentence`}),jr=m({get layout(){return Ar.layout},get transition(){return Ar.transition},get class(){return Ar.class},get clicks(){return Ar.clicks},get name(){return Ar.name},get preload(){return Ar.preload},slide:{content:``,revision:`54fyx2`,frontmatterRaw:`layout: default +title: "In words: A whole sentence" +`,note:``,title:`In words: A whole sentence`,index:85,noteHTML:``,images:[],raw:``,frontmatter:Ar,filepath:``,start:4503,sourceIndex:85,id:85,no:86},__clicksContext:null,__preloaded:!1}),Mr=p({layout:`default`,core:!0,title:`Greedy or beam search`}),Nr=m({get layout(){return Mr.layout},get transition(){return Mr.transition},get class(){return Mr.class},get clicks(){return Mr.clicks},get name(){return Mr.name},get preload(){return Mr.preload},slide:{content:``,revision:`f7sbdv`,frontmatterRaw:`layout: default +core: true +title: Greedy or beam search +`,note:``,title:`Greedy or beam search`,index:86,noteHTML:``,images:[],raw:``,frontmatter:Mr,filepath:``,start:4529,sourceIndex:86,id:86,no:87},__clicksContext:null,__preloaded:!1}),Pr=p({layout:`default`,title:`In words: Greedy or beam search`}),Fr=m({get layout(){return Pr.layout},get transition(){return Pr.transition},get class(){return Pr.class},get clicks(){return Pr.clicks},get name(){return Pr.name},get preload(){return Pr.preload},slide:{content:``,revision:`qcbhe3`,frontmatterRaw:`layout: default +title: "In words: Greedy or beam search" +`,note:``,title:`In words: Greedy or beam search`,index:87,noteHTML:``,images:[],raw:``,frontmatter:Pr,filepath:``,start:4626,sourceIndex:87,id:87,no:88},__clicksContext:null,__preloaded:!1}),Ir=p({layout:`default`,core:!0,title:`The whole transformer, in one picture`}),Lr=m({get layout(){return Ir.layout},get transition(){return Ir.transition},get class(){return Ir.class},get clicks(){return Ir.clicks},get name(){return Ir.name},get preload(){return Ir.preload},slide:{content:``,revision:`-wq812o`,frontmatterRaw:`layout: default +core: true +title: The whole transformer, in one picture +`,note:``,title:`The whole transformer, in one picture`,index:88,noteHTML:``,images:[],raw:``,frontmatter:Ir,filepath:``,start:4653,sourceIndex:88,id:88,no:89},__clicksContext:null,__preloaded:!1}),Rr=p({layout:`default`,title:`In words: The whole transformer, in one picture`}),zr=m({get layout(){return Rr.layout},get transition(){return Rr.transition},get class(){return Rr.class},get clicks(){return Rr.clicks},get name(){return Rr.name},get preload(){return Rr.preload},slide:{content:``,revision:`mkkwzn`,frontmatterRaw:`layout: default +title: "In words: The whole transformer, in one picture" +`,note:``,title:`In words: The whole transformer, in one picture`,index:89,noteHTML:``,images:[],raw:``,frontmatter:Rr,filepath:``,start:4745,sourceIndex:89,id:89,no:90},__clicksContext:null,__preloaded:!1}),X=p({layout:`default`,title:`Going further`}),Br=m({get layout(){return X.layout},get transition(){return X.transition},get class(){return X.class},get clicks(){return X.clicks},get name(){return X.name},get preload(){return X.preload},slide:{content:``,revision:`-nfig0e`,frontmatterRaw:`layout: default +title: Going further +`,note:``,title:`Going further`,index:90,noteHTML:``,images:[],raw:``,frontmatter:X,filepath:``,start:4771,sourceIndex:90,id:90,no:91},__clicksContext:null,__preloaded:!1}),Vr=p({layout:`default`,title:`In words: Going further`}),Hr=m({get layout(){return Vr.layout},get transition(){return Vr.transition},get class(){return Vr.class},get clicks(){return Vr.clicks},get name(){return Vr.name},get preload(){return Vr.preload},slide:{content:``,revision:`-qcrveo`,frontmatterRaw:`layout: default +title: "In words: Going further" +`,note:``,title:`In words: Going further`,index:91,noteHTML:``,images:[],raw:``,frontmatter:Vr,filepath:``,start:4820,sourceIndex:91,id:91,no:92},__clicksContext:null,__preloaded:!1}),Ur=p({layout:`end`,email:`vajira@simula.no`}),Wr=m({get layout(){return Ur.layout},get transition(){return Ur.transition},get class(){return Ur.class},get clicks(){return Ur.clicks},get name(){return Ur.name},get preload(){return Ur.preload},slide:{content:``,revision:`lv04mu`,frontmatterRaw:`layout: end +email: vajira@simula.no +`,note:``,title:`Questions?`,level:1,index:92,noteHTML:``,images:[],raw:``,frontmatter:Ur,filepath:``,start:4846,sourceIndex:92,id:92,no:93},__clicksContext:null,__preloaded:!1}),Z=Array(93),Q=(t,n)=>e({loader:n,delay:300,loadingComponent:Ze,errorComponent:v,onError:e=>console.error(`Failed to load slide `+(t+1),e)}),Gr=async()=>{try{return Z[0]??=await _(()=>import(`./md-DTeIdT5u.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Kr=async()=>{try{return Z[1]??=await _(()=>import(`./md-CE--CYvf.js`),__vite__mapDeps([12,1,2,3,5,6,9,4,10,13,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},qr=async()=>{try{return Z[2]??=await _(()=>import(`./md-CV0LbJ3U2.js`),__vite__mapDeps([22,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Jr=async()=>{try{return Z[3]??=await _(()=>import(`./md-Cq-m9sQz2.js`),__vite__mapDeps([23,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Yr=async()=>{try{return Z[4]??=await _(()=>import(`./md-BUwdHoCB.js`),__vite__mapDeps([26,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Xr=async()=>{try{return Z[5]??=await _(()=>import(`./md-CW77YPMv.js`),__vite__mapDeps([30,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Zr=async()=>{try{return Z[6]??=await _(()=>import(`./md-BT1hbqH6.js`),__vite__mapDeps([31,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Qr=async()=>{try{return Z[7]??=await _(()=>import(`./md-D2cNEyY32.js`),__vite__mapDeps([32,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},$r=async()=>{try{return Z[8]??=await _(()=>import(`./md-DJ9N9dkz.js`),__vite__mapDeps([33,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ei=async()=>{try{return Z[9]??=await _(()=>import(`./md-D2UfMBGR.js`),__vite__mapDeps([34,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ti=async()=>{try{return Z[10]??=await _(()=>import(`./md-BWt5EuMf.js`),__vite__mapDeps([35,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ni=async()=>{try{return Z[11]??=await _(()=>import(`./md-CDcgbbik.js`),__vite__mapDeps([36,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ri=async()=>{try{return Z[12]??=await _(()=>import(`./md-DE54QcLZ.js`),__vite__mapDeps([37,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ii=async()=>{try{return Z[13]??=await _(()=>import(`./md-D8sbaEtQ.js`),__vite__mapDeps([38,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ai=async()=>{try{return Z[14]??=await _(()=>import(`./md-Df1KxXuS.js`),__vite__mapDeps([39,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},oi=async()=>{try{return Z[15]??=await _(()=>import(`./md-D-b0YBoE.js`),__vite__mapDeps([40,1,2,3,5,6,41,4,14,15,16,17,18,19,20,42,43,44,45,46]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},si=async()=>{try{return Z[16]??=await _(()=>import(`./md-DeP3xum_.js`),__vite__mapDeps([47,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ci=async()=>{try{return Z[17]??=await _(()=>import(`./md-BRvTXwre.js`),__vite__mapDeps([48,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},li=async()=>{try{return Z[18]??=await _(()=>import(`./md-DURWg7Wl.js`),__vite__mapDeps([49,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ui=async()=>{try{return Z[19]??=await _(()=>import(`./md-BkwHwcNT.js`),__vite__mapDeps([50,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},di=async()=>{try{return Z[20]??=await _(()=>import(`./md-JhK7xqvk.js`),__vite__mapDeps([51,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},fi=async()=>{try{return Z[21]??=await _(()=>import(`./md-BcztEDTt.js`),__vite__mapDeps([52,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},pi=async()=>{try{return Z[22]??=await _(()=>import(`./md-DEIfGkvE.js`),__vite__mapDeps([53,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},mi=async()=>{try{return Z[23]??=await _(()=>import(`./md-BVyRYzwm.js`),__vite__mapDeps([55,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},hi=async()=>{try{return Z[24]??=await _(()=>import(`./md-DsnKO94w.js`),__vite__mapDeps([56,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},gi=async()=>{try{return Z[25]??=await _(()=>import(`./md-CG5Sy8Ts.js`),__vite__mapDeps([57,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},_i=async()=>{try{return Z[26]??=await _(()=>import(`./md-B_GNIk3O.js`),__vite__mapDeps([58,1,2,3,4,5,6,41,14,15,16,17,18,19,20,42,44,45,59,60]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},vi=async()=>{try{return Z[27]??=await _(()=>import(`./md-Cil9bYLP.js`),__vite__mapDeps([61,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},yi=async()=>{try{return Z[28]??=await _(()=>import(`./md-CBiwiAUN2.js`),__vite__mapDeps([62,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29,63,27,64]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},bi=async()=>{try{return Z[29]??=await _(()=>import(`./md-CKe0B4NX2.js`),__vite__mapDeps([65,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},xi=async()=>{try{return Z[30]??=await _(()=>import(`./md-DBAOYXyd.js`),__vite__mapDeps([66,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Si=async()=>{try{return Z[31]??=await _(()=>import(`./md-C4csASMu2.js`),__vite__mapDeps([67,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ci=async()=>{try{return Z[32]??=await _(()=>import(`./md-ClA16Aez.js`),__vite__mapDeps([68,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},wi=async()=>{try{return Z[33]??=await _(()=>import(`./md-CIEPxxCW.js`),__vite__mapDeps([69,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ti=async()=>{try{return Z[34]??=await _(()=>import(`./md-DfUOvC0T.js`),__vite__mapDeps([70,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ei=async()=>{try{return Z[35]??=await _(()=>import(`./md-Dujs-v-n.js`),__vite__mapDeps([71,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Di=async()=>{try{return Z[36]??=await _(()=>import(`./md-Jxei1Krr2.js`),__vite__mapDeps([72,1,2,3,5,6,27,17,16,18,41,4,14,15,19,20,42,43,44,45,46]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Oi=async()=>{try{return Z[37]??=await _(()=>import(`./md-DA_krWYn2.js`),__vite__mapDeps([73,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ki=async()=>{try{return Z[38]??=await _(()=>import(`./md-DUErez2C2.js`),__vite__mapDeps([74,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ai=async()=>{try{return Z[39]??=await _(()=>import(`./md-hSb063-Y2.js`),__vite__mapDeps([75,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ji=async()=>{try{return Z[40]??=await _(()=>import(`./md-DrgIGlVp2.js`),__vite__mapDeps([76,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Mi=async()=>{try{return Z[41]??=await _(()=>import(`./md-JKbeikw12.js`),__vite__mapDeps([77,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ni=async()=>{try{return Z[42]??=await _(()=>import(`./md-DYSLXf1o2.js`),__vite__mapDeps([78,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,63,27,64]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Pi=async()=>{try{return Z[43]??=await _(()=>import(`./md-n-O9BiQw.js`),__vite__mapDeps([79,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Fi=async()=>{try{return Z[44]??=await _(()=>import(`./md-nMkiMiwP.js`),__vite__mapDeps([80,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ii=async()=>{try{return Z[45]??=await _(()=>import(`./md-YtqeGDdO.js`),__vite__mapDeps([81,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Li=async()=>{try{return Z[46]??=await _(()=>import(`./md-CaP1nPh7.js`),__vite__mapDeps([82,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ri=async()=>{try{return Z[47]??=await _(()=>import(`./md-gM39Vny3.js`),__vite__mapDeps([83,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},zi=async()=>{try{return Z[48]??=await _(()=>import(`./md-BgWTBxyL.js`),__vite__mapDeps([84,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Bi=async()=>{try{return Z[49]??=await _(()=>import(`./md-DxsAiztQ.js`),__vite__mapDeps([85,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Vi=async()=>{try{return Z[50]??=await _(()=>import(`./md-D-DRW-H6.js`),__vite__mapDeps([86,1,2,3,4,5,6,27,17,16,18,41,14,15,19,20,42,45,59,87]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Hi=async()=>{try{return Z[51]??=await _(()=>import(`./md-v3n1Uq5B.js`),__vite__mapDeps([88,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ui=async()=>{try{return Z[52]??=await _(()=>import(`./md-DFuumq9u.js`),__vite__mapDeps([89,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Wi=async()=>{try{return Z[53]??=await _(()=>import(`./md-DjpByc0R.js`),__vite__mapDeps([90,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Gi=async()=>{try{return Z[54]??=await _(()=>import(`./md-DByKDP8J.js`),__vite__mapDeps([91,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ki=async()=>{try{return Z[55]??=await _(()=>import(`./md-fvfttbwL.js`),__vite__mapDeps([92,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},qi=async()=>{try{return Z[56]??=await _(()=>import(`./md-B2eT1_4x.js`),__vite__mapDeps([93,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ji=async()=>{try{return Z[57]??=await _(()=>import(`./md-CChSOWnD.js`),__vite__mapDeps([94,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Yi=async()=>{try{return Z[58]??=await _(()=>import(`./md-pDvaI0qJ.js`),__vite__mapDeps([95,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Xi=async()=>{try{return Z[59]??=await _(()=>import(`./md-aadRBhSJ.js`),__vite__mapDeps([96,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Zi=async()=>{try{return Z[60]??=await _(()=>import(`./md-DOh70PNW.js`),__vite__mapDeps([97,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Qi=async()=>{try{return Z[61]??=await _(()=>import(`./md-B5YzwuK5.js`),__vite__mapDeps([98,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},$i=async()=>{try{return Z[62]??=await _(()=>import(`./md-c1b1hiln.js`),__vite__mapDeps([99,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ea=async()=>{try{return Z[63]??=await _(()=>import(`./md-geNSqxeK.js`),__vite__mapDeps([100,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ta=async()=>{try{return Z[64]??=await _(()=>import(`./md-Bf5Oits0.js`),__vite__mapDeps([101,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},na=async()=>{try{return Z[65]??=await _(()=>import(`./md-BmDYNuWL.js`),__vite__mapDeps([102,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ra=async()=>{try{return Z[66]??=await _(()=>import(`./md-JC1IoCq-.js`),__vite__mapDeps([103,1,2,3,5,6,27,17,16,18,41,4,14,15,19,20,42,104,44,45,59,105]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ia=async()=>{try{return Z[67]??=await _(()=>import(`./md-CBx0Em09.js`),__vite__mapDeps([106,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},aa=async()=>{try{return Z[68]??=await _(()=>import(`./md-DD7CU7HJ.js`),__vite__mapDeps([107,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},oa=async()=>{try{return Z[69]??=await _(()=>import(`./md-CacrcamQ.js`),__vite__mapDeps([108,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},sa=async()=>{try{return Z[70]??=await _(()=>import(`./md-DPlC9Trn.js`),__vite__mapDeps([109,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ca=async()=>{try{return Z[71]??=await _(()=>import(`./md-DxAxCp9K.js`),__vite__mapDeps([110,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},la=async()=>{try{return Z[72]??=await _(()=>import(`./md-nm6wRbKQ.js`),__vite__mapDeps([111,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ua=async()=>{try{return Z[73]??=await _(()=>import(`./md-BE6SL9lC.js`),__vite__mapDeps([112,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},da=async()=>{try{return Z[74]??=await _(()=>import(`./md-Bt-qs18d.js`),__vite__mapDeps([113,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},fa=async()=>{try{return Z[75]??=await _(()=>import(`./md-DtzrSiRi.js`),__vite__mapDeps([114,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},pa=async()=>{try{return Z[76]??=await _(()=>import(`./md-DC_yLTgh.js`),__vite__mapDeps([115,1,2,3,5,6,9,4,10,24,25]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ma=async()=>{try{return Z[77]??=await _(()=>import(`./md-LhxTbmEd2.js`),__vite__mapDeps([116,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ha=async()=>{try{return Z[78]??=await _(()=>import(`./md-DzvF9ZKL2.js`),__vite__mapDeps([117,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ga=async()=>{try{return Z[79]??=await _(()=>import(`./md-C68rt1Jx2.js`),__vite__mapDeps([118,1,2,3,4,5,6,27,17,16,18,41,14,15,19,20,42,59,119]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},_a=async()=>{try{return Z[80]??=await _(()=>import(`./md-DmlbZGZu2.js`),__vite__mapDeps([120,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29,54]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},va=async()=>{try{return Z[81]??=await _(()=>import(`./md-CLNMUNew2.js`),__vite__mapDeps([121,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ya=async()=>{try{return Z[82]??=await _(()=>import(`./md-DHzdLo_f2.js`),__vite__mapDeps([122,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,63,27,64]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ba=async()=>{try{return Z[83]??=await _(()=>import(`./md-DCToEkhh2.js`),__vite__mapDeps([123,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},xa=async()=>{try{return Z[84]??=await _(()=>import(`./md-CqT2jAjy2.js`),__vite__mapDeps([124,1,2,3,5,6,27,17,16,18,41,4,14,15,19,20,42,104,44,45,59,105]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Sa=async()=>{try{return Z[85]??=await _(()=>import(`./md-DuVY9mus2.js`),__vite__mapDeps([125,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ca=async()=>{try{return Z[86]??=await _(()=>import(`./md-CNTV1QrC2.js`),__vite__mapDeps([126,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21,27,28,29]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},wa=async()=>{try{return Z[87]??=await _(()=>import(`./md-BUsztF6n2.js`),__vite__mapDeps([127,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ta=async()=>{try{return Z[88]??=await _(()=>import(`./md-DFAWAndK2.js`),__vite__mapDeps([128,1,2,3,5,6,7,4,8,9,10,13,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Ea=async()=>{try{return Z[89]??=await _(()=>import(`./md-DAKQJiBX2.js`),__vite__mapDeps([129,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Da=async()=>{try{return Z[90]??=await _(()=>import(`./md-4y3kr0IX2.js`),__vite__mapDeps([130,1,2,3,4,5,6,9,10,13,14,15,16,17,18,19,20,21,131]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Oa=async()=>{try{return Z[91]??=await _(()=>import(`./md-DzgQupA02.js`),__vite__mapDeps([132,1,2,3,5,6,13,4,14,15,16,17,18,19,20,21]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},ka=async()=>{try{return Z[92]??=await _(()=>import(`./md-3Q8XeZQo2.js`),__vite__mapDeps([133,1,2,3,4,5,6,9,10,134]),import.meta.url)}catch(e){return console.error(`slide failed to load`,e),v}},Aa=[{no:1,meta:Qe,load:Gr,component:Q(0,Gr)},{no:2,meta:$e,load:Kr,component:Q(1,Kr)},{no:3,meta:et,load:qr,component:Q(2,qr)},{no:4,meta:tt,load:Jr,component:Q(3,Jr)},{no:5,meta:nt,load:Yr,component:Q(4,Yr)},{no:6,meta:rt,load:Xr,component:Q(5,Xr)},{no:7,meta:it,load:Zr,component:Q(6,Zr)},{no:8,meta:at,load:Qr,component:Q(7,Qr)},{no:9,meta:ot,load:$r,component:Q(8,$r)},{no:10,meta:st,load:ei,component:Q(9,ei)},{no:11,meta:ct,load:ti,component:Q(10,ti)},{no:12,meta:lt,load:ni,component:Q(11,ni)},{no:13,meta:ut,load:ri,component:Q(12,ri)},{no:14,meta:dt,load:ii,component:Q(13,ii)},{no:15,meta:ft,load:ai,component:Q(14,ai)},{no:16,meta:pt,load:oi,component:Q(15,oi)},{no:17,meta:mt,load:si,component:Q(16,si)},{no:18,meta:ht,load:ci,component:Q(17,ci)},{no:19,meta:gt,load:li,component:Q(18,li)},{no:20,meta:_t,load:ui,component:Q(19,ui)},{no:21,meta:vt,load:di,component:Q(20,di)},{no:22,meta:yt,load:fi,component:Q(21,fi)},{no:23,meta:bt,load:pi,component:Q(22,pi)},{no:24,meta:xt,load:mi,component:Q(23,mi)},{no:25,meta:St,load:hi,component:Q(24,hi)},{no:26,meta:Ct,load:gi,component:Q(25,gi)},{no:27,meta:wt,load:_i,component:Q(26,_i)},{no:28,meta:Tt,load:vi,component:Q(27,vi)},{no:29,meta:Et,load:yi,component:Q(28,yi)},{no:30,meta:Dt,load:bi,component:Q(29,bi)},{no:31,meta:Ot,load:xi,component:Q(30,xi)},{no:32,meta:At,load:Si,component:Q(31,Si)},{no:33,meta:Mt,load:Ci,component:Q(32,Ci)},{no:34,meta:Pt,load:wi,component:Q(33,wi)},{no:35,meta:It,load:Ti,component:Q(34,Ti)},{no:36,meta:Rt,load:Ei,component:Q(35,Ei)},{no:37,meta:Bt,load:Di,component:Q(36,Di)},{no:38,meta:Ht,load:Oi,component:Q(37,Oi)},{no:39,meta:Wt,load:ki,component:Q(38,ki)},{no:40,meta:Kt,load:Ai,component:Q(39,Ai)},{no:41,meta:Jt,load:ji,component:Q(40,ji)},{no:42,meta:Xt,load:Mi,component:Q(41,Mi)},{no:43,meta:Qt,load:Ni,component:Q(42,Ni)},{no:44,meta:en,load:Pi,component:Q(43,Pi)},{no:45,meta:nn,load:Fi,component:Q(44,Fi)},{no:46,meta:an,load:Ii,component:Q(45,Ii)},{no:47,meta:sn,load:Li,component:Q(46,Li)},{no:48,meta:ln,load:Ri,component:Q(47,Ri)},{no:49,meta:dn,load:zi,component:Q(48,zi)},{no:50,meta:pn,load:Bi,component:Q(49,Bi)},{no:51,meta:hn,load:Vi,component:Q(50,Vi)},{no:52,meta:_n,load:Hi,component:Q(51,Hi)},{no:53,meta:yn,load:Ui,component:Q(52,Ui)},{no:54,meta:xn,load:Wi,component:Q(53,Wi)},{no:55,meta:Cn,load:Gi,component:Q(54,Gi)},{no:56,meta:Tn,load:Ki,component:Q(55,Ki)},{no:57,meta:Dn,load:qi,component:Q(56,qi)},{no:58,meta:kn,load:Ji,component:Q(57,Ji)},{no:59,meta:jn,load:Yi,component:Q(58,Yi)},{no:60,meta:Nn,load:Xi,component:Q(59,Xi)},{no:61,meta:Fn,load:Zi,component:Q(60,Zi)},{no:62,meta:Ln,load:Qi,component:Q(61,Qi)},{no:63,meta:zn,load:$i,component:Q(62,$i)},{no:64,meta:Vn,load:ea,component:Q(63,ea)},{no:65,meta:Un,load:ta,component:Q(64,ta)},{no:66,meta:Gn,load:na,component:Q(65,na)},{no:67,meta:qn,load:ra,component:Q(66,ra)},{no:68,meta:Yn,load:ia,component:Q(67,ia)},{no:69,meta:Zn,load:aa,component:Q(68,aa)},{no:70,meta:$n,load:oa,component:Q(69,oa)},{no:71,meta:tr,load:sa,component:Q(70,sa)},{no:72,meta:rr,load:ca,component:Q(71,ca)},{no:73,meta:ar,load:la,component:Q(72,la)},{no:74,meta:sr,load:ua,component:Q(73,ua)},{no:75,meta:lr,load:da,component:Q(74,da)},{no:76,meta:dr,load:fa,component:Q(75,fa)},{no:77,meta:pr,load:pa,component:Q(76,pa)},{no:78,meta:hr,load:ma,component:Q(77,ma)},{no:79,meta:_r,load:ha,component:Q(78,ha)},{no:80,meta:yr,load:ga,component:Q(79,ga)},{no:81,meta:xr,load:_a,component:Q(80,_a)},{no:82,meta:Cr,load:va,component:Q(81,va)},{no:83,meta:Tr,load:ya,component:Q(82,ya)},{no:84,meta:Dr,load:ba,component:Q(83,ba)},{no:85,meta:kr,load:xa,component:Q(84,xa)},{no:86,meta:jr,load:Sa,component:Q(85,Sa)},{no:87,meta:Nr,load:Ca,component:Q(86,Ca)},{no:88,meta:Fr,load:wa,component:Q(87,wa)},{no:89,meta:Lr,load:Ta,component:Q(88,Ta)},{no:90,meta:zr,load:Ea,component:Q(89,Ea)},{no:91,meta:Br,load:Da,component:Q(90,Da)},{no:92,meta:Hr,load:Oa,component:Q(91,Oa)},{no:93,meta:Wr,load:ka,component:Q(92,ka)}],$=l(Aa);function ja(e,t,{mode:r=`replace`}={}){let i=le();return u({get(){let n=i.currentRoute.value.query[e];return n==null?t??null:Array.isArray(n)?n.filter(Boolean):n},set(a){n(()=>{(i.currentRoute.value.query[e]??t?.toString())!==a.toString()&&i[s(r)]({query:{...i.currentRoute.value.query,[e]:`${a}`===t?void 0:a}})})}})}function Ma(e,t,n=!1){let r=e.meta.slide?.frontmatter.routeAlias??e.no;return n?`/export/${r}`:t?`/presenter/${r}`:`/${r}`}function Na(e){return $.value.find(t=>t.no===+e||t.meta.slide?.frontmatter.routeAlias===e)}function Pa(e,t,n=!1){return(typeof e==`number`||typeof e==`string`)&&(e=Na(e)),Ma(e,t,n)}var Fa={"slide-left":`slide-left | slide-right`,"slide-right":`slide-right | slide-left`,"slide-up":`slide-up | slide-down`,"slide-down":`slide-down | slide-up`};function Ia(e,t=!1){if(!e||(typeof e==`string`&&(e={name:e}),!e.name))return;let n=e.name.includes(`|`)?e.name:Fa[e.name]||e.name;if(n.includes(`|`)){let[e,r]=n.split(`|`).map(e=>e.trim());n=t?r:e}if(n)return{...e,name:n}}function La(e,t,n){let r=e>0?n?.meta?.transition:t?.meta?.transition;return r||=g.transition||void 0,Ia(r,e<0)}var Ra=d(!1),za=d(!1),Ba=d(!1),Va=d(!1),Ha=d(!1),Ua=d(!1),Wa=d(!0),Ga=p(new Set),Ka=u(()=>Ga.size>0),qa=_e({xs:460,...pe}),Ja=fe(),Ya=he(),Xa=u(()=>Ja.height.value-Ja.width.value/je.value>120),Za=ve(ce?document.body:null),Qa=me(),$a=u(()=>[`INPUT`,`TEXTAREA`].includes(Qa.value?.tagName||``)),eo=u(()=>[`BUTTON`,`A`].includes(Qa.value?.tagName||``));h(`slidev-camera`,`default`,{listenToStorageChanges:!1}),h(`slidev-mic`,`default`,{listenToStorageChanges:!1});var to=h(`slidev-scale`,0),no=h(`slidev-wake-lock`,!0),ro=h(`slidev-hide-cursor-idle`,!0);h(`slidev-skip-export-pdf-tip`,!1),h(`slidev-export-capture-delay`,400,{listenToStorageChanges:!1});var io=h(`slidev-presenter-cursor`,!0,{listenToStorageChanges:!1}),ao=h(`slidev-cursor-style`,`cursor`,{listenToStorageChanges:!1});function oo(){io.value=!io.value}var so=h(`slidev-show-editor`,!1,{listenToStorageChanges:!1}),co=h(`slidev-editor-vertical`,!1,{listenToStorageChanges:!1}),lo=h(`slidev-editor-width`,ce?window.innerWidth*.4:318,{listenToStorageChanges:!1}),uo=h(`slidev-editor-height`,ce?window.innerHeight*.4:300,{listenToStorageChanges:!1}),fo=l(null),po=h(`slidev-presenter-font-size`,1,{listenToStorageChanges:!1}),mo=h(`slidev-presenter-layout`,1,{listenToStorageChanges:!1}),ho={invert:!1,contrast:1,brightness:1,hueRotate:0,saturate:1,sepia:0},go=h(`slidev-viewer-css-filter`,ho,{listenToStorageChanges:!1,mergeDefaults:!0,deep:!0}),_o=u(()=>Object.keys(ho).some(e=>go.value[e]!==ho[e]));function vo(){mo.value+=1,mo.value>3&&(mo.value=1)}function yo(){po.value=Math.min(2,po.value+.1)}function bo(){po.value=Math.max(.5,po.value-.1)}var xo=de(Va),So=h(`slidev-sync-directions`,{viewerSend:!0,viewerReceive:!0,presenterSend:!0,presenterReceive:!0},{listenToStorageChanges:!1,mergeDefaults:!0});function Co(e,t,n=1){let r=t.meta.slide.level??n;r&&r>n&&e.length>0?Co(e[e.length-1].children,t,n+1):e.push({no:t.no,children:[],level:n,titleLevel:r,path:Pa(t.meta.slide?.frontmatter?.routeAlias??t.no,!1),hideInToc:!!t.meta?.slide?.frontmatter?.hideInToc,title:t.meta?.slide?.title})}function wo(e,t,n=!1,r,i){return e.map(e=>{let a={...e,active:e.no===i?.value,hasActiveParent:n};return a.children.length>0&&(a.children=wo(a.children,t,a.active||a.hasActiveParent,a,i)),r&&(a.active||a.activeParent)&&(r.activeParent=!0),a})}function To(e,t=1){return e.filter(e=>!e.hideInToc).map(e=>({...e,children:To(e.children,t+1)}))}function Eo(e,t,n){let r=u(()=>e.value.filter(e=>e.meta?.slide?.title).reduce((e,t)=>(Co(e,t),e),[])),i=u(()=>wo(r.value,n.value,void 0,void 0,t));return u(()=>To(i.value))}function Do(e,t,n=d(0),r,i,o){let s=u(()=>$.value.length),c=d(0),l=d(0),ee=u(()=>Pa(e.value,r.value)),f=u(()=>e.value.no),te=u(()=>e.value.meta?.layout||(f.value===1?`cover`:`default`)),ne=u(()=>e.value.meta.slide.frontmatter),p=u(()=>t.value.current),m=u(()=>t.value.clicksStart),re=u(()=>t.value.total),ie=u(()=>$.value[Math.min($.value.length,f.value+1)-1]),ae=u(()=>$.value[Math.max(1,f.value-1)-1]),oe=u(()=>f.value<$.value.length||p.valuef.value>1||p.value>0),ce=u(()=>i.value?void 0:La(c.value,e.value,ae.value));a(e,(e,t)=>{c.value=e.no-t.no});async function le(e){return!1}let ue=Eo($,f,e);async function de(){l.value=1,re.value<=n.value?await pe():n.value+=1}async function fe(){l.value=-1,n.value<=m.value?await me(!0):--n.value}async function pe(e=!1){l.value=1,f.value<$.value.length&&await ge(f.value+1,e&&!i.value?be:void 0)}async function me(e=!1){l.value=-1,f.value>1&&await ge(f.value-1,e&&!i.value?be:void 0)}function he(){return ge(1)}function h(){return ge(s.value)}async function ge(e,t=0,i=!1){Ha.value=!1;let a=f.value!==e,s=t!==n.value,c=Na(e)?.meta,l=c?.slide?.frontmatter.clicksStart??0;t=Se(t,l,c?.__clicksContext?.total??999999),(i||a||s)&&await o?.push({path:Pa(e,r.value,o.currentRoute.value.name===`export`),query:{...o.currentRoute.value.query,clicks:t===0?void 0:t.toString(),embedded:location.search.includes(`embedded`)?`true`:void 0}})}function _e(){o?.push({path:Pa(f.value,!0),query:{...o.currentRoute.value.query}})}function ve(){o?.push({path:Pa(f.value,!1),query:{...o.currentRoute.value.query}})}return{slides:$,total:s,currentPath:ee,currentSlideNo:f,currentPage:f,currentSlideRoute:e,currentLayout:te,currentFrontmatter:ne,currentTransition:ce,clicksDirection:l,nextRoute:ie,prevRoute:ae,clicksContext:t,clicks:p,clicksStart:m,clicksTotal:re,hasNext:oe,hasPrev:se,tocTree:ue,navDirection:c,openInEditor:le,next:de,prev:fe,go:ge,goLast:h,goFirst:he,nextSlide:pe,prevSlide:me,enterPresenter:_e,exitPresenter:ve}}var Oo=ue(()=>{let e=le(),t=ye(),n=u(()=>(e?.currentRoute?.value?.query,new URLSearchParams(location.search))),r=u(()=>n.value.has(`print`)||t.name===`export`),i=d(n.value.get(`print`)===`clicks`),a=u(()=>n.value.has(`embedded`)),o=u(()=>t.name===`play`),s=u(()=>t.name===`presenter`),c=u(()=>t.name===`notes`),l=u(()=>!s.value&&(!g.remote||n.value.get(`password`)===g.remote)),ee=u(()=>!!t.params.no),f=u(()=>ee.value?Na(t.params.no)?.no??1:1),te=u(()=>$.value[f.value-1]),ne=d(Ke($.value.length,t?.query?.range)),p=ja(`clicks`,`0`),m=u(()=>ie(te.value)),re=u({get(){let e=+(p.value||0);return Number.isNaN(e)&&(e=0),e},set(e){Ha.value=!1,p.value=e.toString()}});function ie(e){if(e?.meta?.__clicksContext)return e.meta.__clicksContext;let t=e.no,n=He(u({get(){return f.value===t?Math.max(+(p.value??0),n.clicksStart):f.value>t?be:n.clicksStart},set(e){f.value===t&&(p.value=e.toString())}}),e?.meta.slide?.frontmatter.clicksStart??0,e?.meta.clicks);return e?.meta&&(e.meta.__clicksContext=n),n}return{router:e,currentRoute:u(()=>t),isPrintMode:r,isPrintWithClicks:i,isEmbedded:a,isPlaying:o,isPresenter:s,isNotesViewer:c,isPresenterAvailable:l,hasPrimarySlide:ee,currentSlideNo:f,currentSlideRoute:te,clicksContext:m,queryClicksRaw:p,queryClicks:re,printRange:ne,getPrimaryClicks:ie}}),ko=ue(()=>{let e=Oo(),t=le(),n=Do(e.currentSlideRoute,e.clicksContext,e.queryClicks,e.isPresenter,e.isPrintMode,t);return a([n.total,e.currentRoute],async()=>{let t=e.currentRoute.value.params.no;e.hasPrimarySlide.value&&!Na(t)&&(t&&t!==`index.html`?await n.go(n.total.value,0,!0):await n.go(1,0,!0))},{flush:`pre`,immediate:!0}),{...n,...e}});function Ao(){let e=ko(),t=r()?ge(xe,void 0):void 0;if(!t)return e;let n=te(t).nav;return{...e,...n}}export{Fe as $,to as A,Pa as B,Ka as C,Va as D,za as E,go as F,Ue as G,Ke as H,ho as I,Ae as J,Be as K,no as L,xo as M,oo as N,io as O,vo as P,Me as Q,Ja as R,Wa as S,Ba as T,Ge as U,$ as V,He as W,je as X,Ie as Y,Ne as Z,eo as _,ao as a,mo as b,uo as c,_o as d,Pe as et,ro as f,$a as g,co as h,qa as i,we as it,So as j,Ra as k,lo as l,yo as m,fo as n,Se as nt,bo as o,Ha as p,_ as q,Qa as r,De as rt,Ua as s,Ao as t,g as tt,Za as u,Xa as v,so as w,po as x,Ya as y,Na as z}; \ No newline at end of file diff --git a/transformer-v2/class/404.html b/transformer-v2/class/404.html index 09059bf033c0111a985f56a49c60a177c72a3233..f7733843f9b368b7abab731ff37dcc36e48cc254 100644 --- a/transformer-v2/class/404.html +++ b/transformer-v2/class/404.html @@ -11,16 +11,16 @@ - + - + - +
diff --git a/transformer-v2/class/assets/DeckFooter-RCcsEW0N.js b/transformer-v2/class/assets/DeckFooter-RCcsEW0N.js new file mode 100644 index 0000000000000000000000000000000000000000..e96f040166978d72c6f1b4b1f251b3556dc40ad5 --- /dev/null +++ b/transformer-v2/class/assets/DeckFooter-RCcsEW0N.js @@ -0,0 +1 @@ +import{_ as e,_t as t,b as n,g as r,w as i,xt as a,y as o,z as s}from"./modules/shiki-BFOesOFp.js";import{t as c}from"./useNav-BZQi666j.js";import{t as l}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as u}from"./slidev/context-ChHKJoK9.js";import"./slidev/client-BNcmSz3b.js";var d={class:`dl-footer`},f={class:`dl-footer__left`},p={key:0,class:`dl-footer__code`},m={key:1,class:`dl-footer__sep`},h={key:2},g={key:3,class:`dl-footer__sep`},_={key:4,class:`dl-footer__title`},v={class:`dl-footer__right`},y=l(i({__name:`DeckFooter`,setup(i){let{$slidev:l}=u(),y=c(),b=r(()=>l?.themeConfigs??{}),x=r(()=>b.value.courseCode??``),S=r(()=>b.value.lecture??``),C=r(()=>b.value.lectureTitle??``);return(r,i)=>(s(),n(`footer`,d,[e(`div`,f,[x.value?(s(),n(`span`,p,a(x.value),1)):o(`v-if`,!0),S.value?(s(),n(`span`,m,`·`)):o(`v-if`,!0),S.value?(s(),n(`span`,h,`Lecture `+a(S.value),1)):o(`v-if`,!0),C.value?(s(),n(`span`,g,`·`)):o(`v-if`,!0),C.value?(s(),n(`span`,_,a(C.value),1)):o(`v-if`,!0)]),e(`div`,v,a(t(y).currentPage.value)+` / `+a(t(y).total.value),1)]))}}),[[`__scopeId`,`data-v-fe908050`]]);export{y as t}; \ No newline at end of file diff --git a/transformer-v2/class/assets/DecodeLoop-BEpyTQUC.css b/transformer-v2/class/assets/DecodeLoop-BEpyTQUC.css new file mode 100644 index 0000000000000000000000000000000000000000..23b4ea260c3897bdfc7853a40dea32ab8631c0a0 --- /dev/null +++ b/transformer-v2/class/assets/DecodeLoop-BEpyTQUC.css @@ -0,0 +1 @@ +.dl-dec[data-v-87f8004e]{flex-direction:column;gap:.5rem;width:100%;max-width:36rem;display:flex}.dl-dec__row[data-v-87f8004e]{flex-wrap:wrap;align-items:center;gap:.3rem;display:flex}.dl-dec__label[data-v-87f8004e]{letter-spacing:.1em;text-transform:uppercase;color:var(--dl-muted);font-size:.7rem}.dl-dec__tok[data-v-87f8004e]{border:1px solid var(--dl-accent);background:var(--dl-accent-soft);color:var(--dl-heading);border-color:var(--dl-dec);background:color-mix(in srgb, var(--dl-dec) 12%, var(--dl-bg));border-radius:4px;padding:.08rem .5rem;font-size:.86rem}.dl-dec__tok.is-src[data-v-87f8004e]{border-color:var(--dl-enc);background:color-mix(in srgb, var(--dl-enc) 12%, var(--dl-bg))}@media (prefers-reduced-motion:no-preference){.dl-dec__tok.is-new[data-v-87f8004e]{animation:.5s ease-out both dl-dec-in-87f8004e}}@keyframes dl-dec-in-87f8004e{0%{opacity:0;transform:translateY(-.6rem)}to{opacity:1;transform:none}}.dl-dec__tok.is-start[data-v-87f8004e]{color:var(--dl-muted);background:0 0;border-style:dashed}.dl-dec__tok.is-wrong[data-v-87f8004e]{border-color:var(--dl-danger)}.dl-dec__chart[data-v-87f8004e]{flex-direction:column;gap:.15rem;display:flex}.dl-dec__title[data-v-87f8004e]{color:var(--dl-muted);font-size:.78rem}.dl-dec__bar-row[data-v-87f8004e]{grid-template-columns:5rem 1fr 2.6rem;align-items:center;gap:.5rem;font-size:.86rem;display:grid}.dl-dec__word[data-v-87f8004e]{text-align:right;color:var(--dl-body);border-radius:999px;padding:0 .3rem}.dl-dec__word.is-target[data-v-87f8004e]{outline:2px solid var(--dl-accent);color:var(--dl-heading);font-weight:700}.dl-dec__track[data-v-87f8004e]{background:var(--dl-surface);border:1px solid var(--dl-border);border-radius:3px;height:.75rem;overflow:hidden}.dl-dec__fill[data-v-87f8004e]{background:var(--dl-muted);height:100%;transition:width .25s;display:block}.dl-dec__fill.is-pick[data-v-87f8004e]{background:var(--dl-accent)}.dl-dec__p[data-v-87f8004e]{font-variant-numeric:tabular-nums;color:var(--dl-heading)}.dl-dec__loss[data-v-87f8004e]{color:var(--dl-muted);font-variant-numeric:tabular-nums;font-size:.82rem}.dl-dec__l[data-v-87f8004e]{color:var(--dl-heading);margin-left:.5rem}.dl-dec__total[data-v-87f8004e]{color:var(--dl-accent-strong);margin-left:.8rem;font-weight:700} diff --git a/transformer-v2/class/assets/DecodeLoop-Dzi8nT4a.js b/transformer-v2/class/assets/DecodeLoop-Dzi8nT4a.js new file mode 100644 index 0000000000000000000000000000000000000000..c27c69127266c18beb5c0fbc80c6aef0d0ebc961 --- /dev/null +++ b/transformer-v2/class/assets/DecodeLoop-Dzi8nT4a.js @@ -0,0 +1 @@ +import{Q as e,S as t,V as n,Y as r,_ as i,_t as a,b as o,bt as s,g as c,lt as l,m as u,v as d,vt as f,w as p,x as m,xt as h,y as g,z as _}from"./modules/shiki-BFOesOFp.js";import{t as v}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as y}from"./slidev/context-ChHKJoK9.js";import{n as b,r as x}from"./interactive-BWtflKDO.js";import{c as S,i as C,l as w,r as T,s as E,u as D}from"./useIllustrated-DSSyJg4J.js";import{t as O}from"./useConvolution-qO1u8ksh.js";var k={class:`dl-dec`},A={class:`dl-dec__row`},j={class:`dl-dec__chart`},M={class:`dl-dec__title`},N={class:`dl-dec__track`},P={class:`dl-dec__p`},F={key:0,class:`dl-dec__loss`},I={key:0,class:`dl-dec__total`},L=v(p({__name:`DecodeLoop`,props:{mode:{default:`trained`},step:{default:0},switchable:{type:Boolean,default:!0},loss:{type:Boolean,default:!1}},setup(p){let{$slidev:v,$nav:L,$clicksContext:R,$clicks:z,$page:B,$renderContext:ee,$frontmatter:te}=y(),V=p,H=C.length,U=l(V.mode),W=l(null),G=c(()=>Math.min(H,Math.max(0,W.value??V.step)));r(()=>V.step,()=>{W.value=null});let K=c(()=>U.value===`trained`?E:S),q=c(()=>Math.min(G.value,H-1)),J=c(()=>K.value[q.value]),Y=e=>e.indexOf(Math.max(...e)),X=c(()=>K.value.slice(0,G.value).map(e=>w[Y(e)])),Z=c(()=>K.value.slice(0,G.value).map((e,t)=>D(e,C[t]))),Q=c(()=>Z.value.reduce((e,t)=>e+t,0));function $(){W.value=G.value>=H?0:G.value+1}return(r,c)=>{let l=b,p=x;return _(),d(p,{"max-width":`44rem`},{controls:e(()=>[t(l,{label:G.value>=a(H)?`Start over`:`Write the next word`,glyph:`▸`,onClick:$},null,8,[`label`]),V.switchable?(_(),d(l,{key:0,label:U.value===`trained`?`Show an untrained model`:`Show a trained model`,variant:`ghost`,glyph:`⇄`,onClick:c[0]||=e=>U.value=U.value===`trained`?`untrained`:`trained`},null,8,[`label`])):g(`v-if`,!0)]),readout:e(()=>[G.value===0?(_(),o(u,{key:0},[c[5]||=m(` The encoder has read `,-1),c[6]||=i(`em`,null,`je suis étudiant`,-1),c[7]||=m(` once. The decoder starts from ⟨start⟩ and writes one word per step. The ringed word is the right answer. `,-1)],64)):G.value[i(`div`,k,[i(`div`,A,[c[1]||=i(`span`,{class:`dl-dec__label`},`input`,-1),(_(!0),o(u,null,n(a(T),e=>(_(),o(`span`,{key:e,class:`dl-dec__tok is-src`},h(e),1))),128)),c[2]||=i(`span`,{class:`dl-dec__label ml-3`},`output so far`,-1),c[3]||=i(`span`,{class:`dl-dec__tok is-start`},`⟨start⟩`,-1),(_(!0),o(u,null,n(X.value,(e,t)=>(_(),o(`span`,{key:t,class:f([`dl-dec__tok`,{"is-wrong":e!==a(w)[a(C)[t]],"is-new":t===X.value.length-1}])},h(e),3))),128))]),i(`div`,j,[i(`div`,M,` output position `+h(q.value+1)+` — probability of each word `,1),(_(!0),o(u,null,n(J.value,(e,t)=>(_(),o(`div`,{key:t,class:`dl-dec__bar-row`},[i(`span`,{class:f([`dl-dec__word`,{"is-target":t===a(C)[q.value]}])},h(a(w)[t]),3),i(`span`,N,[i(`span`,{class:f([`dl-dec__fill`,{"is-pick":t===Y(J.value)}]),style:s({width:`${e*100}%`})},null,6)]),i(`span`,P,h(e.toFixed(2)),1)]))),128))]),V.loss?(_(),o(`div`,F,[c[4]||=m(` loss per position: `,-1),(_(!0),o(u,null,n(Z.value,(e,t)=>(_(),o(`span`,{key:t,class:`dl-dec__l`},h(a(O)(e)),1))),128)),Z.value.length?(_(),o(`span`,I,`sum = `+h(a(O)(Q.value)),1)):g(`v-if`,!0)])):g(`v-if`,!0)])]),_:1})}}}),[[`__scopeId`,`data-v-87f8004e`]]);export{L as t}; \ No newline at end of file diff --git a/transformer-v2/class/assets/FlowDot-CpcqfMjQ.js b/transformer-v2/class/assets/FlowDot-CpcqfMjQ.js new file mode 100644 index 0000000000000000000000000000000000000000..cd4644aa4ceb53a16b2132d6a62384d3009ac587 --- /dev/null +++ b/transformer-v2/class/assets/FlowDot-CpcqfMjQ.js @@ -0,0 +1 @@ +import{_ as e,_t as t,b as n,bt as r,w as i,y as a,z as o}from"./modules/shiki-BFOesOFp.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as c}from"./slidev/context-ChHKJoK9.js";var l=[`r`],u=[`path`,`dur`,`begin`],d=s(i({__name:`FlowDot`,props:{path:{},dur:{default:1.8},delay:{default:0},role:{default:`accent`},r:{default:4.5}},setup(i){let{$slidev:s,$nav:d,$clicksContext:f,$clicks:p,$page:m,$renderContext:h,$frontmatter:g}=c(),_=i,v=typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,y=_.role===`body`?`var(--dl-body)`:`var(--dl-${_.role})`;return(i,s)=>t(v)?a(`v-if`,!0):(o(),n(`circle`,{key:0,r:_.r,class:`dl-flowdot`,style:r({fill:t(y)})},[e(`animateMotion`,{path:_.path,dur:`${_.dur}s`,begin:`-${_.delay}s`,repeatCount:`indefinite`,calcMode:`paced`},null,8,u)],12,l))}}),[[`__scopeId`,`data-v-90635adf`]]);export{d as t}; \ No newline at end of file diff --git a/transformer-v2/class/assets/FlowDot-DhuTnWHT.css b/transformer-v2/class/assets/FlowDot-DhuTnWHT.css new file mode 100644 index 0000000000000000000000000000000000000000..aae461ac589d09701cdf7548f3af3e7ecafb2db0 --- /dev/null +++ b/transformer-v2/class/assets/FlowDot-DhuTnWHT.css @@ -0,0 +1 @@ +.dl-flowdot[data-v-90635adf]{stroke:var(--dl-bg);stroke-width:1.5px} diff --git a/transformer-v2/class/assets/ItAttention-Bn_pC1Mv.js b/transformer-v2/class/assets/ItAttention-Bn_pC1Mv.js new file mode 100644 index 0000000000000000000000000000000000000000..217f367e2b5e3d56a9abb6f93f58df10ac7de37d --- /dev/null +++ b/transformer-v2/class/assets/ItAttention-Bn_pC1Mv.js @@ -0,0 +1 @@ +import{Q as e,S as t,V as n,_ as r,_t as i,b as a,bt as o,g as s,lt as c,m as l,v as u,vt as d,w as f,x as p,xt as m,y as h,z as g}from"./modules/shiki-BFOesOFp.js";import{t as _}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as v}from"./slidev/context-ChHKJoK9.js";import{n as y,r as b}from"./interactive-BWtflKDO.js";import{n as x,t as S}from"./useIllustrated-DSSyJg4J.js";var C=[`aria-label`],w=[`x1`,`y1`,`x2`,`y2`],T=[`y`],E=[`y`,`onClick`],D=21,O=16,k=150,A=330,j=_(f({__name:`ItAttention`,props:{head:{default:0},switchable:{type:Boolean,default:!0},movable:{type:Boolean,default:!0}},setup(f){let{$slidev:_,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=v(),L=f,R=c(L.head),z=c(7),B=s(()=>R.value===`both`?[0,1]:[R.value]),V=s(()=>B.value.flatMap(e=>S[e][z.value].map((t,n)=>({h:e,j:n,w:t,y:O+n*D}))));function H(e){let t=S[e][z.value],n=t.indexOf(Math.max(...t));return{word:x[n],w:t[n]}}function U(e){z.value=(z.value+e+x.length)%x.length}function W(e){(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.stopPropagation(),e.preventDefault(),U(e.key===`ArrowUp`?-1:1))}return(s,c)=>{let f=y,_=b;return g(),u(_,{"max-width":`40rem`},{controls:e(()=>[L.switchable?(g(),a(l,{key:0},[t(f,{label:`Head 1`,variant:R.value===0?`primary`:`ghost`,onClick:c[0]||=e=>R.value=0},null,8,[`variant`]),t(f,{label:`Head 2`,variant:R.value===1?`primary`:`ghost`,onClick:c[1]||=e=>R.value=1},null,8,[`variant`]),t(f,{label:`Both`,variant:R.value===`both`?`primary`:`ghost`,onClick:c[2]||=e=>R.value=`both`},null,8,[`variant`])],64)):h(`v-if`,!0),L.movable?(g(),a(l,{key:1},[t(f,{label:`Previous word`,variant:`ghost`,glyph:`↑`,onClick:c[3]||=e=>U(-1)}),t(f,{label:`Next word`,variant:`ghost`,glyph:`↓`,onClick:c[4]||=e=>U(1)})],64)):h(`v-if`,!0)]),readout:e(()=>[(g(!0),a(l,null,n(B.value,e=>(g(),a(l,{key:e},[r(`span`,{class:d(e===1?`dl-ita__h2`:`dl-ita__h1`)},`Head `+m(e+1),3),c[6]||=p(`: `,-1),r(`strong`,null,m(i(x)[z.value]),1),c[7]||=p(` reads `,-1),r(`strong`,null,m(H(e).word),1),p(` most (`+m(H(e).w.toFixed(2))+`). `,1)],64))),128)),c[8]||=r(`span`,{class:`dl-ita__note`},`Weights drawn by hand to show the idea, not taken from a trained model.`,-1)]),default:e(()=>[(g(),a(`svg`,{viewBox:`0 0 460 250`,class:`dl-ita`,role:`img`,tabindex:`0`,"aria-label":`Attention of '${i(x)[z.value]}' over the sentence`,onKeydown:W},[(g(!0),a(l,null,n(V.value,e=>(g(),a(`line`,{key:`${e.h}-${e.j}-${z.value}`,x1:322,y1:O+z.value*D-4,x2:158,y2:e.y-4,class:d([`dl-ita__line`,{"is-h2":e.h===1}]),style:o({strokeWidth:.6+e.w*16,opacity:.25+e.w*1.5})},null,14,w))),128)),(g(!0),a(l,null,n(i(x),(e,t)=>(g(),a(`text`,{key:`k${t}`,x:k,y:O+t*D,"text-anchor":`end`,class:`dl-ita__word`},m(e),9,T))),128)),(g(!0),a(l,null,n(i(x),(e,t)=>(g(),a(`text`,{key:`q${t}`,x:A,y:O+t*D,class:d([`dl-ita__word`,{"is-ask":t===z.value}]),onClick:e=>z.value=t},m(e),11,E))),128)),c[5]||=r(`text`,{x:`20`,y:`245`,class:`dl-ita__small`},`read (keys)`,-1),r(`text`,{x:A,y:`245`,class:`dl-ita__small`},`asking (query)`)],40,C))]),_:1})}}}),[[`__scopeId`,`data-v-1f222a43`]]);export{j as t}; \ No newline at end of file diff --git a/transformer-v2/class/assets/ItAttention-DcmGpltA.css b/transformer-v2/class/assets/ItAttention-DcmGpltA.css new file mode 100644 index 0000000000000000000000000000000000000000..f02cfa48c643d98867c783b0be9d47b5812d11ad --- /dev/null +++ b/transformer-v2/class/assets/ItAttention-DcmGpltA.css @@ -0,0 +1 @@ +.dl-ita[data-v-1f222a43]{outline:none;width:100%;max-width:30rem;height:auto}.dl-ita[data-v-1f222a43]:focus-visible{outline:2px solid var(--dl-accent);outline-offset:2px}.dl-ita__line[data-v-1f222a43]{stroke:var(--dl-accent);stroke-linecap:round}.dl-ita__line.is-h2[data-v-1f222a43]{stroke:var(--dl-k)}.dl-ita__word[data-v-1f222a43]{fill:var(--dl-heading);cursor:pointer;font-size:14px}.dl-ita__word.is-ask[data-v-1f222a43]{fill:var(--dl-q);font-weight:700}.dl-ita__small[data-v-1f222a43]{fill:var(--dl-muted);font-size:11px}.dl-ita__h2[data-v-1f222a43]{color:var(--dl-k)}.dl-ita__h1[data-v-1f222a43]{color:var(--dl-accent)}@media (prefers-reduced-motion:no-preference){.dl-ita__line[data-v-1f222a43]{stroke-dasharray:400;animation:.9s ease-out both dl-ita-draw-1f222a43}}@keyframes dl-ita-draw-1f222a43{0%{stroke-dashoffset:400px}to{stroke-dashoffset:0}}.dl-ita__note[data-v-1f222a43]{color:var(--dl-muted);font-size:.85em;display:block}