Download lecture-07/assets/AutoencoderLab-BLIx_rsl.js from DeepLearning-VT/DeepLearning_2026: direct link, hf CLI and curl.
- Browser
- Download file 4.06 kB
-
https://huggingface.co/spaces/DeepLearning-VT/DeepLearning_2026/resolve/main/lecture-07/assets/AutoencoderLab-BLIx_rsl.js
- Command line
-
hf download hf://spaces/DeepLearning-VT/DeepLearning_2026/lecture-07/assets/AutoencoderLab-BLIx_rsl.js
-
curl -L -o AutoencoderLab-BLIx_rsl.js https://huggingface.co/spaces/DeepLearning-VT/DeepLearning_2026/resolve/main/lecture-07/assets/AutoencoderLab-BLIx_rsl.js
4.06 kB
| import{B as e,C as t,Ct as n,H as r,T as i,_ as a,b as o,bt as s,dt as c,et as l,g as u,m as d,v as f,y as p,yt as m}from"./modules/shiki-CJZsCeMT.js";import{t as h}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as g}from"./slidev/context-DB-9afGB.js";import{d as _,f as v,s as y,x as b,y as x}from"./useGenerative-DhxjRRg5.js";import{n as S,t as C}from"./StepButton-BHTS1uiY.js";import{t as w}from"./Plot2D-ifvwvNLG.js";import{t as T}from"./PlotLabel-BuFT7VP9.js";import{t as E}from"./PlotPoints-Cxs9FmbK.js";import{t as D}from"./PlotCurve-BoqzCl1G.js";var O={class:`dl-ae`},ee={class:`dl-ae__strip`,viewBox:`0 0 470 46`,role:`img`,"aria-label":`The latent codes of every training point, on one axis`},k=[`x1`,`x2`],A=[`x1`,`x2`],j=[`x1`,`x2`],M=[`x`],N={key:0},P={key:1},F={key:2},I={key:3},L=420,R=26,z=h(i({__name:`AutoencoderLab`,props:{latentDim:{default:1}},setup(i){let{$slidev:h,$nav:z,$clicksContext:te,$clicks:ne,$page:re,$renderContext:ie,$frontmatter:ae}=g(),B=c(i.latentDim),V=b(22),H=_(V),U=u(()=>B.value===2?V:V.map(x)),W=u(()=>{let e=[];for(let t=0;t<=80;t++)e.push(y(-1.25+2.5*t/80));return e}),G=[-1,0,...v(H)],K=c(-1),q=u(()=>K.value>=0?G[K.value%G.length]:null),J=u(()=>q.value===null?null:y(q.value)),Y=u(()=>{let e=J.value;return e?Math.sqrt(Math.min(...V.map(t=>(t.x-e.x)**2+(t.y-e.y)**2))):null}),X=u(()=>Y.value!==null&&Y.value>.6);function Z(){K.value+=1}function Q(){K.value=-1}function $(e){return R+(e+1.5)/3*L}return(i,c)=>{let u=D,h=E,g=T,_=w,v=C,y=S;return e(),f(y,{"max-width":`44rem`},{controls:l(()=>[t(v,{label:B.value===1?`latent = 1 (undercomplete)`:`latent = 2 (as wide as the input)`,variant:`ghost`,glyph:`⇆`,onClick:c[0]||=e=>B.value=B.value===1?2:1},null,8,[`label`]),t(v,{label:`Decode a fresh z`,disabled:B.value!==1,onClick:Z},null,8,[`disabled`]),K.value>=0?(e(),f(v,{key:0,label:`Clear`,variant:`ghost`,onClick:Q})):p(`v-if`,!0)]),readout:l(()=>[B.value===2?(e(),o(`span`,N,` Latent as wide as the input: the reconstruction is exact and the model has learned nothing — grey and teal are the same points. `)):q.value===null?(e(),o(`span`,P,` Latent codes sit in three clumps with two gaps. Decode a z from a gap and see what comes out. `)):X.value?(e(),o(`span`,F,` z = `+n(q.value.toFixed(2))+` fell in a gap. The nearest real example is `+n(Y.value.toFixed(2))+` away — this output is not data. `,1)):(e(),o(`span`,I,` z = `+n(q.value.toFixed(2))+` sits inside a clump, so it decodes to something plausible — nearest real example `+n(Y.value.toFixed(2))+` away. `,1))]),default:l(()=>[a(`div`,O,[t(_,{"x-domain":[-3.6,3.6],"y-domain":[-2.4,2.4],width:470,height:220,"x-ticks":[-3,0,3],"y-ticks":[-2,0,2]},{default:l(()=>[p(` everything a 1-D decoder can produce, ever `),B.value===1?(e(),f(u,{key:0,points:W.value,color:`var(--dl-accent)`,width:2,opacity:.5},null,8,[`points`])):p(`v-if`,!0),t(h,{points:m(V),radius:3.4,color:`var(--dl-muted)`,opacity:.55},null,8,[`points`]),t(h,{points:U.value,radius:3,color:`var(--dl-accent)`},null,8,[`points`]),J.value?(e(),o(d,{key:1},[t(h,{points:[{...J.value,highlight:!0}],radius:7,color:X.value?`var(--dl-danger)`:`var(--dl-heading)`},null,8,[`points`,`color`]),t(g,{at:[J.value.x,J.value.y],text:`g(${q.value.toFixed(2)})`,dy:-14,color:X.value?`var(--dl-danger)`:`var(--dl-heading)`,bold:``},null,8,[`at`,`text`,`color`])],64)):p(`v-if`,!0)]),_:1}),p(` where the training data's codes actually are `),(e(),o(`svg`,ee,[a(`line`,{class:`dl-ae__axis`,x1:$(-1.5),x2:$(1.5),y1:`26`,y2:`26`},null,8,k),(e(!0),o(d,null,r(m(H),(t,n)=>(e(),o(`line`,{key:n,class:`dl-ae__tick`,x1:$(t),x2:$(t),y1:`16`,y2:`26`},null,8,A))),128)),q.value===null?p(`v-if`,!0):(e(),o(d,{key:0},[a(`line`,{class:s([`dl-ae__probe`,{"is-hole":X.value}]),x1:$(q.value),x2:$(q.value),y1:`10`,y2:`34`},null,10,j),a(`text`,{class:s([`dl-ae__probelab`,{"is-hole":X.value}]),x:$(q.value),y:`44`,"text-anchor":`middle`},`z = `+n(q.value.toFixed(2)),11,M)],64)),c[1]||=a(`text`,{class:`dl-ae__striplab`,x:`8`,y:`30`},`z`,-1)]))])]),_:1})}}}),[[`__scopeId`,`data-v-f2ff8b85`]]);export{z as t}; |