vlbthambawita commited on
Commit
157ee49
Β·
verified Β·
1 Parent(s): 09eeefd

Release site-v1.0.4 (part 5)

Browse files
This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. lecture-05/assets/Katex-B9T0XOzt.js +0 -0
  2. lecture-05/assets/PollSlide-B7sHLB83.js +1 -0
  3. lecture-05/assets/RnnUnroll-BLKlEl4w.js +1 -0
  4. lecture-05/assets/SeqToSeqFlow-D6Bw6E2W.js +5 -0
  5. lecture-05/assets/SlideWrapper-YCeS5BX7.js +2 -0
  6. lecture-05/assets/default-CkTgO_iP.js +1 -0
  7. lecture-05/assets/index-DdzHTFh8.js +46 -0
  8. lecture-05/assets/index-U6hcpeoQ.css +0 -0
  9. lecture-05/assets/interactive-Dm0CtntL.js +1 -0
  10. lecture-05/assets/md-0TY0dx90.js +1 -0
  11. lecture-05/assets/md-4unhqfQF2.js +28 -0
  12. lecture-05/assets/md-8BSDPxep.js +1 -0
  13. lecture-05/assets/md-8U7N9b1w2.js +1 -0
  14. lecture-05/assets/md-90fMrPtp2.js +1 -0
  15. lecture-05/assets/md-9rwPlqBu.js +1 -0
  16. lecture-05/assets/md-A3drwVkB2.js +1 -0
  17. lecture-05/assets/md-B06fpXsZ2.js +1 -0
  18. lecture-05/assets/md-B5yZyZiw2.js +1 -0
  19. lecture-05/assets/md-BA6--Wmq.js +7 -0
  20. lecture-05/assets/md-BCvwqRh4.js +1 -0
  21. lecture-05/assets/md-BDAYagSu.js +1 -0
  22. lecture-05/assets/md-BIJiSmmn2.js +1 -0
  23. lecture-05/assets/md-BJirPl8n.js +1 -0
  24. lecture-05/assets/md-BKUC5yo2.js +1 -0
  25. lecture-05/assets/md-BK_KSB2L2.js +1 -0
  26. lecture-05/assets/md-BLRwEhJ2.js +1 -0
  27. lecture-05/assets/md-BNzXX7Lr2.js +1 -0
  28. lecture-05/assets/md-BPWudfVY.js +1 -0
  29. lecture-05/assets/md-BQK1FZpL.js +1 -0
  30. lecture-05/assets/md-BRFy5aDW.js +1 -0
  31. lecture-05/assets/md-BTXwqNmD2.js +1 -0
  32. lecture-05/assets/md-BVkuWe7H.js +1 -0
  33. lecture-05/assets/md-BZFxRof9.js +1 -0
  34. lecture-05/assets/md-B_ZqeUP3.js +1 -0
  35. lecture-05/assets/md-B_tcer9R.js +14 -0
  36. lecture-05/assets/md-BbkqrAWu.js +1 -0
  37. lecture-05/assets/md-BcDn48pd.js +1 -0
  38. lecture-05/assets/md-Bj2N68xh.js +1 -0
  39. lecture-05/assets/md-BldLBnj7.js +1 -0
  40. lecture-05/assets/md-BmRdiwFD2.js +7 -0
  41. lecture-05/assets/md-BmZd0fOS.js +1 -0
  42. lecture-05/assets/md-BqKGHBCc.js +1 -0
  43. lecture-05/assets/md-BqlvZ3Kn2.js +1 -0
  44. lecture-05/assets/md-BrSKg0J3.js +1 -0
  45. lecture-05/assets/md-BsQteIGq.js +1 -0
  46. lecture-05/assets/md-BucEuds6.js +1 -0
  47. lecture-05/assets/md-Bv4kuYzj.js +1 -0
  48. lecture-05/assets/md-BwmjyZQI2.js +1 -0
  49. lecture-05/assets/md-ByycPNba.js +1 -0
  50. lecture-05/assets/md-C-j1Z4l8.js +1 -0
lecture-05/assets/Katex-B9T0XOzt.js ADDED
The diff for this file is too large to render. See raw diff
 
lecture-05/assets/PollSlide-B7sHLB83.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,S as t,St as n,V as r,_ as i,b as a,m as o,w as s,z as c}from"./modules/shiki-CkJq9tSf.js";import{t as l}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as u}from"./slidev/context-DnYiQGy6.js";import{t as d}from"./slidev/VClicks-CNqMVSis.js";var f={class:`dl-poll`},p={class:`dl-poll__question`},m=l(s({__name:`PollSlide`,props:{question:{},items:{}},setup(s){let{$slidev:l,$nav:m,$clicksContext:h,$clicks:g,$page:_,$renderContext:v,$frontmatter:y}=u(),b=s;return(s,l)=>{let u=d;return c(),a(`div`,f,[i(`div`,p,n(b.question),1),t(u,null,{default:e(()=>[(c(!0),a(o,null,r(b.items,e=>(c(),a(`div`,{key:e,class:`dl-poll__item`},[l[0]||=i(`span`,{class:`dl-poll__bullet`},`?`,-1),i(`span`,null,n(e),1)]))),128))]),_:1})])}}}),[[`__scopeId`,`data-v-743a908f`]]);export{m as t};
lecture-05/assets/RnnUnroll-BLKlEl4w.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,S as t,St as n,V as ee,_ as r,b as i,g as a,m as o,ut as s,v as te,vt as c,w as l,x as u,y as d,yt as f,z as p}from"./modules/shiki-CkJq9tSf.js";import{t as m}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ne}from"./slidev/context-DnYiQGy6.js";import{n as h}from"./useConvolution-mOidZmS_.js";import{c as re,i as ie,l as ae,r as g,t as oe}from"./useRecurrence-PhWWMav6.js";import{n as se}from"./interactive-Dm0CtntL.js";import{t as ce}from"./StepButton-BvnaUJaa.js";var le=[`viewBox`],ue=[`x`,`y`],de=[`x1`,`y1`,`x2`,`y2`],fe=[`x`,`y`],pe=[`y`],me=[`x`,`y`],he=[`d`],ge=[`x`,`y`],_e=[`x`,`y`],ve=[`x`],ye=[`x1`,`y1`,`x2`,`y2`],be=[`x`,`y`],xe=[`x`,`y`],Se=[`viewBox`,`aria-label`],Ce=[`x1`,`y1`,`x2`,`y2`],we=[`x`,`y`],_=[`x1`,`y1`,`x2`,`y2`],v=[`x`,`y`],y=[`x`],b=[`x`,`y`],x={class:`dl-unroll__sub`,dy:`3`},S={class:`dl-unroll__val`,dy:`-3`},C=[`x1`,`y1`,`x2`,`y2`],w=[`x`,`y`],T=[`x`],E=[`x`,`y`],D={class:`dl-unroll__sub`,dy:`3`},O=[`x`,`y`],k=[`x1`,`y1`,`x2`,`y2`],Te=[`x`,`y`],Ee=[`x`],De=[`x`,`y`],Oe={class:`dl-unroll__sub`,dy:`3`},ke={key:0,class:`dl-unroll__val`,dy:`-3`},Ae=[`x`,`y`],je={class:`dl-unroll__eq`},Me={key:0,class:`dl-unroll__note`},A=118,j=58,M=78,N=46,P=30,F=18,I=92,L=172,Ne=226,R=330,Pe=226,z=96,B=96,Fe=m(l({__name:`RnnUnroll`,props:{steps:{default:4},start:{default:`fold`},values:{type:Boolean,default:!0},weights:{type:Boolean,default:!0},example:{default:`pulse`}},setup(l){let{$slidev:m,$nav:Fe,$clicksContext:Ie,$clicks:Le,$page:Re,$renderContext:ze,$frontmatter:Be}=ne(),V=l,H=a(()=>V.example===`review`),U=a(()=>H.value?g.length:V.steps),W=a(()=>H.value?re(g):Array.from({length:V.steps},(e,t)=>[+(t%2==0)])),G=a(()=>ae(W.value,H.value?ie:oe)),Ve=e=>e.x.every(e=>e===0)&&e.h.some(e=>Math.abs(e)>1e-9),K=s(V.start===`fold`),q=s(-1),J=a(()=>Math.min(q.value,U.value-1)),Y=a(()=>J.value<0?null:G.value[J.value]),He=a(()=>J.value>=U.value-1);function Ue(){K.value=!1,q.value=J.value<U.value-1?J.value+1:-1}let X=e=>e.map(e=>h(e)).join(`, `),We=a(()=>j+(U.value-1)*A+M+30),Z=e=>j+e*A,Q=e=>Z(e)+M/2,$=I;return(a,s)=>{let l=ce,m=se;return p(),te(m,{"max-width":K.value?`24rem`:`46rem`},{controls:e(()=>[t(l,{label:K.value?`Unroll it`:`Fold it back`,glyph:`⇄`,variant:`ghost`,onClick:s[0]||=e=>K.value=!K.value},null,8,[`label`]),t(l,{label:He.value&&!K.value?`Start over`:`Next step`,glyph:`β–Έ`,onClick:Ue},null,8,[`label`])]),readout:e(()=>[K.value?(p(),i(o,{key:0},[s[13]||=u(` One layer, one set of weights, one loop. The loop is not a second layer β€” it is this layer reading `,-1),s[14]||=r(`strong`,null,`its own previous output`,-1),s[15]||=u(`, one time step later. `,-1)],64)):Y.value?(p(),i(o,{key:1},[r(`span`,je,[u(` t = `+n(Y.value.t)+`: W`,1),s[16]||=r(`sub`,null,`xh`,-1),u(`x = [`+n(X(Y.value.fromInput))+`] + W`,1),s[17]||=r(`sub`,null,`hh`,-1),s[18]||=u(`h`,-1),r(`sub`,null,n(Y.value.t-1),1),u(` = [`+n(X(Y.value.fromState))+`] β†’ h`,1),r(`sub`,null,n(Y.value.t),1),u(` = tanh([`+n(X(Y.value.z))+`]) = [`,1),r(`strong`,null,n(X(Y.value.h)),1),s[19]||=u(`] `,-1)]),Ve(Y.value)?(p(),i(`span`,Me,[...s[20]||=[u(` The input at this step is `,-1),r(`strong`,null,`0`,-1),u(` β€” and the state is not. That is the memory. `,-1)]])):d(`v-if`,!0)],64)):(p(),i(o,{key:2},[u(n(U.value)+` copies of one layer. Every W`,1),s[21]||=r(`sub`,null,`xh`,-1),s[22]||=u(`, every W`,-1),s[23]||=r(`sub`,null,`hh`,-1),s[24]||=u(`, every W`,-1),s[25]||=r(`sub`,null,`ho`,-1),s[26]||=u(` on this picture is the `,-1),s[27]||=r(`strong`,null,`same matrix`,-1),s[28]||=u(`. Press `,-1),s[29]||=r(`strong`,null,`Next step`,-1),s[30]||=u(`. `,-1)],64))]),default:e(()=>[K.value?(p(),i(`svg`,{key:0,class:`dl-unroll`,viewBox:`0 0 ${R} ${Pe}`,preserveAspectRatio:`xMidYMid meet`,role:`img`,"aria-label":`A recurrent layer drawn folded: one hidden layer whose output is fed back into itself one time step later`},[s[5]||=r(`defs`,null,[r(`marker`,{id:`dl-unroll-arrowf`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto-start-reverse`},[r(`path`,{d:`M0,0 L8,4 L0,8 z`,fill:`currentColor`})])],-1),r(`rect`,{class:`dl-unroll__io`,x:z,y:L,width:B,height:P,rx:`4`}),r(`text`,{class:`dl-unroll__iolabel`,x:144,y:191,"text-anchor":`middle`},`x`,8,ue),r(`line`,{class:`dl-unroll__feed`,x1:144,y1:170,x2:144,y2:c($)+N+4,"marker-end":`url(#dl-unroll-arrowf)`},null,8,de),V.weights?(p(),i(`text`,{key:0,class:`dl-unroll__w`,x:152,y:160},[...s[1]||=[u(`W`,-1),r(`tspan`,{class:`dl-unroll__sub`,dy:`3`},`xh`,-1)]],8,fe)):d(`v-if`,!0),r(`rect`,{class:`dl-unroll__cell`,x:z,y:c($),width:B,height:N,rx:`6`},null,8,pe),r(`text`,{class:`dl-unroll__celllabel`,x:144,y:120,"text-anchor":`middle`},`h`,8,me),d(` The loop: out of the right edge and straight back into it. `),r(`path`,{class:`dl-unroll__loop`,d:`M 192 104 C 254 61, 254 169, 192 126`,fill:`none`,"marker-end":`url(#dl-unroll-arrowf)`},null,8,he),V.weights?(p(),i(`text`,{key:1,class:`dl-unroll__w is-loop`,x:244,y:95},[...s[2]||=[u(`W`,-1),r(`tspan`,{class:`dl-unroll__sub`,dy:`3`},`hh`,-1)]],8,ge)):d(`v-if`,!0),r(`text`,{class:`dl-unroll__delay`,x:244,y:145},[s[3]||=u(`one step `,-1),r(`tspan`,{x:244,dy:`11`},`of delay`,8,ve)],8,_e),r(`line`,{class:`dl-unroll__feed`,x1:144,y1:c($)-2,x2:144,y2:52,"marker-end":`url(#dl-unroll-arrowf)`},null,8,ye),V.weights?(p(),i(`text`,{key:2,class:`dl-unroll__w`,x:152,y:c($)-14},[...s[4]||=[u(`W`,-1),r(`tspan`,{class:`dl-unroll__sub`,dy:`3`},`ho`,-1)]],8,be)):d(`v-if`,!0),r(`rect`,{class:`dl-unroll__io is-out`,x:z,y:F,width:B,height:P,rx:`4`}),r(`text`,{class:`dl-unroll__iolabel`,x:144,y:37,"text-anchor":`middle`},`o`,8,xe)],8,le)):(p(),i(o,{key:1},[d(` The same layer, copied once per time step. `),(p(),i(`svg`,{class:`dl-unroll`,viewBox:`0 0 ${We.value} ${Ne}`,preserveAspectRatio:`xMidYMid meet`,role:`img`,"aria-label":`The same recurrent layer unrolled across ${U.value} time steps, every copy using the same weights`},[s[12]||=r(`defs`,null,[r(`marker`,{id:`dl-unroll-arrowu`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto-start-reverse`},[r(`path`,{d:`M0,0 L8,4 L0,8 z`,fill:`currentColor`})])],-1),d(` h_0, the state the chain starts from: zeros, and worth naming. `),r(`line`,{class:f([`dl-unroll__state`,{"is-live":J.value>=0}]),x1:24,y1:115,x2:Z(0)-3,y2:115,"marker-end":`url(#dl-unroll-arrowu)`},null,10,Ce),r(`text`,{class:`dl-unroll__h0`,x:20,y:119,"text-anchor":`end`},`0`,8,we),(p(!0),i(o,null,ee(U.value,e=>(p(),i(`g`,{key:`col${e}`},[d(` state in from the previous step `),e>1?(p(),i(o,{key:0},[r(`line`,{class:f([`dl-unroll__state`,{"is-live":J.value>=e-1}]),x1:Z(e-2)+M,y1:115,x2:Z(e-1)-3,y2:115,"marker-end":`url(#dl-unroll-arrowu)`},null,10,_),V.weights?(p(),i(`text`,{key:0,class:`dl-unroll__w is-shared`,x:(Z(e-2)+M+Z(e-1))/2,y:107,"text-anchor":`middle`},[...s[6]||=[u(` W`,-1),r(`tspan`,{class:`dl-unroll__sub`,dy:`3`},`hh`,-1)]],8,v)):d(`v-if`,!0)],64)):d(`v-if`,!0),r(`rect`,{class:`dl-unroll__io`,x:Z(e-1),y:L,width:M,height:P,rx:`4`},null,8,y),r(`text`,{class:`dl-unroll__iolabel`,x:Q(e-1),y:191,"text-anchor":`middle`},[H.value?(p(),i(o,{key:0},[u(n(c(g)[e-1]),1)],64)):(p(),i(o,{key:1},[s[7]||=u(` x`,-1),r(`tspan`,x,n(e),1),r(`tspan`,S,` = `+n(W.value[e-1][0]),1)],64))],8,b),r(`line`,{class:f([`dl-unroll__feed`,{"is-live":J.value===e-1}]),x1:Q(e-1),y1:170,x2:Q(e-1),y2:142,"marker-end":`url(#dl-unroll-arrowu)`},null,10,C),V.weights?(p(),i(`text`,{key:1,class:`dl-unroll__w is-shared`,x:Q(e-1)+7,y:158},[...s[8]||=[u(` W`,-1),r(`tspan`,{class:`dl-unroll__sub`,dy:`3`},`xh`,-1)]],8,w)):d(`v-if`,!0),r(`rect`,{class:f([`dl-unroll__cell`,{"is-done":J.value>=e-1,"is-current":J.value===e-1}]),x:Z(e-1),y:I,width:M,height:N,rx:`6`},null,10,T),r(`text`,{class:`dl-unroll__celllabel`,x:Q(e-1),y:I+(V.values?19:28),"text-anchor":`middle`},[s[9]||=u(` h`,-1),r(`tspan`,D,n(e),1)],8,E),V.values&&J.value>=e-1?(p(),i(`text`,{key:2,class:`dl-unroll__hval`,x:Q(e-1),y:127,"text-anchor":`middle`},n(X(G.value[e-1].h)),9,O)):d(`v-if`,!0),r(`line`,{class:f([`dl-unroll__feed`,{"is-live":J.value===e-1}]),x1:Q(e-1),y1:90,x2:Q(e-1),y2:52,"marker-end":`url(#dl-unroll-arrowu)`},null,10,k),V.weights?(p(),i(`text`,{key:3,class:`dl-unroll__w is-shared`,x:Q(e-1)+7,y:78},[...s[10]||=[u(` W`,-1),r(`tspan`,{class:`dl-unroll__sub`,dy:`3`},`ho`,-1)]],8,Te)):d(`v-if`,!0),r(`rect`,{class:f([`dl-unroll__io`,{"is-out":J.value>=e-1}]),x:Z(e-1),y:F,width:M,height:P,rx:`4`},null,10,Ee),r(`text`,{class:`dl-unroll__iolabel`,x:Q(e-1),y:37,"text-anchor":`middle`},[s[11]||=u(` o`,-1),r(`tspan`,Oe,n(e),1),J.value>=e-1?(p(),i(`tspan`,ke,` = `+n(c(h)(G.value[e-1].o[0])),1)):d(`v-if`,!0)],8,De),r(`text`,{class:`dl-unroll__t`,x:Q(e-1),y:220,"text-anchor":`middle`},`t = `+n(e),9,Ae)]))),128))],8,Se))],2112))]),_:1},8,[`max-width`])}}}),[[`__scopeId`,`data-v-96366cc7`]]);export{Fe as t};
lecture-05/assets/SeqToSeqFlow-D6Bw6E2W.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import{$ as e,St as t,V as n,_ as r,b as i,g as a,m as o,ut as s,v as c,w as l,x as u,xt as d,y as f,yt as p,z as m}from"./modules/shiki-CkJq9tSf.js";import{t as h}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as g}from"./slidev/context-DnYiQGy6.js";import{n as _}from"./interactive-Dm0CtntL.js";import{t as v}from"./StepButton-BvnaUJaa.js";import{t as ee}from"./Slider-Bf0ITYx4.js";var y=[`viewBox`,`aria-label`],b=[`x1`,`y1`,`x2`,`y2`],x=[`x`],S=[`x`,`y`],C=[`y`],w=[`x1`,`y1`,`x2`,`y2`],te=[`x`],ne=[`x`,`y`],re=[`x1`,`y1`,`y2`],ie=[`y1`,`x2`,`y2`],ae=[`y`],oe=[`y`],se=[`x1`,`y1`,`x2`,`y2`,`stroke-width`],T=[`x`,`y`],E=[`x`,`y`],D={key:0,class:`dl-s2s__note`},O=580,ce=254,k=28,A=74,j=34,M=26,N=106,P=184,F=104,I=h(l({__name:`SeqToSeqFlow`,props:{mode:{default:`bottleneck`},contextDim:{default:256}},setup(l){let{$slidev:h,$nav:I,$clicksContext:le,$clicks:ue,$page:de,$renderContext:fe,$frontmatter:pe}=g(),L=l,R=[`Ich`,`habe`,`gestern`,`ein`,`sehr`,`gutes`,`Buch`,`gelesen`],z=[`Ich`,`habe`,`ein`,`Buch`,`gelesen`],B=[`I`,`have`,`read`,`a`,`book`],V=[[.9,.05,.02,.02,.01],[.05,.85,.02,.02,.06],[.02,.1,.01,.02,.85],[.02,.02,.88,.06,.02],[.02,.02,.08,.86,.02]],H=s(4),U=s(-1),W=a(()=>L.mode===`attention`?z:R.slice(0,H.value)),G=a(()=>U.value>=B.length-1);function me(){U.value=G.value?-1:U.value+1}let K=a(()=>U.value<0?null:V[U.value]),q=a(()=>{let e=K.value;if(!e)return null;let t=e.indexOf(Math.max(...e));return{word:z[t],weight:e[t],index:t}});function J(e){return e<=1?0:450/(e-1)}function Y(e){return k+e*J(W.value.length)}function X(e){return k+e*J(B.length)}let Z=e=>Y(e)+A/2,Q=e=>X(e)+A/2,he=O/2-F/2,$=O/2;return(a,s)=>{let l=ee,h=v,g=_;return m(),c(g,{"max-width":`42rem`},{controls:e(()=>[L.mode===`bottleneck`?(m(),c(l,{key:0,modelValue:H.value,"onUpdate:modelValue":s[0]||=e=>H.value=e,label:`words in the source sentence`,min:2,max:R.length,step:1,precision:0},null,8,[`modelValue`,`max`])):(m(),c(h,{key:1,label:G.value?`Start over`:`Next word`,glyph:`β–Έ`,onClick:me},null,8,[`label`]))]),readout:e(()=>[L.mode===`bottleneck`?(m(),i(o,{key:0},[u(t(W.value.length)+` words in, and the context vector is `,1),r(`strong`,null,t(L.contextDim)+` numbers`,1),u(` β€” the same `+t(L.contextDim)+` it was at two words, and the same it would be at forty. Everything the decoder will ever know about the source has to fit in there, and the first word has to survive `+t(W.value.length-1)+` more updates before the encoder is done. `,1)],64)):q.value?(m(),i(o,{key:1},[s[3]||=u(` Writing `,-1),r(`strong`,null,t(B[U.value]),1),s[4]||=u(`: the decoder reads mostly `,-1),r(`strong`,null,t(q.value.word),1),u(` (`+t(q.value.weight.toFixed(2))+` of the weight). The context for this step is the weighted sum of all `+t(z.length)+` encoder states β€” a different vector for every output word. `,1),U.value===2?(m(),i(`span`,D,[...s[2]||=[u(` β€œread” comes from `,-1),r(`em`,null,`gelesen`,-1),u(`, the `,-1),r(`strong`,null,`last`,-1),u(` word of the German sentence. The alignment is not left to right, and nothing told the model that. `,-1)]])):f(`v-if`,!0)],64)):(m(),i(o,{key:2},[u(` No single context vector. At each output step the decoder scores every encoder state, softmaxes the scores into weights, and builds the context it needs right then. `)],64))]),default:e(()=>[(m(),i(`svg`,{class:`dl-s2s`,viewBox:`0 0 ${O} ${ce}`,preserveAspectRatio:`xMidYMid meet`,role:`img`,"aria-label":L.mode===`bottleneck`?`An encoder reading ${W.value.length} words into one context vector of ${L.contextDim} numbers, which the decoder then reads`:`A decoder that recomputes its context vector at every output step as a weighted sum of every encoder state`},[s[1]||=r(`defs`,null,[r(`marker`,{id:`dl-s2s-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto-start-reverse`},[r(`path`,{d:`M0,0 L8,4 L0,8 z`,fill:`currentColor`})]),f(`
2
+ An attention line's stroke-width carries its weight, and a marker sized
3
+ in stroke-widths would therefore grow to 30px on the heaviest line.
4
+ This one is sized in user units, so every head is the same size.
5
+ `),r(`marker`,{id:`dl-s2s-tip`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`9`,markerHeight:`9`,markerUnits:`userSpaceOnUse`,orient:`auto-start-reverse`},[r(`path`,{d:`M0,0 L8,4 L0,8 z`,fill:`currentColor`})])],-1),f(` Encoder: one cell per source word, state passed along. `),(m(!0),i(o,null,n(W.value,(e,n)=>(m(),i(`g`,{key:`e${n}`},[n>0?(m(),i(`line`,{key:0,class:`dl-s2s__state`,x1:Y(n-1)+A,y1:201,x2:Y(n)-3,y2:201,"marker-end":`url(#dl-s2s-arrow)`},null,8,b)):f(`v-if`,!0),r(`rect`,{class:`dl-s2s__cell is-enc`,x:Y(n),y:P,width:A,height:j,rx:`5`},null,8,x),r(`text`,{class:`dl-s2s__cellword`,x:Z(n),y:206,"text-anchor":`middle`},t(e),9,S)]))),128)),r(`text`,{class:`dl-s2s__side`,x:k,y:246},`encoder β€” reads German`,8,C),f(` Decoder `),(m(),i(o,null,n(B,(e,n)=>r(`g`,{key:`d${n}`},[n>0?(m(),i(`line`,{key:0,class:`dl-s2s__state`,x1:X(n-1)+A,y1:43,x2:X(n)-3,y2:43,"marker-end":`url(#dl-s2s-arrow)`},null,8,w)):f(`v-if`,!0),r(`rect`,{class:p([`dl-s2s__cell is-dec`,{"is-current":L.mode===`attention`&&U.value===n,"is-waiting":L.mode===`attention`&&U.value>=0&&U.value!==n}]),x:X(n),y:M,width:A,height:j,rx:`5`},null,10,te),r(`text`,{class:p([`dl-s2s__cellword`,{"is-current":L.mode===`attention`&&U.value===n}]),x:Q(n),y:48,"text-anchor":`middle`},t(e),11,ne)])),64)),r(`text`,{class:`dl-s2s__side`,x:k,y:16},`decoder β€” writes English`),f(` One fixed vector, whatever the sentence length. `),L.mode===`bottleneck`?(m(),i(o,{key:0},[(m(!0),i(o,null,n(W.value,(e,t)=>(m(),i(`line`,{key:`in${t}`,class:`dl-s2s__squeeze`,x1:Z(t),y1:182,x2:$,y2:145,"marker-end":`url(#dl-s2s-arrow)`},null,8,re))),128)),(m(),i(o,null,n(B,(e,t)=>r(`line`,{key:`out${t}`,class:`dl-s2s__squeeze`,x1:$,y1:104,x2:Q(t),y2:65,"marker-end":`url(#dl-s2s-arrow)`},null,8,ie)),64)),r(`rect`,{class:`dl-s2s__ctx`,x:he,y:N,width:F,height:j,rx:`5`}),r(`text`,{class:`dl-s2s__ctxlabel`,x:$,y:121,"text-anchor":`middle`},`context`,8,ae),r(`text`,{class:`dl-s2s__ctxdim`,x:$,y:133,"text-anchor":`middle`},t(L.contextDim)+` numbers`,9,oe)],64)):(m(),i(o,{key:1},[f(` A fresh context vector per output step, weighted over every encoder state. `),K.value?(m(),i(o,{key:0},[(m(!0),i(o,null,n(K.value,(e,t)=>(m(),i(`line`,{key:`att${t}`,class:`dl-s2s__att`,x1:Z(t),y1:182,x2:Q(U.value),y2:65,"stroke-width":.6+e*7,style:d({opacity:.18+e*.8}),"marker-end":`url(#dl-s2s-tip)`},null,12,se))),128)),(m(!0),i(o,null,n(K.value,(e,n)=>(m(),i(`text`,{key:`attv${n}`,class:p([`dl-s2s__attval`,{"is-top":n===q.value?.index}]),x:Z(n),y:174,"text-anchor":`middle`},t(e.toFixed(2)),11,T))),128))],64)):(m(),i(`text`,{key:1,class:`dl-s2s__hint`,x:O/2,y:128,"text-anchor":`middle`},` press Next word β€” every output step gets its own context vector `,8,E))],64))],8,y))]),_:1})}}}),[[`__scopeId`,`data-v-a1556c3c`]]);export{I as t};
lecture-05/assets/SlideWrapper-YCeS5BX7.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{D as e,G as t,H as n,L as r,Q as i,R as a,S as o,X as s,Z as c,_ as l,b as u,ct as d,f,g as p,ht as m,i as h,m as ee,ut as g,v as _,vt as v,w as y,xt as b,y as x,yt as S,z as C}from"./modules/shiki-CkJq9tSf.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-BqAsyLif.js";import{t as A}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{N as j,p as ne}from"./modules/vue-Dz2ojcKF.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-DnYiQGy6.js";import{n as z,r as B,t as V}from"./syncState-BCmj5bTl.js";import{a as H,p as U}from"./index-DdzHTFh8.js";import"./slidev/client-DbL5Af2r.js";import{t as W}from"./useDrawings-B0MfsDor.js";var G=[`innerHTML`],K=y({__name:`DrawingPreview`,props:{page:{}},setup(e){let{drawingState:t}=W();return(n,r)=>v(t)[e.page]?(C(),u(`svg`,{key:0,class:`w-full h-full absolute top-0 pointer-events-none`,innerHTML:v(t)[e.page]},null,8,G)):x(`v-if`,!0)}}),q=d({}),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=g(null),de=A(y({__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:o}=te(),d=g(null),f=ne(d),m=g(null),_=p(()=>t.width??f.width.value),v=p(()=>t.width?t.width/E.value:f.height.value),y=p(()=>w.value&&!o.value?+w.value:Math.min(_.value/T.value,v.value/D.value)),S=p(()=>({...t.contentStyle,height:`${D.value}px`,width:`${T.value}px`,"--slidev-slide-scale":y.value})),O=p(()=>t.width?{width:`${t.width}px`,height:`${t.width/E.value}px`}:{});if(t.isMain){let e=document.documentElement.style;c(()=>e.setProperty(`--slidev-slide-scale`,y.value.toString())),a(()=>e.removeProperty(`--slidev-slide-scale`))}j(re,y),j(N,m),i(()=>{t.isMain&&(Q.value=m.value)}),r(()=>{s(()=>t.isMain&&y.value,()=>{h()})});let k=p(()=>{if(!(t.no==null||!t.useSnapshot))return oe.getSnapshot(t.no,U.value)});return(t,r)=>k.value?(C(),u(ee,{key:1},[x(` Image Snapshot `),l(`div`,le,[l(`img`,{src:k.value,class:`w-full h-full object-cover`,style:b(O.value)},null,12,ue),r[0]||=l(`div`,{absolute:``,"bottom-1":``,"right-1":``,"p0.5":``,"text-cyan:75":``,"bg-cyan:10":``,rounded:``,title:`Snapshot`},[l(`div`,{class:`i-carbon-camera`})],-1)])],2112)):(C(),u(`div`,{key:0,id:e.isMain?`slide-container`:void 0,ref_key:`container`,ref:d,class:`slidev-slide-container`,style:b(O.value)},[l(`div`,{id:e.isMain?`slide-content`:void 0,ref_key:`slideElement`,ref:m,class:`slidev-slide-content`,style:b(S.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:`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(y({__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?**`,`<!-- e.g. typo, wrong equation, broken figure, unclear explanation -->`,``].join(`
2
+ `),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)):x(`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(y({__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,g(n.route.no)),j(F,g(n.renderContext)),j(ie,m(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,a)=>(C(),u(`div`,{"data-slidev-no":n.route.no,class:S(v(H)(e.route,[`slide`,`presenter`].includes(n.renderContext)?``:`disable-view-transition`)),style:b(i.value),lang:n.route.meta.slide.frontmatter.lang},[o(v(Me)),(C(),_(t(n.route.component))),o(v(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};
lecture-05/assets/default-CkTgO_iP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{H as e,S as t,b as n,z as r}from"./modules/shiki-CkJq9tSf.js";import{t as i}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as a}from"./slidev/context-DnYiQGy6.js";import{t as o}from"./DeckFooter-sY1qw60z.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};
lecture-05/assets/index-DdzHTFh8.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./modules/file-saver-BpWusTEB.js","./rolldown-runtime-hePW80VL.js","./slidev/entry-DXY6sGn2.js","./modules/shiki-CkJq9tSf.js","./modules/shiki-BrmBd2_v.css","./_plugin-vue_export-helper-BDNMzG2s.js","./entry-Dba4BKje.css","./slidev/overview-afK9Px3A.js","./useNav-BqAsyLif.js","./modules/vue-Dz2ojcKF.js","./slidev/context-DnYiQGy6.js","./modules/unplugin-icons-CEvhMF8G.js","./slidev/IconButton-CfFb_8Iy.js","./slidev/NoteDisplay-Dvu5YOak.js","./NoteDisplay-DCBzjb4F.css","./SlideWrapper-YCeS5BX7.js","./syncState-BCmj5bTl.js","./slidev/client-DbL5Af2r.js","./useDrawings-B0MfsDor.js","./SlideWrapper-DBNQYNtZ.css","./slidev/NoteEditable-BIDa3V5H.js","./overview-BIQ10iVu.css","./slidev/notes-CPXmI0zR.js","./slidev/Modal-Bum_LA_c.js","./slidev/TimerBar-DpvvemRL.js","./slidev/notes-edit-CT3D_gWN.js","./slidev/presenter-55QuCC1n.js","./slidev/DrawingControls-DnFBBHLG.js","./slidev/VerticalDivider-E2da-Zpk.js","./DrawingControls-Dhbx0szf.css","./slidev/shortcuts-8Qn7rvhV.js","./shortcuts-nRB69a7e.css","./presenter-J5ibmAMh.css","./slidev/play-C_pNWp29.js","./play-D_7yfuao.css","./slidev/404-YTK3euKy.js","./404-bkedjYjP.css"])))=>i.map(i=>d[i]);
2
+ 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,Z as l,_t as u,at as d,b as f,ct as p,g as m,k as h,m as g,pt as _,rt as v,s as y,t as b,ut as x,vt as S,w as C,y as w,z as T}from"./modules/shiki-CkJq9tSf.js";import{$ as E,A as ee,B as te,G as ne,H as re,Q as D,R as ie,Z as ae,c as oe,et as O,h as se,j as k,l as ce,n as le,p as A,q as j,t as ue,tt as M,w as de,z as fe}from"./useNav-BqAsyLif.js";import{A as pe,L as me,R as he,S as ge,T as _e,V as ve,f as ye,g as be,i as xe,j as Se,o as Ce,x as we,z as Te}from"./modules/vue-Dz2ojcKF.js";import{a as Ee,c as De,d as Oe,f as ke,g as Ae,i as je,m as Me,o as Ne,p as Pe,r as Fe,s as Ie,u as Le,y as Re}from"./slidev/context-DnYiQGy6.js";import{n as N,r as ze,t as Be}from"./syncState-BCmj5bTl.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)}})(),x(!1),x(!1);var Ve=new Set([`link`,`style`,`script`,`noscript`]),He=new Set([`title`,`titleTemplate`,`script`,`style`,`noscript`]),Ue=new Set([`base`,`meta`,`link`,`style`,`script`,`noscript`]),We=new Set([`title`,`base`,`htmlAttrs`,`bodyAttrs`,`meta`,`link`,`style`,`script`,`noscript`]),Ge=new Set([`base`,`title`,`titleTemplate`,`bodyAttrs`,`htmlAttrs`,`templateParams`]),Ke=new Set([`key`,`tagPosition`,`tagPriority`,`tagDuplicateStrategy`,`innerHTML`,`textContent`,`processTemplateParams`]),qe=new Set([`templateParams`,`htmlAttrs`,`bodyAttrs`]),Je=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`]),Ye={critical:-8,high:-1,low:2},Xe=e=>typeof e==`number`?Number.isFinite(e):e;function Ze(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function Qe(e,t,n,r){for(let i=n;i<e.length;i+=1)try{let n=r?r.run(()=>e[i](...t)):e[i](...t);if(n&&typeof n.then==`function`)return Promise.resolve(n).then(()=>Qe(e,t,i+1,r))}catch(e){return Promise.reject(e)}}var $e=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 Qe(n,t,0)}};function et(e){let t=new $e;for(let n in e||{})t.hook(n,e[n]);return t}function tt(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 Je.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(Ge.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}`:He.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<r.length;n++){let i=st(r[n],t);e?e[n]=i:i!==r[n]&&(e=r.slice(0,n),e[n]=i)}return e||r}if(r?.constructor===Object){let e;for(let n in r){let i=Ze(n),a=i?void 0:st(r[n],t,n);if(!e&&(i||a!==r[n])){e={};for(let t in r){if(t===n)break;e[t]=r[t]}}e&&!i&&(e[n]=a)}return e||r}return r}var ct=/[\s"'<>/=\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=Ue.has(e.tag)||e.tag===`htmlAttrs`||e.tag===`bodyAttrs`;for(let r in t){if(Ze(r))continue;let i=r.startsWith(`data-`),a=n&&!Ke.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(Ke.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;r<t.length;r++)n=t[r](e,n);return n},e=n(void 0,e)),st(e,n)}function ft(e,t){let n=ut({tag:e,props:{}},typeof t==`object`&&typeof t!=`function`?t:{[e===`script`||e===`noscript`||e===`style`?`innerHTML`:`textContent`]:t});if(n.key&&Ve.has(n.tag)&&(n.props[`data-hid`]=n._h=n.key),n.tag===`script`&&typeof n.innerHTML==`object`&&(n.innerHTML=JSON.stringify(n.innerHTML),n.props.type=n.props.type||`application/json`),Array.isArray(n.props.content)){let e=[];for(let t of n.props.content)e.push({...n,props:{...n.props,content:t}});return e}return n}function pt(e,t){if(Array.isArray(t))for(let n of t)e.push(n);else e.push(t)}function mt(e,t){if(!e)return[];typeof e==`function`&&(e=e()),e=dt(e,t);let n=[];for(let t in e){let r=e[t];if(r!==void 0){if(Array.isArray(r))for(let e of r)pt(n,ft(t,e));else pt(n,ft(t,r))}}return n}var ht=/</g,gt=/<\/script/g,_t=(e,t)=>e._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<e.length;t++){let n=e[t],r={...n.props};r.class instanceof Set&&(r.class=new Set(r.class)),r.style instanceof Map&&(r.style=new Map(r.style)),e[t]={...n,props:r}}}function Ct(e,t){let n=e.tags,r=0;for(let t of e.tagMap.values())if(Array.isArray(t))for(let e of t)n[r++]=e;else n[r++]=t;n.length=r,t&&n.sort(_t)}function wt(e){let t=!1;for(let n of e.tags.sort(_t)){let r=n._d||ot(n);if(!r)continue;let i=e.tagMap.get(r);if(!i){e.tagMap.set(r,n);continue}if((n.tagDuplicateStrategy||(qe.has(n.tag)?`merge`:null)||(n.key&&n.key===i.key?`merge`:null))===`merge`){let t={...i.props};for(let e in n.props)t[e]=e===`style`?new Map([...i.props.style||new Map,...n.props[e]]):e===`class`?new Set([...i.props.class||[],...n.props[e]]):n.props[e];e.tagMap.set(r,{...n,props:t})}else n._p>>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._w<i._w)&&e.tagMap.set(r,n)}return t}function Tt(e,t){let n=e.tagMap.get(`title`),r=e.tagMap.get(`titleTemplate`);if(t._title=n?.textContent,!r)return;let i=r.textContent;if(t._titleTemplate=i,!i)return;let a=typeof i==`function`?i(n?.textContent):i;typeof a==`string`&&!t.plugins.has(`template-params`)&&(a=a.replace(`%s`,n?.textContent||``)),n?a===null?e.tagMap.delete(`title`):e.tagMap.set(`title`,{...n,textContent:a}):e.tagMap.set(`titleTemplate`,{...r,tag:`title`,textContent:a})}function Et(e){let t=0;for(let n of e){let{innerHTML:r,tag:i,props:a}=n;if(!(!We.has(i)||yt(a)&&!Xe(r)&&!Xe(n.textContent))&&!(i===`meta`&&!Xe(a.content)&&!a[`http-equiv`]&&!a.charset)){if(i===`script`&&(r||n.textContent)){let e=String(a.type),t=e.endsWith(`json`)||e===`importmap`||e===`speculationrules`,i=e=>t?(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&&tt(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};tt(e,`entries:normalize`,n),a=n.tags}for(let e=0;e<a.length;e++){let r=a[e];r._w=n(r),r._p=(t._i<<10)+e,r._d=at(r),r._d||(r._h=ot(r))}t._tags=a}}r.tags.push(...a)}for(let e in i)if(i[e]?.length&&bt.test(e)){St(r.tags);break}let o=wt(r);return Tt(r,e),Ct(r,o),tt(e,`tags:beforeResolve`,r),tt(e,`tags:resolve`,r),tt(e,`tags:afterResolve`,r),Et(r.tags)}var Ot=`usehead`;function kt(){if(r()){let e=h(Ot);if(e)return e}throw Error(`useHead() was called without provide context, ensure you call it through the setup() function.`)}function At(e){return{install(t){t.config.globalProperties.$unhead=e,t.config.globalProperties.$head=e,t.provide(Ot,e)}}.install}var jt=Object.assign((e,t)=>d(t)?u(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=v();if(s&&!s.active)return{patch(){},dispose(){},_i:-1};let c=x(!1);if(a.onRendered&&s){let e=a.onRendered;a={...a,onRendered:t=>s.run(()=>e(t))}}let u;return l(()=>{let t=c.value?{}:st(r,jt);u?u.patch(t):u=e.push(t,a)}),o()&&(t(()=>{u.dispose()}),n(()=>{c.value=!0}),i(()=>{c.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=we(),Vt=be(`slidev-color-schema`,`auto`),Ht=m(()=>M.colorSchema!==`auto`),Ut=m({get(){return Ht.value?M.colorSchema===`dark`:Vt.value===`auto`?Bt.value:Vt.value===`dark`},set(e){Ht.value||(Vt.value=e===Bt.value?`auto`:e?`dark`:`light`)}}),Wt=me(Ut);Se&&c(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}=ue();ge(m(()=>e.value?`
3
+ @page {
4
+ size: ${D.value}px ${ae.value}px;
5
+ margin: 0px;
6
+ }
7
+
8
+ * {
9
+ transition: none !important;
10
+ transition-duration: 0s !important;
11
+ }`:``))}var Kt=Symbol.for(`yaml.alias`),qt=Symbol.for(`yaml.document`),Jt=Symbol.for(`yaml.map`),Yt=Symbol.for(`yaml.pair`),Xt=Symbol.for(`yaml.scalar`),Zt=Symbol.for(`yaml.seq`),P=Symbol.for(`yaml.node.type`),Qt=e=>!!e&&typeof e==`object`&&e[P]===Kt,$t=e=>!!e&&typeof e==`object`&&e[P]===qt,en=e=>!!e&&typeof e==`object`&&e[P]===Jt,F=e=>!!e&&typeof e==`object`&&e[P]===Yt,I=e=>!!e&&typeof e==`object`&&e[P]===Xt,tn=e=>!!e&&typeof e==`object`&&e[P]===Zt;function L(e){if(e&&typeof e==`object`)switch(e[P]){case Jt:case Zt:return!0}return!1}function R(e){if(e&&typeof e==`object`)switch(e[P]){case Kt:case Jt:case Xt:case Zt:return!0}return!1}var nn=e=>(I(e)||L(e))&&!!e.anchor,z=Symbol(`break visit`),rn=Symbol(`skip children`),an=Symbol(`remove node`);function on(e,t){let n=cn(t);$t(e)?sn(null,e.contents,n,Object.freeze([e]))===an&&(e.contents=null):sn(null,e,n,Object.freeze([]))}on.BREAK=z,on.SKIP=rn,on.REMOVE=an;function sn(e,t,n,r){let i=ln(e,t,n,r);if(R(i)||F(i))return un(e,r,i),sn(e,i,n,r);if(typeof i!=`symbol`){if(L(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=sn(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===z)return z;else i===an&&(t.items.splice(e,1),--e)}}else if(F(t)){r=Object.freeze(r.concat(t));let e=sn(`key`,t.key,n,r);if(e===z)return z;e===an&&(t.key=null);let i=sn(`value`,t.value,n,r);if(i===z)return z;i===an&&(t.value=null)}}return i}function cn(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function ln(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(en(t))return n.Map?.(e,t,r);if(tn(t))return n.Seq?.(e,t,r);if(F(t))return n.Pair?.(e,t,r);if(I(t))return n.Scalar?.(e,t,r);if(Qt(t))return n.Alias?.(e,t,r)}function un(e,t,n){let r=t[t.length-1];if(L(r))r.items[e]=n;else if(F(r))e===`key`?r.key=n:r.value=n;else if($t(r))r.contents=n;else{let e=Qt(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function dn(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function fn(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=fn(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=fn(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=fn(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=fn(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function B(e,t,n){if(Array.isArray(e))return e.map((e,t)=>B(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!nn(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 pn=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(!$t(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`?fn(i,{"":o},``,o):o}},mn=class extends pn{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=[],on(e,{Node:(e,t)=>{(Qt(t)||nn(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=hn(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(dn(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 hn(e,t,n){if(Qt(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=hn(e,i,n);t>r&&(r=t)}return r}if(F(t)){let r=hn(e,t.key,n),i=hn(e,t.value,n);return Math.max(r,i)}return 1}var gn=e=>!e||typeof e!=`function`&&typeof e!=`object`,V=class extends pn{constructor(e){super(Xt),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 _n=`tag:yaml.org,2002:`;function vn(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 yn(e,t,n){if($t(e)&&(e=e.contents),R(e))return e;if(F(e)){let t=n.schema[Jt].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 mn(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=_n+t.slice(2));let l=vn(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[Jt]:Symbol.iterator in Object(e)?o[Zt]:o[Jt]}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 bn(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 yn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var xn=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Sn=class extends pn{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(xn(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,bn(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,bn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Cn=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function wn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Tn=(e,t,n)=>e.endsWith(`
12
+ `)?wn(n,t):n.includes(`
13
+ `)?`
14
+ `+wn(n,t):(e.endsWith(` `)?``:` `)+n,En=`flow`,Dn=`block`,On=`quoted`;function kn(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=An(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===`
15
+ `)n===`block`&&(h=An(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
16
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
17
+ `&&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<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function An(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
18
+ `);r=t,i=t+1,a=e[i]}return r}var jn=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Mn=e=>/^(%|---|\.\.\.)/m.test(e);function Nn(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;t<i;++t)if(e[t]===`
19
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Pn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Mn(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<i)e+=1;else{for(o+=n.slice(s,e)+`
20
+
21
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
22
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:kn(o,a,On,jn(t,!1))}function Fn(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
23
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Pn(e,t);let n=t.indent||(Mn(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:kn(r,n,En,jn(t,!1))}function In(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Pn;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Fn:i&&!t?Pn:n?Fn:Pn}return r(e,t)}var Ln;try{Ln=RegExp(`(^|(?<!
24
+ ))
25
+ +(?!
26
+ |$)`,`g`)}catch{Ln=/\n+(?!\n|$)/g}function Rn({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return In(n,r);let l=r.indent||(r.forceBlockIndent||Mn(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===V.BLOCK_FOLDED?!1:t===V.BLOCK_LITERAL||!Nn(n,c,l.length);if(!n)return u?`|
27
+ `:`>
28
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
29
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
30
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
31
+ `&&(p=p.slice(0,-1)),p.replace(Ln,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
32
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
33
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=jn(r,!0);o!==`folded`&&t!==V.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=kn(`${v}${e}${p}`,l,Dn,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function zn(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(`
34
+ `)||u&&/[[\]{},]/.test(a))return In(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
35
+ `)?In(a,t):Rn(e,t,n,r);if(!s&&!u&&i!==V.PLAIN&&a.includes(`
36
+ `))return Rn(e,t,n,r);if(Mn(a)){if(c===``)return t.forceBlockIndent=!0,Rn(e,t,n,r);if(s&&c===l)return In(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 In(a,t)}return s?d:kn(d,c,En,jn(t,!1))}function Bn(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?In(o.value,t):Rn(o,t,n,r);case V.QUOTE_DOUBLE:return Pn(o.value,t);case V.QUOTE_SINGLE:return Fn(o.value,t);case V.PLAIN:return zn(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 Vn(e,t){let n=Object.assign({blockQuote:!0,commentString:Cn,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 Hn(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 Un(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(I(e)||L(e))&&e.anchor;a&&dn(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 Wn(e,t,n,r){if(F(e))return e.toString(t,n,r);if(Qt(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??=Hn(t.doc.schema.tags,a);let o=Un(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)?Bn(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 Gn({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=Wn(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+=Tn(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Tn(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Tn(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&&tn(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Wn(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
37
+ `:``,v){let e=l(v);S+=`\n${wn(e,n.indent)}`}x===``&&!n.inFlow?S===`
38
+ `&&y&&(S=`
39
+
40
+ `):S+=`\n${n.indent}`}else if(!p&&L(t)){let e=x[0],r=x.indexOf(`
41
+ `),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&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
42
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=Tn(g,n.indent,l(y)):h&&i&&i(),g}function Kn(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var qn=`<<`,Jn={identify:e=>e===qn||typeof e==`symbol`&&e.description===qn,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new V(Symbol(qn)),{addToJSMap:Xn}),stringify:()=>qn},Yn=(e,t)=>(Jn.identify(t)||I(t)&&(!t.type||t.type===V.PLAIN)&&Jn.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Jn.tag&&e.default);function Xn(e,t,n){let r=Qn(e,n);if(tn(r))for(let n of r.items)Zn(e,t,n);else if(Array.isArray(r))for(let n of r)Zn(e,t,n);else Zn(e,t,r)}function Zn(e,t,n){let r=Qn(e,n);if(!en(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 Qn(e,t){return e&&Qt(t)?t.resolve(e.doc,e):t}function $n(e,t,{key:n,value:r}){if(R(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Yn(e,n))Xn(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=er(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 er(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(R(e)&&n?.doc){let t=Vn(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)+`..."`),Kn(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 tr(e,t,n){return new H(yn(e,void 0,n),yn(t,void 0,n))}var H=class e{constructor(e,t=null){Object.defineProperty(this,P,{value:Yt}),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 $n(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Gn(this,e,t,n):JSON.stringify(this)}};function nr(e,t,n){return(t.inFlow??e.flow?ir:rr)(e,t,n)}function rr({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;e<t.length;++e){let i=t[e],o=null;if(R(i))!d&&i.spaceBefore&&f.push(``),ar(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(F(i)){let e=R(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),ar(n,f,e.commentBefore,d))}d=!1;let s=Wn(i,u,()=>o=null,()=>d=!0);o&&(s+=Tn(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;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
43
+ `}}return e?(p+=`
44
+ `+wn(l(e),c),s&&s()):d&&o&&o(),p}function ir({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(R(i))i.spaceBefore&&d.push(``),ar(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(F(i)){let e=R(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),ar(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=R(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Wn(i,c,()=>a=null);l||=d.length>u||o.includes(`
45
+ `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Tn(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}`:`
46
+ `;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function ar({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=wn(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 Sn{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Jt,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(tr(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)&&gn(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)$n(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})),nr(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},or={collection:`map`,default:!0,nodeClass:W,tag:`tag:yaml.org,2002:map`,resolve(e,t){return en(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>W.from(e,t,n)},sr=class extends Sn{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Zt,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=cr(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=cr(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&I(r)?r.value:r}has(e){let t=cr(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=cr(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];I(r)&&gn(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(B(e,String(r++),t));return n}toString(e,t,n){return e?nr(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(yn(a,void 0,n))}}return i}};function cr(e){let t=I(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var lr={collection:`seq`,default:!0,nodeClass:sr,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return tn(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>sr.from(e,t,n)};function ur(e){return typeof e==`bigint`||Number.isInteger(e)}var dr=({value:e})=>JSON.stringify(e),fr=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:dr},{identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:dr},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:dr},{identify:ur,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})=>ur(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:dr}];[or,lr].concat(fr,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function pr(e,t,n){let{replacer:r}=n,i=new sr(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(tr(o,s,n))}return i}var mr=class e extends sr{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=pr(e,t,n),i=new this;return i.items=r.items,i}};mr.tag=`tag:yaml.org,2002:omap`;var hr=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(tr(e,null,n));return i}};hr.tag=`tag:yaml.org,2002:set`;var gr=Symbol(`break visit`),_r=Symbol(`skip children`),vr=Symbol(`remove item`);function yr(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),br(Object.freeze([]),e,t)}yr.BREAK=gr,yr.SKIP=_r,yr.REMOVE=vr,yr.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},yr.parentCollection=(e,t)=>{let n=yr.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 br(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;t<a.items.length;++t){let r=br(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===gr)return gr;else r===vr&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function xr(e=5){let t=[];for(let n=0;n<e;n++)t.push(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`.charAt(Math.floor(Math.random()*52)));return t.join(``)}function Sr(e,t,n,r){let i=re(t+n-1,e);for(let e=0;e<t;e++){let t=r(e),a=i.includes(e+n);for(let e of t)e.classList.toggle(`slidev-code-highlighted`,a),e.classList.toggle(`slidev-code-dishonored`,!a),e.classList.toggle(`highlighted`,a),e.classList.toggle(`dishonored`,!a)}}var G=p({}),Cr=[],wr=[];N(G,`$syncUp`,!0),N(G,`$syncDown`,!0),N(G,`$paused`,!1),N(G,`$onSet`,e=>Cr.push(e)),N(G,`$onPatch`,e=>wr.push(e)),ze(),N(G,`$patch`,async()=>!1);var{init:Tr,onPatch:Er,onUpdate:Dr,patch:Or,state:kr}=Be(G,G,!1),K=p({page:0,clicks:0,timer:{status:`stopped`,slides:{},startedAt:0,pausedAt:0}}),Ar=[],jr=[];N(K,`$syncUp`,!0),N(K,`$syncDown`,!0),N(K,`$paused`,!1),N(K,`$onSet`,e=>Ar.push(e)),N(K,`$onPatch`,e=>jr.push(e)),ze(),N(K,`$patch`,async()=>!1);var{init:Mr,onPatch:Nr,onUpdate:Pr,patch:Fr,state:Ir}=Be(K,{page:1,clicks:0,clicksTotal:0,timer:{status:`stopped`,slides:{},startedAt:0,pausedAt:0}});function Lr(){let e=o().appContext.app,t=p({nav:ue(),configs:M,themeConfigs:m(()=>M.themeConfig)});e.provide(Me,x(`none`)),e.provide(Re,t),e.provide(ke,m(()=>t.nav.currentSlideNo)),e.provide(Oe,_(ne()));for(let e of zt)e();let{clicksContext:n,currentSlideNo:r,hasPrimarySlide:i,isNotesViewer:a,isPresenter:s,isPrintMode:l}=ue();Mt({title:E,htmlAttrs:M.htmlAttrs}),Gt(),Mr(`${E} - shared`),Tr(`${E} - drawings`);let u=`${location.origin}_${xr()}`,d=m(()=>s.value?`presenter`:`viewer`);function f(){(s.value?k.value.presenterSend:k.value.viewerSend)&&(a.value||l.value||!s.value&&!Le.includes(location.host.split(`:`)[0])||(Fr(`page`,+r.value),Fr(`clicks`,n.value.current),Fr(`clicksTotal`,n.value.total),Fr(`lastUpdate`,{id:u,type:d.value,time:Date.now()})))}let h=ve();h.afterEach(f),c(n,f),Nr(e=>{(s.value?k.value.presenterReceive:k.value.viewerReceive)&&(!i.value||l.value||e.lastUpdate?.type!==d.value&&(+e.page!=+r.value||+n.value.current!=+e.clicks)&&(A.value=!1,h.replace({path:te(e.page,s.value),query:{...h.currentRoute.value.query,clicks:e.clicks||0}})))})}var Rr=C({__name:`App`,setup(e){return Lr(),l(()=>{for(let[e,t]of Object.entries(O.value))document.body.style.setProperty(e,t.toString())}),(e,t)=>{let n=s(`RouterView`);return T(),f(g,null,[a(n),w(`v-if`,!0)],64)}}});function zr(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 Br=/\s+/;function Vr(e={}){return t=>Wr(t,e)}function Hr(e){for(let t of e.entries.values())if(t._pending!==void 0)return!0;return!1}function Ur(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(!Ue.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(Br))i&&(n._p[`${t}:attr:class:${i}`]=()=>e.classList.remove(i))}}}return n}function Wr(e,t={}){let n=t.document||e.resolvedOptions.document,r=e._dom,i=!!r&&r._d!==n;if(!n||r&&!i&&!e.dirty&&!Hr(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(tt(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=Ur(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):Ue.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,tt(e,`dom:rendered`,{renders:g})}catch(t){throw e.dirty=!0,t}finally{e._du=!1}return o&&(e.dirty||Hr(e))&&Wr(e,t),o}var Gr=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(Ye[e.tagPriority]||0);function Kr(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||Vr({document:e.document}),n=zr(Ft(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:Gr,init:[]}),et(e.hooks),t);return e.plugins?.forEach(e=>n.use(e)),e.init?.forEach(e=>e&&n.push(e)),n}function qr(e={}){let t=Vr(),n,r=0;return n=Kr({render:()=>{let e=++r;setTimeout(()=>{e===r&&t(n)},0)},...e}),n.install=At(n),n}var Jr=Object.assign({}),Yr=Object.assign({}),Xr=Object.assign({}),Zr=[Object.values(Jr)[0],Object.values(Yr)[0],Object.values(Xr)[0]].filter(Boolean);function Qr(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 $r(){let{saveAs:t}=await j(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 M.download==`string`?M.download:M.exportFilename?`${M.exportFilename}.pdf`:`./slidev-exported.pdf`,`${M.title}.pdf`)}function ei(e,t,n){return(e.instance?.$).provides[t]??n}var ti=/[\s,]+/;function ni(e,t){let n=t.map(e=>`${Fe}${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 ri(){return{install(e){e.directive(`click`,{name:`v-click`,mounted(e,t){let n=ai(e,t,t.value);n!=null&&(e.classList.toggle(De,!0),e.dataset.slidevClicksStart=String(n.start),Number.isFinite(n.end)&&(e.dataset.slidevClicksEnd=String(n.end)),e.watchStopHandle=l(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;n.flagHide?(e.classList.toggle(Ee,t),e.classList.toggle(Ne,t)):e.classList.toggle(Ee,!t),ni(e,n.flagAnimations.value),e.classList.toggle(je,r),e.classList.toggle(Ie,i)}))},unmounted:oi}),e.directive(`after`,{name:`v-after`,mounted(e,t){let n=ai(e,t,`+0`);n!=null&&(e.classList.toggle(De,!0),e.watchStopHandle=l(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;n.flagHide?(e.classList.toggle(Ee,t),e.classList.toggle(Ne,t)):e.classList.toggle(Ee,!t),ni(e,n.flagAnimations.value),e.classList.toggle(je,r),e.classList.toggle(Ie,i)}))},unmounted:oi}),e.directive(`click-hide`,{name:`v-click-hide`,mounted(e,t){let n=ai(e,t,t.value,!0);n!=null&&(e.classList.toggle(De,!0),e.watchStopHandle=l(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;e.classList.toggle(Ee,t),e.classList.toggle(Ne,t),ni(e,n.flagAnimations.value),e.classList.toggle(je,r),e.classList.toggle(Ie,i)}))},unmounted:oi})}}}var ii=new Map;function ai(e,t,n,r=!1){let i=ei(t,Oe)?.value,a=ei(t,Pe);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=m(()=>{if(s.length>0)return s;let e=a?.clickAnimation||M.clickAnimation;return e?e.split(ti).filter(Boolean):[]}),l=i.calculate(n);if(!l)return null;i.register(e,l);let u=m(()=>o?!l.isActive.value:l.isActive.value),d=m(()=>u.value?`shown`:Number.isFinite(l.end)?i.current<l.start?`before`:`after`:o?`after`:`before`),f={...l,isShown:u,visibilityState:d,flagHide:o,flagAnimations:c};return ii.set(e,f),f}function oi(e,t){e.classList.toggle(De,!1),(ei(t,Oe)?.value)?.unregister(e),e.watchStopHandle?.()}function si(e=h(Ae,x())){let t=ye(e),n=c([de,se,ce,oe,ee,ie.width,ie.height],()=>{setTimeout(t.update,300)},{flush:`post`,immediate:!0});return{...t,stop:n}}function ci(e){return{info:x(fe(e)?.meta.slide??null),update:async()=>{}}}var li={};function ui(e){function t(e){return li[e]??=ci(e)}return{info:m({get(){return t(S(e)).info.value},set(n){t(S(e)).info.value=n}}),update:async(n,r)=>{let i=t(r??S(e)),a=await i.update(n);return a&&(i.info.value=a),a}}}function di(e){return()=>{}}function fi(e,t,n,r=!1){function i(t){return e?ei(e,t):pe(t)}let a=i(Me),o=i(`$$slidev-fontmatter`)??{},s=i(ke),l=m(()=>di(s.value)),u=i(`$$slidev-slide-scale`)??x(1),d=i(`$$slidev-slide-zoom`)??x(1),{left:f,top:p,stop:h}=si(i(`$$slidev-slide-element`)??x()),{isPrintMode:g}=ue(),_=[`slide`,`presenter`].includes(a.value)&&!g.value,v=e?`directive`:`prop`,y=xr(),b;if(Array.isArray(t)?b=t:typeof t==`string`&&t.includes(`,`)?b=t.split(`,`).map(Number):t!=null&&(v=`frontmatter`,y=`${t}`,t=o?.dragPos?.[y],b=t?.split(`,`).map(Number)),v!==`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(b?.[3]);b??=[NaN,NaN,0];let w=x(b[2]),T=x(b[0]+b[2]/2),E=x(r?0:b[4]??0),ee=m(()=>E.value*Math.PI/180),te=m(()=>Math.sin(ee.value)),ne=m(()=>Math.cos(ee.value)),re=x(),D=x({left:0,top:0,width:0,height:0}),ie=x(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(c(w,ae,{flush:`post`}));let oe=x(b[3]??0),O=C?m({get:()=>(C?ie.value:oe.value)||0,set:e=>!C&&(oe.value=e)}):oe,se=x(C?b[1]:b[1]+b[3]/2),k=C?m({get:()=>se.value+O.value/2,set:e=>se.value=e-O.value/2}):se,ce=m(()=>Number.isFinite(T.value)?{position:`absolute`,zIndex:100,left:`${T.value-w.value/2}px`,top:`${k.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(c([T,k,w,O,E],([e,t,r,i,a])=>{let o=[e-r/2,t-i/2,r].map(Math.round).join();o+=C?v===`directive`?`,NaN`:`,_`:`,${Math.round(i)}`,Math.round(a)!==0&&(o+=`,${Math.round(a)}`),v===`directive`&&(o=`[${o}]`),l.value(y,o,v,n)}));let A={dragId:y,dataSource:v,markdownSource:n,isArrow:r,zoom:d,autoHeight:C,x0:T,y0:k,width:w,height:O,rotate:E,container:re,containerStyle:ce,watchStopHandles:S,dragging:m(()=>le.value===A),mounted(){_&&(ae(),t||setTimeout(()=>{ae(),T.value=(D.value.left+D.value.width/2-f.value)/u.value,k.value=(D.value.top-p.value)/u.value,w.value=D.value.width/u.value,O.value=D.value.height/u.value},100))},unmounted(){_&&A.stopDragging()},startDragging(){_&&(ae(),le.value=A)},stopDragging(){_&&le.value===A&&(le.value=null)}};return S.push(Ce(re,e=>{let t=document.querySelector(`#drag-control-container`);t&&e.target&&t.contains(e.target)||A.stopDragging()}),c(_e(),e=>{e||A.stopDragging()})),A}function pi(){return{install(e){e.directive(`drag`,{name:`v-drag`,created(e,t,n){let r=fi(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(c(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 mi(){return Math.floor(Math.random()*2**31)}var hi=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 gi(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 _i(e,t,n){let r=[];e.forEach(e=>r.push(...e)),gi(r,t,n)}function vi(e,t){return e[0]===t[0]&&e[1]===t[1]}function yi(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)gi(e,s,i);let c=bi(o,a,r);if(i){for(let e of o)gi(e,s,-i);_i(c,s,-i)}return c}function bi(e,t,n){let r=[];for(let t of e){let e=[...t];vi(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;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.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;t<a.length&&!(a[t].ymin>s);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;e+=2){let t=e+1;if(t>=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 xi(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),yi(e,r,n,i||1)}var Si=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=xi(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 Ci(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var wi=class extends Si{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=t.strokeWidth*4),n=Math.max(n,.1);let r=xi(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)Ci([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)}}},Ti=class extends Si{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}},Ei=class{constructor(e){this.helper=e}fillPolygons(e,t){t=Object.assign({},t,{hachureAngle:0});let n=xi(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=Ci(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<c;e++){let o=d+l+e*r,s=u-a+Math.random()*2*a,c=o-a+Math.random()*2*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},Di=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=xi(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?t.strokeWidth*4:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?t.strokeWidth*4:t.hachureGap:t.dashGap,i=[];return e.forEach(e=>{let a=Ci(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<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}}),i}},Oi=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?t.strokeWidth*4:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset;t=Object.assign({},t,{hachureGap:n+r});let i=xi(e,t);return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach(e=>{let i=Ci(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;e<a;e++){let i=e*2*t,a=(e+1)*2*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}}),r}},q={};function ki(e,t){let n=e.fillStyle||`hachure`;if(!q[n])switch(n){case`zigzag`:q[n]||(q[n]=new wi(t));break;case`cross-hatch`:q[n]||(q[n]=new Ti(t));break;case`dots`:q[n]||(q[n]=new Ei(t));break;case`dashed`:q[n]||(q[n]=new Di(t));break;case`zigzag-line`:q[n]||(q[n]=new Oi(t));break;default:n=`hachure`,q[n]||(q[n]=new Si(t))}return q[n]}var Ai=0,ji=1,Mi=2,Ni={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Pi(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:Ai,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:ji,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:Mi,text:``},t}function Fi(e,t){return e.type===t}function Ii(e){let t=[],n=Pi(e),r=`BOD`,i=0,a=n[i];for(;!Fi(a,Mi);){let o=0,s=[];if(r===`BOD`){if(a.text===`M`||a.text===`m`)i++,o=Ni[a.text],r=a.text;else return Ii(`M0,0`+e)}else Fi(a,ji)?o=Ni[r]:(i++,o=Ni[a.text],r=a.text);if(i+o<n.length){for(let e=i;e<i+o;e++){let t=n[e];if(Fi(t,ji))s[s.length]=+t.text;else throw Error(`Param not a number: `+r+`,`+t.text)}if(typeof Ni[r]==`number`){let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}else throw Error(`Bad segment: `+r)}else throw Error(`Path data ended short`)}return t}function Li(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map((e,r)=>r%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 Ri(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)&&(Vi(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 zi(e){return Math.PI*e/180}function Bi(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Vi(e,t,n,r,i,a,o,s,c,l){let u=zi(o),d=[],f=0,p=0,m=0,h=0;if(l)[f,p,m,h]=l;else{[e,t]=Bi(e,t,-u),[n,r]=Bi(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))),e<m&&(f=Math.PI-f),n<m&&(p=Math.PI-p),f<0&&(f=Math.PI*2+f),p<0&&(p=Math.PI*2+p),c&&f>p&&(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=Vi(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;t<d.length;t+=3){let n=Bi(d[t][0],d[t][1],u),r=Bi(d[t+1][0],d[t+1][1],u),i=Bi(d[t+2][0],d[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var Hi={randOffset:ta,randOffsetWithRange:na,ellipse:qi,doubleLineOps:ra};function J(e,t,n,r,i){return{type:`path`,ops:X(e,t,n,r,i)}}function Ui(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...X(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...X(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?J(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function Wi(e,t){return Ui(e,!0,t)}function Gi(e,t,n,r,i){return Wi([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function Ki(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=ca(n[0],1*(1+t.roughness*.2),t),i=t.disableMultiStroke?[]:ca(n[0],1.5*(1+t.roughness*.22),ia(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=ca(a,1*(1+t.roughness*.2),t),n=t.disableMultiStroke?[]:ca(a,1.5*(1+t.roughness*.22),ia(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function qi(e,t,n,r,i){return Yi(e,t,i,Ji(n,r,i)).opset}function Ji(e,t,n){let r=Math.sqrt(Math.PI*2*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=Math.PI*2/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=Y(o*c,n),s+=Y(s*c,n),{increment:a,rx:o,ry:s}}function Yi(e,t,n,r){let[i,a]=ua(r.increment,e,t,r.rx,r.ry,1,r.increment*oa(.1,oa(.4,1,n),n),n),o=la(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=ua(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=la(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function Xi(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=Y(d*.01,c),f+=Y(f*.01,c);let p=i,m=a;for(;p<0;)p+=Math.PI*2,m+=Math.PI*2;m-p>Math.PI*2&&(p=0,m=Math.PI*2);let h=Math.PI*2/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=da(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=da(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 Zi(e,t){let n=Ri(Li(Ii(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(...fa(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 Qi(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;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+Y(e,t),r[a][1]+Y(e,t)]})}}return{type:`fillPath`,ops:n}}function $i(e,t){return ki(t,Hi).fillPolygons(e,t)}function ea(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=Y(l*.01,o),u+=Y(u*.01,o);let d=i,f=a;for(;d<0;)d+=Math.PI*2,f+=Math.PI*2;f-d>Math.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]),$i([m],o)}function ta(e,t){return Y(e,t)}function na(e,t,n){return oa(e,t,n)}function ra(e,t,n,r,i){return X(e,t,n,r,i,!0)}function ia(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function aa(e){return e.randomizer||=new hi(e.seed||0),e.randomizer.next()}function oa(e,t,n,r=1){return n.roughness*r*(aa(n)*(t-e)+e)}function Y(e,t,n=1){return oa(-e,e,t,n)}function X(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=sa(e,t,n,r,i,!0,!1);if(o)return s;let c=sa(e,t,n,r,i,!0,!0);return s.concat(c)}function sa(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+aa(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 ca(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;i<e.length;i++)r.push([e[i][0]+Y(t,n),e[i][1]+Y(t,n)]),i===e.length-1&&r.push([e[i][0]+Y(t,n),e[i][1]+Y(t,n)]);return la(r,null,n)}function la(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+Y(e,n),t[1]+Y(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...sa(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function ua(e,t,n,r,i,a,o,s){let c=s.roughness===0,l=[],u=[];if(c){e/=4,u.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=Math.PI*2;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];l.push(e),u.push(e)}u.push([t+r*Math.cos(0),n+i*Math.sin(0)]),u.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let c=Y(.5,s)-Math.PI/2;u.push([Y(a,s)+t+.9*r*Math.cos(c-e),Y(a,s)+n+.9*i*Math.sin(c-e)]);let d=Math.PI*2+c-.01;for(let o=c;o<d;o+=e){let e=[Y(a,s)+t+r*Math.cos(o),Y(a,s)+n+i*Math.sin(o)];l.push(e),u.push(e)}u.push([Y(a,s)+t+r*Math.cos(c+Math.PI*2+o*.5),Y(a,s)+n+i*Math.sin(c+Math.PI*2+o*.5)]),u.push([Y(a,s)+t+.98*r*Math.cos(c+o),Y(a,s)+n+.98*i*Math.sin(c+o)]),u.push([Y(a,s)+t+.9*r*Math.cos(c+o*.5),Y(a,s)+n+.9*i*Math.sin(c+o*.5)])}return[u,l]}function da(e,t,n,r,i,a,o,s,c){let l=a+Y(.1,c),u=[];u.push([Y(s,c)+t+.9*r*Math.cos(l-e),Y(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([Y(s,c)+t+r*Math.cos(a),Y(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),la(u,null,c)}function fa(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:Y(l[0],s)),o[1]+(f?0:Y(l[0],s))]}),u=f?[i,a]:[i+Y(l[p],s),a+Y(l[p],s)],c.push({op:`bcurveTo`,data:[e+Y(l[p],s),t+Y(l[p],s),n+Y(l[p],s),r+Y(l[p],s),u[0],u[1]]});return c}function pa(e){return[...e]}function ma(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(pa(e[0]),pa(e[1]),pa(e[2]),pa(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(pa(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function ha(e,t){return Math.sqrt(ga(e,t))}function ga(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function _a(e,t,n){let r=ga(t,n);if(r===0)return ga(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ga(e,va(t,n,i))}function va(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ya(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}function ba(e,t,n,r){let i=r||[];if(ya(e,t)<n){let n=e[t+0];i.length?ha(i[i.length-1],n)>1&&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=va(a,o,r),u=va(o,s,r),d=va(s,c,r),f=va(l,u,r),p=va(u,d,r),m=va(f,p,r);ba([a,l,f,m],0,n,i),ba([m,p,d,c],0,n,i)}return i}function xa(e,t){return Sa(e,0,e.length,t)}function Sa(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=_a(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Sa(e,t,l+1,r,a),Sa(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Ca(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)ba(e,n*3,t,r);return n&&n>0?Sa(r,0,r.length,n):r}function wa(e,t,n){let r=Ri(Li(Ii(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Ca(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=xa(e,n);t.length&&u.push(t)}return u}var Z=`none`,Ta=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 mi()}_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=Gi(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(Qi([i],a)):o.push($i([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=Ji(n,r,a),c=Yi(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=Yi(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push($i([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`,[Ui(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=Xi(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=Xi(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(ea(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=Ki(e,n);if(n.fill&&n.fill!==Z){if(n.fillStyle===`solid`){let t=Ki(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(...Ca(ma([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Ca(ma(r),10,(1+n.roughness)/2))}t.length&&r.push($i([t],n))}}return n.stroke!==Z&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=Ui(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(Qi([e],n)):r.push($i([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=wa(e,1,s),l=Zi(e,n);if(i){if(n.fillStyle===`solid`){if(c.length===1){let t=Zi(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(Qi(c,n))}else r.push($i(c,n))}return a&&(o?c.forEach(e=>{r.push(Ui(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`)}},Ea=`http://www.w3.org/2000/svg`,Da=800,Oa=null;function ka(){return Oa||=new Ta().defaultOptions,Oa}function Aa(e,t,n){return{...ka(),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 ja(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 Ma(e,t,n,r,i,a){let o=[],s=n.strokeWidth||2,c=ja(n),l=n.animate===void 0||!!n.animate,u=n.iterations||2,d=+!!n.rtl,f=Aa(`single`,a,n);switch(n.type){case`underline`:{let e=t.y+t.h+c[2];for(let n=d;n<u+d;n++)n%2?o.push(J(t.x+t.w,e,t.x,e,f)):o.push(J(t.x,e,t.x+t.w,e,f));break}case`strike-through`:{let e=t.y+t.h/2;for(let n=d;n<u+d;n++)n%2?o.push(J(t.x+t.w,e,t.x,e,f)):o.push(J(t.x,e,t.x+t.w,e,f));break}case`box`:{let e=t.x-c[3],n=t.y-c[0],r=t.w+(c[1]+c[3]),i=t.h+(c[0]+c[2]);for(let t=0;t<u;t++)o.push(Gi(e,n,r,i,f));break}case`bracket`:{let e=Array.isArray(n.brackets)?n.brackets:n.brackets?[n.brackets]:[`right`],r=t.x-c[3]*2,i=t.x+t.w+c[1]*2,a=t.y-c[0]*2,s=t.y+t.h+c[2]*2;for(let n of e){let e;switch(n){case`bottom`:e=[[r,t.y+t.h],[r,s],[i,s],[i,t.y+t.h]];break;case`top`:e=[[r,t.y],[r,a],[i,a],[i,t.y]];break;case`left`:e=[[t.x,a],[r,a],[r,s],[t.x,s]];break;case`right`:e=[[t.x+t.w,a],[i,a],[i,s],[t.x+t.w,s]]}e&&o.push(Ui(e,!1,f))}break}case`crossed-off`:{let e=t.x,n=t.y,r=e+t.w,i=n+t.h;for(let t=d;t<u+d;t++)t%2?o.push(J(r,i,e,n,f)):o.push(J(e,n,r,i,f));for(let t=d;t<u+d;t++)t%2?o.push(J(e,i,r,n,f)):o.push(J(r,n,e,i,f));break}case`circle`:{let e=Aa(`double`,a,n),r=t.w+(c[1]+c[3]),i=t.h+(c[0]+c[2]),s=t.x-c[3]+r/2,l=t.y-c[0]+i/2,d=Math.floor(u/2),p=u-d*2;for(let t=0;t<d;t++)o.push(qi(s,l,r,i,e));for(let e=0;e<p;e++)o.push(qi(s,l,r,i,f));break}case`highlight`:{let e=Aa(`highlight`,a,n);s=t.h*.95;let r=t.y+t.h/2;for(let n=d;n<u+d;n++)n%2?o.push(J(t.x+t.w,r,t.x,r,e)):o.push(J(t.x,r,t.x+t.w,r,e));break}}if(o.length){let t=Pa(o),a=[],c=[],u=0,d=(e,t,n)=>e.setAttribute(t,n);for(let r of t){let t=document.createElementNS(Ea,`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;t<c.length;t++){let n=c[t],o=a[t],s=u?o/u*i:0,l=r+e,d=n.style;d.strokeDashoffset=`${o}`,d.strokeDasharray=`${o}`,d.animation=`rough-notation-dash ${s}ms ease-out ${l}ms forwards`,e+=s}return Na(i+r)}}return Na(0)}function Na(e){return new Promise(t=>setTimeout(t,e))}function Pa(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 Fa(){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 Ia=Object.defineProperty,La=(e,t,n)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(La(e,typeof t==`symbol`?t:t+``,n),n),Ra=class{constructor(e,t){Q(this,`_state`,`unattached`),Q(this,`_config`),Q(this,`_resizing`,!1),Q(this,`_ro`),Q(this,`_seed`,mi()),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){Fa();let e=this._svg=document.createElementNS(Ea,`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;t<e.length;t++)if(!this.isSameRect(e[t],this._lastSizes[t]))return!0}else return!0}return!1}isSameRect(e,t){let n=(e,t)=>Math.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||Da,o=0,s=[];for(let t=0;t<r.length;t++){let c=a*(r[t].w/i);s.push(Ma(e,r[t],n,o+this._animationDelay+(this._config.delay||0),c,this._seed)),o+=c}return this._lastSizes=r,this._state=`showing`,await Promise.all(s)}rects(){let e=[];if(this._svg){if(this._config.multiline){let t=this._e.getClientRects();for(let n=0;n<t.length;n++)e.push(this.svgRect(this._svg,t[n]))}else e.push(this.svgRect(this._svg,this._e.getBoundingClientRect()))}return e}svgRect(e,t){let n=e.getBoundingClientRect(),r=t;return{x:(r.x||r.left)-(n.x||n.left),y:(r.y||r.top)-(n.y||n.top),w:r.width,h:r.height}}};function za(e,t){return new Ra(e,t)}function $(e,t){return e.class=[e.class,t].filter(Boolean).join(` `),e}var Ba={box:e=>Object.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`)},Va=[[/^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 Ha(){return{install(e){e.directive(`mark`,{name:`v-mark`,mounted:(e,t)=>{let{isPrintMode:n}=ue(),r=m(()=>{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(Ba[e])return r=Ba[e](r,t),!1;for(let[n,i]of Va){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=za(e,r.value),a=ai(e,t,r.value.at);if(!a){i.show();return}e.watchStopHandle=l(()=>{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 Ua(){return{install(e){let t=xe();e.directive(`motion`,{name:`v-motion`,mounted(e,n,r,i){let a=ei(n,Oe),o=ei(n,ke),s=ei(n,Me),{currentPage:l,clicks:u,isPrintMode:d}=ue(),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=`${xr()}-`,_=[];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=c([o,l,u].filter(Boolean),()=>{let t=ii.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===l.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)>l.value?p:h)},{immediate:!0})},unmounted(e){e.motionInstance.watchStopHandle()}})}}}var Wa=Object.assign({}),Ga=Object.assign({}),Ka=Object.assign({}),qa=[Object.values(Wa)[0],Object.values(Ga)[0],Object.values(Ka)[0]].filter(Boolean);function Ja(){let e=[];function t(e){if(!M.remote||M.remote===e.query.password)return!0;if(M.remote&&e.query.password===void 0){let e=prompt(`Enter password`);if(M.remote===e)return!0}return e.params.no?{path:`/${e.params.no}`}:{path:``}}return e.push({name:`entry`,path:`/entry`,component:()=>j(()=>import(`./slidev/entry-DXY6sGn2.js`),__vite__mapDeps([2,3,1,4,5,6]),import.meta.url),beforeEnter:t},{name:`overview`,path:`/overview`,component:()=>j(()=>import(`./slidev/overview-afK9Px3A.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:()=>j(()=>import(`./slidev/notes-CPXmI0zR.js`),__vite__mapDeps([22,3,1,4,8,5,9,10,12,23,13,14,24]),import.meta.url),beforeEnter:t},{name:`notes-edit`,path:`/notes-edit`,component:()=>j(()=>import(`./slidev/notes-edit-CT3D_gWN.js`),__vite__mapDeps([25,3,1,4,8,5,9,10,12,23]),import.meta.url),beforeEnter:t},{name:`presenter`,path:`/presenter/:no`,component:()=>j(()=>import(`./slidev/presenter-55QuCC1n.js`),__vite__mapDeps([26,3,1,4,8,5,9,10,18,27,12,28,29,13,14,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:()=>j(()=>import(`./slidev/play-C_pNWp29.js`),__vite__mapDeps([33,3,1,4,8,5,9,10,18,11,23,15,16,17,19,30,12,28,31,34]),import.meta.url)},{path:``,redirect:{path:`/1`}},{path:`/:pathMatch(.*)*`,name:`NotFound`,component:()=>j(()=>import(`./slidev/404-YTK3euKy.js`),__vite__mapDeps([35,3,1,4,8,5,9,10,36]),import.meta.url)}),qa.reduce((e,t)=>t(e),e)}async function Ya(e){function t(){document.documentElement.style.setProperty(`--vh`,`${window.innerHeight*.01}px`)}t(),window.addEventListener(`resize`,t);let n=he({history:Te(`./`),routes:Ja()});e.use(n),e.use(qr()),e.use(ri()),e.use(Ha()),e.use(pi()),e.use(Ua()),e.use(b,{container:`#twoslash-container`});let r={app:e,router:n};for(let e of Zr)await e(r)}async function Xa(){let e=y(Rr);await Ya(e),e.mount(`#app`)}Xa();export{Qr as a,Er as c,Sr as d,Ht as f,Mt as h,$r as i,Or as l,Wt as m,ci as n,Ir as o,Ut as p,si as r,kr as s,ui as t,xr as u};
lecture-05/assets/index-U6hcpeoQ.css ADDED
The diff for this file is too large to render. See raw diff
 
lecture-05/assets/interactive-Dm0CtntL.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{H as e,S as t,St as n,_ as r,b as i,w as a,xt as o,y as s,yt as c,z as l}from"./modules/shiki-CkJq9tSf.js";import{t as u}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as d}from"./slidev/context-DnYiQGy6.js";import{t as f}from"./DeckFooter-sY1qw60z.js";var p={class:`dl-widget__stage`},m={class:`dl-widget__controls`},h={class:`dl-widget__readout`},g=u(a({__name:`WidgetFrame`,props:{maxWidth:{default:`100%`},controlsFirst:{type:Boolean}},setup(t){let{$slidev:n,$nav:a,$clicksContext:s,$clicks:u,$page:f,$renderContext:g,$frontmatter:_}=d(),v=t;return(t,n)=>(l(),i(`div`,{class:c([`dl-widget`,{"is-controls-first":v.controlsFirst}]),style:o({maxWidth:v.maxWidth})},[r(`div`,p,[e(t.$slots,`default`,{},void 0,!0)]),r(`div`,m,[e(t.$slots,`controls`,{},void 0,!0)]),r(`div`,h,[e(t.$slots,`readout`,{},void 0,!0)])],6))}}),[[`__scopeId`,`data-v-0f64089e`]]),_={class:`slidev-layout dl-interactive`},v={key:0,class:`dl-interactive__title`},y={class:`dl-interactive__stage`},b=u(a({__name:`interactive`,props:{heading:{},asideWidth:{},asideLeft:{type:Boolean}},setup(a){let{$slidev:u,$nav:p,$clicksContext:m,$clicks:h,$page:g,$renderContext:b,$frontmatter:x}=d(),S=a;return(a,u)=>{let d=f;return l(),i(`div`,_,[S.heading?(l(),i(`h1`,v,n(S.heading),1)):s(`v-if`,!0),r(`div`,{class:c([`dl-interactive__grid`,{"is-aside-left":S.asideLeft}])},[r(`div`,y,[e(a.$slots,`default`,{},void 0,!0)]),r(`div`,{class:`dl-interactive__aside`,style:o({flexBasis:S.asideWidth??`17rem`})},[e(a.$slots,`aside`,{},void 0,!0)],4)],2),t(d)])}}}),[[`__scopeId`,`data-v-0c449bbd`]]);export{g as n,b as t};
lecture-05/assets/md-0TY0dx90.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,_ as r,bt as i,v as a,vt as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./RnnGlyph-DxX0mQto.js";import{t as d}from"./section-CLxRKQ9Y.js";var f={style:{position:`absolute`,right:`4.5rem`,top:`50%`,transform:`translateY(-50%)`}},p={__name:`slides.md__slidev_86`,setup(p){let{$slidev:m,$nav:h,$clicksContext:g,$clicks:_,$page:v,$renderContext:y,$frontmatter:b}=c();return g.setup(),(c,p)=>{let m=u;return s(),a(d,i(t(o(l)(o(b),85))),{default:e(()=>[p[0]||=r(`h1`,null,`Words into vectors`,-1),p[1]||=r(`p`,null,`Where the input vectors came from.`,-1),r(`div`,f,[n(m,{kind:`map`,size:190})])]),_:1},16)}}};export{p as default};
lecture-05/assets/md-4unhqfQF2.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,x as u,z as d}from"./modules/shiki-CkJq9tSf.js";import{n as f,t as p}from"./slidev/context-DnYiQGy6.js";import{t as m}from"./default-CkTgO_iP.js";import{t as h}from"./slidev/VClicks-CNqMVSis.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_52`,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=r(`click`);return d(),c(m,o(t(l(p)(l(E),51))),{default:e(()=>[y[3]||=i(`h1`,null,`Reading the equation: backpropagation through time`,-1),i(`div`,g,[i(`div`,_,[n(b,null,{default:e(()=>[...y[0]||=[i(`table`,null,[i(`thead`,null,[i(`tr`,null,[i(`th`,null,`symbol`),i(`th`,null,`name`),i(`th`,null,`what it is here`),i(`th`,null,`example`)])]),i(`tbody`,null,[i(`tr`,null,[i(`td`,null,[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(`mi`,null,`L`),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`msub`,null,[i(`mi`,null,`L`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`L,\\ L_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,[u(`loss, step-`),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(`mi`,null,`t`)]),i(`annotation`,{encoding:`application/x-tex`},`t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),i(`span`,{class:`mord mathnormal`},`t`)])])]),u(` loss`)]),i(`td`,null,[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(`mi`,null,`L`),i(`mo`,null,`=`),i(`msub`,null,[i(`mo`,null,`βˆ‘`),i(`mi`,null,`t`)]),i(`msub`,null,[i(`mi`,null,`L`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`L = \\sum_t L_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.0497em`,"vertical-align":`-0.2997em`}}),i(`span`,{class:`mop`},[i(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`βˆ‘`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.1308em`}},[i(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2997em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,[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(`mi`,null,`L`),i(`mo`,null,`=`),i(`msub`,null,[i(`mi`,null,`L`),i(`mn`,null,`3`)]),i(`mo`,null,`=`),i(`msub`,null,[i(`mi`,null,`h`),i(`mn`,null,`3`)])]),i(`annotation`,{encoding:`application/x-tex`},`L = L_3 = h_3`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},`3`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},`3`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])])]),i(`tr`,null,[i(`td`,null,[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(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`mi`,null,`L`),i(`mi`,{mathvariant:`normal`},`/`),i(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])])]),i(`annotation`,{encoding:`application/x-tex`},`\\partial L / \\partial W_{hh}`)])])]),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:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`mord`},`/`),i(`span`,{class:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`gradient`),i(`td`,null,[u(`slope of `),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(`mi`,null,`L`)]),i(`annotation`,{encoding:`application/x-tex`},`L`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`},`L`)])])]),u(` in `),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(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])])]),i(`annotation`,{encoding:`application/x-tex`},`W_{hh}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`1.0`)]),i(`tr`,null,[i(`td`,null,[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(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])])]),i(`annotation`,{encoding:`application/x-tex`},`W_{hh}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`recurrent weight`),i(`td`,null,`learned; used every step`),i(`td`,null,`0.5`)]),i(`tr`,null,[i(`td`,null,[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(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`t`)]),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`k`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}_t,\\ \\mathbf{h}_k`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`hidden states`),i(`td`,null,[u(`at step `),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(`mi`,null,`t`)]),i(`annotation`,{encoding:`application/x-tex`},`t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),i(`span`,{class:`mord mathnormal`},`t`)])])]),u(`, earlier step `),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(`mi`,null,`k`)]),i(`annotation`,{encoding:`application/x-tex`},`k`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0315em`}},`k`)])])])]),i(`td`,null,[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(`msub`,null,[i(`mi`,null,`h`),i(`mn`,null,`1`)]),i(`mo`,null,`=`),i(`mn`,null,`1`)]),i(`annotation`,{encoding:`application/x-tex`},`h_1 = 1`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},`1`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`1`)])])])])]),i(`tr`,null,[i(`td`,null,[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(`msubsup`,null,[i(`mo`,null,`βˆ‘`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`=`),i(`mn`,null,`1`)]),i(`mi`,null,`T`)]),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`msubsup`,null,[i(`mo`,null,`βˆ‘`),i(`mrow`,null,[i(`mi`,null,`k`),i(`mo`,null,`=`),i(`mn`,null,`1`)]),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\sum_{t=1}^{T},\\ \\sum_{k=1}^{t}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.2809em`,"vertical-align":`-0.2997em`}}),i(`span`,{class:`mop`},[i(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`βˆ‘`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.9812em`}},[i(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mrel mtight`},`=`),i(`span`,{class:`mord mtight`},`1`)])])]),i(`span`,{style:{top:`-3.2029em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`T`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2997em`}},[i(`span`)])])])])]),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mop`},[i(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`βˆ‘`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.9335em`}},[i(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`),i(`span`,{class:`mrel mtight`},`=`),i(`span`,{class:`mord mtight`},`1`)])])]),i(`span`,{style:{top:`-3.2029em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2997em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`sums`),i(`td`,null,[u(`over `),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(`mi`,null,`t`)]),i(`annotation`,{encoding:`application/x-tex`},`t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),i(`span`,{class:`mord mathnormal`},`t`)])])]),u(`, then over `),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(`mi`,null,`k`),i(`mo`,null,`≀`),i(`mi`,null,`t`)]),i(`annotation`,{encoding:`application/x-tex`},`k \\le t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8304em`,"vertical-align":`-0.136em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0315em`}},`k`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`≀`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),i(`span`,{class:`mord mathnormal`},`t`)])])])]),i(`td`,null,[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(`mi`,null,`T`),i(`mo`,null,`=`),i(`mn`,null,`3`)]),i(`annotation`,{encoding:`application/x-tex`},`T = 3`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`3`)])])])])]),i(`tr`,null,[i(`td`,null,[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(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,null,`L`),i(`mi`,null,`t`)]),i(`mi`,{mathvariant:`normal`},`/`),i(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\partial L_t / \\partial \\mathbf{h}_t`)])])]),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:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mord`},`/`),i(`span`,{class:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`state gradient`),i(`td`,null,[u(`slope of `),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(`msub`,null,[i(`mi`,null,`L`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`L_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])]),u(` in `),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(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`1`)]),i(`tr`,null,[i(`td`,null,[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(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`t`)]),i(`mi`,{mathvariant:`normal`},`/`),i(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`k`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\partial \\mathbf{h}_t / \\partial \\mathbf{h}_k`)])])]),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:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mord`},`/`),i(`span`,{class:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`Jacobian`),i(`td`,null,[u(`factor for `),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(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mi`,null,`k`)]),i(`annotation`,{encoding:`application/x-tex`},`t - k`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6984em`,"vertical-align":`-0.0833em`}}),i(`span`,{class:`mord mathnormal`},`t`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`βˆ’`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0315em`}},`k`)])])]),u(` steps back`)]),i(`td`,null,[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(`msup`,null,[i(`mn`,null,`0.5`),i(`mrow`,null,[i(`mtext`,null,` `),i(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mi`,null,`k`)])])]),i(`annotation`,{encoding:`application/x-tex`},`0.5^{\\,t-k}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8491em`}}),i(`span`,{class:`mord`},`0.`),i(`span`,{class:`mord`},[i(`span`,{class:`mord`},`5`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.8491em`}},[i(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mspace mtight`,style:{"margin-right":`0.1952em`}}),i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])])])])])])])])])])])]),i(`tr`,null,[i(`td`,null,[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(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`k`)]),i(`mi`,{mathvariant:`normal`},`/`),i(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])])]),i(`annotation`,{encoding:`application/x-tex`},`\\partial \\mathbf{h}_k / \\partial W_{hh}`)])])]),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:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mord`},`/`),i(`span`,{class:`mord`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`local gradient`),i(`td`,null,[u(`step `),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(`mi`,null,`k`)]),i(`annotation`,{encoding:`application/x-tex`},`k`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0315em`}},`k`)])])]),u(` alone`)]),i(`td`,null,[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(`msub`,null,[i(`mi`,null,`h`),i(`mrow`,null,[i(`mi`,null,`k`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1`)])])]),i(`annotation`,{encoding:`application/x-tex`},`h_{k-1}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.9028em`,"vertical-align":`-0.2083em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2083em`}},[i(`span`)])])])])])])])])])])])],-1)]]),_:1})]),i(`div`,null,[y[2]||=i(`svg`,{viewBox:`0 0 300 130`,class:`dl-diagram`,role:`img`,"aria-label":`A chain h1 equal to 1, h2 equal to 0.5, h3 equal to 0.25; the gradient travels back from h3 with factor 1, then 0.5, then 0.25`},[i(`defs`,null,[i(`marker`,{id:`l5b-rd3-fwd`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[i(`path`,{d:`M0 0 L7 3.5 L0 7 z`,class:`dl-dg-head`})]),i(`marker`,{id:`l5b-rd3-back`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[i(`path`,{d:`M0 0 L7 3.5 L0 7 z`,style:{fill:`var(--dl-danger)`}})])]),i(`rect`,{x:`10`,y:`30`,width:`72`,height:`34`,rx:`6`,class:`dl-dg-box`}),i(`text`,{x:`46`,y:`52`,"text-anchor":`middle`,class:`dl-dg-lab is-sm`},`h₁ = 1`),i(`rect`,{x:`114`,y:`30`,width:`72`,height:`34`,rx:`6`,class:`dl-dg-box`}),i(`text`,{x:`150`,y:`52`,"text-anchor":`middle`,class:`dl-dg-lab is-sm`},`hβ‚‚ = 0.5`),i(`rect`,{x:`218`,y:`30`,width:`74`,height:`34`,rx:`6`,class:`dl-dg-box is-accent`}),i(`text`,{x:`255`,y:`52`,"text-anchor":`middle`,class:`dl-dg-lab is-sm`},`h₃ = 0.25`),i(`path`,{d:`M84 40 H110`,class:`dl-dg-arrow`,"marker-end":`url(#l5b-rd3-fwd)`}),i(`path`,{d:`M188 40 H214`,class:`dl-dg-arrow`,"marker-end":`url(#l5b-rd3-fwd)`}),i(`path`,{d:`M214 56 H188`,class:`dl-dg-grad is-bad`,"marker-end":`url(#l5b-rd3-back)`}),i(`path`,{d:`M110 56 H84`,class:`dl-dg-grad is-bad`,"marker-end":`url(#l5b-rd3-back)`}),i(`text`,{x:`46`,y:`88`,"text-anchor":`middle`,class:`dl-dg-small is-bad`},`Γ— 0.25`),i(`text`,{x:`150`,y:`88`,"text-anchor":`middle`,class:`dl-dg-small is-bad`},`Γ— 0.5`),i(`text`,{x:`255`,y:`88`,"text-anchor":`middle`,class:`dl-dg-small is-bad`},`Γ— 1`),i(`text`,{x:`150`,y:`118`,"text-anchor":`middle`,class:`dl-dg-small`},`factor βˆ‚h₃/βˆ‚hβ‚–`)],-1),s((d(),a(`div`,v,[...y[1]||=[i(`p`,null,[u(`One unit, no `),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(`mi`,null,`tanh`),i(`mo`,null,`⁑`)]),i(`annotation`,{encoding:`application/x-tex`},`\\tanh`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mop`},`tanh`)])])]),u(`, `),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(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])]),i(`mo`,null,`=`),i(`mn`,null,`0.5`)]),i(`annotation`,{encoding:`application/x-tex`},`W_{hh} = 0.5`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0.5`)])])]),u(`, inputs `),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(`mn`,null,`1`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`0`),i(`mo`,{separator:`true`},`,`),i(`mn`,null,`0`)]),i(`annotation`,{encoding:`application/x-tex`},`1, 0, 0`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8389em`,"vertical-align":`-0.1944em`}}),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`)])])]),u(`:`)],-1),i(`p`,null,[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(`mfrac`,null,[i(`mrow`,null,[i(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`mi`,null,`L`)]),i(`mrow`,null,[i(`mi`,{mathvariant:`normal`},`βˆ‚`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])])])]),i(`mo`,null,`=`),i(`munder`,null,[i(`munder`,null,[i(`mrow`,null,[i(`mn`,null,`0.25`),i(`mo`,null,`β‹…`),i(`mn`,null,`0`)]),i(`mo`,{stretchy:`true`},`⏟`)]),i(`mrow`,null,[i(`mi`,null,`k`),i(`mo`,null,`=`),i(`mn`,null,`1`)])]),i(`mo`,null,`+`),i(`munder`,null,[i(`munder`,null,[i(`mrow`,null,[i(`mn`,null,`0.5`),i(`mo`,null,`β‹…`),i(`mn`,null,`1`)]),i(`mo`,{stretchy:`true`},`⏟`)]),i(`mrow`,null,[i(`mi`,null,`k`),i(`mo`,null,`=`),i(`mn`,null,`2`)])]),i(`mo`,null,`+`),i(`munder`,null,[i(`munder`,null,[i(`mrow`,null,[i(`mn`,null,`1`),i(`mo`,null,`β‹…`),i(`mn`,null,`0.5`)]),i(`mo`,{stretchy:`true`},`⏟`)]),i(`mrow`,null,[i(`mi`,null,`k`),i(`mo`,null,`=`),i(`mn`,null,`3`)])]),i(`mo`,null,`=`),i(`mn`,null,`1.0`)]),i(`annotation`,{encoding:`application/x-tex`},`\\frac{\\partial L}{\\partial W_{hh}} = \\underbrace{0.25 \\cdot 0}_{k=1} + \\underbrace{0.5 \\cdot 1}_{k=2} + \\underbrace{1 \\cdot 0.5}_{k=3} = 1.0`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.331em`,"vertical-align":`-0.4509em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mopen nulldelimiter`}),i(`span`,{class:`mfrac`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.8801em`}},[i(`span`,{style:{top:`-2.655em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mtight`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3448em`}},[i(`span`,{style:{top:`-2.3488em`,"margin-left":`-0.1389em`,"margin-right":`0.0714em`}},[i(`span`,{class:`pstrut`,style:{height:`2.5em`}}),i(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.1512em`}},[i(`span`)])])])])])])])]),i(`span`,{style:{top:`-3.23em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),i(`span`,{style:{top:`-3.394em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mtight`,style:{"margin-right":`0.0556em`}},`βˆ‚`),i(`span`,{class:`mord mathnormal mtight`},`L`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.4509em`}},[i(`span`)])])])]),i(`span`,{class:`mclose nulldelimiter`})]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.9785em`,"vertical-align":`-1.3341em`}}),i(`span`,{class:`minner munder`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6444em`}},[i(`span`,{style:{top:`-1.6659em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`),i(`span`,{class:`mrel mtight`},`=`),i(`span`,{class:`mord mtight`},`1`)])])]),i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`minner munder`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6444em`}},[i(`span`,{class:`svg-align`,style:{top:`-2.352em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-stretchy`,style:{height:`0.548em`,"min-width":`1.6em`}},[i(`span`,{class:`brace-left`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMinYMin slice`},[i(`path`,{d:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
2
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
3
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
4
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`})])]),i(`span`,{class:`brace-center`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMidYMin slice`},[i(`path`,{d:`M199572 214
5
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
6
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
7
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
8
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`})])]),i(`span`,{class:`brace-right`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMaxYMin slice`},[i(`path`,{d:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
9
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
10
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`})])])])]),i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord`},`0.25`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`β‹…`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mord`},`0`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.648em`}},[i(`span`)])])])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`1.3341em`}},[i(`span`)])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.9785em`,"vertical-align":`-1.3341em`}}),i(`span`,{class:`minner munder`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6444em`}},[i(`span`,{style:{top:`-1.6659em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`),i(`span`,{class:`mrel mtight`},`=`),i(`span`,{class:`mord mtight`},`2`)])])]),i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`minner munder`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6444em`}},[i(`span`,{class:`svg-align`,style:{top:`-2.352em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-stretchy`,style:{height:`0.548em`,"min-width":`1.6em`}},[i(`span`,{class:`brace-left`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMinYMin slice`},[i(`path`,{d:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
11
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
12
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
13
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`})])]),i(`span`,{class:`brace-center`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMidYMin slice`},[i(`path`,{d:`M199572 214
14
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
15
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
16
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
17
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`})])]),i(`span`,{class:`brace-right`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMaxYMin slice`},[i(`path`,{d:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
18
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
19
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`})])])])]),i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord`},`0.5`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`β‹…`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mord`},`1`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.648em`}},[i(`span`)])])])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`1.3341em`}},[i(`span`)])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.9785em`,"vertical-align":`-1.3341em`}}),i(`span`,{class:`minner munder`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6444em`}},[i(`span`,{style:{top:`-1.6659em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`),i(`span`,{class:`mrel mtight`},`=`),i(`span`,{class:`mord mtight`},`3`)])])]),i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`minner munder`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6444em`}},[i(`span`,{class:`svg-align`,style:{top:`-2.352em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-stretchy`,style:{height:`0.548em`,"min-width":`1.6em`}},[i(`span`,{class:`brace-left`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMinYMin slice`},[i(`path`,{d:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
20
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
21
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
22
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`})])]),i(`span`,{class:`brace-center`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMidYMin slice`},[i(`path`,{d:`M199572 214
23
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
24
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
25
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
26
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`})])]),i(`span`,{class:`brace-right`,style:{height:`0.548em`}},[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`0.548em`,viewBox:`0 0 400000 548`,preserveAspectRatio:`xMaxYMin slice`},[i(`path`,{d:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
27
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
28
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`})])])])]),i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord`},`1`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`β‹…`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mord`},`0.5`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.648em`}},[i(`span`)])])])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`1.3341em`}},[i(`span`)])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`1.0`)])])])],-1),i(`p`,null,[u(`Check: `),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(`msub`,null,[i(`mi`,null,`h`),i(`mn`,null,`3`)]),i(`mo`,null,`=`),i(`msubsup`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)]),i(`mn`,null,`2`)])]),i(`annotation`,{encoding:`application/x-tex`},`h_3 = W_{hh}^2`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},`3`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.0972em`,"vertical-align":`-0.2831em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.8141em`}},[i(`span`,{style:{top:`-2.4169em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])]),i(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},`2`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2831em`}},[i(`span`)])])])])])])])]),u(`, slope `),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(`mn`,null,`2`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])]),i(`mo`,null,`=`),i(`mn`,null,`1.0`)]),i(`annotation`,{encoding:`application/x-tex`},`2 W_{hh} = 1.0`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},`2`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`1.0`)])])]),u(`.`)],-1)]])),[[x]])])])]),_:1},16)}}};export{y as default};
lecture-05/assets/md-8BSDPxep.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.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,r(t(a(l)(a(v),35))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: The same equation, one matrix`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The two weight matrices can be written as one. Nothing new is computed.`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`The trick.`),o(` Stack the 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(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_t`)])])]),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.2806em`}},[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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` on top of the note `),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`},`h`),n(`mrow`,null,[n(`mi`,null,`t`),n(`mo`,null,`βˆ’`),n(`mn`,null,`1`)])])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}_{t-1}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.9028em`,"vertical-align":`-0.2083em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`h`),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 mathnormal mtight`},`t`),n(`span`,{class:`mbin mtight`},`βˆ’`),n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2083em`}},[n(`span`)])])])])])])])]),o(` into one long vector. Place `),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,`x`),n(`mi`,null,`h`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{xh}`)])])]),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.3361em`}},[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`},`x`),n(`span`,{class:`mord mathnormal mtight`},`h`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` 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(`mrow`,null,[n(`mi`,null,`h`),n(`mi`,null,`h`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{hh}`)])])]),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.3361em`}},[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`},`hh`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` side by side 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(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`h`)])]),n(`annotation`,{encoding:`application/x-tex`},`W_h`)])])]),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.3361em`}},[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`},`h`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`. Add the bias `),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`},`b`),n(`mi`,null,`h`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{b}_h`)])])]),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`},`b`),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`},`h`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` and apply tanh, as before.`)]),n(`li`,null,[n(`strong`,null,`The picture`),o(` is to 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(`msub`,null,[n(`mi`,null,`W`),n(`mrow`,null,[n(`mi`,null,`x`),n(`mi`,null,`h`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{xh}`)])])]),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.3361em`}},[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`},`x`),n(`span`,{class:`mord mathnormal mtight`},`h`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` is 64 columns wide, the shaded `),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,`h`),n(`mi`,null,`h`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{hh}`)])])]),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.3361em`}},[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`},`hh`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` 128. Both have 128 rows, one per hidden unit.`)]),n(`li`,null,[n(`strong`,null,`The numbers.`),o(` The toy at `),n(`em`,null,`great`),o(` 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,`0.482`),n(`mo`,{separator:`true`},`,`),n(`mo`,null,`βˆ’`),n(`mn`,null,`0.446`),n(`mo`,{stretchy:`false`},`]`)]),n(`annotation`,{encoding:`application/x-tex`},`[0.482, -0.446]`)])])]),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.482`),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`βˆ’`),n(`span`,{class:`mord`},`0.446`),n(`span`,{class:`mclose`},`]`)])])]),o(`, the same sum as before tanh. A real layer 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,`128`),n(`mo`,null,`Γ—`),n(`mn`,null,`192`)]),n(`annotation`,{encoding:`application/x-tex`},`128 \\times 192`)])])]),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`},`128`),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`},`192`)])])]),o(`, because `),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,`64`),n(`mo`,null,`+`),n(`mn`,null,`128`),n(`mo`,null,`=`),n(`mn`,null,`192`)]),n(`annotation`,{encoding:`application/x-tex`},`64 + 128 = 192`)])])]),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`},`64`),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`},`128`),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`},`192`)])])]),o(`.`)])]),n(`p`,null,`So a recurrent layer is one dense layer reading word and note, joined.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-8U7N9b1w2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.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,r(t(a(l)(a(v),11))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Averaging loses the order`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The chart places each review at its `),n(`strong`,null,`average word vector`),o(`.`)]),n(`ol`,null,[n(`li`,null,[o(`Review A lands at `),n(`span`,null,`0.25, 0`),o(` and review B at `),n(`span`,null,`0.2, 0.2`),o(`. A line at 0.1 splits them, so averaging seems to work.`)]),n(`li`,null,[o(`But that line has only learned "any `),n(`em`,null,`not`),o(` means negative". It is a rule about which words occur, not about order.`)]),n(`li`,null,[o(`Add `),n(`em`,null,`bad`),o(` = `),n(`span`,null,`βˆ’1, 0`),o(`. Review C, `),n(`em`,null,`not bad, the movie was great`),o(`, is positive. Review D, `),n(`em`,null,`not great, the movie was bad`),o(`, is negative.`)]),n(`li`,null,[o(`Same six words, so both average to `),n(`span`,null,`0, 0.17`),o(`: one point, two labels.`)])]),n(`p`,null,`No rule on the average can separate them.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-90fMrPtp2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_118`,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,r(t(a(l)(a(v),117))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Attention β€” stop choosing in advance`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The same widget, now with `),n(`strong`,null,`attention`),o(`. The source is `),n(`em`,null,`Ich habe ein Buch gelesen`),o(`; the output is `),n(`em`,null,`I have read a book`),o(`.`)]),n(`p`,null,[o(`The decoder keeps `),n(`strong`,null,`every`),o(` encoder state. Each press of `),n(`strong`,null,`Next word`),o(` writes one English word, and the weights show where it looks.`)]),n(`ul`,null,[n(`li`,null,[o(`Writing `),n(`em`,null,`have`),o(`, the weight sits on `),n(`em`,null,`habe`),o(`: 0.85.`)]),n(`li`,null,[o(`Writing `),n(`em`,null,`read`),o(`, 0.85 of the weight is on `),n(`em`,null,`gelesen`),o(`, the last German word. The lines cross, so the model is not just copying word order.`)])]),n(`p`,null,`Nobody told the model these pairs: the alignment is learned. No fixed summary to overflow: the decoder looks words up.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-9rwPlqBu.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,x as u,z as d}from"./modules/shiki-CkJq9tSf.js";import{n as f,t as p}from"./slidev/context-DnYiQGy6.js";import{t as m}from"./WordStrip-wEzaLRUv.js";import{t as h}from"./default-CkTgO_iP.js";var g={class:`grid grid-cols-[19rem_1fr] gap-8 mt-1`},_={viewBox:`0 0 330 240`,class:`dl-diagram`,role:`img`,"aria-label":`The average word vector of each review on a plane. A at 0.25, 0; B at 0.2, 0.2. A horizontal line at 0.1 separates them. C and D, the same six words in a different order, both land at 0, 0.17`},v={class:`mt-3`},y={class:`mt-3`},b={class:`grid grid-cols-[1fr_4.8rem] gap-1 items-center mt-1`},x={class:`mt-3 dl-callout`},S={__name:`slides.md__slidev_11`,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=m,w=r(`click`);return d(),c(h,o(t(l(p)(l(k),10))),{default:e(()=>[S[16]||=i(`h1`,null,`Averaging loses the order`,-1),i(`div`,g,[i(`div`,null,[(d(),a(`svg`,_,[S[2]||=i(`path`,{class:`dl-dg-arrow`,d:`M50 200 H305 M50 200 V14`},null,-1),S[3]||=i(`text`,{class:`dl-dg-small`,x:`44`,y:`124`,"text-anchor":`end`},`0.1`,-1),S[4]||=i(`text`,{class:`dl-dg-small`,x:`305`,y:`234`,"text-anchor":`end`},`positive β†’`,-1),S[5]||=i(`text`,{class:`dl-dg-small`,x:`56`,y:`12`},`↑ negation`,-1),S[6]||=i(`circle`,{class:`dl-dg-dot is-accent`,cx:`250`,cy:`200`,r:`6`},null,-1),S[7]||=i(`text`,{class:`dl-dg-small is-good`,x:`250`,y:`188`,"text-anchor":`middle`},`A [0.25, 0]`,-1),S[8]||=i(`circle`,{class:`dl-dg-dot is-bad`,cx:`210`,cy:`40`,r:`6`},null,-1),S[9]||=i(`text`,{class:`dl-dg-small is-bad`,x:`210`,y:`28`,"text-anchor":`middle`},`B [0.2, 0.2]`,-1),s((d(),a(`g`,null,[...S[0]||=[i(`path`,{class:`dl-dg-loss`,d:`M50 120 H305`},null,-1),i(`text`,{class:`dl-dg-small`,x:`300`,y:`113`,"text-anchor":`end`},`any not β†’ negative`,-1)]])),[[w,1]]),s((d(),a(`g`,null,[...S[1]||=[i(`circle`,{class:`dl-dg-dot`,cx:`50`,cy:`67`,r:`6`},null,-1),i(`circle`,{class:`dl-dg-box is-bad`,cx:`50`,cy:`67`,r:`11`},null,-1),i(`text`,{class:`dl-dg-small`,x:`66`,y:`64`},`C, D [0, 0.17]`,-1),i(`text`,{class:`dl-dg-small is-bad`,x:`66`,y:`78`},`wrong for C`,-1)]])),[[w,2]])]))]),i(`div`,null,[S[15]||=i(`p`,null,[u(`A `),i(`strong`,null,`bag of words`),u(` averages the word vectors, so order is lost.`)],-1),s((d(),a(`div`,v,[...S[10]||=[i(`p`,null,`A and B still differ: a line splits them.`,-1)]])),[[w,1]]),s((d(),a(`div`,y,[S[13]||=i(`p`,null,[u(`Add `),i(`em`,null,`bad`),u(` = `),i(`span`,null,`βˆ’1, 0`),u(`, and reorder:`)],-1),i(`div`,b,[n(C,{review:[`not`,`bad,`,`the`,`movie`,`was`,`great`],highlight:`not`,width:330}),S[11]||=i(`span`,{class:`dl-secondary`},`C positive`,-1),n(C,{review:[`not`,`great,`,`the`,`movie`,`was`,`bad`],highlight:`not`,width:330}),S[12]||=i(`span`,{class:`dl-secondary`},`D negative`,-1)])])),[[w,2]]),s((d(),a(`div`,x,[...S[14]||=[i(`p`,null,`Same average, opposite labels. No rule on the average can fix that.`,-1)]])),[[w,3]])])])]),_:1},16)}}};export{S as default};
lecture-05/assets/md-A3drwVkB2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,V as r,W as i,_ as a,b as o,bt as s,et as c,m as l,v as u,vt as d,x as f,yt as p,z as m}from"./modules/shiki-CkJq9tSf.js";import{n as h,t as g}from"./slidev/context-DnYiQGy6.js";import{t as _}from"./default-CkTgO_iP.js";import{t as v}from"./RnnGlyph-DxX0mQto.js";var y={class:`grid grid-cols-3 gap-6 mt-2 dl-tight`},b={viewBox:`0 0 120 64`,class:`dl-diagram is-xs`,role:`img`,"aria-label":`A chain of cells with a cut after two of them`},x=[`x`],S={class:`flex justify-center`},C={class:`mt-4 dl-callout`},w={__name:`slides.md__slidev_60`,setup(w){let{$slidev:T,$nav:E,$clicksContext:D,$clicks:O,$page:k,$renderContext:A,$frontmatter:j}=h();return D.setup(),(h,w)=>{let T=v,E=i(`click`);return m(),u(_,s(t(d(g)(d(j),59))),{default:e(()=>[w[9]||=a(`h1`,null,`Three ways out, honestly ranked`,-1),a(`div`,y,[c((m(),o(`div`,null,[...w[0]||=[a(`svg`,{viewBox:`0 0 120 64`,class:`dl-diagram is-xs`,role:`img`,"aria-label":`A tall arrow cut off at a dashed ceiling`},[a(`path`,{d:`M20 58 L100 8`,class:`dl-dg-grad is-bad`}),a(`path`,{d:`M20 58 L60 33`,class:`dl-dg-line`}),a(`path`,{d:`M4 33 H116`,class:`dl-dg-split`,style:{"stroke-dasharray":`4 3`}})],-1),a(`h3`,null,`Gradient clipping`,-1),a(`p`,null,`Cap the gradient’s length.`,-1),a(`div`,{class:`mt-1 dl-secondary`},[a(`p`,null,[f(`Fixes `),a(`strong`,null,`exploding`),f(` only.`)])],-1)]])),[[E]]),c((m(),o(`div`,null,[(m(),o(`svg`,b,[(m(),o(l,null,r(4,e=>a(`g`,{key:e},[a(`rect`,{x:4+(e-1)*30,y:`22`,width:`20`,height:`20`,rx:`3`,class:p(e>2?`dl-dg-box is-accent`:`dl-dg-box`)},null,10,x)])),64)),w[1]||=a(`path`,{d:`M59 10 V54`,class:`dl-dg-grad is-bad`},null,-1)])),w[2]||=a(`h3`,null,`Truncated BPTT`,-1),w[3]||=a(`p`,null,[f(`Backpropagate `),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.6944em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0315em`}},`k`)])])]),f(` steps, then cut.`)],-1),w[4]||=a(`div`,{class:`mt-1 dl-secondary`},[a(`p`,null,[f(`Nothing beyond `),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.6944em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0315em`}},`k`)])])]),f(` steps is learned.`)])],-1)])),[[E]]),c((m(),o(`div`,null,[a(`div`,S,[n(T,{kind:`gate`,size:64})]),w[5]||=a(`h3`,null,`Gated cells`,-1),w[6]||=a(`p`,null,[f(`Make the gradient’s path `),a(`strong`,null,`add`),f(`, not multiply.`)],-1),w[7]||=a(`div`,{class:`mt-1 dl-secondary`},[a(`p`,null,`The real fix: the next section.`)],-1)])),[[E]])]),c((m(),o(`div`,C,[...w[8]||=[a(`p`,null,[f(`Use clipping `),a(`strong`,null,`and`),f(` a gated cell. Truncate when a sequence is too long for memory.`)],-1)]])),[[E]])]),_:1},16)}}};export{w as default};
lecture-05/assets/md-B06fpXsZ2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,_ as r,bt as i,v as a,vt as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./RnnGlyph-DxX0mQto.js";import{t as d}from"./section-CLxRKQ9Y.js";var f={style:{position:`absolute`,right:`4.5rem`,top:`50%`,transform:`translateY(-50%)`}},p={__name:`slides.md__slidev_66`,setup(p){let{$slidev:m,$nav:h,$clicksContext:g,$clicks:_,$page:v,$renderContext:y,$frontmatter:b}=c();return g.setup(),(c,p)=>{let m=u;return s(),a(d,i(t(o(l)(o(b),65))),{default:e(()=>[p[0]||=r(`h1`,null,`Gated cells`,-1),p[1]||=r(`p`,null,`The fix for the fading note: a sealed envelope that only the gates may open.`,-1),r(`div`,f,[n(m,{kind:`gate`,size:190})])]),_:1},16)}}};export{p as default};
lecture-05/assets/md-B5yZyZiw2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,z as u}from"./modules/shiki-CkJq9tSf.js";import{n as d,t as f}from"./slidev/context-DnYiQGy6.js";import{t as p}from"./default-CkTgO_iP.js";import{t as m}from"./RnnGlyph-DxX0mQto.js";var h={class:`grid grid-cols-4 gap-x-4 gap-y-3 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:`mt-4 dl-callout`},w={__name:`slides.md__slidev_124`,setup(w){let{$slidev:T,$nav:E,$clicksContext:D,$clicks:O,$page:k,$renderContext:A,$frontmatter:j}=d();return D.setup(),(d,w)=>{let T=m,E=r(`click`);return u(),c(p,o(t(l(f)(l(j),123))),{default:e(()=>[w[8]||=i(`h1`,null,`Where we got to`,-1),i(`div`,h,[s((u(),a(`div`,g,[n(T,{kind:`sequence`,size:56}),w[0]||=i(`span`,{class:`dl-secondary`},`Order matters: carry one state forward`,-1)])),[[E]]),s((u(),a(`div`,_,[n(T,{kind:`loop`,size:56}),w[1]||=i(`span`,{class:`dl-secondary`},`The same weights at every step`,-1)])),[[E]]),s((u(),a(`div`,v,[n(T,{kind:`fade`,size:56}),w[2]||=i(`span`,{class:`dl-secondary`},`The gradient fades: 0.8²⁰ = 0.012`,-1)])),[[E]]),s((u(),a(`div`,y,[n(T,{kind:`gate`,size:56}),w[3]||=i(`span`,{class:`dl-secondary`},`Gates keep an additive path: 0.99²⁰ = 0.82`,-1)])),[[E]]),s((u(),a(`div`,b,[n(T,{kind:`map`,size:56}),w[4]||=i(`span`,{class:`dl-secondary`},`Words become learned vectors`,-1)])),[[E]]),s((u(),a(`div`,x,[n(T,{kind:`shape`,size:56}),w[5]||=i(`span`,{class:`dl-secondary`},`Batch first, pack, clip`,-1)])),[[E]]),s((u(),a(`div`,S,[n(T,{kind:`generate`,size:56}),w[6]||=i(`span`,{class:`dl-secondary`},`Feed outputs back in; attend to the source`,-1)])),[[E]])]),s((u(),a(`div`,C,[...w[7]||=[i(`p`,null,`Two walls. A fixed-size summary: attention fixes it. Time that cannot run in parallel: still open. Each step waits for the last.`,-1)]])),[[E]])]),_:1},16)}}};export{w as default};
lecture-05/assets/md-BA6--Wmq.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,M as n,S as r,W as i,_ as a,b as o,bt as s,et as c,v as l,vt as u,x as d,z as f}from"./modules/shiki-CkJq9tSf.js";import{n as p,t as m}from"./slidev/context-DnYiQGy6.js";import{t as h}from"./default-CkTgO_iP.js";import{t as g}from"./slidev/VClicks-CNqMVSis.js";import{t as _}from"./slidev/CodeBlockWrapper-CSwO122r.js";var v={class:`grid grid-cols-2 gap-6 dl-tight`},y={class:`dl-callout`},b={__name:`slides.md__slidev_93`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=p();return C.setup(),(p,b)=>{let x=_,S=g,C=i(`click`);return f(),l(h,s(t(u(m)(u(D),92))),{default:e(()=>[b[3]||=a(`h1`,null,`Embeddings in code, and where they come from`,-1),b[4]||=a(`div`,{class:`flex justify-center`},[a(`svg`,{viewBox:`0 0 560 56`,class:`dl-diagram is-sm-h`,role:`img`,"aria-label":`Token ids of shape 2 by 5 go into the embedding table of 20 000 by 64 and come out as vectors of shape 2 by 5 by 64`},[a(`defs`,null,[a(`marker`,{id:`l5c-emb-arrow`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`},[a(`path`,{class:`dl-dg-head`,d:`M0 0 L6 3 L0 6 z`})])]),a(`rect`,{class:`dl-dg-box`,x:`4`,y:`10`,width:`110`,height:`34`,rx:`4`}),a(`text`,{class:`dl-dg-lab is-sm`,x:`59`,y:`32`,"text-anchor":`middle`},`ids (2, 5)`),a(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-emb-arrow)`,d:`M116 27 H170`}),a(`rect`,{class:`dl-dg-box is-accent`,x:`174`,y:`4`,width:`170`,height:`46`,rx:`4`}),a(`text`,{class:`dl-dg-in`,x:`259`,y:`32`,"text-anchor":`middle`},`table 20 000 Γ— 64`),a(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-emb-arrow)`,d:`M346 27 H400`}),a(`rect`,{class:`dl-dg-box`,x:`412`,y:`4`,width:`140`,height:`34`,rx:`4`}),a(`rect`,{class:`dl-dg-box`,x:`404`,y:`12`,width:`140`,height:`34`,rx:`4`}),a(`text`,{class:`dl-dg-lab is-sm`,x:`474`,y:`34`,"text-anchor":`middle`},`vectors (2, 5, 64)`)])],-1),r(x,n({lines:!0},{title:``,ranges:[`all`,`1-2`,`4-5`,`6`,`7`,`all`]}),{default:e(()=>[...b[0]||=[a(`pre`,{class:`shiki shiki-themes vitesse-dark vitesse-light slidev-code`,style:{"--shiki-dark":`#dbd7caee`,"--shiki-light":`#393a34`,"--shiki-dark-bg":`#121212`,"--shiki-light-bg":`#ffffff`}},[a(`code`,{class:`language-python`},[a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`vocab_size`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` embed_dim `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 20_000`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 64`)]),d(`
2
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`embed `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` nn`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`Embedding`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`vocab_size`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` embed_dim`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#BD976A`,"--shiki-light":`#B07D48`}},` padding_idx`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`0`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),d(`
3
+ `),a(`span`,{class:`line`}),d(`
4
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`ids `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` torch`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`tensor`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`([[`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`2`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 17`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 9`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 31`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 4217`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`],`),a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # B: the movie was not great`)]),d(`
5
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},` [`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`2`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 17`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 9`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 4217`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 0`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`]])`),a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # A: the movie was great, padded`)]),d(`
6
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`vectors `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` embed`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`ids`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`),a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # (2, 5, 64)`)]),d(`
7
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#B8A965`,"--shiki-light":`#998418`}},`print`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`embed`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`weight`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`shape`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`),a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # torch.Size([20000, 64])`)])])],-1)]]),_:1},16),a(`div`,v,[a(`div`,null,[r(S,null,{default:e(()=>[...b[1]||=[a(`ul`,null,[a(`li`,null,`Integer ids in, shape (batch, time)`),a(`li`,null,[a(`code`,null,`padding_idx=0`),d(` keeps row 0 at zero`)]),a(`li`,null,`1.28 M learned numbers, starting random`)],-1)]]),_:1})]),c((f(),o(`div`,y,[...b[2]||=[a(`p`,null,[d(`Or start from a table pre-trained on billions of words: `),a(`strong`,null,`word2vec`),d(`, `),a(`strong`,null,`GloVe`),d(`, `),a(`strong`,null,`fastText`),d(`.`)],-1)]])),[[C]])])]),_:1},16)}}};export{b as default};
lecture-05/assets/md-BCvwqRh4.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_85`,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,r(t(a(l)(a(v),84))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Poll: what is left after fifty steps?`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The question: an LSTM unit runs 50 steps with forget = 1 and input = 0. What 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`,null,`c`),n(`mn`,null,`50`)])]),n(`annotation`,{encoding:`application/x-tex`},`c_{50}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`c`),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`},`50`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`?`)]),n(`p`,null,[n(`strong`,null,[o(`The answer 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`,null,`c`),n(`mn`,null,`0`)])]),n(`annotation`,{encoding:`application/x-tex`},`c_0`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`c`),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`},`0`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`, unchanged.`)]),o(` The picture shows why: each step multiplies by 1 and adds 0. So `),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,`c`),n(`mi`,null,`t`)]),n(`mo`,null,`=`),n(`mn`,null,`1`),n(`mo`,null,`β‹…`),n(`msub`,null,[n(`mi`,null,`c`),n(`mrow`,null,[n(`mi`,null,`t`),n(`mo`,null,`βˆ’`),n(`mn`,null,`1`)])]),n(`mo`,null,`+`),n(`mn`,null,`0`),n(`mo`,null,`β‹…`),n(`msub`,null,[n(`mover`,{accent:`true`},[n(`mi`,null,`c`),n(`mo`,null,`~`)]),n(`mi`,null,`t`)]),n(`mo`,null,`=`),n(`msub`,null,[n(`mi`,null,`c`),n(`mrow`,null,[n(`mi`,null,`t`),n(`mo`,null,`βˆ’`),n(`mn`,null,`1`)])])]),n(`annotation`,{encoding:`application/x-tex`},`c_t = 1 \\cdot c_{t-1} + 0 \\cdot \\tilde{c}_t = c_{t-1}`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`c`),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":`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`},`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.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`),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.7917em`,"vertical-align":`-0.2083em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`c`),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 mathnormal mtight`},`t`),n(`span`,{class:`mbin mtight`},`βˆ’`),n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2083em`}},[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.6444em`}}),n(`span`,{class:`mord`},`0`),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.8179em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord katex-accent`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.6679em`}},[n(`span`,{style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord mathnormal`},`c`)]),n(`span`,{style:{top:`-3.35em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`accent-body`,style:{left:`-0.1944em`}},[n(`span`,{class:`mord`},`~`)])])])])])]),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":`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`},`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.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.2083em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`c`),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 mathnormal mtight`},`t`),n(`span`,{class:`mbin mtight`},`βˆ’`),n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2083em`}},[n(`span`)])])])])])])])]),o(`, fifty times over. The gradient travels back the same way, multiplied by exactly 1 at each step.`)]),n(`p`,null,`Why the other answers are wrong:`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Zero:`),o(` nothing shrinks it, because the factor is 1, not less than 1.`)]),n(`li`,null,[n(`strong`,null,`Saturates:`),o(` a state fills up only when input keeps being added. Here input is 0.`)]),n(`li`,null,[n(`strong`,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,`tanh`),n(`mo`,null,`⁑`),n(`mo`,{stretchy:`false`},`(`),n(`msub`,null,[n(`mi`,null,`c`),n(`mn`,null,`0`)]),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`\\tanh(c_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:`mop`},`tanh`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`c`),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`},`0`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mclose`},`)`)])])]),o(`:`)]),o(),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,`tanh`),n(`mo`,null,`⁑`)]),n(`annotation`,{encoding:`application/x-tex`},`\\tanh`)])])]),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:`mop`},`tanh`)])])]),o(` is applied on the way out 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(`mi`,null,`h`)]),n(`annotation`,{encoding:`application/x-tex`},`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 mathnormal`},`h`)])])]),o(`, never 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(`mi`,null,`c`)]),n(`annotation`,{encoding:`application/x-tex`},`c`)])])]),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`},`c`)])])]),o(` itself.`)])])],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BDAYagSu.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_83`,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,r(t(a(l)(a(v),82))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Which one, and the sign that will catch you`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The bars count the weights of one layer with 64 inputs and 128 hidden units, drawn to scale.`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Plain RNN:`),o(` 24 832 weights, one set.`)]),n(`li`,null,[n(`strong`,null,`GRU:`),o(` 74 496, three sets.`)]),n(`li`,null,[n(`strong`,null,`LSTM:`),o(` 99 328, four sets.`)])]),n(`p`,null,`Which to use? On long sequences either gated cell does better than the plain RNN. Between the two, accuracy is usually within a point, so pick one and move on.`),n(`p`,null,[n(`strong`,null,`The sign trap.`),o(` 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(`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.4306em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`)])])]),o(` means how much to `),n(`strong`,null,`update`),o(`. Cho’s paper and PyTorch’s `),n(`code`,null,`nn.GRU`),o(` write `),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,`h`),n(`mi`,null,`t`)]),n(`mo`,null,`=`),n(`mi`,null,`z`),n(`mtext`,null,` `),n(`msub`,null,[n(`mi`,null,`h`),n(`mrow`,null,[n(`mi`,null,`t`),n(`mo`,null,`βˆ’`),n(`mn`,null,`1`)])]),n(`mo`,null,`+`),n(`mo`,{stretchy:`false`},`(`),n(`mn`,null,`1`),n(`mo`,null,`βˆ’`),n(`mi`,null,`z`),n(`mo`,{stretchy:`false`},`)`),n(`mtext`,null,` `),n(`msub`,null,[n(`mover`,{accent:`true`},[n(`mi`,null,`h`),n(`mo`,null,`~`)]),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`h_t = z\\,h_{t-1} + (1-z)\\,\\tilde{h}_t`)])])]),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`},`h`),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":`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`},`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.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.9028em`,"vertical-align":`-0.2083em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathnormal`},`h`),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 mathnormal mtight`},`t`),n(`span`,{class:`mbin mtight`},`βˆ’`),n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2083em`}},[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:`mopen`},`(`),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:`1.1813em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`),n(`span`,{class:`mclose`},`)`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord katex-accent`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.9313em`}},[n(`span`,{style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord mathnormal`},`h`)]),n(`span`,{style:{top:`-3.6134em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`accent-body`,style:{left:`-0.25em`}},[n(`span`,{class:`mord`},`~`)])])])])])]),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":`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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`, so there `),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.4306em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`)])])]),o(` means how much to `),n(`strong`,null,`keep`),o(`. It is the same model, with the gate’s meaning flipped.`)])],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BIJiSmmn2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_114`,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,r(t(a(l)(a(v),113))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Generating one step at a time`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`One next-word model, used in two ways. Read each panel bottom to top.`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Left, training.`),o(` The inputs are the true words of review B: `),n(`em`,null,`the movie was not`),o(`. Each prediction is compared with the true next word: one loss per step. This is `),n(`strong`,null,`teacher forcing`),o(`. One forward call covers the review.`)]),n(`li`,null,[n(`strong`,null,`Right, generating.`),o(` No true review exists. Only `),n(`em`,null,`the`),o(` goes in; each guess is fed back as the next input.`)])]),n(`p`,null,[o(`One wrong guess changes every later input. This gap between training and generating is called `),n(`strong`,null,`exposure bias`),o(`.`)])],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BJirPl8n.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.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,r(t(a(l)(a(v),72))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: The six equations`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The LSTM looks like six equations, but four of them are the same layer.`),n(`ol`,null,[n(`li`,null,[n(`strong`,null,`Three gates:`),o(` forget `),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`},`f`),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{f}_t`)])])]),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`,style:{"margin-right":`0.109em`}},`f`),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.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 mathnormal mtight`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`, 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(`msub`,null,[n(`mi`,{mathvariant:`bold`},`i`),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{i}_t`)])])]),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`},`i`),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":`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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`, 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`,{mathvariant:`bold`},`o`),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{o}_t`)])])]),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`},`o`),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":`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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`. Each 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,`Οƒ`),n(`mo`,{stretchy:`false`},`(`),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`x`)]),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`x`),n(`mi`,null,`t`)]),n(`mo`,null,`+`),n(`msub`,null,[n(`mi`,null,`W`),n(`mi`,null,`h`)]),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`h`),n(`mrow`,null,[n(`mi`,null,`t`),n(`mo`,null,`βˆ’`),n(`mn`,null,`1`)])]),n(`mo`,null,`+`),n(`mi`,{mathvariant:`bold`},`b`),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`\\sigma(W_x\\mathbf{x}_t + W_h\\mathbf{h}_{t-1} + \\mathbf{b})`)])])]),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 mathnormal`,style:{"margin-right":`0.0359em`}},`Οƒ`),n(`span`,{class:`mopen`},`(`),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.1514em`}},[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`},`x`)])])]),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 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.2806em`}},[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`},`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.9028em`,"vertical-align":`-0.2083em`}}),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.3361em`}},[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`},`h`)])])]),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 mathbf`},`h`),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 mathnormal mtight`},`t`),n(`span`,{class:`mbin mtight`},`βˆ’`),n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2083em`}},[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 mathbf`},`b`),n(`span`,{class:`mclose`},`)`)])])]),o(` with its own weights. The sigmoid `),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`}},`Οƒ`)])])]),o(` gives a fraction between 0 and 1.`)]),n(`li`,null,[n(`strong`,null,`The candidate`),o(),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(`mover`,{accent:`true`},[n(`mi`,{mathvariant:`bold`},`c`),n(`mo`,null,`~`)]),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\tilde{\\mathbf{c}}_t`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8313em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord katex-accent`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.6813em`}},[n(`span`,{style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord mathbf`},`c`)]),n(`span`,{style:{top:`-3.3634em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`accent-body`,style:{left:`-0.25em`}},[n(`span`,{class:`mord`},`~`)])])])])])]),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":`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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`: the same layer 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(`mi`,null,`tanh`),n(`mo`,null,`⁑`)]),n(`annotation`,{encoding:`application/x-tex`},`\\tanh`)])])]),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:`mop`},`tanh`)])])]),o(`, so the new content can be negative.`)]),n(`li`,null,[n(`strong`,null,`Cell update:`),o(),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`},`c`),n(`mi`,null,`t`)]),n(`mo`,null,`=`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`f`),n(`mi`,null,`t`)]),n(`mo`,null,`βŠ™`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`c`),n(`mrow`,null,[n(`mi`,null,`t`),n(`mo`,null,`βˆ’`),n(`mn`,null,`1`)])]),n(`mo`,null,`+`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`i`),n(`mi`,null,`t`)]),n(`mo`,null,`βŠ™`),n(`msub`,null,[n(`mover`,{accent:`true`},[n(`mi`,{mathvariant:`bold`},`c`),n(`mo`,null,`~`)]),n(`mi`,null,`t`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{c}_t = \\mathbf{f}_t \\odot \\mathbf{c}_{t-1} + \\mathbf{i}_t \\odot \\tilde{\\mathbf{c}}_t`)])])]),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`},`c`),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":`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`},`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.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`,style:{"margin-right":`0.109em`}},`f`),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.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 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.7917em`,"vertical-align":`-0.2083em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`c`),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 mathnormal mtight`},`t`),n(`span`,{class:`mbin mtight`},`βˆ’`),n(`span`,{class:`mord mtight`},`1`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.2083em`}},[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`},`i`),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":`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`},`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.8313em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord katex-accent`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.6813em`}},[n(`span`,{style:{top:`-3em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`mord mathbf`},`c`)]),n(`span`,{style:{top:`-3.3634em`}},[n(`span`,{class:`pstrut`,style:{height:`3em`}}),n(`span`,{class:`accent-body`,style:{left:`-0.25em`}},[n(`span`,{class:`mord`},`~`)])])])])])]),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":`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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(`. Keep part of the old memory, add part of the new. `),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(`annotation`,{encoding:`application/x-tex`},`\\odot`)])])]),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`},`βŠ™`)])])]),o(` multiplies unit by unit.`)]),n(`li`,null,[n(`strong`,null,`Output:`),o(),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`},`h`),n(`mi`,null,`t`)]),n(`mo`,null,`=`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`o`),n(`mi`,null,`t`)]),n(`mo`,null,`βŠ™`),n(`mi`,null,`tanh`),n(`mo`,null,`⁑`),n(`mo`,{stretchy:`false`},`(`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`c`),n(`mi`,null,`t`)]),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}_t = \\mathbf{o}_t \\odot \\tanh(\\mathbf{c}_t)`)])])]),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`},`h`),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":`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`},`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.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.7333em`,"vertical-align":`-0.15em`}}),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`o`),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":`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`},`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:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mop`},`tanh`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`c`),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":`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`},`t`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mclose`},`)`)])])]),o(`.`)])]),n(`p`,null,[o(`Worked forget gate: `),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(`mo`,{stretchy:`false`},`(`),n(`mn`,null,`1.5`),n(`mo`,null,`β‹…`),n(`mn`,null,`1`),n(`mo`,null,`+`),n(`mn`,null,`0.8`),n(`mo`,null,`β‹…`),n(`mn`,null,`0.5`),n(`mo`,null,`+`),n(`mn`,null,`0.3`),n(`mo`,{stretchy:`false`},`)`),n(`mo`,null,`=`),n(`mi`,null,`Οƒ`),n(`mo`,{stretchy:`false`},`(`),n(`mn`,null,`2.2`),n(`mo`,{stretchy:`false`},`)`),n(`mo`,null,`=`),n(`mn`,null,`0.90`)]),n(`annotation`,{encoding:`application/x-tex`},`\\sigma(1.5 \\cdot 1 + 0.8 \\cdot 0.5 + 0.3) = \\sigma(2.2) = 0.90`)])])]),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 mathnormal`,style:{"margin-right":`0.0359em`}},`Οƒ`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},`1.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.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`},`0.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`},`0.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:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`0.3`),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:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`Οƒ`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},`2.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:`0.6444em`}}),n(`span`,{class:`mord`},`0.90`)])])]),o(`.`)])],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BKUC5yo2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,St as r,V as i,W as a,_ as o,b as s,bt as c,et as l,m as u,v as d,vt as f,x as p,z as m}from"./modules/shiki-CkJq9tSf.js";import{n as h,t as g}from"./slidev/context-DnYiQGy6.js";import{t as _}from"./slidev/VClicks-CNqMVSis.js";import{t as v}from"./interactive-Dm0CtntL.js";import{t as y}from"./EmbeddingLab-ykKavple.js";var b={viewBox:`0 0 280 78`,class:`dl-diagram`,role:`img`,"aria-label":`The toy table: the, movie and was map to 0, 0; not maps to 0, 1; great maps to 1, 0`},x=[`y`],S=[`y`],C=[`y`],w=[`y`],T=[`y`],E={class:`mt-2 dl-callout`},D={__name:`slides.md__slidev_89`,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=_,A=a(`click`);return m(),d(v,c(t(f(g)(f(P),88))),{aside:e(t=>[D[2]||=o(`p`,null,[p(`Our review’s table was `),o(`strong`,null,`set by hand`),p(`:`)],-1),(m(),s(`svg`,b,[(m(),s(u,null,i([[`the, movie, was`,`0`,`0`],[`not`,`0`,`1`],[`great`,`1`,`0`]],(e,t)=>o(`g`,{key:`l5c-toy${t}`},[o(`text`,{class:`dl-dg-small`,x:`132`,y:20+t*24,"text-anchor":`end`},r(e[0]),9,x),o(`rect`,{class:`dl-dg-box is-accent`,x:`142`,y:6+t*24,width:`44`,height:`20`,rx:`2`},null,8,S),o(`rect`,{class:`dl-dg-box is-accent`,x:`190`,y:6+t*24,width:`44`,height:`20`,rx:`2`},null,8,C),o(`text`,{class:`dl-dg-in`,x:`164`,y:21+t*24,"text-anchor":`middle`},r(e[1]),9,w),o(`text`,{class:`dl-dg-in`,x:`212`,y:21+t*24,"text-anchor":`middle`},r(e[2]),9,T)])),64))])),n(k,null,{default:e(()=>[...D[0]||=[o(`ul`,null,[o(`li`,null,[p(`The widget: a `),o(`strong`,null,`different, bigger`),p(` table, 9 words Γ— 4 numbers`)]),o(`li`,null,[p(`Real: 20 000 rows of `),o(`strong`,null,`64 learned`),p(` numbers`)])],-1)]]),_:1}),l((m(),s(`div`,E,[...D[1]||=[o(`p`,null,`One-hot times the table picks a row. So it trains like any layer.`,-1)]])),[[A]])]),default:e(()=>[n(O)]),_:1},16)}}};export{D as default};
lecture-05/assets/md-BK_KSB2L2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,V as n,W as r,_ as i,b as a,bt as o,et as s,m as c,v as l,vt as u,x as d,z as f}from"./modules/shiki-CkJq9tSf.js";import{n as p,t as m}from"./slidev/context-DnYiQGy6.js";import{t as h}from"./default-CkTgO_iP.js";var g={viewBox:`0 0 640 190`,class:`dl-diagram`,role:`img`,"aria-label":`Top: review B read word by word, with a window of the last three words, movie was not, used to predict the next word. Bottom: in a long review the word not is fifteen words before great, outside the window of three`},_=[`x`],v={class:`mt-3 dl-callout`},y={__name:`slides.md__slidev_5`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=p();return S.setup(),(p,y)=>{let b=r(`click`);return f(),l(h,o(t(u(m)(u(E),4))),{default:e(()=>[y[23]||=i(`h1`,null,`One step at a time, through a window`,-1),(f(),a(`svg`,g,[y[8]||=i(`text`,{class:`dl-dg-small`,x:`30`,y:`14`},`Review B`,-1),y[9]||=i(`rect`,{class:`dl-dg-box`,x:`30`,y:`30`,width:`100`,height:`34`,rx:`4`},null,-1),y[10]||=i(`rect`,{class:`dl-dg-box`,x:`146`,y:`30`,width:`100`,height:`34`,rx:`4`},null,-1),y[11]||=i(`rect`,{class:`dl-dg-box`,x:`262`,y:`30`,width:`100`,height:`34`,rx:`4`},null,-1),y[12]||=i(`rect`,{class:`dl-dg-box`,x:`378`,y:`30`,width:`100`,height:`34`,rx:`4`},null,-1),y[13]||=i(`rect`,{class:`dl-dg-box is-accent`,x:`494`,y:`30`,width:`100`,height:`34`,rx:`4`},null,-1),y[14]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`80`,y:`52`,"text-anchor":`middle`},`the`,-1),y[15]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`196`,y:`52`,"text-anchor":`middle`},`movie`,-1),y[16]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`312`,y:`52`,"text-anchor":`middle`},`was`,-1),y[17]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`428`,y:`52`,"text-anchor":`middle`},`not`,-1),y[18]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`544`,y:`52`,"text-anchor":`middle`},`?`,-1),y[19]||=i(`rect`,{class:`dl-dg-line`,x:`140`,y:`24`,width:`344`,height:`46`,rx:`6`},null,-1),y[20]||=i(`text`,{class:`dl-dg-small`,x:`146`,y:`86`},`window of 3`,-1),y[21]||=i(`text`,{class:`dl-dg-small`,x:`544`,y:`86`,"text-anchor":`middle`},`next word`,-1),s((f(),a(`g`,null,[y[0]||=i(`text`,{class:`dl-dg-small`,x:`30`,y:`114`},`5 words, or 500`,-1),y[1]||=i(`rect`,{class:`dl-dg-box is-accent`,x:`30`,y:`124`,width:`50`,height:`28`,rx:`3`},null,-1),y[2]||=i(`text`,{class:`dl-dg-small`,x:`55`,y:`142`,"text-anchor":`middle`},`not`,-1),(f(),a(c,null,n(14,e=>i(`rect`,{key:e,class:`dl-dg-box`,x:60+e*28,y:`124`,width:`22`,height:`28`,rx:`2`},null,8,_)),64)),y[3]||=i(`rect`,{class:`dl-dg-box`,x:`482`,y:`124`,width:`70`,height:`28`,rx:`3`},null,-1),y[4]||=i(`text`,{class:`dl-dg-small`,x:`517`,y:`142`,"text-anchor":`middle`},`great`,-1),y[5]||=i(`rect`,{class:`dl-dg-line`,x:`391`,y:`119`,width:`88`,height:`38`,rx:`4`},null,-1),y[6]||=i(`text`,{class:`dl-dg-small`,x:`395`,y:`174`},`window of 3`,-1),y[7]||=i(`text`,{class:`dl-dg-small is-bad`,x:`30`,y:`174`},`not is 15 words back: outside the window`,-1)])),[[b]])])),y[24]||=i(`p`,null,[d(`A fixed window cannot see a `),i(`em`,null,`not`),d(` further back. And a review can be any length.`)],-1),s((f(),a(`div`,v,[...y[22]||=[i(`p`,null,[d(`Today’s question: keep a `),i(`strong`,null,`running summary`),d(` instead of a window.`)],-1)]])),[[b]])]),_:1},16)}}};export{y as default};
lecture-05/assets/md-BLRwEhJ2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.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,r(t(a(l)(a(v),78))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Where the LSTM came from`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The timeline reads left to right, one dot per milestone.`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`1991:`),o(` the vanishing gradient is described.`)]),n(`li`,null,[n(`strong`,null,`1997:`),o(` the LSTM is built to fix it. Its key part is the additive cell state.`)]),n(`li`,null,[n(`strong`,null,`2000:`),o(` the forget gate is added. This dot is highlighted, because the gate was not in the first design.`)]),n(`li`,null,[n(`strong`,null,`2014:`),o(` the GRU arrives, with fewer parts.`)])]),n(`p`,null,`Why the forget gate mattered: the 1997 cell could write and read, but never clear. So on a long input the memory kept growing until it saturated and stopped responding.`),n(`p`,null,`After that fix, the LSTM was the standard model for sequences for about twenty years.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BNzXX7Lr2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,V as r,W as i,_ as a,b as o,bt as s,et as c,m as l,v as u,vt as d,x as f,y as p,yt as m,z as h}from"./modules/shiki-CkJq9tSf.js";import{n as g,t as _}from"./slidev/context-DnYiQGy6.js";import{t as v}from"./default-CkTgO_iP.js";import{t as y}from"./slidev/KaTexBlockWrapper-BUTSeX36.js";var b={class:`grid grid-cols-2 gap-10 mt-1 dl-tight`},x={viewBox:`0 0 300 76`,class:`dl-diagram is-sm`,role:`img`,"aria-label":`Five cells in a chain; only the last one feeds a loss`},S=[`x`],C=[`d`],w={class:`dl-math-sm`},T={viewBox:`0 0 300 76`,class:`dl-diagram is-sm`,role:`img`,"aria-label":`Five cells in a chain; every one feeds its own loss`},E=[`x`],D=[`d`],O=[`d`],k=[`x`],A={class:`dl-math-sm`},j={class:`mt-3 dl-callout`},M={__name:`slides.md__slidev_48`,setup(M){let{$slidev:N,$nav:P,$clicksContext:F,$clicks:I,$page:L,$renderContext:R,$frontmatter:z}=g();return F.setup(),(g,M)=>{let N=y,P=i(`click`);return h(),u(v,s(t(d(_)(d(z),47))),{default:e(()=>[M[9]||=a(`h1`,null,`The loss for a whole sequence`,-1),a(`div`,b,[a(`div`,null,[M[4]||=a(`h3`,null,`One label per review`,-1),(h(),o(`svg`,x,[(h(),o(l,null,r(5,e=>a(`g`,{key:e},[a(`rect`,{x:6+(e-1)*58,y:`34`,width:`40`,height:`28`,rx:`4`,class:m(e===5?`dl-dg-box is-accent`:`dl-dg-box`)},null,10,S),e<5?(h(),o(`path`,{key:0,d:`M${46+(e-1)*58} 48 H${64+(e-1)*58}`,class:`dl-dg-arrow`},null,8,C)):p(`v-if`,!0)])),64)),M[0]||=a(`path`,{d:`M258 32 V18`,class:`dl-dg-loss`},null,-1),M[1]||=a(`text`,{x:`258`,y:`12`,"text-anchor":`middle`,class:`dl-dg-small is-bad`},`β„“`,-1)])),a(`div`,w,[n(N,{ranges:[]},{default:e(()=>[...M[2]||=[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(`mi`,{mathvariant:`normal`},`β„“`),a(`mtext`,null,` ⁣`),a(`mrow`,null,[a(`mo`,{fence:`true`},`(`),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`o`),a(`mi`,null,`T`)]),a(`mo`,{separator:`true`},`,`),a(`mtext`,null,`β€…β€Š`),a(`mi`,null,`y`),a(`mo`,{fence:`true`},`)`)])]),a(`annotation`,{encoding:`application/x-tex`},`L = \\ell\\!\\left(\\mathbf{o}_T,\\; y\\right)`)])])]),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:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mord`},`β„“`),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:`mord`},[a(`span`,{class:`mord mathbf`},`o`),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":`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.1389em`}},`T`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),a(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},`)`)])])])])])],-1)]]),_:1})]),c((h(),o(`div`,null,[...M[3]||=[a(`p`,null,[f(`One term, at the last word. Review B: `),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`},`β„“`),a(`mo`,null,`=`),a(`mo`,null,`βˆ’`),a(`mi`,null,`ln`),a(`mo`,null,`⁑`),a(`mn`,null,`0.78`),a(`mo`,null,`=`),a(`mn`,null,`0.25`)]),a(`annotation`,{encoding:`application/x-tex`},`\\ell = -\\ln 0.78 = 0.25`)])])]),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:`mord`},`β„“`),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.7778em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord`},`βˆ’`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mop`},`ln`),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord`},`0.78`),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.25`)])])]),f(`.`)],-1)]])),[[P]])]),a(`div`,null,[M[7]||=a(`h3`,null,`One label per word`,-1),(h(),o(`svg`,T,[(h(),o(l,null,r(5,e=>a(`g`,{key:e},[a(`rect`,{x:6+(e-1)*58,y:`34`,width:`40`,height:`28`,rx:`4`,class:`dl-dg-box is-accent`},null,8,E),e<5?(h(),o(`path`,{key:0,d:`M${46+(e-1)*58} 48 H${64+(e-1)*58}`,class:`dl-dg-arrow`},null,8,D)):p(`v-if`,!0),a(`path`,{d:`M${26+(e-1)*58} 32 V18`,class:`dl-dg-loss`},null,8,O),a(`text`,{x:26+(e-1)*58,y:`12`,"text-anchor":`middle`,class:`dl-dg-small is-bad`},`β„“`,8,k)])),64))])),a(`div`,A,[n(N,{ranges:[]},{default:e(()=>[...M[5]||=[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(`mfrac`,null,[a(`mn`,null,`1`),a(`mi`,null,`T`)]),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(`mi`,{mathvariant:`normal`},`β„“`),a(`mtext`,null,` ⁣`),a(`mrow`,null,[a(`mo`,{fence:`true`},`(`),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`o`),a(`mi`,null,`t`)]),a(`mo`,{separator:`true`},`,`),a(`mtext`,null,`β€…β€Š`),a(`msub`,null,[a(`mi`,null,`y`),a(`mi`,null,`t`)]),a(`mo`,{fence:`true`},`)`)])]),a(`annotation`,{encoding:`application/x-tex`},`L = \\frac{1}{T}\\sum_{t=1}^{T} \\ell\\!\\left(\\mathbf{o}_t,\\; y_t\\right)`)])])]),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:`3.0954em`,"vertical-align":`-1.2671em`}}),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.3214em`}},[a(`span`,{style:{top:`-2.314em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])]),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.677em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord`},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.686em`}},[a(`span`)])])])]),a(`span`,{class:`mclose nulldelimiter`})]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),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:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`minner`},[a(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},`(`),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`o`),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:`mpunct`},`,`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),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 delimcenter`,style:{top:`0em`}},`)`)])])])])])],-1)]]),_:1})]),c((h(),o(`div`,null,[...M[6]||=[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`,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`)])])]),f(` terms, averaged. Each is a cross-entropy.`)],-1)]])),[[P]])])]),c((h(),o(`div`,j,[...M[8]||=[a(`p`,null,[f(`Either way, `),a(`strong`,null,`one`),f(` set of weights receives gradient from `),a(`strong`,null,`every`),f(` term.`)],-1)]])),[[P]])]),_:1},16)}}};export{M as default};
lecture-05/assets/md-BPWudfVY.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,St as n,V as r,W as i,_ as a,b as o,bt as s,et as c,m as l,v as u,vt as d,x as f,z as p}from"./modules/shiki-CkJq9tSf.js";import{n as m,t as h}from"./slidev/context-DnYiQGy6.js";import{t as g}from"./default-CkTgO_iP.js";var _={class:`dl-diagram mt-2`,viewBox:`0 0 600 168`,role:`img`,"aria-label":`Three shape strips. Default: T 200, B 32, F 64. batch_first=True: B 32, T 200, F 64. The trap: a batch-first tensor read by the default layer becomes T 32, B 200.`},v=[`x`],y=[`x`],b=[`x`],x=[`x`],S=[`x`],C=[`x`],w=[`x`],T=[`x`],E=[`x`],D={class:`mt-2 dl-callout`},O={class:`mt-2 dl-secondary`},k={__name:`slides.md__slidev_96`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=m();return M.setup(),(m,k)=>{let A=i(`click`);return p(),u(g,s(t(d(h)(d(I),95))),{default:e(()=>[k[7]||=a(`h1`,null,`The shape that causes the most bugs`,-1),k[8]||=a(`p`,null,`32 reviews (B) of 200 words (T), 64 numbers per word (F). Which axis is time?`,-1),(p(),o(`svg`,_,[k[2]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`0`,y:`22`},`default`,-1),k[3]||=a(`text`,{class:`dl-dg-small`,x:`0`,y:`38`},`batch_first=False`,-1),(p(),o(l,null,r([[`T`,`200`],[`B`,`32`],[`F`,`64`]],(e,t)=>a(`g`,{key:`r1${t}`},[a(`rect`,{class:`dl-dg-box`,x:190+t*130,y:`4`,width:`120`,height:`40`,rx:`5`},null,8,v),a(`text`,{class:`dl-dg-lab is-sm`,x:232+t*130,y:`29`,"text-anchor":`middle`},n(e[0]),9,y),a(`text`,{class:`dl-dg-small`,x:262+t*130,y:`29`,"text-anchor":`middle`},n(e[1]),9,b)])),64)),k[4]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`0`,y:`80`},`batch_first=True`,-1),(p(),o(l,null,r([[`B`,`32`],[`T`,`200`],[`F`,`64`]],(e,t)=>a(`g`,{key:`r2${t}`},[a(`rect`,{class:`dl-dg-box is-accent`,x:190+t*130,y:`62`,width:`120`,height:`40`,rx:`5`},null,8,x),a(`text`,{class:`dl-dg-lab is-sm`,x:232+t*130,y:`87`,"text-anchor":`middle`},n(e[0]),9,S),a(`text`,{class:`dl-dg-small`,x:262+t*130,y:`87`,"text-anchor":`middle`},n(e[1]),9,C)])),64)),c((p(),o(`g`,null,[k[0]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`0`,y:`138`},`the trap`,-1),k[1]||=a(`text`,{class:`dl-dg-small is-bad`,x:`0`,y:`154`},`flag left out`,-1),(p(),o(l,null,r([[`T`,`32`],[`B`,`200`],[`F`,`64`]],(e,t)=>a(`g`,{key:`r3${t}`},[a(`rect`,{class:`dl-dg-box is-bad`,x:190+t*130,y:`120`,width:`120`,height:`40`,rx:`5`},null,8,w),a(`text`,{class:`dl-dg-lab is-sm`,x:232+t*130,y:`145`,"text-anchor":`middle`},n(e[0]),9,T),a(`text`,{class:`dl-dg-small is-bad`,x:262+t*130,y:`145`,"text-anchor":`middle`},n(e[1]),9,E)])),64))])),[[A]])])),c((p(),o(`div`,D,[...k[5]||=[a(`p`,null,[f(`Pass `),a(`code`,null,`batch_first=True`),f(`. Without it the model still trains, but reads 32 reviews as 32 time steps, with no error.`)],-1)]])),[[A]]),c((p(),o(`div`,O,[...k[6]||=[a(`p`,null,[f(`Exception: `),a(`code`,null,`h_n`),f(` is always (layers Γ— directions, B, hidden).`)],-1)]])),[[A]])]),_:1},16)}}};export{k as default};
lecture-05/assets/md-BQK1FZpL.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,V as n,W as r,_ as i,b as a,bt as o,et as s,m as c,v as l,vt as u,x as d,z as f}from"./modules/shiki-CkJq9tSf.js";import{n as p,t as m}from"./slidev/context-DnYiQGy6.js";import{t as h}from"./default-CkTgO_iP.js";var g={class:`dl-diagram mx-auto`,viewBox:`0 0 600 64`,style:{"max-height":`4.2rem`},role:`img`,"aria-label":`A slab 32 by 200 by 64 becomes a flat 32 by 128 after the LSTM, then 32 by 2 after the linear layer.`},_=[`x`,`y`],v={class:`mt-2 dl-callout`},y={__name:`slides.md__slidev_106`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=p();return S.setup(),(p,y)=>{let b=r(`click`);return f(),l(h,o(t(u(m)(u(E),105))),{default:e(()=>[y[11]||=i(`h1`,null,`Shapes, end to end`,-1),(f(),a(`svg`,g,[y[0]||=i(`defs`,null,[i(`marker`,{id:`l5d-head-ledger`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[i(`path`,{d:`M0 0 L7 3.5 L0 7 z`,class:`dl-dg-head`})])],-1),(f(),a(c,null,n(3,e=>i(`rect`,{key:e,class:`dl-dg-box`,x:10+(e-1)*8,y:4+(e-1)*6,width:`150`,height:`40`,rx:`3`},null,8,_)),64)),y[1]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`101`,y:`40`,"text-anchor":`middle`},`32Γ—200Γ—64`,-1),y[2]||=i(`path`,{class:`dl-dg-arrow`,d:`M182 32 H262`,"marker-end":`url(#l5d-head-ledger)`},null,-1),y[3]||=i(`text`,{class:`dl-dg-small`,x:`222`,y:`24`,"text-anchor":`middle`},`LSTM`,-1),y[4]||=i(`rect`,{class:`dl-dg-box is-accent`,x:`270`,y:`16`,width:`120`,height:`30`,rx:`3`},null,-1),y[5]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`330`,y:`36`,"text-anchor":`middle`},`32Γ—128`,-1),y[6]||=i(`path`,{class:`dl-dg-arrow`,d:`M396 32 H466`,"marker-end":`url(#l5d-head-ledger)`},null,-1),y[7]||=i(`text`,{class:`dl-dg-small`,x:`431`,y:`24`,"text-anchor":`middle`},`Linear`,-1),y[8]||=i(`rect`,{class:`dl-dg-box`,x:`474`,y:`16`,width:`70`,height:`30`,rx:`3`},null,-1),y[9]||=i(`text`,{class:`dl-dg-lab is-sm`,x:`509`,y:`36`,"text-anchor":`middle`},`32Γ—2`,-1)])),y[12]||=i(`div`,{class:`dl-ledger dl-tight`},[i(`table`,null,[i(`thead`,null,[i(`tr`,null,[i(`th`,null,`step`),i(`th`,null,`shape`),i(`th`,null,`what it is`)])]),i(`tbody`,null,[i(`tr`,null,[i(`td`,null,[i(`code`,null,`ids`)]),i(`td`,null,[i(`code`,null,`(32, 200)`)]),i(`td`,null,`padded token ids`)]),i(`tr`,null,[i(`td`,null,[i(`code`,null,`lengths`)]),i(`td`,null,[i(`code`,null,`(32,)`)]),i(`td`,null,`real lengths`)]),i(`tr`,null,[i(`td`,null,[i(`code`,null,`embed(ids)`)]),i(`td`,null,[i(`code`,null,`(32, 200, 64)`)]),i(`td`,null,`a vector per token`)]),i(`tr`,null,[i(`td`,null,[i(`code`,null,`lstm(packed)`),d(` β†’ `),i(`code`,null,`output`)]),i(`td`,null,[d(`packed; unpacked `),i(`code`,null,`(32, ≀200, 128)`)]),i(`td`,null,`state at every step`)]),i(`tr`,null,[i(`td`,null,[i(`code`,null,`lstm(packed)`),d(` β†’ `),i(`code`,null,`h_n`)]),i(`td`,null,[i(`code`,null,`(1, 32, 128)`)]),i(`td`,null,`state after the last real token`)]),i(`tr`,null,[i(`td`,null,[i(`code`,null,`h_n[-1]`)]),i(`td`,null,[i(`code`,null,`(32, 128)`)]),i(`td`,null,`one vector per review`)]),i(`tr`,null,[i(`td`,null,[i(`code`,null,`head(…)`)]),i(`td`,null,[i(`code`,null,`(32, 2)`)]),i(`td`,null,`logits`)])])])],-1),s((f(),a(`div`,v,[...y[10]||=[i(`p`,null,`Test first: push one batch of random ids through the model.`,-1)]])),[[b]])]),_:1},16)}}};export{y as default};
lecture-05/assets/md-BRFy5aDW.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.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,r(t(a(l)(a(v),7))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Two reviews, one word apart`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`These two reviews are the running example for the whole lecture.`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Review A`),o(`, `),n(`em`,null,`the movie was great`),o(`, is positive.`)]),n(`li`,null,[n(`strong`,null,`Review B`),o(`, `),n(`em`,null,`the movie was not great`),o(`, is negative.`)])]),n(`p`,null,[o(`They differ only in the highlighted `),n(`em`,null,`not`),o(`. On its own, `),n(`em`,null,`not`),o(` has no sentiment. It flips the meaning of the word `),n(`strong`,null,`after`),o(` it.`)]),n(`p`,null,[o(`The chart shows a toy `),n(`strong`,null,`embedding`),o(`: two numbers per word. Dimension 1 means "positive", and dimension 2 means "negation". The words `),n(`em`,null,`the`),o(`, `),n(`em`,null,`movie`),o(` and `),n(`em`,null,`was`),o(` sit at `),n(`span`,null,`0, 0`),o(`. `),n(`em`,null,`great`),o(` sits at `),n(`span`,null,`1, 0`),o(`, and `),n(`em`,null,`not`),o(` at `),n(`span`,null,`0, 1`),o(`.`)]),n(`p`,null,`The model therefore has to keep some memory of earlier words as it reads.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BTXwqNmD2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_59`,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,r(t(a(l)(a(v),58))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: And tanh is not helping`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`In the widget, the solid curve is tanh and the dashed curve is its slope, `),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(`mrow`,null,[n(`mi`,null,`tanh`),n(`mo`,null,`⁑`)]),n(`mo`,{mathvariant:`normal`,lspace:`0em`,rspace:`0em`},`β€²`)])]),n(`annotation`,{encoding:`application/x-tex`},`\\tanh'`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8362em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mop`},`tanh`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8362em`}},[n(`span`,{style:{top:`-3.1473em`,"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`},`β€²`)])])])])])])])])])])]),o(`.`)]),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`The slope peaks at 1`),o(`, at input 0, and falls towards zero on both sides.`)]),n(`li`,null,[n(`strong`,null,`A saturated unit`),o(`, sitting near +1 or βˆ’1, has a slope near zero. It passes almost no gradient back.`)]),n(`li`,null,[n(`strong`,null,`Every backward step`),o(` multiplies by one of these slopes.`)])]),n(`p`,null,[o(`So the real factor per step 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,`W`),n(`mo`,null,`β‹…`),n(`msup`,null,[n(`mrow`,null,[n(`mi`,null,`tanh`),n(`mo`,null,`⁑`)]),n(`mo`,{mathvariant:`normal`,lspace:`0em`,rspace:`0em`},`β€²`)])]),n(`annotation`,{encoding:`application/x-tex`},`W \\cdot \\tanh'`)])])]),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.1389em`}},`W`),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.8362em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mop`},`tanh`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8362em`}},[n(`span`,{style:{top:`-3.1473em`,"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`},`β€²`)])])])])])])])])])])]),o(`, and it is smaller than `),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,`W`)]),n(`annotation`,{encoding:`application/x-tex`},`W`)])])]),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.1389em`}},`W`)])])]),o(`. On the review, the flag unit sits at 0.964 after `),n(`em`,null,`not`),o(`. There `),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(`mrow`,null,[n(`mi`,null,`tanh`),n(`mo`,null,`⁑`)]),n(`mo`,{mathvariant:`normal`,lspace:`0em`,rspace:`0em`},`β€²`)]),n(`mo`,null,`=`),n(`mn`,null,`1`),n(`mo`,null,`βˆ’`),n(`msup`,null,[n(`mn`,null,`0.964`),n(`mn`,null,`2`)]),n(`mo`,null,`=`),n(`mn`,null,`0.07`)]),n(`annotation`,{encoding:`application/x-tex`},`\\tanh' = 1 - 0.964^2 = 0.07`)])])]),n(`span`,{class:`katex-html`,"aria-hidden":`true`},[n(`span`,{class:`katex-base`},[n(`span`,{class:`katex-strut`,style:{height:`0.8362em`}}),n(`span`,{class:`mop`},[n(`span`,{class:`mop`},`tanh`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8362em`}},[n(`span`,{style:{top:`-3.1473em`,"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:`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.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.8141em`}}),n(`span`,{class:`mord`},`0.96`),n(`span`,{class:`mord`},[n(`span`,{class:`mord`},`4`),n(`span`,{class:`msupsub`},[n(`span`,{class:`vlist-t`},[n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.8141em`}},[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`},`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`},`0.07`)])])]),o(`.`)]),n(`p`,null,`The 0.012 was optimistic: what keeps the state bounded also shrinks the gradient.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BVkuWe7H.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_111`,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,r(t(a(l)(a(v),110))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Four bugs, and what each one looks like`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The chart sketches three loss curves; it is not a measured run. The green curve is the correct model and goes lowest. The grey curve is any silent bug: it flattens out higher. The red curve, without clipping, stops at `),n(`code`,null,`nan`),o(` ("not a number").`)]),n(`ol`,null,[n(`li`,null,[n(`strong`,null,[n(`code`,null,`batch_first`),o(` left out:`)]),o(` 32 reviews are read as 32 time steps.`)]),n(`li`,null,[n(`strong`,null,`No packing:`),o(),n(`code`,null,`h_n`),o(` is read after the padding.`)]),n(`li`,null,[n(`strong`,null,`Loss on padding`),o(`, with a label per word: use `),n(`code`,null,`ignore_index=0`),o(`.`)]),n(`li`,null,[n(`strong`,null,`No clipping:`),o(` one exploding step gives a `),n(`code`,null,`nan`),o(` loss that spreads to every weight.`)])]),n(`p`,null,`The first three give no error: the loss falls, just not far enough.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BZFxRof9.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,x as u,z as d}from"./modules/shiki-CkJq9tSf.js";import{n as f,t as p}from"./slidev/context-DnYiQGy6.js";import{t as m}from"./default-CkTgO_iP.js";import{t as h}from"./PollSlide-B7sHLB83.js";var g={class:`grid grid-cols-[1.6fr_1fr] gap-6 items-start`},_={class:`mt-4 dl-reveal`},v={class:`mt-2 dl-secondary`},y={__name:`slides.md__slidev_84`,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=r(`click`);return d(),c(m,o(t(l(p)(l(E),83))),{default:e(()=>[i(`div`,g,[i(`div`,null,[n(b,{question:`An LSTM unit runs 50 steps with forget = 1 and input = 0 throughout. What is cβ‚…β‚€?`,items:[`Zero β€” it has been multiplied down`,`cβ‚€, unchanged`,`Undefined β€” the state saturates`,`tanh(cβ‚€)`]})]),y[0]||=i(`div`,{class:`mt-10`},[i(`svg`,{viewBox:`0 0 260 110`,class:`dl-diagram`,role:`img`,"aria-label":`The cell state c-zero passes through fifty steps of multiply by 1 and add 0; what comes out?`},[i(`text`,{class:`dl-dg-lab is-sm`,x:`4`,y:`45`},`cβ‚€`),i(`path`,{class:`dl-dg-line`,d:`M28 40 H200`}),i(`circle`,{class:`dl-dg-op`,cx:`70`,cy:`40`,r:`14`}),i(`text`,{class:`dl-dg-small`,x:`70`,y:`44`,"text-anchor":`middle`},`Γ—1`),i(`circle`,{class:`dl-dg-op`,cx:`120`,cy:`40`,r:`14`}),i(`text`,{class:`dl-dg-small`,x:`120`,y:`44`,"text-anchor":`middle`},`+0`),i(`text`,{class:`dl-dg-small`,x:`160`,y:`44`,"text-anchor":`middle`},`…`),i(`text`,{class:`dl-dg-lab is-sm`,x:`206`,y:`45`},`cβ‚…β‚€`),i(`text`,{class:`dl-dg-small`,x:`110`,y:`84`,"text-anchor":`middle`},`50 steps: f = 1, i = 0`)])],-1)]),s((d(),a(`div`,_,[...y[1]||=[i(`p`,null,`cβ‚€, unchanged`,-1)]])),[[x]]),s((d(),a(`div`,v,[...y[2]||=[i(`p`,null,[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(`msub`,null,[i(`mi`,null,`c`),i(`mi`,null,`t`)]),i(`mo`,null,`=`),i(`mn`,null,`1`),i(`mo`,null,`β‹…`),i(`msub`,null,[i(`mi`,null,`c`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1`)])]),i(`mo`,null,`+`),i(`mn`,null,`0`),i(`mo`,null,`β‹…`),i(`msub`,null,[i(`mover`,{accent:`true`},[i(`mi`,null,`c`),i(`mo`,null,`~`)]),i(`mi`,null,`t`)]),i(`mo`,null,`=`),i(`msub`,null,[i(`mi`,null,`c`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1`)])])]),i(`annotation`,{encoding:`application/x-tex`},`c_t = 1 \\cdot c_{t-1} + 0 \\cdot \\tilde{c}_t = c_{t-1}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`c`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`1`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`β‹…`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.7917em`,"vertical-align":`-0.2083em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`c`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2083em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`β‹…`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8179em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord katex-accent`},[i(`span`,{class:`vlist-t`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.6679em`}},[i(`span`,{style:{top:`-3em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`mord mathnormal`},`c`)]),i(`span`,{style:{top:`-3.35em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`accent-body`,style:{left:`-0.1944em`}},[i(`span`,{class:`mord`},`~`)])])])])])]),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.2083em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`c`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2083em`}},[i(`span`)])])])])])])])]),u(`, fifty times over. The gradient travels back along the same path, multiplied by exactly 1 at each step.`)],-1)]])),[[x]])]),_:1},16)}}};export{y as default};
lecture-05/assets/md-B_ZqeUP3.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_116`,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,r(t(a(l)(a(v),115))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: One sequence in, another out`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The widget shows an `),n(`strong`,null,`encoder–decoder`),o(`, two RNNs joined in the middle.`)]),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Bottom row, the encoder:`),o(` an RNN that reads the German source.`)]),n(`li`,null,[n(`strong`,null,`Middle box, the context vector:`),o(` the encoder’s final state, 256 numbers.`)]),n(`li`,null,[n(`strong`,null,`Top row, the decoder:`),o(` a second RNN that writes the English sentence one word at a time.`)])]),n(`p`,null,[o(`Nothing is written until the whole source is read. The context vector is all the decoder knows about it. The slider changes the source from 2 to 8 words, and the box stays 256 numbers. Eight words fit; forty words into the same 256 is the `),n(`strong`,null,`bottleneck`),o(`.`)])],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-B_tcer9R.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,M as n,S as r,St as i,V as a,W as o,_ as s,b as c,bt as l,et as u,m as d,v as f,vt as p,x as m,yt as h,z as g}from"./modules/shiki-CkJq9tSf.js";import{n as _,t as v}from"./slidev/context-DnYiQGy6.js";import{t as y}from"./default-CkTgO_iP.js";import{t as b}from"./slidev/CodeBlockWrapper-CSwO122r.js";var x={class:`grid grid-cols-[2.1fr_1fr] gap-4 items-center`},S={class:`dl-diagram`,style:{"max-height":`14rem`},viewBox:`0 0 200 250`,role:`img`,"aria-label":`Shape strip: ids 32 by 200, embedding, 32 by 200 by 64, LSTM, 32 by 128, linear, 32 by 2.`},C=[`x`,`y`,`width`],w=[`y`],T=[`y`],E=[`d`],D=[`y`],O={class:`mt-2 dl-secondary`},k={__name:`slides.md__slidev_104`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=_();return M.setup(),(_,k)=>{let A=b,j=o(`click`);return g(),f(y,l(t(p(v)(p(I),103))),{default:e(()=>[k[3]||=s(`h1`,null,`The model`,-1),s(`div`,x,[s(`div`,null,[r(A,n({lines:!0},{title:``,ranges:[`all`,`4-5`,`6-7`,`10`,`11-14`,`all`]}),{default:e(()=>[...k[0]||=[s(`pre`,{class:`shiki shiki-themes vitesse-dark vitesse-light slidev-code`,style:{"--shiki-dark":`#dbd7caee`,"--shiki-light":`#393a34`,"--shiki-dark-bg":`#121212`,"--shiki-light-bg":`#ffffff`}},[s(`code`,{class:`language-python`},[s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},`class`),s(`span`,{style:{"--shiki-dark":`#5DA994`,"--shiki-light":`#2E8F82`}},` ReviewClassifier`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#80A665`,"--shiki-light":`#59873A`}},`nn`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#80A665`,"--shiki-light":`#59873A`}},`Module`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`):`)]),m(`
2
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},` def`),s(`span`,{style:{"--shiki-dark":`#B8A965`,"--shiki-light":`#998418`}},` __init__`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` vocab_size`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` embed`),s(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},`=`),s(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`64`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden`),s(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},`=`),s(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`128`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`):`)]),m(`
3
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#B8A965`,"--shiki-light":`#998418`}},` super`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`().`),s(`span`,{style:{"--shiki-dark":`#B8A965`,"--shiki-light":`#998418`}},`__init__`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`()`)]),m(`
4
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`embed `),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` nn`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`Embedding`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`vocab_size`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` embed`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#BD976A`,"--shiki-light":`#B07D48`}},` padding_idx`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`0`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),m(`
5
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`lstm `),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` nn`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`LSTM`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`embed`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#BD976A`,"--shiki-light":`#B07D48`}},` batch_first`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},`True`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),m(`
6
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`drop `),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` nn`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`Dropout`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`0.3`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),m(`
7
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`head `),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` nn`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`Linear`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`hidden`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},` 2`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`),s(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # logits`)]),m(`
8
+ `),s(`span`,{class:`line`}),m(`
9
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},` def`),s(`span`,{style:{"--shiki-dark":`#80A665`,"--shiki-light":`#59873A`}},` forward`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` ids`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` lengths`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`):`)]),m(`
10
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` emb `),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`embed`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`ids`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`),s(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # (B, T, 64)`)]),m(`
11
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` packed `),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` pack_padded_sequence`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`emb`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` lengths`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`cpu`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(),`)]),m(`
12
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#BD976A`,"--shiki-light":`#B07D48`}},` batch_first`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},`True`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#BD976A`,"--shiki-light":`#B07D48`}},` enforce_sorted`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),s(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},`False`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),m(`
13
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` _`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},` (`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`h_n`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` _`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},` =`),s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`lstm`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`packed`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`),s(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # (1, B, 128)`)]),m(`
14
+ `),s(`span`,{class:`line`},[s(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},` return`),s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`head`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},`self`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`drop`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),s(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`h_n`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`[`),s(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},`-`),s(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`1`),s(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`]))`),s(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # (B, 2)`)])])],-1)]]),_:1},16)]),s(`div`,null,[(g(),c(`svg`,S,[k[1]||=s(`defs`,null,[s(`marker`,{id:`l5d-head-model`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[s(`path`,{d:`M0 0 L7 3.5 L0 7 z`,class:`dl-dg-head`})])],-1),(g(),c(d,null,a([[`ids`,`(32, 200)`,150],[`emb`,`(32, 200, 64)`,180],[`h_n[-1]`,`(32, 128)`,100],[`logits`,`(32, 2)`,64]],(e,t)=>s(`g`,{key:t},[s(`rect`,{class:h([`dl-dg-box`,t===2?`is-accent`:``]),x:100-e[2]/2,y:4+t*66,width:e[2],height:`34`,rx:`4`},null,10,C),s(`text`,{class:`dl-dg-small`,x:`100`,y:18+t*66,"text-anchor":`middle`},i(e[0]),9,w),s(`text`,{class:`dl-dg-lab is-sm`,x:`100`,y:33+t*66,"text-anchor":`middle`},i(e[1]),9,T)])),64)),(g(),c(d,null,a([`Embedding`,`LSTM, packed`,`Linear`],(e,t)=>s(`g`,{key:`o${t}`},[s(`path`,{class:`dl-dg-arrow`,d:`M100 ${40+t*66} V${66+t*66}`,"marker-end":`url(#l5d-head-model)`},null,8,E),s(`text`,{class:`dl-dg-small`,x:`108`,y:57+t*66},i(e),9,D)])),64))]))])]),u((g(),c(`div`,O,[...k[2]||=[s(`p`,null,[m(`Three layers. The only new line is the `),s(`code`,null,`pack`),m(`. `),s(`code`,null,`h_n[-1]`),m(` is the last layer’s final state, so it stays right with `),s(`code`,null,`num_layers=2`),m(`.`)],-1)]])),[[j]])]),_:1},16)}}};export{k as default};
lecture-05/assets/md-BbkqrAWu.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,_ as r,bt as i,v as a,vt as o,x as s,z as c}from"./modules/shiki-CkJq9tSf.js";import{n as l,t as u}from"./slidev/context-DnYiQGy6.js";import{t as d}from"./WordStrip-wEzaLRUv.js";import{t as f}from"./default-CkTgO_iP.js";import{t as p}from"./slidev/VClicks-CNqMVSis.js";var m={class:`flex flex-col gap-1 mt-2 mx-auto`,style:{"max-width":`600px`}},h={class:`dl-tight mt-2`},g={__name:`slides.md__slidev_100`,setup(g){let{$slidev:_,$nav:v,$clicksContext:y,$clicks:b,$page:x,$renderContext:S,$frontmatter:C}=l();return y.setup(),(l,g)=>{let _=d,v=p;return c(),a(f,i(t(o(u)(o(C),99))),{default:e(()=>[g[1]||=r(`h1`,null,`Sequences in a batch are not the same length`,-1),g[2]||=r(`p`,null,[s(`A batch is one rectangle. Short reviews are filled up with a reserved `),r(`strong`,null,`pad`),s(` token, id 0.`)],-1),r(`div`,m,[n(_,{review:[`a`,`brilliant`,`film`,`about`,`nothing`,...[,,,].fill(`<pad>`)],upto:5,width:600},null,8,[`review`]),n(_,{review:[`not`,`worth`,`it`,...[,,,,,].fill(`<pad>`)],upto:3,width:600},null,8,[`review`]),n(_,{review:[`the`,`movie`,`was`,`not`,`great`,`but`,`well`,`acted`],upto:8,highlight:`not`,width:600}),n(_,{review:[`utterly`,`awful`,...[,,,,,,].fill(`<pad>`)],upto:2,highlight:`awful`,width:600},null,8,[`review`])]),r(`div`,h,[n(v,null,{default:e(()=>[...g[0]||=[r(`ul`,null,[r(`li`,null,`18 real tokens, 14 pads: nearly half the batch is nothing`),r(`li`,null,[s(`The LSTM runs 8 steps on `),r(`em`,null,`utterly awful`),s(`. Six of them read padding`)]),r(`li`,null,[s(`So `),r(`code`,null,`h_n`),s(` is the state after the padding. The batch must carry its `),r(`strong`,null,`lengths`)])],-1)]]),_:1})])]),_:1},16)}}};export{g as default};
lecture-05/assets/md-BcDn48pd.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,W as n,_ as r,b as i,bt as a,et as o,v as s,vt as c,x as l,z as u}from"./modules/shiki-CkJq9tSf.js";import{n as d,t as f}from"./slidev/context-DnYiQGy6.js";import{t as p}from"./default-CkTgO_iP.js";var m={class:`mt-2 flex justify-center`},h={viewBox:`0 0 640 180`,class:`dl-diagram`,role:`img`,"aria-label":`The cell state 0.6 is multiplied by the forget gate 0.9 to give 0.54, then 0.4 times 0.8 = 0.32 is added to give 0.86; tanh of 0.86 times the output gate 0.7 gives h = 0.49`},g={class:`mt-2 dl-callout`},_={__name:`slides.md__slidev_74`,setup(_){let{$slidev:v,$nav:y,$clicksContext:b,$clicks:x,$page:S,$renderContext:C,$frontmatter:w}=d();return b.setup(),(d,_)=>{let v=n(`click`);return u(),s(p,a(t(c(f)(c(w),73))),{default:e(()=>[_[18]||=r(`h1`,null,`One LSTM step, by hand`,-1),_[19]||=r(`p`,null,[l(`Values from the last slide: `),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(`msub`,null,[r(`mi`,null,`c`),r(`mrow`,null,[r(`mi`,null,`t`),r(`mo`,null,`βˆ’`),r(`mn`,null,`1`)])]),r(`mo`,null,`=`),r(`mn`,null,`0.6`)]),r(`annotation`,{encoding:`application/x-tex`},`c_{t-1} = 0.6`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.2083em`}}),r(`span`,{class:`mord`},[r(`span`,{class:`mord mathnormal`},`c`),r(`span`,{class:`msupsub`},[r(`span`,{class:`vlist-t vlist-t2`},[r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.3011em`}},[r(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[r(`span`,{class:`pstrut`,style:{height:`2.7em`}}),r(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[r(`span`,{class:`mord mtight`},[r(`span`,{class:`mord mathnormal mtight`},`t`),r(`span`,{class:`mbin mtight`},`βˆ’`),r(`span`,{class:`mord mtight`},`1`)])])])]),r(`span`,{class:`vlist-s`},`​`)]),r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.2083em`}},[r(`span`)])])])])]),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),r(`span`,{class:`mrel`},`=`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`0.6`)])])]),l(`, `),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(`mi`,null,`f`),r(`mo`,null,`=`),r(`mn`,null,`0.9`)]),r(`annotation`,{encoding:`application/x-tex`},`f = 0.9`)])])]),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 mathnormal`,style:{"margin-right":`0.1076em`}},`f`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),r(`span`,{class:`mrel`},`=`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`0.9`)])])]),l(`, `),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(`mi`,null,`i`),r(`mo`,null,`=`),r(`mn`,null,`0.4`)]),r(`annotation`,{encoding:`application/x-tex`},`i = 0.4`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6595em`}}),r(`span`,{class:`mord mathnormal`},`i`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),r(`span`,{class:`mrel`},`=`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`0.4`)])])]),l(`, `),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(`mover`,{accent:`true`},[r(`mi`,null,`c`),r(`mo`,null,`~`)]),r(`mo`,null,`=`),r(`mn`,null,`0.8`)]),r(`annotation`,{encoding:`application/x-tex`},`\\tilde{c} = 0.8`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6679em`}}),r(`span`,{class:`mord katex-accent`},[r(`span`,{class:`vlist-t`},[r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.6679em`}},[r(`span`,{style:{top:`-3em`}},[r(`span`,{class:`pstrut`,style:{height:`3em`}}),r(`span`,{class:`mord mathnormal`},`c`)]),r(`span`,{style:{top:`-3.35em`}},[r(`span`,{class:`pstrut`,style:{height:`3em`}}),r(`span`,{class:`accent-body`,style:{left:`-0.1944em`}},[r(`span`,{class:`mord`},`~`)])])])])])]),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),r(`span`,{class:`mrel`},`=`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`0.8`)])])]),l(`, `),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(`mi`,null,`o`),r(`mo`,null,`=`),r(`mn`,null,`0.7`)]),r(`annotation`,{encoding:`application/x-tex`},`o = 0.7`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),r(`span`,{class:`mord mathnormal`},`o`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),r(`span`,{class:`mrel`},`=`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`0.7`)])])]),l(`.`)],-1),r(`div`,m,[(u(),i(`svg`,h,[_[4]||=r(`defs`,null,[r(`marker`,{id:`l5c-step-arrow`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`},[r(`path`,{class:`dl-dg-head`,d:`M0 0 L6 3 L0 6 z`})])],-1),_[5]||=r(`text`,{class:`dl-dg-lab is-sm`,x:`2`,y:`55`},[l(`c`),r(`tspan`,{"baseline-shift":`sub`,style:{"font-size":`9px`}},`tβˆ’1`),l(` = 0.6`)],-1),_[6]||=r(`path`,{class:`dl-dg-line`,"marker-end":`url(#l5c-step-arrow)`,d:`M70 50 H610`},null,-1),_[7]||=r(`circle`,{class:`dl-dg-op`,cx:`170`,cy:`50`,r:`13`},null,-1),_[8]||=r(`text`,{class:`dl-dg-lab is-sm`,x:`170`,y:`55`,"text-anchor":`middle`},`Γ—`,-1),_[9]||=r(`rect`,{class:`dl-dg-box is-accent`,x:`140`,y:`96`,width:`60`,height:`26`,rx:`4`},null,-1),_[10]||=r(`text`,{class:`dl-dg-in`,x:`170`,y:`114`,"text-anchor":`middle`},`f = 0.9`,-1),_[11]||=r(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-step-arrow)`,d:`M170 96 V66`},null,-1),_[12]||=r(`circle`,{class:`dl-dg-op`,cx:`320`,cy:`50`,r:`13`},null,-1),_[13]||=r(`text`,{class:`dl-dg-lab is-sm`,x:`320`,y:`55`,"text-anchor":`middle`},`+`,-1),_[14]||=r(`rect`,{class:`dl-dg-box is-accent`,x:`270`,y:`96`,width:`100`,height:`26`,rx:`4`},null,-1),_[15]||=r(`text`,{class:`dl-dg-in`,x:`320`,y:`114`,"text-anchor":`middle`},`i Β· cΜƒ = 0.4 Γ— 0.8`,-1),_[16]||=r(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-step-arrow)`,d:`M320 96 V66`},null,-1),o((u(),i(`g`,null,[..._[0]||=[r(`text`,{class:`dl-dg-lab`,x:`245`,y:`36`,"text-anchor":`middle`},`0.54`,-1),r(`text`,{class:`dl-dg-small`,x:`245`,y:`74`,"text-anchor":`middle`},`kept`,-1)]])),[[v]]),o((u(),i(`g`,null,[..._[1]||=[r(`text`,{class:`dl-dg-small`,x:`320`,y:`140`,"text-anchor":`middle`},`written: 0.32`,-1)]])),[[v]]),o((u(),i(`g`,null,[..._[2]||=[r(`text`,{class:`dl-dg-lab`,x:`395`,y:`36`,"text-anchor":`middle`},`0.86`,-1)]])),[[v]]),o((u(),i(`g`,null,[..._[3]||=[r(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-step-arrow)`,d:`M450 50 V100 H476`},null,-1),r(`text`,{class:`dl-dg-small`,x:`444`,y:`84`,"text-anchor":`end`},`tanh`,-1),r(`circle`,{class:`dl-dg-op`,cx:`492`,cy:`100`,r:`13`},null,-1),r(`text`,{class:`dl-dg-lab is-sm`,x:`492`,y:`105`,"text-anchor":`middle`},`Γ—`,-1),r(`rect`,{class:`dl-dg-box is-accent`,x:`462`,y:`140`,width:`60`,height:`26`,rx:`4`},null,-1),r(`text`,{class:`dl-dg-in`,x:`492`,y:`158`,"text-anchor":`middle`},`o = 0.7`,-1),r(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-step-arrow)`,d:`M492 140 V116`},null,-1),r(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#l5c-step-arrow)`,d:`M506 100 H532`},null,-1),r(`text`,{class:`dl-dg-lab`,x:`538`,y:`106`},[l(`h`),r(`tspan`,{"baseline-shift":`sub`,style:{"font-size":`11px`}},`t`),l(` = 0.49`)],-1)]])),[[v]])]))]),o((u(),i(`div`,g,[..._[17]||=[r(`p`,null,[l(`The cell `),r(`strong`,null,`holds`),l(` 0.86 but `),r(`strong`,null,`shows`),l(` 0.49: the output gate decides how much to reveal.`)],-1)]])),[[v]])]),_:1},16)}}};export{_ as default};
lecture-05/assets/md-Bj2N68xh.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,_ as r,bt as i,v as a,vt as o,x as s,z as c}from"./modules/shiki-CkJq9tSf.js";import{n as l,t as u}from"./slidev/context-DnYiQGy6.js";import{t as d}from"./slidev/VClicks-CNqMVSis.js";import{t as f}from"./interactive-Dm0CtntL.js";import{t as p}from"./GatedCell-DSupqvNZ.js";var m={__name:`slides.md__slidev_80`,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,i(t(o(u)(o(x),79))),{aside:e(t=>[m[1]||=r(`p`,null,`The GRU (gated recurrent unit): one state, two gates.`,-1),n(g,null,{default:e(()=>[...m[0]||=[r(`ul`,null,[r(`li`,null,[s(`The `),r(`strong`,null,`update gate`),s(),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(`mi`,null,`z`)]),r(`annotation`,{encoding:`application/x-tex`},`z`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),r(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`)])])]),s(` does the forget and input jobs at once`)]),r(`li`,null,[s(`The `),r(`strong`,null,`reset gate`),s(),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(`mi`,null,`r`)]),r(`annotation`,{encoding:`application/x-tex`},`r`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),r(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0278em`}},`r`)])])]),s(` sets how much of the past the candidate may read. Drag it to 0`)]),r(`li`,null,[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(`msub`,null,[r(`mi`,null,`h`),r(`mi`,null,`t`)]),r(`mo`,null,`=`),r(`mo`,{stretchy:`false`},`(`),r(`mn`,null,`1`),r(`mo`,null,`βˆ’`),r(`mi`,null,`z`),r(`mo`,{stretchy:`false`},`)`),r(`mtext`,null,` `),r(`msub`,null,[r(`mi`,null,`h`),r(`mrow`,null,[r(`mi`,null,`t`),r(`mo`,null,`βˆ’`),r(`mn`,null,`1`)])]),r(`mo`,null,`+`),r(`mi`,null,`z`),r(`mtext`,null,` `),r(`msub`,null,[r(`mover`,{accent:`true`},[r(`mi`,null,`h`),r(`mo`,null,`~`)]),r(`mi`,null,`t`)])]),r(`annotation`,{encoding:`application/x-tex`},`h_t = (1-z)\\,h_{t-1} + z\\,\\tilde{h}_t`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),r(`span`,{class:`mord`},[r(`span`,{class:`mord mathnormal`},`h`),r(`span`,{class:`msupsub`},[r(`span`,{class:`vlist-t vlist-t2`},[r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.2806em`}},[r(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[r(`span`,{class:`pstrut`,style:{height:`2.7em`}}),r(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[r(`span`,{class:`mord mathnormal mtight`},`t`)])])]),r(`span`,{class:`vlist-s`},`​`)]),r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.15em`}},[r(`span`)])])])])]),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),r(`span`,{class:`mrel`},`=`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),r(`span`,{class:`mopen`},`(`),r(`span`,{class:`mord`},`1`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),r(`span`,{class:`mbin`},`βˆ’`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),r(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`),r(`span`,{class:`mclose`},`)`),r(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),r(`span`,{class:`mord`},[r(`span`,{class:`mord mathnormal`},`h`),r(`span`,{class:`msupsub`},[r(`span`,{class:`vlist-t vlist-t2`},[r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.3011em`}},[r(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[r(`span`,{class:`pstrut`,style:{height:`2.7em`}}),r(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[r(`span`,{class:`mord mtight`},[r(`span`,{class:`mord mathnormal mtight`},`t`),r(`span`,{class:`mbin mtight`},`βˆ’`),r(`span`,{class:`mord mtight`},`1`)])])])]),r(`span`,{class:`vlist-s`},`​`)]),r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.2083em`}},[r(`span`)])])])])]),r(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),r(`span`,{class:`mbin`},`+`),r(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`1.0813em`,"vertical-align":`-0.15em`}}),r(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`),r(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),r(`span`,{class:`mord`},[r(`span`,{class:`mord katex-accent`},[r(`span`,{class:`vlist-t`},[r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.9313em`}},[r(`span`,{style:{top:`-3em`}},[r(`span`,{class:`pstrut`,style:{height:`3em`}}),r(`span`,{class:`mord mathnormal`},`h`)]),r(`span`,{style:{top:`-3.6134em`}},[r(`span`,{class:`pstrut`,style:{height:`3em`}}),r(`span`,{class:`accent-body`,style:{left:`-0.25em`}},[r(`span`,{class:`mord`},`~`)])])])])])]),r(`span`,{class:`msupsub`},[r(`span`,{class:`vlist-t vlist-t2`},[r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.2806em`}},[r(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[r(`span`,{class:`pstrut`,style:{height:`2.7em`}}),r(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[r(`span`,{class:`mord mathnormal mtight`},`t`)])])]),r(`span`,{class:`vlist-s`},`​`)]),r(`span`,{class:`vlist-r`},[r(`span`,{class:`vlist`,style:{height:`0.15em`}},[r(`span`)])])])])])])])]),s(`: a blend, and the two shares sum to 1`)])],-1)]]),_:1})]),default:e(()=>[n(h,{variant:`gru`})]),_:1},16)}}};export{m as default};
lecture-05/assets/md-BldLBnj7.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_20`,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,r(t(a(l)(a(v),19))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: An aside β€” a convolution can read a sequence too`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`A `),n(`strong`,null,`1-D convolution`),o(` reads a sequence too: one filter slides along the words, with the same weights everywhere. Padding keeps the output length; stride 2 halves it.`)]),n(`p`,null,[o(`In the small picture, each box shows the `),n(`strong`,null,`round`),o(` its output is computed in.`)]),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Convolution`),o(`: each output needs only the nearby words. All five outputs are computed in round 1, in parallel. But its reach is limited: a `),n(`em`,null,`not`),o(` 60 words back is never seen.`)]),n(`li`,null,[n(`strong`,null,`Recurrent layer`),o(`: step 5 waits for step 4, so five steps take five rounds. In return, the state carries a word from any distance back.`)])])],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BmRdiwFD2.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,M as n,S as r,V as i,_ as a,b as o,bt as s,m as c,v as l,vt as u,x as d,z as f}from"./modules/shiki-CkJq9tSf.js";import{n as p,t as m}from"./slidev/context-DnYiQGy6.js";import{t as h}from"./default-CkTgO_iP.js";import{t as g}from"./slidev/VClicks-CNqMVSis.js";import{t as _}from"./slidev/CodeBlockWrapper-CSwO122r.js";var v={class:`grid grid-cols-[1.3fr_1fr] gap-6 items-start`},y={viewBox:`0 0 330 110`,class:`dl-diagram is-sm`,role:`img`,"aria-label":`Three chunks of cells: the state flows forward through all of them; the gradient flows back only inside each chunk, and stops at the detach cuts`},b=[`x`],x=[`d`],S={class:`dl-tight`},C={__name:`slides.md__slidev_64`,setup(C){let{$slidev:w,$nav:T,$clicksContext:E,$clicks:D,$page:O,$renderContext:k,$frontmatter:A}=p();return E.setup(),(p,C)=>{let w=_,T=g;return f(),l(h,s(t(u(m)(u(A),63))),{default:e(()=>[C[9]||=a(`h1`,null,`Truncated backpropagation through time`,-1),C[10]||=a(`p`,null,`A 100 000-character book is one sequence, and 100 000 steps of activations do not fit in memory.`,-1),a(`div`,v,[a(`div`,null,[r(w,n({lines:!0},{title:``,ranges:[`all`,`3`,`4-5`,`6`,`all`]}),{default:e(()=>[...C[0]||=[a(`pre`,{class:`shiki shiki-themes vitesse-dark vitesse-light slidev-code`,style:{"--shiki-dark":`#dbd7caee`,"--shiki-light":`#393a34`,"--shiki-dark-bg":`#121212`,"--shiki-light-bg":`#ffffff`}},[a(`code`,{class:`language-python`},[a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`hidden `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},` None`)]),d(`
2
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},`for`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` chunk `),a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},`in`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` chunks_of`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`book`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#BD976A`,"--shiki-light":`#B07D48`}},` size`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#4C9A91`,"--shiki-light":`#2F798A`}},`128`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`):`),a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # 128 steps`)]),d(`
3
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},` if`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden `),a(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},`is`),a(`span`,{style:{"--shiki-dark":`#CB7676`,"--shiki-light":`#AB5959`}},` not`),a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},` None`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`:`)]),d(`
4
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#B8A965`,"--shiki-light":`#998418`}},` tuple`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`h`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`.`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`detach`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`()`),a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},` for`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` h `),a(`span`,{style:{"--shiki-dark":`#4D9375`,"--shiki-light":`#1E754F`}},`in`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),d(`
5
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # keep the values, cut the graph`)]),d(`
6
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` logits`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden `),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`=`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` model`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`(`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},`chunk`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`,`),a(`span`,{style:{"--shiki-dark":`#DBD7CAEE`,"--shiki-light":`#393A34`}},` hidden`),a(`span`,{style:{"--shiki-dark":`#666666`,"--shiki-light":`#999999`}},`)`)]),d(`
7
+ `),a(`span`,{class:`line`},[a(`span`,{style:{"--shiki-dark":`#C99076`,"--shiki-light":`#A65E2B`}},` ...`),a(`span`,{style:{"--shiki-dark":`#758575DD`,"--shiki-light":`#A0ADA0`}},` # loss, backward, step`)])])],-1)]]),_:1},16)]),a(`div`,null,[(f(),o(`svg`,y,[C[1]||=a(`defs`,null,[a(`marker`,{id:`l5b-tb-back`,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-danger)`}})])],-1),C[2]||=a(`path`,{d:`M8 44 H322`,class:`dl-dg-line`},null,-1),(f(),o(c,null,i(9,e=>a(`g`,{key:e},[a(`rect`,{x:10+(e-1)*35+Math.floor((e-1)/3)*8,y:`34`,width:`22`,height:`20`,rx:`3`,class:`dl-dg-box is-accent`},null,8,b)])),64)),(f(),o(c,null,i(3,e=>a(`g`,{key:`c${e}`},[a(`path`,{d:`M${76+(e-1)*113} 70 H${22+(e-1)*113}`,class:`dl-dg-grad is-bad`,"marker-end":`url(#l5b-tb-back)`},null,8,x)])),64)),C[3]||=a(`path`,{d:`M112 18 V90`,class:`dl-dg-split`,style:{"stroke-dasharray":`4 3`}},null,-1),C[4]||=a(`path`,{d:`M225 18 V90`,class:`dl-dg-split`,style:{"stroke-dasharray":`4 3`}},null,-1),C[5]||=a(`text`,{x:`112`,y:`12`,"text-anchor":`middle`,class:`dl-dg-small`},`detach()`,-1),C[6]||=a(`text`,{x:`225`,y:`12`,"text-anchor":`middle`,class:`dl-dg-small`},`detach()`,-1),C[7]||=a(`text`,{x:`165`,y:`104`,"text-anchor":`middle`,class:`dl-dg-small is-bad`},`gradient: inside one chunk only`,-1)]))])]),a(`div`,S,[r(T,null,{default:e(()=>[...C[8]||=[a(`ul`,null,[a(`li`,null,[d(`The state still flows `),a(`strong`,null,`forward`),d(` across chunks: the model’s context is not cut`)]),a(`li`,null,[d(`Only the `),a(`strong`,null,`gradient`),d(` stops at the boundary. That is what `),a(`code`,null,`detach()`),d(` does`)]),a(`li`,null,[d(`Forget the `),a(`code`,null,`detach`),d(` and the graph grows until the run runs out of memory`)])],-1)]]),_:1})])]),_:1},16)}}};export{C as default};
lecture-05/assets/md-BmZd0fOS.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_46`,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,r(t(a(l)(a(v),45))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: Five ways to wire it`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,`The widget shows one wiring per tab: where does the recurrent arrow come from?`),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`Hidden β†’ hidden.`),o(` The whole note `),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,`h`)]),n(`annotation`,{encoding:`application/x-tex`},`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 mathnormal`},`h`)])])]),o(` passes to the next step. This is what `),n(`code`,null,`nn.RNN`),o(` uses.`)]),n(`li`,null,[n(`strong`,null,`Output β†’ hidden.`),o(` Only 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`,null,`o`)]),n(`annotation`,{encoding:`application/x-tex`},`o`)])])]),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`},`o`)])])]),o(`, usually far smaller than `),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,`h`)]),n(`annotation`,{encoding:`application/x-tex`},`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 mathnormal`},`h`)])])]),o(`, passes on.`)]),n(`li`,null,[n(`strong`,null,`Output β†’ output.`),o(` Only the previous output feeds the next; `),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,`h`)]),n(`annotation`,{encoding:`application/x-tex`},`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 mathnormal`},`h`)])])]),o(` carries nothing forward.`)]),n(`li`,null,[n(`strong`,null,`Stacked.`),o(` One layer’s states are the next layer’s inputs (`),n(`code`,null,`num_layers`),o(`).`)]),n(`li`,null,[n(`strong`,null,`Bidirectional.`),o(` A second row reads right to left, and the two notes are joined at each word (`),n(`code`,null,`bidirectional=True`),o(`).`)])]),n(`p`,null,`Bidirectional needs the whole sequence first. It suits classifying review B, but it cannot predict the next word.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BqKGHBCc.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_27`,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,r(t(a(l)(a(v),26))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: One new wire`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The widget shows one hidden layer. The word comes in from below. The layer’s output curls back into its own input: the `),n(`strong`,null,`one new wire`),o(`.`)]),n(`p`,null,`Think of a note passed along a row of readers. Each reads one word, updates the note, and passes it on.`),n(`p`,null,`Three weight matrices do the work:`),n(`ul`,null,[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`,null,`W`),n(`mrow`,null,[n(`mi`,null,`x`),n(`mi`,null,`h`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{xh}`)])])]),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.3361em`}},[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`},`x`),n(`span`,{class:`mord mathnormal mtight`},`h`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` reads this word.`)]),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`,null,`W`),n(`mrow`,null,[n(`mi`,null,`h`),n(`mi`,null,`h`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{hh}`)])])]),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.3361em`}},[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`},`hh`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` reads the note, which is the layer’s own last output.`)]),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`,null,`W`),n(`mrow`,null,[n(`mi`,null,`h`),n(`mi`,null,`o`)])])]),n(`annotation`,{encoding:`application/x-tex`},`W_{ho}`)])])]),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.3361em`}},[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`},`h`),n(`span`,{class:`mord mathnormal mtight`},`o`)])])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])])])])]),o(` reads the note and produces the output.`)])]),n(`p`,null,`The loop is not a second layer. It is the same units, reading what they held one step ago.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-BqlvZ3Kn2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,St as r,V as i,W as a,_ as o,b as s,bt as c,et as l,m as u,v as d,vt as f,x as p,z as m}from"./modules/shiki-CkJq9tSf.js";import{n as h,t as g}from"./slidev/context-DnYiQGy6.js";import{t as _}from"./default-CkTgO_iP.js";import{t as v}from"./slidev/VClicks-CNqMVSis.js";var y={class:`grid grid-cols-2 gap-10 mt-2 dl-tight`},b={viewBox:`0 0 260 70`,class:`dl-diagram`,role:`img`,"aria-label":`A DNA sequence as letter tiles in a row, indexed by position only`},x=[`x`],S=[`x`,`textContent`],C={viewBox:`0 0 260 70`,class:`dl-diagram`,role:`img`,"aria-label":`A time series: samples on a time axis with an uneven gap between two of them`},w=[`cx`,`cy`],T={class:`mt-3 dl-callout`},E={__name:`slides.md__slidev_15`,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(),d(_,c(t(f(g)(f(N),14))),{default:e(()=>[E[12]||=o(`h1`,null,`Sequence, or time series?`,-1),o(`div`,y,[o(`div`,null,[(m(),s(`svg`,b,[(m(),s(u,null,i([`A`,`C`,`G`,`G`,`T`,`T`,`A`],(e,t)=>o(`rect`,{key:t,class:`dl-dg-box`,x:4+t*36,y:`8`,width:`30`,height:`28`,rx:`3`},null,8,x)),64)),(m(),s(u,null,i([`A`,`C`,`G`,`G`,`T`,`T`,`A`],(e,t)=>o(`text`,{key:`t${t}`,class:`dl-dg-lab is-sm`,x:19+t*36,y:`27`,"text-anchor":`middle`,textContent:r(e)},null,8,S)),64)),E[0]||=o(`text`,{class:`dl-dg-small`,x:`4`,y:`56`},`positions only`,-1)])),E[2]||=o(`h3`,null,`Sequence`,-1),E[3]||=o(`p`,null,`Order matters. No clock needed.`,-1),n(D,null,{default:e(()=>[...E[1]||=[o(`ul`,null,[o(`li`,null,`the words of a sentence`),o(`li`,null,`a DNA (genetic code) sequence`)],-1)]]),_:1})]),o(`div`,null,[(m(),s(`svg`,C,[E[4]||=o(`path`,{class:`dl-dg-arrow`,d:`M4 52 H252`},null,-1),E[5]||=o(`path`,{class:`dl-dg-line`,d:`M10 34 L30 22 L50 30 L64 14 L110 26 L126 18 L190 36 L240 24`},null,-1),(m(),s(u,null,i([[10,34],[30,22],[50,30],[64,14],[110,26],[126,18],[190,36],[240,24]],(e,t)=>o(`circle`,{key:t,class:`dl-dg-dot`,cx:e[0],cy:e[1],r:`3`},null,8,w)),64)),E[6]||=o(`text`,{class:`dl-dg-small is-bad`,x:`158`,y:`14`,"text-anchor":`middle`},`gap`,-1),E[7]||=o(`text`,{class:`dl-dg-small`,x:`252`,y:`66`,"text-anchor":`end`},`time β†’`,-1)])),E[9]||=o(`h3`,null,`Time series`,-1),E[10]||=o(`p`,null,[p(`A sequence on a `),o(`strong`,null,`time`),p(` axis. The gaps are data too.`)],-1),n(D,null,{default:e(()=>[...E[8]||=[o(`ul`,null,[o(`li`,null,`stock prices, one per minute`),o(`li`,null,`speech: 16β€―000 samples a second`),o(`li`,null,`an ECG (electrocardiogram) trace`)],-1)]]),_:1})])]),l((m(),s(`div`,T,[...E[11]||=[o(`p`,null,`Every time series is a sequence. Today’s models see only positions.`,-1)]])),[[O]])]),_:1},16)}}};export{E as default};
lecture-05/assets/md-BrSKg0J3.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,St as r,V as i,W as a,_ as o,b as s,bt as c,et as l,m as u,v as d,vt as f,x as p,yt as m,z as h}from"./modules/shiki-CkJq9tSf.js";import{n as g,t as _}from"./slidev/context-DnYiQGy6.js";import{t as v}from"./default-CkTgO_iP.js";import{t as y}from"./Citation-BuY_RPc0.js";var b={class:`mt-3 flex justify-center`},x={viewBox:`0 0 640 120`,class:`dl-diagram`,role:`img`,"aria-label":`A timeline: 1991, the vanishing gradient described; 1997, the LSTM with an additive cell state; 2000, the forget gate added; 2014, the GRU`},S=[`cx`],C=[`x`],w=[`x`],T=[`x`],E={class:`mt-3 dl-callout`},D={class:`mt-4 dl-secondary`},O={class:`mt-4`},k={__name:`slides.md__slidev_78`,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=a(`click`);return h(),d(v,c(t(f(_)(f(I),77))),{default:e(()=>[k[3]||=o(`h1`,null,`Where the LSTM came from`,-1),o(`div`,b,[(h(),s(`svg`,x,[k[0]||=o(`path`,{class:`dl-dg-line is-muted`,d:`M30 50 H620`},null,-1),(h(),s(u,null,i([[60,`1991`,`vanishing gradient`,`described`],[210,`1997`,`LSTM: additive`,`cell state`],[300,`2000`,`forget gate`,`added`],[560,`2014`,`GRU:`,`fewer parts`]],(e,t)=>o(`g`,{key:`l5c-year${t}`},[o(`circle`,{class:m(t===2?`dl-dg-dot is-accent`:`dl-dg-dot`),cx:e[0],cy:`50`,r:`7`},null,10,S),o(`text`,{class:`dl-dg-lab is-sm`,x:e[0],y:`30`,"text-anchor":`middle`},r(e[1]),9,C),o(`text`,{class:m(t===2?`dl-dg-small is-good`:`dl-dg-small`),x:e[0],y:`80`,"text-anchor":`middle`},r(e[2]),11,w),o(`text`,{class:m(t===2?`dl-dg-small is-good`:`dl-dg-small`),x:e[0],y:`96`,"text-anchor":`middle`},r(e[3]),11,T)])),64))]))]),l((h(),s(`div`,E,[...k[1]||=[o(`p`,null,[p(`The 1997 cell could write and read, but `),o(`strong`,null,`never clear`),p(`. On a long stream its state filled up and stopped changing. The forget gate came three years later.`)],-1)]])),[[j]]),l((h(),s(`div`,D,[...k[2]||=[o(`p`,null,`For about twenty years, the LSTM was the standard model for sequences.`,-1)]])),[[j]]),o(`div`,O,[n(A,{source:`Hochreiter & Schmidhuber, Long Short-Term Memory (1997); Gers et al., Learning to Forget (2000)`,url:`https://www.bioinf.jku.at/publications/older/2604.pdf`})])]),_:1},16)}}};export{k as default};
lecture-05/assets/md-BsQteIGq.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,St as n,V as r,W as i,_ as a,b as o,bt as s,et as c,m as l,v as u,vt as d,x as f,z as p}from"./modules/shiki-CkJq9tSf.js";import{n as m,t as h}from"./slidev/context-DnYiQGy6.js";import{t as g}from"./default-CkTgO_iP.js";var _={class:`mt-2 flex justify-center`},v={viewBox:`0 0 640 176`,class:`dl-diagram`,role:`img`,"aria-label":`Left: words numbered by index on a line, aardvark 96, brilliant 2103, great 4217, which invents an order. Right: one-hot vectors as the corners of a triangle, every pair the same distance apart.`},y=[`cx`],b=[`x`],x=[`x`],S={class:`mt-2 dl-callout`},C={__name:`slides.md__slidev_87`,setup(C){let{$slidev:w,$nav:T,$clicksContext:E,$clicks:D,$page:O,$renderContext:k,$frontmatter:A}=m();return E.setup(),(m,C)=>{let w=i(`click`);return p(),u(g,s(t(d(h)(d(A),86))),{default:e(()=>[C[6]||=a(`h1`,null,`A word is not a number`,-1),C[7]||=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`,null,`W`),a(`mrow`,null,[a(`mi`,null,`x`),a(`mi`,null,`h`)])]),a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`x`),a(`mi`,null,`t`)])]),a(`annotation`,{encoding:`application/x-tex`},`W_{xh}\\mathbf{x}_t`)])])]),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`},[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.3361em`}},[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 mtight`},[a(`span`,{class:`mord mathnormal mtight`},`x`),a(`span`,{class:`mord mathnormal mtight`},`h`)])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`x`),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`)])])])])])])])]),f(` needs a vector. Two first tries, for 20 000 words:`)],-1),a(`div`,_,[(p(),o(`svg`,v,[C[1]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`150`,y:`16`,"text-anchor":`middle`},`index: one number`,-1),C[2]||=a(`path`,{class:`dl-dg-line is-muted`,d:`M14 90 H290`},null,-1),(p(),o(l,null,r([[34,`aardvark`,`96`],[130,`brilliant`,`2 103`],[250,`great`,`4 217`]],(e,t)=>a(`g`,{key:`l5c-idx${t}`},[a(`circle`,{class:`dl-dg-dot`,cx:e[0],cy:`90`,r:`6`},null,8,y),a(`text`,{class:`dl-dg-small`,x:e[0],y:`70`,"text-anchor":`middle`},n(e[1]),9,b),a(`text`,{class:`dl-dg-small`,x:e[0],y:`112`,"text-anchor":`middle`},n(e[2]),9,x)])),64)),C[3]||=a(`text`,{class:`dl-dg-small is-bad`,x:`150`,y:`160`,"text-anchor":`middle`},`great "bigger" than brilliant?`,-1),C[4]||=a(`line`,{class:`dl-dg-split`,x1:`320`,y1:`4`,x2:`320`,y2:`170`},null,-1),c((p(),o(`g`,null,[...C[0]||=[a(`text`,{class:`dl-dg-lab is-sm`,x:`480`,y:`16`,"text-anchor":`middle`},`one-hot: 20 000 numbers`,-1),a(`path`,{class:`dl-dg-line is-muted`,d:`M480 38 L410 128 L550 128 Z`},null,-1),a(`circle`,{class:`dl-dg-dot`,cx:`480`,cy:`38`,r:`6`},null,-1),a(`circle`,{class:`dl-dg-dot`,cx:`410`,cy:`128`,r:`6`},null,-1),a(`circle`,{class:`dl-dg-dot`,cx:`550`,cy:`128`,r:`6`},null,-1),a(`text`,{class:`dl-dg-small`,x:`494`,y:`42`},`great`,-1),a(`text`,{class:`dl-dg-small`,x:`396`,y:`132`,"text-anchor":`end`},`brilliant`,-1),a(`text`,{class:`dl-dg-small`,x:`564`,y:`132`},`aardvark`,-1),a(`text`,{class:`dl-dg-small is-bad`,x:`480`,y:`160`,"text-anchor":`middle`},`every pair equally far apart`,-1)]])),[[w]])]))]),c((p(),o(`div`,S,[...C[5]||=[a(`p`,null,[f(`Neither knows that `),a(`em`,null,`great`),f(` and `),a(`em`,null,`brilliant`),f(` mean almost the same. We want a short vector per word, with `),a(`strong`,null,`similar words close together`),f(`.`)],-1)]])),[[w]])]),_:1},16)}}};export{C as default};
lecture-05/assets/md-BucEuds6.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,x as u,z as d}from"./modules/shiki-CkJq9tSf.js";import{n as f,t as p}from"./slidev/context-DnYiQGy6.js";import{t as m}from"./default-CkTgO_iP.js";import{t as h}from"./slidev/VClicks-CNqMVSis.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_49`,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=r(`click`);return d(),c(m,o(t(l(p)(l(E),48))),{default:e(()=>[y[3]||=i(`h1`,null,`Reading the equation: the sequence loss`,-1),i(`div`,g,[i(`div`,_,[n(b,null,{default:e(()=>[...y[0]||=[i(`table`,null,[i(`thead`,null,[i(`tr`,null,[i(`th`,null,`symbol`),i(`th`,null,`name`),i(`th`,null,`what it is here`),i(`th`,null,`example`)])]),i(`tbody`,null,[i(`tr`,null,[i(`td`,null,[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(`mi`,null,`L`)]),i(`annotation`,{encoding:`application/x-tex`},`L`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`},`L`)])])])]),i(`td`,null,`loss`),i(`td`,null,`one per sequence`),i(`td`,null,`0.77`)]),i(`tr`,null,[i(`td`,null,[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(`mi`,{mathvariant:`normal`},`β„“`)]),i(`annotation`,{encoding:`application/x-tex`},`\\ell`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mord`},`β„“`)])])])]),i(`td`,null,`per-step loss`),i(`td`,null,[u(`cross-entropy `),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`,null,`βˆ’`),i(`mi`,null,`ln`),i(`mo`,null,`⁑`),i(`mi`,null,`p`)]),i(`annotation`,{encoding:`application/x-tex`},`-\\ln p`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord`},`βˆ’`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mop`},`ln`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord mathnormal`},`p`)])])]),u(`; `),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(`mi`,null,`p`)]),i(`annotation`,{encoding:`application/x-tex`},`p`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord mathnormal`},`p`)])])]),u(` = chance of the right answer`)]),i(`td`,null,[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`,null,`βˆ’`),i(`mi`,null,`ln`),i(`mo`,null,`⁑`),i(`mn`,null,`0.8`),i(`mo`,null,`=`),i(`mn`,null,`0.22`)]),i(`annotation`,{encoding:`application/x-tex`},`-\\ln 0.8 = 0.22`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.7778em`,"vertical-align":`-0.0833em`}}),i(`span`,{class:`mord`},`βˆ’`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mop`},`ln`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`0.8`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0.22`)])])])])]),i(`tr`,null,[i(`td`,null,[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(`msub`,null,[i(`mi`,{mathvariant:`bold`},`o`),i(`mi`,null,`t`)]),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`o`),i(`mi`,null,`T`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{o}_t,\\ \\mathbf{o}_T`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`o`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`o`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3283em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`T`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`output`),i(`td`,null,[u(`logits at `),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(`mi`,null,`t`)]),i(`annotation`,{encoding:`application/x-tex`},`t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),i(`span`,{class:`mord mathnormal`},`t`)])])]),u(`, or at the end`)]),i(`td`,null,[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(`msub`,null,[i(`mi`,null,`o`),i(`mn`,null,`5`)]),i(`mo`,null,`=`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1.26`)]),i(`annotation`,{encoding:`application/x-tex`},`o_5 = -1.26`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`o`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},`5`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),i(`span`,{class:`mord`},`βˆ’`),i(`span`,{class:`mord`},`1.26`)])])])])]),i(`tr`,null,[i(`td`,null,[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(`mi`,null,`y`),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`msub`,null,[i(`mi`,null,`y`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`y,\\ y_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.0359em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])]),i(`td`,null,`true label`),i(`td`,null,`data`),i(`td`,null,`negative`)]),i(`tr`,null,[i(`td`,null,[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(`mi`,null,`t`),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`mi`,null,`T`)]),i(`annotation`,{encoding:`application/x-tex`},`t,\\ T`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord mathnormal`},`t`),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),i(`td`,null,`step, sequence length`),i(`td`,null,[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(`mi`,null,`t`)]),i(`annotation`,{encoding:`application/x-tex`},`t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6151em`}}),i(`span`,{class:`mord mathnormal`},`t`)])])]),u(` runs from 1 to `),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(`mi`,null,`T`)]),i(`annotation`,{encoding:`application/x-tex`},`T`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),i(`td`,null,[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(`mi`,null,`T`),i(`mo`,null,`=`),i(`mn`,null,`3`)]),i(`annotation`,{encoding:`application/x-tex`},`T = 3`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`3`)])])])])]),i(`tr`,null,[i(`td`,null,[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(`msubsup`,null,[i(`mo`,null,`βˆ‘`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`=`),i(`mn`,null,`1`)]),i(`mi`,null,`T`)]),i(`mo`,{separator:`true`},`,`),i(`mtext`,null,`\xA0`),i(`mfrac`,null,[i(`mn`,null,`1`),i(`mi`,null,`T`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\sum_{t=1}^{T},\\ \\frac{1}{T}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1.3262em`,"vertical-align":`-0.345em`}}),i(`span`,{class:`mop`},[i(`span`,{class:`mop op-symbol small-op`,style:{position:`relative`,top:`0em`}},`βˆ‘`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.9812em`}},[i(`span`,{style:{top:`-2.4003em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mrel mtight`},`=`),i(`span`,{class:`mord mtight`},`1`)])])]),i(`span`,{style:{top:`-3.2029em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`T`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2997em`}},[i(`span`)])])])])]),i(`span`,{class:`mpunct`},`,`),i(`span`,{class:`mspace`},`\xA0`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mopen nulldelimiter`}),i(`span`,{class:`mfrac`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.8451em`}},[i(`span`,{style:{top:`-2.655em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.1389em`}},`T`)])])]),i(`span`,{style:{top:`-3.23em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),i(`span`,{style:{top:`-3.394em`}},[i(`span`,{class:`pstrut`,style:{height:`3em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.345em`}},[i(`span`)])])])]),i(`span`,{class:`mclose nulldelimiter`})])])])])]),i(`td`,null,`sum, average`),i(`td`,null,[u(`add the `),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(`mi`,null,`T`)]),i(`annotation`,{encoding:`application/x-tex`},`T`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])]),u(` losses, divide by `),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(`mi`,null,`T`)]),i(`annotation`,{encoding:`application/x-tex`},`T`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`)])])])]),i(`td`,null,[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(`mn`,null,`2.30`),i(`mi`,{mathvariant:`normal`},`/`),i(`mn`,null,`3`)]),i(`annotation`,{encoding:`application/x-tex`},`2.30 / 3`)])])]),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:`mord`},`2.30/3`)])])])])])])],-1)]]),_:1})]),i(`div`,null,[y[2]||=i(`svg`,{viewBox:`0 0 300 160`,class:`dl-diagram`,role:`img`,"aria-label":`Three bars for the step losses 0.22, 0.69 and 1.39, and a dashed line at their mean, 0.77`},[i(`line`,{x1:`20`,y1:`130`,x2:`290`,y2:`130`,class:`dl-dg-split`}),i(`rect`,{x:`40`,y:`114`,width:`44`,height:`16`,class:`dl-dg-fill`}),i(`rect`,{x:`120`,y:`80`,width:`44`,height:`50`,class:`dl-dg-fill`}),i(`rect`,{x:`200`,y:`30`,width:`44`,height:`100`,class:`dl-dg-fill`}),i(`text`,{x:`62`,y:`108`,"text-anchor":`middle`,class:`dl-dg-small`},`0.22`),i(`text`,{x:`142`,y:`74`,"text-anchor":`middle`,class:`dl-dg-small`},`0.69`),i(`text`,{x:`222`,y:`24`,"text-anchor":`middle`,class:`dl-dg-small`},`1.39`),i(`line`,{x1:`20`,y1:`75`,x2:`290`,y2:`75`,class:`dl-dg-grad is-bad`}),i(`text`,{x:`22`,y:`69`,class:`dl-dg-small is-bad`},`L = 0.77`),i(`text`,{x:`62`,y:`148`,"text-anchor":`middle`,class:`dl-dg-small`},`t = 1`),i(`text`,{x:`142`,y:`148`,"text-anchor":`middle`,class:`dl-dg-small`},`t = 2`),i(`text`,{x:`222`,y:`148`,"text-anchor":`middle`,class:`dl-dg-small`},`t = 3`)],-1),s((d(),a(`div`,v,[...y[1]||=[i(`p`,null,[u(`Next character, `),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(`mi`,null,`T`),i(`mo`,null,`=`),i(`mn`,null,`3`)]),i(`annotation`,{encoding:`application/x-tex`},`T = 3`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`3`)])])]),u(`, `),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(`mi`,null,`p`)]),i(`annotation`,{encoding:`application/x-tex`},`p`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord mathnormal`},`p`)])])]),u(` = 0.8, 0.5, 0.25: `),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(`mi`,null,`L`),i(`mo`,null,`=`),i(`mo`,{stretchy:`false`},`(`),i(`mn`,null,`0.22`),i(`mo`,null,`+`),i(`mn`,null,`0.69`),i(`mo`,null,`+`),i(`mn`,null,`1.39`),i(`mo`,{stretchy:`false`},`)`),i(`mi`,{mathvariant:`normal`},`/`),i(`mn`,null,`3`),i(`mo`,null,`=`),i(`mn`,null,`0.77`)]),i(`annotation`,{encoding:`application/x-tex`},`L = (0.22 + 0.69 + 1.39) / 3 = 0.77`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),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.22`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),i(`span`,{class:`mord`},`0.69`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),i(`span`,{class:`mord`},`1.39`),i(`span`,{class:`mclose`},`)`),i(`span`,{class:`mord`},`/3`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0.77`)])])])],-1),i(`p`,null,[u(`Review B (negative): `),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(`mi`,null,`p`),i(`mo`,null,`=`),i(`mn`,null,`1`),i(`mo`,null,`βˆ’`),i(`mn`,null,`0.22`),i(`mo`,null,`=`),i(`mn`,null,`0.78`)]),i(`annotation`,{encoding:`application/x-tex`},`p = 1 - 0.22 = 0.78`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.625em`,"vertical-align":`-0.1944em`}}),i(`span`,{class:`mord mathnormal`},`p`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.7278em`,"vertical-align":`-0.0833em`}}),i(`span`,{class:`mord`},`1`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`βˆ’`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0.22`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0.78`)])])])],-1),i(`p`,null,[u(`so `),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(`mi`,null,`L`),i(`mo`,null,`=`),i(`mo`,null,`βˆ’`),i(`mi`,null,`ln`),i(`mo`,null,`⁑`),i(`mn`,null,`0.78`),i(`mo`,null,`=`),i(`mn`,null,`0.25`)]),i(`annotation`,{encoding:`application/x-tex`},`L = -\\ln 0.78 = 0.25`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),i(`span`,{class:`mord mathnormal`},`L`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.7778em`,"vertical-align":`-0.0833em`}}),i(`span`,{class:`mord`},`βˆ’`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mop`},`ln`),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},`0.78`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),i(`span`,{class:`mord`},`0.25`)])])])],-1)]])),[[x]])])])]),_:1},16)}}};export{y as default};
lecture-05/assets/md-Bv4kuYzj.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,x as u,z as d}from"./modules/shiki-CkJq9tSf.js";import{n as f,t as p}from"./slidev/context-DnYiQGy6.js";import{t as m}from"./interactive-Dm0CtntL.js";import{t as h}from"./GatedCell-DSupqvNZ.js";var g={class:`mt-2 dl-callout`},_={class:`mt-2 dl-secondary`},v={__name:`slides.md__slidev_69`,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=h,b=r(`click`);return d(),c(m,o(t(l(p)(l(T),68))),{aside:e(e=>[v[2]||=i(`p`,null,[u(`The LSTM (long short-term memory) carries two states. The `),i(`strong`,null,`cell state`),u(),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(`mi`,null,`c`)]),i(`annotation`,{encoding:`application/x-tex`},`c`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),i(`span`,{class:`mord mathnormal`},`c`)])])]),u(` runs along the top.`)],-1),v[3]||=i(`p`,null,[u(`Press `),i(`strong`,null,`Walk the cell`),u(` for the six parts.`)],-1),s((d(),a(`div`,g,[...v[0]||=[i(`p`,null,[u(`Set `),i(`strong`,null,`forget = 1`),u(`, `),i(`strong`,null,`input = 0`),u(`: `),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(`msub`,null,[i(`mi`,null,`c`),i(`mi`,null,`t`)]),i(`mo`,null,`=`),i(`msub`,null,[i(`mi`,null,`c`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1`)])])]),i(`annotation`,{encoding:`application/x-tex`},`c_t = c_{t-1}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.5806em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`c`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6389em`,"vertical-align":`-0.2083em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`},`c`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2083em`}},[i(`span`)])])])])])])])]),u(`, step after step. The envelope stays sealed.`)],-1)]])),[[b]]),s((d(),a(`div`,_,[...v[1]||=[i(`p`,null,`Forget = 0 wipes the past at once. Training learns which.`,-1)]])),[[b]])]),default:e(()=>[n(y)]),_:1},16)}}};export{v as default};
lecture-05/assets/md-BwmjyZQI2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.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,r(t(a(l)(a(v),49))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: The loss for a whole sequence`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The loss is the cross-entropy, `),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`},`β„“`),n(`mo`,null,`=`),n(`mo`,null,`βˆ’`),n(`mi`,null,`ln`),n(`mo`,null,`⁑`),n(`mi`,null,`p`)]),n(`annotation`,{encoding:`application/x-tex`},`\\ell = -\\ln p`)])])]),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`},`β„“`),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:`mord`},`βˆ’`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},`ln`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`},`p`)])])]),o(`, where `),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,`p`)]),n(`annotation`,{encoding:`application/x-tex`},`p`)])])]),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`},`p`)])])]),o(` is the chance the model gave the right answer. Used once, or `),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(`annotation`,{encoding:`application/x-tex`},`T`)])])]),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.1389em`}},`T`)])])]),o(` times.`)]),n(`ul`,null,[n(`li`,null,[n(`strong`,null,`One label per review (left).`),o(` Only the last cell feeds the 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(`mi`,null,`L`),n(`mo`,null,`=`),n(`mi`,{mathvariant:`normal`},`β„“`),n(`mo`,{stretchy:`false`},`(`),n(`msub`,null,[n(`mi`,{mathvariant:`bold`},`o`),n(`mi`,null,`T`)]),n(`mo`,{separator:`true`},`,`),n(`mi`,null,`y`),n(`mo`,{stretchy:`false`},`)`)]),n(`annotation`,{encoding:`application/x-tex`},`L = \\ell(\\mathbf{o}_T, 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:`1em`,"vertical-align":`-0.25em`}}),n(`span`,{class:`mord`},`β„“`),n(`span`,{class:`mopen`},`(`),n(`span`,{class:`mord`},[n(`span`,{class:`mord mathbf`},`o`),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":`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.1389em`}},`T`)])])]),n(`span`,{class:`vlist-s`},`​`)]),n(`span`,{class:`vlist-r`},[n(`span`,{class:`vlist`,style:{height:`0.15em`}},[n(`span`)])])])])]),n(`span`,{class:`mpunct`},`,`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0359em`}},`y`),n(`span`,{class:`mclose`},`)`)])])]),o(`. Review B is negative and the model gives that 0.78, so `),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,`ln`),n(`mo`,null,`⁑`),n(`mn`,null,`0.78`),n(`mo`,null,`=`),n(`mn`,null,`0.25`)]),n(`annotation`,{encoding:`application/x-tex`},`L = -\\ln 0.78 = 0.25`)])])]),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.7778em`,"vertical-align":`-0.0833em`}}),n(`span`,{class:`mord`},`βˆ’`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mop`},`ln`),n(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),n(`span`,{class:`mord`},`0.78`),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.25`)])])]),o(`.`)]),n(`li`,null,[n(`strong`,null,`One label per word (right).`),o(` Every cell feeds a loss; 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(`mi`,null,`T`)]),n(`annotation`,{encoding:`application/x-tex`},`T`)])])]),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.1389em`}},`T`)])])]),o(` losses are averaged. For the next character 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(`mi`,null,`T`),n(`mo`,null,`=`),n(`mn`,null,`3`)]),n(`annotation`,{encoding:`application/x-tex`},`T = 3`)])])]),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.1389em`}},`T`),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`)])])]),o(` 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,`p`)]),n(`annotation`,{encoding:`application/x-tex`},`p`)])])]),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`},`p`)])])]),o(` = 0.8, 0.5, 0.25, the step losses are 0.22, 0.69 and 1.39. Their mean 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(`mn`,null,`0.77`)]),n(`annotation`,{encoding:`application/x-tex`},`L = 0.77`)])])]),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.6444em`}}),n(`span`,{class:`mord`},`0.77`)])])]),o(`.`)])]),n(`p`,null,`Either way, the same weights act at every step, so every loss term sends them gradient.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-ByycPNba.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,_ as n,bt as r,v as i,vt as a,x as o,z as s}from"./modules/shiki-CkJq9tSf.js";import{n as c,t as l}from"./slidev/context-DnYiQGy6.js";import{t as u}from"./default-CkTgO_iP.js";var d={__name:`slides.md__slidev_109`,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,r(t(a(l)(a(v),108))),{default:e(()=>[...d[0]||=[n(`h1`,null,`In words: The training loop, with one line added`,-1),n(`div`,{class:`dl-describe`},[n(`p`,null,[o(`The strip under the code is the loop in five boxes: forward, loss, backward, clip, step. Only `),n(`strong`,null,`clip`),o(` is new, so it is drawn in the accent colour.`)]),n(`ol`,null,[n(`li`,null,`The model, the cross-entropy loss, and Adam with learning rate 1e-3.`),n(`li`,null,`The loader now gives ids, lengths and labels.`),n(`li`,null,`Run forward with the lengths. Compute the loss and zero the gradients.`),n(`li`,null,[o(`Calling `),n(`code`,null,`backward()`),o(` computes the gradients.`)]),n(`li`,null,[o(`Then `),n(`code`,null,`clip_grad_norm_`),o(` rescales them so their total length is at most 1.0.`)]),n(`li`,null,[o(`Finally `),n(`code`,null,`step()`),o(` moves the weights.`)])]),n(`p`,null,`The clip sits after the gradients exist and before the weights change. Otherwise this is the MLP and CNN loop.`)],-1)]]),_:1},16))}};export{d as default};
lecture-05/assets/md-C-j1Z4l8.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,S as n,W as r,_ as i,b as a,bt as o,et as s,v as c,vt as l,x as u,z as d}from"./modules/shiki-CkJq9tSf.js";import{n as f,t as p}from"./slidev/context-DnYiQGy6.js";import{t as m}from"./default-CkTgO_iP.js";import{t as h}from"./slidev/VClicks-CNqMVSis.js";import{t as g}from"./slidev/KaTexBlockWrapper-BUTSeX36.js";var _={class:`dl-math-sm`},v={class:`grid grid-cols-[1fr_1.15fr] gap-8 mt-2 items-start dl-tight`},y={class:`mt-2 dl-callout`},b={class:`mt-2 dl-secondary`},x={__name:`slides.md__slidev_30`,setup(x){let{$slidev:S,$nav:C,$clicksContext:w,$clicks:T,$page:E,$renderContext:D,$frontmatter:O}=f();return w.setup(),(f,x)=>{let S=g,C=h,w=r(`click`);return d(),c(m,o(t(l(p)(l(O),29))),{default:e(()=>[x[5]||=i(`h1`,null,`The forward pass, written down`,-1),x[6]||=i(`p`,null,`The new note is a squashed sum of this word and the old note:`,-1),i(`div`,_,[n(S,{ranges:[]},{default:e(()=>[...x[0]||=[i(`p`,null,[i(`span`,{class:`katex-display`},[i(`span`,{class:`katex`},[i(`span`,{class:`katex-mathml`},[i(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[i(`semantics`,null,[i(`mrow`,null,[i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`t`)]),i(`mo`,null,`=`),i(`mi`,null,`tanh`),i(`mo`,null,`⁑`),i(`mtext`,null,` ⁣`),i(`mrow`,null,[i(`mo`,{fence:`true`},`(`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`x`),i(`mi`,null,`h`)])]),i(`mtext`,null,` `),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`x`),i(`mi`,null,`t`)]),i(`mo`,null,`+`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`h`)])]),i(`mtext`,null,` `),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1`)])]),i(`mo`,null,`+`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`b`),i(`mi`,null,`h`)]),i(`mo`,{fence:`true`},`)`)]),i(`mspace`,{width:`2em`}),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`o`),i(`mi`,null,`t`)]),i(`mo`,null,`=`),i(`msub`,null,[i(`mi`,null,`W`),i(`mrow`,null,[i(`mi`,null,`h`),i(`mi`,null,`o`)])]),i(`mtext`,null,` `),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mi`,null,`t`)]),i(`mo`,null,`+`),i(`msub`,null,[i(`mi`,{mathvariant:`bold`},`b`),i(`mi`,null,`o`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}_t = \\tanh\\!\\left(W_{xh}\\,\\mathbf{x}_t + W_{hh}\\,\\mathbf{h}_{t-1} + \\mathbf{b}_h\\right) \\qquad \\mathbf{o}_t = W_{ho}\\,\\mathbf{h}_t + \\mathbf{b}_o`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),i(`span`,{class:`mop`},`tanh`),i(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`minner`},[i(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},`(`),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`x`),i(`span`,{class:`mord mathnormal mtight`},`h`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`x`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`hh`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2083em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`b`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`h`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},`)`)]),i(`span`,{class:`mspace`,style:{"margin-right":`2em`}}),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`o`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),i(`span`,{class:`mrel`},`=`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3361em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`h`),i(`span`,{class:`mord mathnormal mtight`},`o`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])]),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),i(`span`,{class:`mbin`},`+`),i(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`b`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.1514em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`o`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])])])],-1)]]),_:1})]),i(`div`,v,[x[4]||=i(`div`,null,[i(`svg`,{viewBox:`0 0 320 170`,class:`dl-diagram is-sm`,role:`img`,"aria-label":`One recurrent cell: the old state comes in from the left, the input from below, the new state leaves to the right and the output goes up`},[i(`defs`,null,[i(`marker`,{id:`l5b-fwd-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[i(`path`,{d:`M0 0 L7 3.5 L0 7 z`,class:`dl-dg-head`})])]),i(`rect`,{x:`115`,y:`66`,width:`90`,height:`42`,rx:`6`,class:`dl-dg-box is-accent`}),i(`text`,{x:`160`,y:`93`,"text-anchor":`middle`,class:`dl-dg-lab is-sm`},`tanh`),i(`text`,{x:`30`,y:`92`,"text-anchor":`middle`,class:`dl-dg-in`},`hβ‚œβ‚‹β‚`),i(`path`,{d:`M52 87 H111`,class:`dl-dg-arrow`,"marker-end":`url(#l5b-fwd-head)`}),i(`text`,{x:`82`,y:`78`,"text-anchor":`middle`,class:`dl-dg-small`},`W_hh`),i(`path`,{d:`M207 87 H266`,class:`dl-dg-arrow`,"marker-end":`url(#l5b-fwd-head)`}),i(`text`,{x:`290`,y:`92`,"text-anchor":`middle`,class:`dl-dg-in`},`hβ‚œ`),i(`text`,{x:`160`,y:`162`,"text-anchor":`middle`,class:`dl-dg-in`},`xβ‚œ`),i(`path`,{d:`M160 146 V112`,class:`dl-dg-arrow`,"marker-end":`url(#l5b-fwd-head)`}),i(`text`,{x:`168`,y:`134`,class:`dl-dg-small`},`W_xh`),i(`path`,{d:`M160 64 V30`,class:`dl-dg-arrow`,"marker-end":`url(#l5b-fwd-head)`}),i(`text`,{x:`168`,y:`50`,class:`dl-dg-small`},`W_ho`),i(`text`,{x:`160`,y:`20`,"text-anchor":`middle`,class:`dl-dg-in`},`oβ‚œ`)])],-1),i(`div`,null,[n(C,null,{default:e(()=>[...x[1]||=[i(`ul`,null,[i(`li`,null,[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(`msub`,null,[i(`mi`,{mathvariant:`bold`},`x`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`x`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])]),u(` β€” this word’s embedding`)]),i(`li`,null,[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(`msub`,null,[i(`mi`,{mathvariant:`bold`},`h`),i(`mrow`,null,[i(`mi`,null,`t`),i(`mo`,null,`βˆ’`),i(`mn`,null,`1`)])])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}_{t-1}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.9028em`,"vertical-align":`-0.2083em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`h`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.3011em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`),i(`span`,{class:`mbin mtight`},`βˆ’`),i(`span`,{class:`mord mtight`},`1`)])])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2083em`}},[i(`span`)])])])])])])])]),u(` β€” the note: `),i(`strong`,null,`all the layer remembers`)]),i(`li`,null,[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(`mi`,null,`tanh`),i(`mo`,null,`⁑`)]),i(`annotation`,{encoding:`application/x-tex`},`\\tanh`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mop`},`tanh`)])])]),u(` keeps `),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(`mi`,{mathvariant:`bold`},`h`)]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{h}`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.6944em`}}),i(`span`,{class:`mord mathbf`},`h`)])])]),u(` between βˆ’1 and 1`)])],-1)]]),_:1}),s((d(),a(`div`,y,[...x[2]||=[i(`p`,null,`Delete the second term and this is a dense layer.`,-1)]])),[[w]]),s((d(),a(`div`,b,[...x[3]||=[i(`p`,null,[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(`msub`,null,[i(`mi`,{mathvariant:`bold`},`o`),i(`mi`,null,`t`)])]),i(`annotation`,{encoding:`application/x-tex`},`\\mathbf{o}_t`)])])]),i(`span`,{class:`katex-html`,"aria-hidden":`true`},[i(`span`,{class:`katex-base`},[i(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),i(`span`,{class:`mord`},[i(`span`,{class:`mord mathbf`},`o`),i(`span`,{class:`msupsub`},[i(`span`,{class:`vlist-t vlist-t2`},[i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.2806em`}},[i(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[i(`span`,{class:`pstrut`,style:{height:`2.7em`}}),i(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[i(`span`,{class:`mord mathnormal mtight`},`t`)])])]),i(`span`,{class:`vlist-s`},`​`)]),i(`span`,{class:`vlist-r`},[i(`span`,{class:`vlist`,style:{height:`0.15em`}},[i(`span`)])])])])])])])]),u(`: logits, with no activation.`)],-1)]])),[[w]])])])]),_:1},16)}}};export{x as default};