[{"data":1,"prerenderedAt":44855},["ShallowReactive",2],{"profile":3,"og-project-count":64,"projects-all":65,"i-lucide:share-2":44847,"i-lucide:moon":44851,"tikz:b72623aff6c2c6efbd912ec641a33cca6e23453518ac5eb283f916895b3eef65":44853,"tikz:e15002c31491229fa41d1faaf02fd3cc8f9daa5d7baa269bd9a9485551ffcf0e":44854},{"id":4,"blurb":5,"email":6,"extension":7,"location":8,"meta":9,"name":10,"og":11,"site":14,"socials":15,"stem":45,"version":46,"versions":47,"__hash__":63},"profile\u002Fprofile.yml","Looking to trade notes on systems, mathematics, and the craft of\nbuilding software that lasts.","amittaijoel@outlook.com","yml","Menlo Park, CA.",{},"Amittai Siavava",{"kicker":12,"description":13},"Product Engineer","Crafting experiences.\nI build software from first principles — compilers, search engines,\nsimulations — and write about the systems and mathematics beneath it.","amittai.studio",[16,21,26,31,36,41],{"label":17,"icon":18,"url":19,"color":20},"LinkedIn","simple-icons:linkedin","https:\u002F\u002Flinkedin.com\u002Fin\u002Fsiavava","#0A66C2",{"label":22,"icon":23,"url":24,"color":25},"GitHub","simple-icons:github","https:\u002F\u002Fgithub.com\u002Fsiavava","#181717",{"label":27,"icon":28,"url":29,"color":30},"HuggingFace","simple-icons:huggingface","https:\u002F\u002Fhuggingface.co\u002Fsiavava","#FFD21E",{"label":32,"icon":33,"url":34,"color":35},"Twitter","simple-icons:x","https:\u002F\u002Fx.com\u002Fproofofalt","#000000",{"label":37,"icon":38,"url":39,"color":40},"Substack","simple-icons:substack","https:\u002F\u002Fsubstack.com\u002F@siavava","#FF6719",{"label":42,"icon":43,"url":44,"color":35},"Literal","simple-icons:literal","https:\u002F\u002Fliteral.club\u002Fctrl","profile","v5.0.1",[48,51,54,57,60],{"label":49,"url":50},"v1","https:\u002F\u002Fv1.amittai.studio",{"label":52,"url":53},"v2","https:\u002F\u002Fv2.amittai.studio",{"label":55,"url":56},"v3","https:\u002F\u002Fv3.amittai.studio",{"label":58,"url":59},"v4","https:\u002F\u002Fv4.amittai.studio",{"label":61,"url":62},"v5","https:\u002F\u002Famittai.studio","ZQIWiRwc_pbe4-8kAaV8BEyYoMsF7LMYHJawvAc0vNE",67,[66,497,2284,2368,3979,5124,5691,7071,8862,11041,12391,12666,13039,13474,13726,13825,14000,14946,15298,15347,15470,15652,17729,19202,19320,19458,19884,20004,20164,20254,20324,20933,21011,21104,21251,21486,22818,24574,25742,25802,27111,27958,29283,31016,31157,32405,33080,33221,35677,36663,37046,37649,38393,38497,38874,38953,41438,41533,42991,43817,43912,44153,44216,44552,44629,44710,44761],{"id":67,"title":68,"body":69,"date":481,"description":482,"extension":483,"featured":484,"meta":485,"navigation":484,"path":486,"references":487,"repo":489,"seo":490,"stem":491,"summary":492,"tag":493,"tech":494,"url":78,"__hash__":496},"projects\u002Fprojects\u002Fvisual\u002F89-astronomy.md","Astronomy Simulations",{"type":70,"value":71,"toc":477},"minimark",[72,112,245,249,289,292,388,391,394,446,455,464],[73,74,75,82,83,88,89,94,95,100,101,106,107,111],"p",{},[76,77,81],"a",{"href":78,"rel":79},"https:\u002F\u002Fastra.amittai.studio",[80],"nofollow","astra"," is a real-time solar system that runs in the browser: the\nsun, the eight planets, and their major moons as textured ",[76,84,87],{"href":85,"rel":86},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGlTF",[80],"glTF","\nmodels drawn with ",[76,90,93],{"href":91,"rel":92},"https:\u002F\u002Fthreejs.org",[80],"Three.js"," over WebGL and served from\n",[76,96,99],{"href":97,"rel":98},"https:\u002F\u002Fnuxt.com",[80],"Nuxt",". Every body's orbit and physical dimensions come from a\n",[76,102,105],{"href":103,"rel":104},"https:\u002F\u002Fcontent.nuxt.com",[80],"Nuxt Content"," ",[108,109,110],"code",{},"bodies.yml"," file instead of the source, so\ncorrecting a radius or adding a moon is an edit to the data rather than to\nthe geometry.",[73,113,114,115,244],{},"The planets move at such different rates because of gravity. The sun pulls\neach one inward with a force that grows as it draws nearer, and for a\nnearly circular orbit that pull is exactly the centripetal force needed to\nbend the planet's motion into a loop instead of letting it fly off in a\nstraight line. Balancing the two leaves an orbital speed of\n",[116,117,120],"span",{"className":118},[119],"katex",[116,121,125,154],{"className":122,"ariaHidden":124},[123],"katex-html","true",[116,126,129,134,141,146,151],{"className":127},[128],"base",[116,130],{"className":131,"style":133},[132],"strut","height:0.4306em;",[116,135,140],{"className":136,"style":139},[137,138],"mord","mathnormal","margin-right:0.0359em;","v",[116,142],{"className":143,"style":145},[144],"mspace","margin-right:0.2778em;",[116,147,150],{"className":148},[149],"mrel","=",[116,152],{"className":153,"style":145},[144],[116,155,157,161],{"className":156},[128],[116,158],{"className":159,"style":160},[132],"height:1.24em;vertical-align:-0.305em;",[116,162,165],{"className":163},[137,164],"sqrt",[116,166,170,235],{"className":167},[168,169],"vlist-t","vlist-t2",[116,171,174,230],{"className":172},[173],"vlist-r",[116,175,179,207],{"className":176,"style":178},[177],"vlist","height:0.935em;",[116,180,184,189],{"className":181,"style":183},[182],"svg-align","top:-3.2em;",[116,185],{"className":186,"style":188},[187],"pstrut","height:3.2em;",[116,190,193,198,202],{"className":191,"style":192},[137],"padding-left:1em;",[116,194,197],{"className":195,"style":196},[137,138],"margin-right:0.109em;","GM",[116,199,201],{"className":200},[137],"\u002F",[116,203,206],{"className":204,"style":205},[137,138],"margin-right:0.0278em;","r",[116,208,210,213],{"style":209},"top:-2.895em;",[116,211],{"className":212,"style":188},[187],[116,214,218],{"className":215,"style":217},[216],"hide-tail","min-width:1.02em;height:1.28em;",[219,220,226],"svg",{"xmlns":221,"width":222,"height":223,"viewBox":224,"preserveAspectRatio":225},"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","400em","1.28em","0 0 400000 1296","xMinYMin slice",[227,228],"path",{"d":229},"M263,681c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl0 -0\nc4.7,-7.3,11,-11,19,-11\nH40000v40H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM1001 80h400000v40h-400000z",[116,231,234],{"className":232},[233],"vlist-s","​",[116,236,238],{"className":237},[173],[116,239,242],{"className":240,"style":241},[177],"height:0.305em;",[116,243],{},", so a planet close to the sun is held tightly, sweeps a\nshort path, and finishes its year quickly, while a distant one drifts.\nMercury laps the sun every eighty-eight days at almost 48 km\u002Fs; Neptune\ntakes a hundred and sixty-four years at barely a tenth of that.",[246,247],"tikz-figure",{"hash":248},"6951d72210e9f232db269665ca762e1d3d3259b4298aaa90d92f3126b5846960",[73,250,251,252,255,256,259,260,288],{},"Rather than recompute that force every frame, astra reads each body's\nmeasured orbital speed and radius and moves the planet along its circle\ndirectly. On each frame ",[108,253,254],{},"tick"," advances the body's ",[108,257,258],{},"currentDistance"," by\n",[116,261,263],{"className":262},[119],[116,264,266],{"className":265,"ariaHidden":124},[123],[116,267,269,273,276,280,284],{"className":268},[128],[116,270],{"className":271,"style":272},[132],"height:0.6833em;",[116,274,140],{"className":275,"style":139},[137,138],[116,277],{"className":278,"style":279},[144],"margin-right:0.1667em;",[116,281,283],{"className":282},[137],"Δ",[116,285,287],{"className":286},[137,138],"t",", wraps it at the orbital circumference, and turns it into an\nangle around the sun; a second rotation spins the body on its own axis at\nits real rotation rate, tilted to match its axial tilt. A moon rides its\nplanet's motion and lays its own orbit on top of it, and every planet\nstarts at a random phase, so they never fall into a straight line on load.",[73,290,291],{},"Those speeds come straight from the measured orbits:",[293,294,295,314],"table",{},[296,297,298],"thead",{},[299,300,301,305,308,311],"tr",{},[302,303,304],"th",{},"Planet",[302,306,307],{},"Orbital speed",[302,309,310],{},"Year",[302,312,313],{},"Moons",[315,316,317,332,346,360,374],"tbody",{},[299,318,319,323,326,329],{},[320,321,322],"td",{},"Mercury",[320,324,325],{},"47.9 km\u002Fs",[320,327,328],{},"88 days",[320,330,331],{},"0",[299,333,334,337,340,343],{},[320,335,336],{},"Earth",[320,338,339],{},"29.8 km\u002Fs",[320,341,342],{},"365 days",[320,344,345],{},"1",[299,347,348,351,354,357],{},[320,349,350],{},"Mars",[320,352,353],{},"24.1 km\u002Fs",[320,355,356],{},"1.88 years",[320,358,359],{},"2",[299,361,362,365,368,371],{},[320,363,364],{},"Saturn",[320,366,367],{},"9.7 km\u002Fs",[320,369,370],{},"29.5 years",[320,372,373],{},"82",[299,375,376,379,382,385],{},[320,377,378],{},"Neptune",[320,380,381],{},"5.4 km\u002Fs",[320,383,384],{},"164 years",[320,386,387],{},"14",[73,389,390],{},"The visualizer below strips the same relationship down to two dimensions, a\ntop-down system where each planet sweeps its ring at a rate set only by its\ndistance from the center.",[392,393],"orbit-viz",{},[73,395,396,397,440,441,445],{},"The clock stretches to taste: a speed control runs it from real time\nthrough a day a second up to roughly a month a second\n(",[116,398,400],{"className":399},[119],[116,401,403,417],{"className":402,"ariaHidden":124},[123],[116,404,406,410,414],{"className":405},[128],[116,407],{"className":408,"style":409},[132],"height:0.4831em;",[116,411,413],{"className":412},[149],"≈",[116,415],{"className":416,"style":145},[144],[116,418,420,424,428,436],{"className":419},[128],[116,421],{"className":422,"style":423},[132],"height:0.7667em;vertical-align:-0.0833em;",[116,425,427],{"className":426},[137],"2.4",[116,429,432],{"className":430},[137,431],"text",[116,433,435],{"className":434},[137],"M",[116,437,439],{"className":438},[137],"×","), with a date read-out following the simulated\ncalendar. An ",[442,443,444],"em",{},"idealized"," mode ignores true scale entirely and drives every\norbit at a legible, exaggerated pace, so the whole system is turning\nvisibly the moment it loads instead of appearing frozen.",[73,447,448,449,454],{},"The camera orbits and zooms under damped ",[76,450,453],{"href":451,"rel":452},"https:\u002F\u002Fthreejs.org\u002Fdocs\u002F#examples\u002Fen\u002Fcontrols\u002FOrbitControls",[80],"controls"," with panning\nswitched off so the sun stays centered. A raycaster picks out whatever body\nsits under the cursor and lights it, glowing the model and brightening its\norbit ring from a faint fifteen percent to full. Clicking that body slides\nin a card of its facts (day length, year, moon count, temperature, size\nagainst Earth) and retargets the camera to follow it, reframing the zoom to\nthe body's own diameter so the click drops you into a close orbit around\nit; clicking the sun pulls back out to the whole system.",[73,456,457,458,463],{},"Behind the planets, a cube-mapped starfield renders first on its own layer\nso everything composites cleanly over it, and the sun throws a\n",[76,459,462],{"href":460,"rel":461},"https:\u002F\u002Fthreejs.org\u002Fdocs\u002F#examples\u002Fen\u002Fobjects\u002FLensflare",[80],"lens flare"," from a warm point light. Ambient, area, and\ndirectional lights around the origin fill in the rest, enough that the\nplanets' far sides still catch light and read against the dark.",[73,465,466,467,472,473,476],{},"astra grew out of a ",[76,468,471],{"href":469,"rel":470},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-python\u002Ftree\u002Fmain\u002FCS1\u002FLAB\u002FLAB%202\u002Fxc",[80],"solar-system sketch"," I wrote in my\nfirst term, a 2-D ",[108,474,475],{},"cs1lib"," program that summed Newton's pairwise pulls on\nevery body each frame. This rebuild trades that live gravity integrator for\nmeasured orbital data, textured 3-D models, and a camera you can fly\nthrough the system.",{"title":478,"searchDepth":479,"depth":479,"links":480},"",2,[],"2024-05-15","astra is a real-time solar system that runs in the browser: the\nsun, the eight planets, and their major moons as textured glTF\nmodels drawn with Three.js over WebGL and served from\nNuxt. Every body's orbit and physical dimensions come from a\nNuxt Content bodies.yml file instead of the source, so\ncorrecting a radius or adding a moon is an edit to the data rather than to\nthe geometry.","md",true,{},"\u002Fprojects\u002Fvisual\u002F89-astronomy",[488],"https:\u002F\u002Fnotes.amittai.studio\u002Flinear-algebra","https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fastra",{"title":68,"description":482},"projects\u002Fvisual\u002F89-astronomy","A real-time 3-D solar system in the browser — Three.js renders textured\nplanet models orbiting the sun on a hierarchy of pivots, driven from real\norbital data, with click-to-focus planet cards and time that stretches from\nreal-time to a month a second.","visual computing",[99,93,495],"WebGL","ZepxEjYjRW6L9NqQHLGp2gq0hyF1KsLGOemT4Hs88bI",{"id":498,"title":499,"body":500,"date":2268,"description":2269,"extension":483,"featured":484,"meta":2270,"navigation":484,"path":2271,"references":2272,"repo":2273,"seo":2274,"stem":2275,"summary":2276,"tag":2277,"tech":2278,"url":2282,"__hash__":2283},"projects\u002Fprojects\u002Fcomputer-vision\u002F4.optical-flow.md","Optical Flow",{"type":70,"value":501,"toc":2266},[502,537,699,906,927,1853,1856,2106,2168,2262],[73,503,504,508,509,514,515,518,519,522,523,528,529,532,533,536],{},[505,506,507],"strong",{},"Optical flow"," is the apparent motion of the scene across a video,\nwhether the objects move or the camera does. This project builds three\ntrackers for it from first principles: a translation-only\n",[76,510,513],{"href":511,"rel":512},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLucas%E2%80%93Kanade_method",[80],"Lucas-Kanade","\nsolver (",[108,516,517],{},"LucasKanade","), a six-parameter affine version\n(",[108,520,521],{},"LucasKanadeAffine","), and its\n",[76,524,527],{"href":525,"rel":526},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLucas%E2%80%93Kanade_method#Inverse_compositional_algorithm",[80],"inverse-compositional","\ncounterpart (",[108,530,531],{},"InverseCompositionAffine",", the Matthews-Baker\nformulation). All three sample the image and its gradients at subpixel\nlocations with a ",[108,534,535],{},"RectBivariateSpline",", and iterate up to a hundred\ntimes or until the parameter update drops below tolerance.",[73,538,539,540,698],{},"All three rest on one equation. Assume a pixel keeps its brightness as it\nmoves; expanding ",[116,541,543],{"className":542},[119],[116,544,546,579,611,639,662],{"className":545,"ariaHidden":124},[123],[116,547,549,553,558,563,567,571,576],{"className":548},[128],[116,550],{"className":551,"style":552},[132],"height:1em;vertical-align:-0.25em;",[116,554,557],{"className":555,"style":556},[137,138],"margin-right:0.0785em;","I",[116,559,562],{"className":560},[561],"mopen","(",[116,564,566],{"className":565},[137,138],"x",[116,568],{"className":569,"style":570},[144],"margin-right:0.2222em;",[116,572,575],{"className":573},[574],"mbin","+",[116,577],{"className":578,"style":570},[144],[116,580,582,586,590,595,598,602,605,608],{"className":581},[128],[116,583],{"className":584,"style":585},[132],"height:0.7778em;vertical-align:-0.1944em;",[116,587,589],{"className":588},[137,138],"u",[116,591,594],{"className":592},[593],"mpunct",",",[116,596],{"className":597,"style":279},[144],[116,599,601],{"className":600,"style":139},[137,138],"y",[116,603],{"className":604,"style":570},[144],[116,606,575],{"className":607},[574],[116,609],{"className":610,"style":570},[144],[116,612,614,618,621,624,627,630,633,636],{"className":613},[128],[116,615],{"className":616,"style":617},[132],"height:0.8095em;vertical-align:-0.1944em;",[116,619,140],{"className":620,"style":139},[137,138],[116,622,594],{"className":623},[593],[116,625],{"className":626,"style":279},[144],[116,628,287],{"className":629},[137,138],[116,631],{"className":632,"style":570},[144],[116,634,575],{"className":635},[574],[116,637],{"className":638,"style":570},[144],[116,640,642,645,648,653,656,659],{"className":641},[128],[116,643],{"className":644,"style":552},[132],[116,646,345],{"className":647},[137],[116,649,652],{"className":650},[651],"mclose",")",[116,654],{"className":655,"style":145},[144],[116,657,150],{"className":658},[149],[116,660],{"className":661,"style":145},[144],[116,663,665,668,671,674,677,680,683,686,689,692,695],{"className":664},[128],[116,666],{"className":667,"style":552},[132],[116,669,557],{"className":670,"style":556},[137,138],[116,672,562],{"className":673},[561],[116,675,566],{"className":676},[137,138],[116,678,594],{"className":679},[593],[116,681],{"className":682,"style":279},[144],[116,684,601],{"className":685,"style":139},[137,138],[116,687,594],{"className":688},[593],[116,690],{"className":691,"style":279},[144],[116,693,287],{"className":694},[137,138],[116,696,652],{"className":697},[651]," to first order\ngives the brightness-constancy constraint",[116,700,703],{"className":701},[702],"katex-display",[116,704,706],{"className":705},[119],[116,707,709,777,837,893],{"className":708,"ariaHidden":124},[123],[116,710,712,716,765,768,771,774],{"className":711},[128],[116,713],{"className":714,"style":715},[132],"height:0.8333em;vertical-align:-0.15em;",[116,717,719,722],{"className":718},[137],[116,720,557],{"className":721,"style":556},[137,138],[116,723,726],{"className":724},[725],"msupsub",[116,727,729,756],{"className":728},[168,169],[116,730,732,753],{"className":731},[173],[116,733,736],{"className":734,"style":735},[177],"height:0.1514em;",[116,737,739,743],{"style":738},"top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;",[116,740],{"className":741,"style":742},[187],"height:2.7em;",[116,744,750],{"className":745},[746,747,748,749],"sizing","reset-size6","size3","mtight",[116,751,566],{"className":752},[137,138,749],[116,754,234],{"className":755},[233],[116,757,759],{"className":758},[173],[116,760,763],{"className":761,"style":762},[177],"height:0.15em;",[116,764],{},[116,766,589],{"className":767},[137,138],[116,769],{"className":770,"style":570},[144],[116,772,575],{"className":773},[574],[116,775],{"className":776,"style":570},[144],[116,778,780,784,825,828,831,834],{"className":779},[128],[116,781],{"className":782,"style":783},[132],"height:0.9694em;vertical-align:-0.2861em;",[116,785,787,790],{"className":786},[137],[116,788,557],{"className":789,"style":556},[137,138],[116,791,793],{"className":792},[725],[116,794,796,816],{"className":795},[168,169],[116,797,799,813],{"className":798},[173],[116,800,802],{"className":801,"style":735},[177],[116,803,804,807],{"style":738},[116,805],{"className":806,"style":742},[187],[116,808,810],{"className":809},[746,747,748,749],[116,811,601],{"className":812,"style":139},[137,138,749],[116,814,234],{"className":815},[233],[116,817,819],{"className":818},[173],[116,820,823],{"className":821,"style":822},[177],"height:0.2861em;",[116,824],{},[116,826,140],{"className":827,"style":139},[137,138],[116,829],{"className":830,"style":570},[144],[116,832,575],{"className":833},[574],[116,835],{"className":836,"style":570},[144],[116,838,840,843,884,887,890],{"className":839},[128],[116,841],{"className":842,"style":715},[132],[116,844,846,849],{"className":845},[137],[116,847,557],{"className":848,"style":556},[137,138],[116,850,852],{"className":851},[725],[116,853,855,876],{"className":854},[168,169],[116,856,858,873],{"className":857},[173],[116,859,862],{"className":860,"style":861},[177],"height:0.2806em;",[116,863,864,867],{"style":738},[116,865],{"className":866,"style":742},[187],[116,868,870],{"className":869},[746,747,748,749],[116,871,287],{"className":872},[137,138,749],[116,874,234],{"className":875},[233],[116,877,879],{"className":878},[173],[116,880,882],{"className":881,"style":762},[177],[116,883],{},[116,885],{"className":886,"style":145},[144],[116,888,150],{"className":889},[149],[116,891],{"className":892,"style":145},[144],[116,894,896,900,903],{"className":895},[128],[116,897],{"className":898,"style":899},[132],"height:0.8389em;vertical-align:-0.1944em;",[116,901,331],{"className":902},[137],[116,904,594],{"className":905},[593],[73,907,908,909,926],{},"one equation in two unknowns per pixel — the aperture problem: motion\nalong an edge is invisible. Lucas-Kanade resolves it by assuming the\nflow is constant over a small window ",[116,910,912],{"className":911},[119],[116,913,915],{"className":914,"ariaHidden":124},[123],[116,916,918,921],{"className":917},[128],[116,919],{"className":920,"style":272},[132],[116,922,925],{"className":923,"style":924},[137,138],"margin-right:0.1389em;","W"," and solving all of the window's\nconstraints at once, in least squares:",[116,928,930],{"className":929},[702],[116,931,933],{"className":932},[119],[116,934,936,1600],{"className":935,"ariaHidden":124},[123],[116,937,939,943,1518,1521,1591,1594,1597],{"className":938},[128],[116,940],{"className":941,"style":942},[132],"height:3.8185em;vertical-align:-2.357em;",[116,944,948],{"className":945},[946,947],"minner","munder",[116,949,951,1509],{"className":950},[168,169],[116,952,954,1506],{"className":953},[173],[116,955,958,1010],{"className":956,"style":957},[177],"height:1.4616em;",[116,959,961,965],{"style":960},"top:-1.1046em;",[116,962],{"className":963,"style":964},[187],"height:3.4616em;",[116,966,968],{"className":967},[746,747,748,749],[116,969,971,1007],{"className":970},[137,749],[116,972,974,978],{"className":973},[137,749],[116,975,977],{"className":976},[137,138,749],"A",[116,979,981],{"className":980},[725],[116,982,984],{"className":983},[168],[116,985,987],{"className":986},[173],[116,988,991],{"className":989,"style":990},[177],"height:0.782em;",[116,992,994,998],{"style":993},"top:-2.786em;margin-right:0.0714em;",[116,995],{"className":996,"style":997},[187],"height:2.5em;",[116,999,1003],{"className":1000},[746,1001,1002,749],"reset-size3","size1",[116,1004,1006],{"className":1005},[137,749],"⊤",[116,1008,977],{"className":1009},[137,138,749],[116,1011,1013,1016],{"style":1012},"top:-3.4616em;",[116,1014],{"className":1015,"style":964},[187],[116,1017,1019],{"className":1018},[946,947],[116,1020,1022,1497],{"className":1021},[168,169],[116,1023,1025,1494],{"className":1024},[173],[116,1026,1028,1072],{"className":1027,"style":957},[177],[116,1029,1032,1035],{"className":1030,"style":1031},[182],"top:-1.852em;",[116,1033],{"className":1034,"style":964},[187],[116,1036,1040,1052,1062],{"className":1037,"style":1039},[1038],"stretchy","height:0.548em;min-width:1.6em;",[116,1041,1045],{"className":1042,"style":1044},[1043],"brace-left","height:0.548em;",[219,1046,1049],{"xmlns":221,"width":222,"height":1047,"viewBox":1048,"preserveAspectRatio":225},"0.548em","0 0 400000 548",[227,1050],{"d":1051},"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 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\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",[116,1053,1056],{"className":1054,"style":1044},[1055],"brace-center",[219,1057,1059],{"xmlns":221,"width":222,"height":1047,"viewBox":1048,"preserveAspectRatio":1058},"xMidYMin slice",[227,1060],{"d":1061},"M199572 214\nc100.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\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 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\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",[116,1063,1066],{"className":1064,"style":1044},[1065],"brace-right",[219,1067,1069],{"xmlns":221,"width":222,"height":1047,"viewBox":1048,"preserveAspectRatio":1068},"xMaxYMin slice",[227,1070],{"d":1071},"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",[116,1073,1074,1077],{"style":1012},[116,1075],{"className":1076,"style":964},[187],[116,1078,1080],{"className":1079},[137],[116,1081,1083,1093,1487],{"className":1082},[946],[116,1084,1088],{"className":1085,"style":1087},[561,1086],"delimcenter","top:0em;",[116,1089,1092],{"className":1090},[1091,748],"delimsizing","[",[116,1094,1096],{"className":1095},[137],[116,1097,1100,1296,1301,1304],{"className":1098},[1099],"mtable",[116,1101,1104],{"className":1102},[1103],"col-align-c",[116,1105,1107,1287],{"className":1106},[168,169],[116,1108,1110,1284],{"className":1109},[173],[116,1111,1113,1189],{"className":1112,"style":957},[177],[116,1114,1116,1120],{"style":1115},"top:-3.6216em;",[116,1117],{"className":1118,"style":1119},[187],"height:3em;",[116,1121,1123,1131,1134],{"className":1122},[137],[116,1124,1130],{"className":1125,"style":1129},[1126,1127,1128],"mop","op-symbol","small-op","position:relative;top:0em;","∑",[116,1132],{"className":1133,"style":279},[144],[116,1135,1137,1140],{"className":1136},[137],[116,1138,557],{"className":1139,"style":556},[137,138],[116,1141,1143],{"className":1142},[725],[116,1144,1146,1180],{"className":1145},[168,169],[116,1147,1149,1177],{"className":1148},[173],[116,1150,1153,1165],{"className":1151,"style":1152},[177],"height:0.8141em;",[116,1154,1156,1159],{"style":1155},"top:-2.453em;margin-left:-0.0785em;margin-right:0.05em;",[116,1157],{"className":1158,"style":742},[187],[116,1160,1162],{"className":1161},[746,747,748,749],[116,1163,566],{"className":1164},[137,138,749],[116,1166,1168,1171],{"style":1167},"top:-3.063em;margin-right:0.05em;",[116,1169],{"className":1170,"style":742},[187],[116,1172,1174],{"className":1173},[746,747,748,749],[116,1175,359],{"className":1176},[137,749],[116,1178,234],{"className":1179},[233],[116,1181,1183],{"className":1182},[173],[116,1184,1187],{"className":1185,"style":1186},[177],"height:0.247em;",[116,1188],{},[116,1190,1192,1195],{"style":1191},"top:-2.4216em;",[116,1193],{"className":1194,"style":1119},[187],[116,1196,1198,1201,1204,1244],{"className":1197},[137],[116,1199,1130],{"className":1200,"style":1129},[1126,1127,1128],[116,1202],{"className":1203,"style":279},[144],[116,1205,1207,1210],{"className":1206},[137],[116,1208,557],{"className":1209,"style":556},[137,138],[116,1211,1213],{"className":1212},[725],[116,1214,1216,1236],{"className":1215},[168,169],[116,1217,1219,1233],{"className":1218},[173],[116,1220,1222],{"className":1221,"style":735},[177],[116,1223,1224,1227],{"style":738},[116,1225],{"className":1226,"style":742},[187],[116,1228,1230],{"className":1229},[746,747,748,749],[116,1231,566],{"className":1232},[137,138,749],[116,1234,234],{"className":1235},[233],[116,1237,1239],{"className":1238},[173],[116,1240,1242],{"className":1241,"style":762},[177],[116,1243],{},[116,1245,1247,1250],{"className":1246},[137],[116,1248,557],{"className":1249,"style":556},[137,138],[116,1251,1253],{"className":1252},[725],[116,1254,1256,1276],{"className":1255},[168,169],[116,1257,1259,1273],{"className":1258},[173],[116,1260,1262],{"className":1261,"style":735},[177],[116,1263,1264,1267],{"style":738},[116,1265],{"className":1266,"style":742},[187],[116,1268,1270],{"className":1269},[746,747,748,749],[116,1271,601],{"className":1272,"style":139},[137,138,749],[116,1274,234],{"className":1275},[233],[116,1277,1279],{"className":1278},[173],[116,1280,1282],{"className":1281,"style":822},[177],[116,1283],{},[116,1285,234],{"className":1286},[233],[116,1288,1290],{"className":1289},[173],[116,1291,1294],{"className":1292,"style":1293},[177],"height:0.9616em;",[116,1295],{},[116,1297],{"className":1298,"style":1300},[1299],"arraycolsep","width:0.5em;",[116,1302],{"className":1303,"style":1300},[1299],[116,1305,1307],{"className":1306},[1103],[116,1308,1310,1479],{"className":1309},[168,169],[116,1311,1313,1476],{"className":1312},[173],[116,1314,1316,1410],{"className":1315,"style":957},[177],[116,1317,1318,1321],{"style":1115},[116,1319],{"className":1320,"style":1119},[187],[116,1322,1324,1327,1330,1370],{"className":1323},[137],[116,1325,1130],{"className":1326,"style":1129},[1126,1127,1128],[116,1328],{"className":1329,"style":279},[144],[116,1331,1333,1336],{"className":1332},[137],[116,1334,557],{"className":1335,"style":556},[137,138],[116,1337,1339],{"className":1338},[725],[116,1340,1342,1362],{"className":1341},[168,169],[116,1343,1345,1359],{"className":1344},[173],[116,1346,1348],{"className":1347,"style":735},[177],[116,1349,1350,1353],{"style":738},[116,1351],{"className":1352,"style":742},[187],[116,1354,1356],{"className":1355},[746,747,748,749],[116,1357,566],{"className":1358},[137,138,749],[116,1360,234],{"className":1361},[233],[116,1363,1365],{"className":1364},[173],[116,1366,1368],{"className":1367,"style":762},[177],[116,1369],{},[116,1371,1373,1376],{"className":1372},[137],[116,1374,557],{"className":1375,"style":556},[137,138],[116,1377,1379],{"className":1378},[725],[116,1380,1382,1402],{"className":1381},[168,169],[116,1383,1385,1399],{"className":1384},[173],[116,1386,1388],{"className":1387,"style":735},[177],[116,1389,1390,1393],{"style":738},[116,1391],{"className":1392,"style":742},[187],[116,1394,1396],{"className":1395},[746,747,748,749],[116,1397,601],{"className":1398,"style":139},[137,138,749],[116,1400,234],{"className":1401},[233],[116,1403,1405],{"className":1404},[173],[116,1406,1408],{"className":1407,"style":822},[177],[116,1409],{},[116,1411,1412,1415],{"style":1191},[116,1413],{"className":1414,"style":1119},[187],[116,1416,1418,1421,1424],{"className":1417},[137],[116,1419,1130],{"className":1420,"style":1129},[1126,1127,1128],[116,1422],{"className":1423,"style":279},[144],[116,1425,1427,1430],{"className":1426},[137],[116,1428,557],{"className":1429,"style":556},[137,138],[116,1431,1433],{"className":1432},[725],[116,1434,1436,1467],{"className":1435},[168,169],[116,1437,1439,1464],{"className":1438},[173],[116,1440,1442,1453],{"className":1441,"style":1152},[177],[116,1443,1444,1447],{"style":1155},[116,1445],{"className":1446,"style":742},[187],[116,1448,1450],{"className":1449},[746,747,748,749],[116,1451,601],{"className":1452,"style":139},[137,138,749],[116,1454,1455,1458],{"style":1167},[116,1456],{"className":1457,"style":742},[187],[116,1459,1461],{"className":1460},[746,747,748,749],[116,1462,359],{"className":1463},[137,749],[116,1465,234],{"className":1466},[233],[116,1468,1470],{"className":1469},[173],[116,1471,1474],{"className":1472,"style":1473},[177],"height:0.3831em;",[116,1475],{},[116,1477,234],{"className":1478},[233],[116,1480,1482],{"className":1481},[173],[116,1483,1485],{"className":1484,"style":1293},[177],[116,1486],{},[116,1488,1490],{"className":1489,"style":1087},[651,1086],[116,1491,1493],{"className":1492},[1091,748],"]",[116,1495,234],{"className":1496},[233],[116,1498,1500],{"className":1499},[173],[116,1501,1504],{"className":1502,"style":1503},[177],"height:1.6096em;",[116,1505],{},[116,1507,234],{"className":1508},[233],[116,1510,1512],{"className":1511},[173],[116,1513,1516],{"className":1514,"style":1515},[177],"height:2.357em;",[116,1517],{},[116,1519],{"className":1520,"style":279},[144],[116,1522,1524,1530,1585],{"className":1523},[946],[116,1525,1527],{"className":1526,"style":1087},[561,1086],[116,1528,1092],{"className":1529},[1091,748],[116,1531,1533],{"className":1532},[137],[116,1534,1536],{"className":1535},[1099],[116,1537,1539],{"className":1538},[1103],[116,1540,1542,1576],{"className":1541},[168,169],[116,1543,1545,1573],{"className":1544},[173],[116,1546,1549,1561],{"className":1547,"style":1548},[177],"height:1.45em;",[116,1550,1552,1555],{"style":1551},"top:-3.61em;",[116,1553],{"className":1554,"style":1119},[187],[116,1556,1558],{"className":1557},[137],[116,1559,589],{"className":1560},[137,138],[116,1562,1564,1567],{"style":1563},"top:-2.41em;",[116,1565],{"className":1566,"style":1119},[187],[116,1568,1570],{"className":1569},[137],[116,1571,140],{"className":1572,"style":139},[137,138],[116,1574,234],{"className":1575},[233],[116,1577,1579],{"className":1578},[173],[116,1580,1583],{"className":1581,"style":1582},[177],"height:0.95em;",[116,1584],{},[116,1586,1588],{"className":1587,"style":1087},[651,1086],[116,1589,1493],{"className":1590},[1091,748],[116,1592],{"className":1593,"style":145},[144],[116,1595,150],{"className":1596},[149],[116,1598],{"className":1599,"style":145},[144],[116,1601,1603,1607,1611,1614,1846,1849],{"className":1602},[128],[116,1604],{"className":1605,"style":1606},[132],"height:2.4em;vertical-align:-0.95em;",[116,1608,1610],{"className":1609},[137],"−",[116,1612],{"className":1613,"style":279},[144],[116,1615,1617,1623,1840],{"className":1616},[946],[116,1618,1620],{"className":1619,"style":1087},[561,1086],[116,1621,1092],{"className":1622},[1091,748],[116,1624,1626],{"className":1625},[137],[116,1627,1629],{"className":1628},[1099],[116,1630,1632],{"className":1631},[1103],[116,1633,1635,1832],{"className":1634},[168,169],[116,1636,1638,1829],{"className":1637},[173],[116,1639,1641,1735],{"className":1640,"style":1548},[177],[116,1642,1643,1646],{"style":1551},[116,1644],{"className":1645,"style":1119},[187],[116,1647,1649,1652,1655,1695],{"className":1648},[137],[116,1650,1130],{"className":1651,"style":1129},[1126,1127,1128],[116,1653],{"className":1654,"style":279},[144],[116,1656,1658,1661],{"className":1657},[137],[116,1659,557],{"className":1660,"style":556},[137,138],[116,1662,1664],{"className":1663},[725],[116,1665,1667,1687],{"className":1666},[168,169],[116,1668,1670,1684],{"className":1669},[173],[116,1671,1673],{"className":1672,"style":735},[177],[116,1674,1675,1678],{"style":738},[116,1676],{"className":1677,"style":742},[187],[116,1679,1681],{"className":1680},[746,747,748,749],[116,1682,566],{"className":1683},[137,138,749],[116,1685,234],{"className":1686},[233],[116,1688,1690],{"className":1689},[173],[116,1691,1693],{"className":1692,"style":762},[177],[116,1694],{},[116,1696,1698,1701],{"className":1697},[137],[116,1699,557],{"className":1700,"style":556},[137,138],[116,1702,1704],{"className":1703},[725],[116,1705,1707,1727],{"className":1706},[168,169],[116,1708,1710,1724],{"className":1709},[173],[116,1711,1713],{"className":1712,"style":861},[177],[116,1714,1715,1718],{"style":738},[116,1716],{"className":1717,"style":742},[187],[116,1719,1721],{"className":1720},[746,747,748,749],[116,1722,287],{"className":1723},[137,138,749],[116,1725,234],{"className":1726},[233],[116,1728,1730],{"className":1729},[173],[116,1731,1733],{"className":1732,"style":762},[177],[116,1734],{},[116,1736,1737,1740],{"style":1563},[116,1738],{"className":1739,"style":1119},[187],[116,1741,1743,1746,1749,1789],{"className":1742},[137],[116,1744,1130],{"className":1745,"style":1129},[1126,1127,1128],[116,1747],{"className":1748,"style":279},[144],[116,1750,1752,1755],{"className":1751},[137],[116,1753,557],{"className":1754,"style":556},[137,138],[116,1756,1758],{"className":1757},[725],[116,1759,1761,1781],{"className":1760},[168,169],[116,1762,1764,1778],{"className":1763},[173],[116,1765,1767],{"className":1766,"style":735},[177],[116,1768,1769,1772],{"style":738},[116,1770],{"className":1771,"style":742},[187],[116,1773,1775],{"className":1774},[746,747,748,749],[116,1776,601],{"className":1777,"style":139},[137,138,749],[116,1779,234],{"className":1780},[233],[116,1782,1784],{"className":1783},[173],[116,1785,1787],{"className":1786,"style":822},[177],[116,1788],{},[116,1790,1792,1795],{"className":1791},[137],[116,1793,557],{"className":1794,"style":556},[137,138],[116,1796,1798],{"className":1797},[725],[116,1799,1801,1821],{"className":1800},[168,169],[116,1802,1804,1818],{"className":1803},[173],[116,1805,1807],{"className":1806,"style":861},[177],[116,1808,1809,1812],{"style":738},[116,1810],{"className":1811,"style":742},[187],[116,1813,1815],{"className":1814},[746,747,748,749],[116,1816,287],{"className":1817},[137,138,749],[116,1819,234],{"className":1820},[233],[116,1822,1824],{"className":1823},[173],[116,1825,1827],{"className":1826,"style":762},[177],[116,1828],{},[116,1830,234],{"className":1831},[233],[116,1833,1835],{"className":1834},[173],[116,1836,1838],{"className":1837,"style":1582},[177],[116,1839],{},[116,1841,1843],{"className":1842,"style":1087},[651,1086],[116,1844,1493],{"className":1845},[1091,748],[116,1847],{"className":1848,"style":279},[144],[116,1850,1852],{"className":1851},[137],".",[246,1854],{"hash":1855},"affd957554622cfe8f7ebe661a20c8a38d4410cfff7e54f5f44f74cde0e3fbc8",[73,1857,1858,1859,1894,1895,1940,1941,1975,1976,2071,2072,2105],{},"The translation tracker reduces to a ",[116,1860,1862],{"className":1861},[119],[116,1863,1865,1884],{"className":1864,"ariaHidden":124},[123],[116,1866,1868,1872,1875,1878,1881],{"className":1867},[128],[116,1869],{"className":1870,"style":1871},[132],"height:0.7278em;vertical-align:-0.0833em;",[116,1873,359],{"className":1874},[137],[116,1876],{"className":1877,"style":570},[144],[116,1879,439],{"className":1880},[574],[116,1882],{"className":1883,"style":570},[144],[116,1885,1887,1891],{"className":1886},[128],[116,1888],{"className":1889,"style":1890},[132],"height:0.6444em;",[116,1892,359],{"className":1893},[137]," solve per window, and\nthe matrix ",[116,1896,1898],{"className":1897},[119],[116,1899,1901],{"className":1900,"ariaHidden":124},[123],[116,1902,1904,1908,1937],{"className":1903},[128],[116,1905],{"className":1906,"style":1907},[132],"height:0.8491em;",[116,1909,1911,1914],{"className":1910},[137],[116,1912,977],{"className":1913},[137,138],[116,1915,1917],{"className":1916},[725],[116,1918,1920],{"className":1919},[168],[116,1921,1923],{"className":1922},[173],[116,1924,1926],{"className":1925,"style":1907},[177],[116,1927,1928,1931],{"style":1167},[116,1929],{"className":1930,"style":742},[187],[116,1932,1934],{"className":1933},[746,747,748,749],[116,1935,1006],{"className":1936},[137,749],[116,1938,977],{"className":1939},[137,138]," is exactly the Harris corner matrix, which is why\ncorners are the pixels worth tracking: the system is well-conditioned\nprecisely where the image has structure in two directions. The affine\nversion widens the warp to six parameters, so each pixel's Jacobian is\nthe ",[116,1942,1944],{"className":1943},[119],[116,1945,1947,1965],{"className":1946,"ariaHidden":124},[123],[116,1948,1950,1953,1956,1959,1962],{"className":1949},[128],[116,1951],{"className":1952,"style":1871},[132],[116,1954,359],{"className":1955},[137],[116,1957],{"className":1958,"style":570},[144],[116,1960,439],{"className":1961},[574],[116,1963],{"className":1964,"style":570},[144],[116,1966,1968,1971],{"className":1967},[128],[116,1969],{"className":1970,"style":1890},[132],[116,1972,1974],{"className":1973},[137],"6"," block ",[116,1977,1979],{"className":1978},[119],[116,1980,1982],{"className":1981,"ariaHidden":124},[123],[116,1983,1985,1988,1991,1994,1998,2001,2004,2007,2010,2013,2016,2019,2022,2025,2029,2032,2035,2038,2041,2044,2047,2050,2053,2056,2059,2062,2065,2068],{"className":1984},[128],[116,1986],{"className":1987,"style":552},[132],[116,1989,1092],{"className":1990},[561],[116,1992,566],{"className":1993},[137,138],[116,1995,1997],{"className":1996},[144]," ",[116,1999,331],{"className":2000},[137],[116,2002,1997],{"className":2003},[144],[116,2005,601],{"className":2006,"style":139},[137,138],[116,2008,1997],{"className":2009},[144],[116,2011,331],{"className":2012},[137],[116,2014,1997],{"className":2015},[144],[116,2017,345],{"className":2018},[137],[116,2020,1997],{"className":2021},[144],[116,2023,331],{"className":2024},[137],[116,2026,2028],{"className":2027},[593],";",[116,2030,1997],{"className":2031},[144],[116,2033],{"className":2034,"style":279},[144],[116,2036,331],{"className":2037},[137],[116,2039,1997],{"className":2040},[144],[116,2042,566],{"className":2043},[137,138],[116,2045,1997],{"className":2046},[144],[116,2048,331],{"className":2049},[137],[116,2051,1997],{"className":2052},[144],[116,2054,601],{"className":2055,"style":139},[137,138],[116,2057,1997],{"className":2058},[144],[116,2060,331],{"className":2061},[137],[116,2063,1997],{"className":2064},[144],[116,2066,345],{"className":2067},[137],[116,2069,1493],{"className":2070},[651]," and the\nper-step update comes from the pseudo-inverse of the ",[116,2073,2075],{"className":2074},[119],[116,2076,2078,2096],{"className":2077,"ariaHidden":124},[123],[116,2079,2081,2084,2087,2090,2093],{"className":2080},[128],[116,2082],{"className":2083,"style":1871},[132],[116,2085,1974],{"className":2086},[137],[116,2088],{"className":2089,"style":570},[144],[116,2091,439],{"className":2092},[574],[116,2094],{"className":2095,"style":570},[144],[116,2097,2099,2102],{"className":2098},[128],[116,2100],{"className":2101,"style":1890},[132],[116,2103,1974],{"className":2104},[137],"\nHessian.",[2107,2108,2112],"pre",{"className":2109,"code":2110,"language":2111,"meta":478,"style":478},"language-algorithm shiki shiki-themes github-light github-dark","caption: $\\textsc{Lucas-Kanade}(I, J, p)$ — iterative flow for one window\ninput: frames $I, J$, window center $p$, initial flow $w \\gets 0$\nrepeat\n  warp $J$ by current flow $w$ around $p$\n  $b \\gets$ residuals $I - J_{warped}$ over the window\n  solve $(A^\\top A)\\, \\Delta = A^\\top b$ for the update $\\Delta$\n  $w \\gets w + \\Delta$\nuntil $\\lVert \\Delta \\rVert$ is below tolerance\nreturn $w$\n","algorithm",[108,2113,2114,2121,2126,2132,2138,2144,2150,2156,2162],{"__ignoreMap":478},[116,2115,2118],{"class":2116,"line":2117},"line",1,[116,2119,2120],{},"caption: $\\textsc{Lucas-Kanade}(I, J, p)$ — iterative flow for one window\n",[116,2122,2123],{"class":2116,"line":479},[116,2124,2125],{},"input: frames $I, J$, window center $p$, initial flow $w \\gets 0$\n",[116,2127,2129],{"class":2116,"line":2128},3,[116,2130,2131],{},"repeat\n",[116,2133,2135],{"class":2116,"line":2134},4,[116,2136,2137],{},"  warp $J$ by current flow $w$ around $p$\n",[116,2139,2141],{"class":2116,"line":2140},5,[116,2142,2143],{},"  $b \\gets$ residuals $I - J_{warped}$ over the window\n",[116,2145,2147],{"class":2116,"line":2146},6,[116,2148,2149],{},"  solve $(A^\\top A)\\, \\Delta = A^\\top b$ for the update $\\Delta$\n",[116,2151,2153],{"class":2116,"line":2152},7,[116,2154,2155],{},"  $w \\gets w + \\Delta$\n",[116,2157,2159],{"class":2116,"line":2158},8,[116,2160,2161],{},"until $\\lVert \\Delta \\rVert$ is below tolerance\n",[116,2163,2165],{"class":2116,"line":2164},9,[116,2166,2167],{},"return $w$\n",[73,2169,2170,2171,2173,2174,2256,2257,1852],{},"The classical affine loop re-evaluates the image gradient and rebuilds\nthe Hessian on the warped frame every iteration. The inverse-compositional trick (Matthews-Baker) swaps\ntemplate and image so the gradient, Jacobian, and Hessian depend only on\nthe template: ",[108,2172,531],{}," computes them once before the\nloop, and each iteration solves against the precomputed pseudo-inverse,\nthen folds the incremental warp in by composing with its inverse,\n",[116,2175,2177],{"className":2176},[119],[116,2178,2180,2199],{"className":2179,"ariaHidden":124},[123],[116,2181,2183,2186,2189,2192,2196],{"className":2182},[128],[116,2184],{"className":2185,"style":272},[132],[116,2187,925],{"className":2188,"style":924},[137,138],[116,2190],{"className":2191,"style":145},[144],[116,2193,2195],{"className":2194},[149],"←",[116,2197],{"className":2198,"style":145},[144],[116,2200,2202,2206,2209,2212,2215,2218,2221],{"className":2201},[128],[116,2203],{"className":2204,"style":2205},[132],"height:1.0641em;vertical-align:-0.25em;",[116,2207,925],{"className":2208,"style":924},[137,138],[116,2210],{"className":2211,"style":279},[144],[116,2213,562],{"className":2214},[561],[116,2216,283],{"className":2217},[137],[116,2219,925],{"className":2220,"style":924},[137,138],[116,2222,2224,2227],{"className":2223},[651],[116,2225,652],{"className":2226},[651],[116,2228,2230],{"className":2229},[725],[116,2231,2233],{"className":2232},[168],[116,2234,2236],{"className":2235},[173],[116,2237,2239],{"className":2238,"style":1152},[177],[116,2240,2241,2244],{"style":1167},[116,2242],{"className":2243,"style":742},[187],[116,2245,2247],{"className":2246},[746,747,748,749],[116,2248,2250,2253],{"className":2249},[137,749],[116,2251,1610],{"className":2252},[137,749],[116,2254,345],{"className":2255},[137,749],". The iteration reaches the same fixed point\nat a fraction of the cost. The write-up with derivations and results is\navailable as a ",[76,2258,2261],{"href":2259,"rel":2260},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Fblob\u002Fmain\u002Fpsets\u002F04\u002Fwriteup\u002Fmain.pdf",[80],"PDF report",[2263,2264,2265],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":478,"searchDepth":479,"depth":479,"links":2267},[],"2024-03-03","Optical flow is the apparent motion of the scene across a video,\nwhether the objects move or the camera does. This project builds three\ntrackers for it from first principles: a translation-only\nLucas-Kanade\nsolver (LucasKanade), a six-parameter affine version\n(LucasKanadeAffine), and its\ninverse-compositional\ncounterpart (InverseCompositionAffine, the Matthews-Baker\nformulation). All three sample the image and its gradients at subpixel\nlocations with a RectBivariateSpline, and iterate up to a hundred\ntimes or until the parameter update drops below tolerance.",{},"\u002Fprojects\u002Fcomputer-vision\u002Foptical-flow",[488],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Ftree\u002Fmain\u002Fpsets\u002F04",{"title":499,"description":2269},"projects\u002Fcomputer-vision\u002F4.optical-flow","Tracking apparent motion through a video — Lucas-Kanade and its\ninverse-compositional refinements, derived from the brightness-constancy\nequation down to a 2×2 linear solve.","computer vision",[2279,2280,2281],"Python","OpenCV","Computer Vision",null,"rj-1hATx6Ctfk_qLbtvVBmRZY7GMCh6TIIP8hLdrNAk",{"id":2285,"title":2286,"body":2287,"date":2352,"description":2353,"extension":483,"featured":2354,"meta":2355,"navigation":484,"path":2356,"references":2357,"repo":2360,"seo":2361,"stem":2362,"summary":2363,"tag":2364,"tech":2365,"url":2282,"__hash__":2367},"projects\u002Fprojects\u002Flinguistics\u002F7.audio-emotions.md","Emotion Detection in Audio",{"type":70,"value":2288,"toc":2350},[2289,2308,2311,2324,2331,2334],[73,2290,2291,2292,2297,2298,2303,2304,2307],{},"Speech emotion recognition — predicting the emotion in a spoken clip —\ncomparing two ways of turning raw audio into features for a classifier:\nhand-engineered\n",[76,2293,2296],{"href":2294,"rel":2295},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMel-frequency_cepstrum",[80],"MFCCs"," and learned\nrepresentations from\n",[76,2299,2302],{"href":2300,"rel":2301},"https:\u002F\u002Fhuggingface.co\u002Ftransformers\u002Fmodel_doc\u002Fwav2vec2.html",[80],"Wav2Vec2",".\nThe clips come from the Kaggle ",[442,2305,2306],{},"Audio Emotions"," set, sorted into seven\nlabels (angry, sad, disgusted, fearful, happy, neutral, surprised) with\nan 80\u002F20 train\u002Ftest split. The task is classification, but the\ninteresting choice is upstream, in how the waveform is represented.",[246,2309],{"hash":2310},"a00e5a5c1f0e53df0ae9949f9667832c30c0582e94b808c2f25bb16360084b7e",[73,2312,2313,2314,2317,2318,2323],{},"MFCCs follow a fixed recipe. ",[108,2315,2316],{},"librosa.feature.mfcc"," windows the waveform\ninto short frames, warps each frame's power spectrum onto the\nperceptual ",[76,2319,2322],{"href":2320,"rel":2321},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMel_scale",[80],"mel scale",",\nlog-compresses, and runs a discrete cosine transform, keeping 40\ncoefficients per frame. Averaging over time collapses each clip to a\nsingle 40-number vector, the coarse spectral envelope that carries\ntimbre and vowel quality. It is compact and requires no training, but it\ndiscards whatever the fixed recipe does not capture.",[73,2325,2326,2327,2330],{},"Wav2Vec2 learns its features instead. The learned path loads the audio at\nWav2Vec2's native 16 kHz and passes it through the ",[108,2328,2329],{},"wav2vec2-base-960h","\nfeature extractor. Wav2Vec2 is a transformer pretrained on large amounts\nof unlabeled speech with a self-supervised objective, so its activations\nalready encode phonetic and prosodic structure. These sequences vary in\nlength, so they are zero-padded to the longest clip before batching.\nFeeding them to the classifier brings knowledge from far more audio than\nthe labeled emotion set alone: transfer learning in place of\nhand-engineering.",[73,2332,2333],{},"Either way, the head is a classifier: both feature paths feed a small\nPyTorch Lightning module trained with cross-entropy and Adam. The MFCC\nhead is a 1-D convolution over the coefficient vector followed by a\nlinear layer and softmax over the seven emotions; the Wav2Vec2 head is a\nlinear projection down to the same seven logits. Holding the objective\nfixed and swapping only the features isolates the comparison between the\nengineered and the learned representation.",[73,2335,2336],{},[442,2337,2338,2339,2344,2345,1852],{},"Collaborative project with\n",[76,2340,2343],{"href":2341,"rel":2342},"https:\u002F\u002Fgithub.com\u002Ftheivyzhang",[80],"Ivy (Aiwei) Zhang"," and\n",[76,2346,2349],{"href":2347,"rel":2348},"https:\u002F\u002Fgithub.com\u002Fcarlosguealv",[80],"Carlos Guerrero Alvarez",{"title":478,"searchDepth":479,"depth":479,"links":2351},[],"2024-03-02","Speech emotion recognition — predicting the emotion in a spoken clip —\ncomparing two ways of turning raw audio into features for a classifier:\nhand-engineered\nMFCCs and learned\nrepresentations from\nWav2Vec2.\nThe clips come from the Kaggle Audio Emotions set, sorted into seven\nlabels (angry, sad, disgusted, fearful, happy, neutral, surprised) with\nan 80\u002F20 train\u002Ftest split. The task is classification, but the\ninteresting choice is upstream, in how the waveform is represented.",false,{},"\u002Fprojects\u002Flinguistics\u002Faudio-emotions",[2358,2359],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fspeech\u002Fautomatic-speech-recognition","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fspeech\u002Facoustic-phonetics","https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics-project",{"title":2286,"description":2353},"projects\u002Flinguistics\u002F7.audio-emotions","Classifying emotion from speech audio, comparing hand-engineered MFCC\nfeatures against learned Wav2Vec2 representations as input to a classifier.","Natural Language Processing",[2279,2366],"Transformers","9smW1aXzASPGRyiFNTG9jp2cBKu-2-rVIuDp4vxkssk",{"id":2369,"title":2370,"body":2371,"date":3966,"description":3967,"extension":483,"featured":2354,"meta":3968,"navigation":484,"path":3969,"references":3970,"repo":3973,"seo":3974,"stem":3975,"summary":3976,"tag":2277,"tech":3977,"url":2282,"__hash__":3978},"projects\u002Fprojects\u002Fcomputer-vision\u002F2.reconstruction.md","3D Reconstruction",{"type":70,"value":2372,"toc":3964},[2373,2381,2452,2530,2775,3103,3106,3226,3788,3953,3956],[73,2374,2375,2380],{},[76,2376,2379],{"href":2377,"rel":2378},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSparse_3D_reconstruction",[80],"Structure from motion"," recovers the 3-D structure of a scene\nfrom several photographs taken at slightly different viewpoints. The input\nis only 2-D pixel correspondences across images; the geometry recovers both\nwhere the cameras were and where the world points sit.",[73,2382,2383,2384,2399,2400,2446,2447],{},"Two views of the same point are not independent, and epipolar geometry is\nwhat constrains the matches. If a world point projects to ",[116,2385,2387],{"className":2386},[119],[116,2388,2390],{"className":2389,"ariaHidden":124},[123],[116,2391,2393,2396],{"className":2392},[128],[116,2394],{"className":2395,"style":133},[132],[116,2397,566],{"className":2398},[137,138]," in one image\nand ",[116,2401,2403],{"className":2402},[119],[116,2404,2406],{"className":2405,"ariaHidden":124},[123],[116,2407,2409,2413],{"className":2408},[128],[116,2410],{"className":2411,"style":2412},[132],"height:0.7519em;",[116,2414,2416,2419],{"className":2415},[137],[116,2417,566],{"className":2418},[137,138],[116,2420,2422],{"className":2421},[725],[116,2423,2425],{"className":2424},[168],[116,2426,2428],{"className":2427},[173],[116,2429,2431],{"className":2430,"style":2412},[177],[116,2432,2433,2436],{"style":1167},[116,2434],{"className":2435,"style":742},[187],[116,2437,2439],{"className":2438},[746,747,748,749],[116,2440,2442],{"className":2441},[137,749],[116,2443,2445],{"className":2444},[137,749],"′"," in the other (homogeneous pixel coordinates), the pair obeys the\n",[76,2448,2451],{"href":2449,"rel":2450},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEpipolar_geometry",[80],"epipolar constraint",[116,2453,2455],{"className":2454},[702],[116,2456,2458],{"className":2457},[119],[116,2459,2461,2518],{"className":2460,"ariaHidden":124},[123],[116,2462,2464,2468,2502,2506,2509,2512,2515],{"className":2463},[128],[116,2465],{"className":2466,"style":2467},[132],"height:0.8991em;",[116,2469,2471,2474],{"className":2470},[137],[116,2472,566],{"className":2473},[137,138],[116,2475,2477],{"className":2476},[725],[116,2478,2480],{"className":2479},[168],[116,2481,2483],{"className":2482},[173],[116,2484,2486],{"className":2485,"style":2467},[177],[116,2487,2489,2492],{"style":2488},"top:-3.113em;margin-right:0.05em;",[116,2490],{"className":2491,"style":742},[187],[116,2493,2495],{"className":2494},[746,747,748,749],[116,2496,2498],{"className":2497},[137,749],[116,2499,2501],{"className":2500},[137,749],"′⊤",[116,2503,2505],{"className":2504,"style":924},[137,138],"F",[116,2507,566],{"className":2508},[137,138],[116,2510],{"className":2511,"style":145},[144],[116,2513,150],{"className":2514},[149],[116,2516],{"className":2517,"style":145},[144],[116,2519,2521,2524,2527],{"className":2520},[128],[116,2522],{"className":2523,"style":899},[132],[116,2525,331],{"className":2526},[137],[116,2528,594],{"className":2529},[593],[73,2531,2532,2533,2548,2549,2583,2584,2599,2600,2615,2616,2634,2635,2650,2651,2668,2669,2739,2740,2757,2758,2774],{},"where ",[116,2534,2536],{"className":2535},[119],[116,2537,2539],{"className":2538,"ariaHidden":124},[123],[116,2540,2542,2545],{"className":2541},[128],[116,2543],{"className":2544,"style":272},[132],[116,2546,2505],{"className":2547,"style":924},[137,138]," is the ",[116,2550,2552],{"className":2551},[119],[116,2553,2555,2574],{"className":2554,"ariaHidden":124},[123],[116,2556,2558,2561,2565,2568,2571],{"className":2557},[128],[116,2559],{"className":2560,"style":1871},[132],[116,2562,2564],{"className":2563},[137],"3",[116,2566],{"className":2567,"style":570},[144],[116,2569,439],{"className":2570},[574],[116,2572],{"className":2573,"style":570},[144],[116,2575,2577,2580],{"className":2576},[128],[116,2578],{"className":2579,"style":1890},[132],[116,2581,2564],{"className":2582},[137]," fundamental matrix of rank 2. ",[116,2585,2587],{"className":2586},[119],[116,2588,2590],{"className":2589,"ariaHidden":124},[123],[116,2591,2593,2596],{"className":2592},[128],[116,2594],{"className":2595,"style":272},[132],[116,2597,2505],{"className":2598,"style":924},[137,138]," collapses\nthe correspondence search to a line: for each ",[116,2601,2603],{"className":2602},[119],[116,2604,2606],{"className":2605,"ariaHidden":124},[123],[116,2607,2609,2612],{"className":2608},[128],[116,2610],{"className":2611,"style":133},[132],[116,2613,566],{"className":2614},[137,138],", its match lies on the\nepipolar line ",[116,2617,2619],{"className":2618},[119],[116,2620,2622],{"className":2621,"ariaHidden":124},[123],[116,2623,2625,2628,2631],{"className":2624},[128],[116,2626],{"className":2627,"style":272},[132],[116,2629,2505],{"className":2630,"style":924},[137,138],[116,2632,566],{"className":2633},[137,138]," in the other image. Eight or more correspondences fix\n",[116,2636,2638],{"className":2637},[119],[116,2639,2641],{"className":2640,"ariaHidden":124},[123],[116,2642,2644,2647],{"className":2643},[128],[116,2645],{"className":2646,"style":272},[132],[116,2648,2505],{"className":2649,"style":924},[137,138]," up to scale — the eight-point algorithm, a linear least-squares solve\nfor the smallest singular vector of the constraint matrix. With known\nintrinsics ",[116,2652,2654],{"className":2653},[119],[116,2655,2657],{"className":2656,"ariaHidden":124},[123],[116,2658,2660,2663],{"className":2659},[128],[116,2661],{"className":2662,"style":272},[132],[116,2664,2667],{"className":2665,"style":2666},[137,138],"margin-right:0.0715em;","K",", the essential matrix ",[116,2670,2672],{"className":2671},[119],[116,2673,2675,2695],{"className":2674,"ariaHidden":124},[123],[116,2676,2678,2681,2686,2689,2692],{"className":2677},[128],[116,2679],{"className":2680,"style":272},[132],[116,2682,2685],{"className":2683,"style":2684},[137,138],"margin-right:0.0576em;","E",[116,2687],{"className":2688,"style":145},[144],[116,2690,150],{"className":2691},[149],[116,2693],{"className":2694,"style":145},[144],[116,2696,2698,2701,2733,2736],{"className":2697},[128],[116,2699],{"className":2700,"style":1907},[132],[116,2702,2704,2707],{"className":2703},[137],[116,2705,2667],{"className":2706,"style":2666},[137,138],[116,2708,2710],{"className":2709},[725],[116,2711,2713],{"className":2712},[168],[116,2714,2716],{"className":2715},[173],[116,2717,2719],{"className":2718,"style":1907},[177],[116,2720,2721,2724],{"style":1167},[116,2722],{"className":2723,"style":742},[187],[116,2725,2727],{"className":2726},[746,747,748,749],[116,2728,2730],{"className":2729},[137,749],[116,2731,2501],{"className":2732},[137,749],[116,2734,2505],{"className":2735,"style":924},[137,138],[116,2737,2667],{"className":2738,"style":2666},[137,138]," factors into a\nrelative rotation ",[116,2741,2743],{"className":2742},[119],[116,2744,2746],{"className":2745,"ariaHidden":124},[123],[116,2747,2749,2752],{"className":2748},[128],[116,2750],{"className":2751,"style":272},[132],[116,2753,2756],{"className":2754,"style":2755},[137,138],"margin-right:0.0077em;","R"," and translation ",[116,2759,2761],{"className":2760},[119],[116,2762,2764],{"className":2763,"ariaHidden":124},[123],[116,2765,2767,2771],{"className":2766},[128],[116,2768],{"className":2769,"style":2770},[132],"height:0.6151em;",[116,2772,287],{"className":2773},[137,138]," by SVD.",[73,2776,2777,2778,2833,2834,2894,2895,2911,2912,2917,2918,2344,2973,3086,3087,3102],{},"Once the two camera matrices ",[116,2779,2781],{"className":2780},[119],[116,2782,2784],{"className":2783,"ariaHidden":124},[123],[116,2785,2787,2791,2795,2798,2801],{"className":2786},[128],[116,2788],{"className":2789,"style":2790},[132],"height:0.9463em;vertical-align:-0.1944em;",[116,2792,2794],{"className":2793,"style":924},[137,138],"P",[116,2796,594],{"className":2797},[593],[116,2799],{"className":2800,"style":279},[144],[116,2802,2804,2807],{"className":2803},[137],[116,2805,2794],{"className":2806,"style":924},[137,138],[116,2808,2810],{"className":2809},[725],[116,2811,2813],{"className":2812},[168],[116,2814,2816],{"className":2815},[173],[116,2817,2819],{"className":2818,"style":2412},[177],[116,2820,2821,2824],{"style":1167},[116,2822],{"className":2823,"style":742},[187],[116,2825,2827],{"className":2826},[746,747,748,749],[116,2828,2830],{"className":2829},[137,749],[116,2831,2445],{"className":2832},[137,749]," are known, each matched pair\n",[116,2835,2837],{"className":2836},[119],[116,2838,2840],{"className":2839,"ariaHidden":124},[123],[116,2841,2843,2847,2850,2853,2856,2859,2891],{"className":2842},[128],[116,2844],{"className":2845,"style":2846},[132],"height:1.0019em;vertical-align:-0.25em;",[116,2848,562],{"className":2849},[561],[116,2851,566],{"className":2852},[137,138],[116,2854,594],{"className":2855},[593],[116,2857],{"className":2858,"style":279},[144],[116,2860,2862,2865],{"className":2861},[137],[116,2863,566],{"className":2864},[137,138],[116,2866,2868],{"className":2867},[725],[116,2869,2871],{"className":2870},[168],[116,2872,2874],{"className":2873},[173],[116,2875,2877],{"className":2876,"style":2412},[177],[116,2878,2879,2882],{"style":1167},[116,2880],{"className":2881,"style":742},[187],[116,2883,2885],{"className":2884},[746,747,748,749],[116,2886,2888],{"className":2887},[137,749],[116,2889,2445],{"className":2890},[137,749],[116,2892,652],{"className":2893},[651]," back-projects to two rays whose intersection is the world\npoint ",[116,2896,2898],{"className":2897},[119],[116,2899,2901],{"className":2900,"ariaHidden":124},[123],[116,2902,2904,2907],{"className":2903},[128],[116,2905],{"className":2906,"style":272},[132],[116,2908,2910],{"className":2909,"style":556},[137,138],"X",". ",[76,2913,2916],{"href":2914,"rel":2915},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTriangulation_(computer_vision)",[80],"Triangulation","\nunder measurement noise means the rays rarely meet exactly; the direct\nlinear transform stacks the constraints ",[116,2919,2921],{"className":2920},[119],[116,2922,2924,2943,2964],{"className":2923,"ariaHidden":124},[123],[116,2925,2927,2931,2934,2937,2940],{"className":2926},[128],[116,2928],{"className":2929,"style":2930},[132],"height:0.6667em;vertical-align:-0.0833em;",[116,2932,566],{"className":2933},[137,138],[116,2935],{"className":2936,"style":570},[144],[116,2938,439],{"className":2939},[574],[116,2941],{"className":2942,"style":570},[144],[116,2944,2946,2949,2952,2955,2958,2961],{"className":2945},[128],[116,2947],{"className":2948,"style":272},[132],[116,2950,2794],{"className":2951,"style":924},[137,138],[116,2953,2910],{"className":2954,"style":556},[137,138],[116,2956],{"className":2957,"style":145},[144],[116,2959,150],{"className":2960},[149],[116,2962],{"className":2963,"style":145},[144],[116,2965,2967,2970],{"className":2966},[128],[116,2968],{"className":2969,"style":1890},[132],[116,2971,331],{"className":2972},[137],[116,2974,2976],{"className":2975},[119],[116,2977,2979,3027,3077],{"className":2978,"ariaHidden":124},[123],[116,2980,2982,2986,3018,3021,3024],{"className":2981},[128],[116,2983],{"className":2984,"style":2985},[132],"height:0.8352em;vertical-align:-0.0833em;",[116,2987,2989,2992],{"className":2988},[137],[116,2990,566],{"className":2991},[137,138],[116,2993,2995],{"className":2994},[725],[116,2996,2998],{"className":2997},[168],[116,2999,3001],{"className":3000},[173],[116,3002,3004],{"className":3003,"style":2412},[177],[116,3005,3006,3009],{"style":1167},[116,3007],{"className":3008,"style":742},[187],[116,3010,3012],{"className":3011},[746,747,748,749],[116,3013,3015],{"className":3014},[137,749],[116,3016,2445],{"className":3017},[137,749],[116,3019],{"className":3020,"style":570},[144],[116,3022,439],{"className":3023},[574],[116,3025],{"className":3026,"style":570},[144],[116,3028,3030,3033,3065,3068,3071,3074],{"className":3029},[128],[116,3031],{"className":3032,"style":2412},[132],[116,3034,3036,3039],{"className":3035},[137],[116,3037,2794],{"className":3038,"style":924},[137,138],[116,3040,3042],{"className":3041},[725],[116,3043,3045],{"className":3044},[168],[116,3046,3048],{"className":3047},[173],[116,3049,3051],{"className":3050,"style":2412},[177],[116,3052,3053,3056],{"style":1167},[116,3054],{"className":3055,"style":742},[187],[116,3057,3059],{"className":3058},[746,747,748,749],[116,3060,3062],{"className":3061},[137,749],[116,3063,2445],{"className":3064},[137,749],[116,3066,2910],{"className":3067,"style":556},[137,138],[116,3069],{"className":3070,"style":145},[144],[116,3072,150],{"className":3073},[149],[116,3075],{"className":3076,"style":145},[144],[116,3078,3080,3083],{"className":3079},[128],[116,3081],{"className":3082,"style":1890},[132],[116,3084,331],{"className":3085},[137]," and takes the least-squares ",[116,3088,3090],{"className":3089},[119],[116,3091,3093],{"className":3092,"ariaHidden":124},[123],[116,3094,3096,3099],{"className":3095},[128],[116,3097],{"className":3098,"style":272},[132],[116,3100,2910],{"className":3101,"style":556},[137,138]," as the smallest\nsingular vector.",[246,3104],{"hash":3105},"87d96e4b4aeaafd84b558e1995d232dc5b6c8fe27a11d042d2819426fd233741",[73,3107,3108,3109,3114,3115,3170,3171,3225],{},"Pose estimation and triangulation each accumulate error, and\n",[76,3110,3113],{"href":3111,"rel":3112},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBundle_adjustment",[80],"bundle adjustment","\ncorrects both at once, minimizing the total reprojection error over all\ncameras ",[116,3116,3118],{"className":3117},[119],[116,3119,3121],{"className":3120,"ariaHidden":124},[123],[116,3122,3124,3127],{"className":3123},[128],[116,3125],{"className":3126,"style":715},[132],[116,3128,3130,3133],{"className":3129},[137],[116,3131,2794],{"className":3132,"style":924},[137,138],[116,3134,3136],{"className":3135},[725],[116,3137,3139,3162],{"className":3138},[168,169],[116,3140,3142,3159],{"className":3141},[173],[116,3143,3146],{"className":3144,"style":3145},[177],"height:0.3117em;",[116,3147,3149,3152],{"style":3148},"top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;",[116,3150],{"className":3151,"style":742},[187],[116,3153,3155],{"className":3154},[746,747,748,749],[116,3156,3158],{"className":3157},[137,138,749],"i",[116,3160,234],{"className":3161},[233],[116,3163,3165],{"className":3164},[173],[116,3166,3168],{"className":3167,"style":762},[177],[116,3169],{}," and points ",[116,3172,3174],{"className":3173},[119],[116,3175,3177],{"className":3176,"ariaHidden":124},[123],[116,3178,3180,3183],{"className":3179},[128],[116,3181],{"className":3182,"style":783},[132],[116,3184,3186,3189],{"className":3185},[137],[116,3187,2910],{"className":3188,"style":556},[137,138],[116,3190,3192],{"className":3191},[725],[116,3193,3195,3217],{"className":3194},[168,169],[116,3196,3198,3214],{"className":3197},[173],[116,3199,3201],{"className":3200,"style":3145},[177],[116,3202,3203,3206],{"style":738},[116,3204],{"className":3205,"style":742},[187],[116,3207,3209],{"className":3208},[746,747,748,749],[116,3210,3213],{"className":3211,"style":3212},[137,138,749],"margin-right:0.0572em;","j",[116,3215,234],{"className":3216},[233],[116,3218,3220],{"className":3219},[173],[116,3221,3223],{"className":3222,"style":822},[177],[116,3224],{},":",[116,3227,3229],{"className":3228},[702],[116,3230,3232],{"className":3231},[119],[116,3233,3235,3617],{"className":3234,"ariaHidden":124},[123],[116,3236,3238,3242,3402,3405,3467,3470,3515,3518,3564,3608,3611,3614],{"className":3237},[128],[116,3239],{"className":3240,"style":3241},[132],"height:2.4638em;vertical-align:-1.4138em;",[116,3243,3246],{"className":3244},[1126,3245],"op-limits",[116,3247,3249,3393],{"className":3248},[168,169],[116,3250,3252,3390],{"className":3251},[173],[116,3253,3256,3374],{"className":3254,"style":3255},[177],"height:0.6679em;",[116,3257,3259,3262],{"style":3258},"top:-2.309em;margin-left:0em;",[116,3260],{"className":3261,"style":1119},[187],[116,3263,3265],{"className":3264},[746,747,748,749],[116,3266,3268,3272,3315,3319,3322,3326,3329,3371],{"className":3267},[137,749],[116,3269,3271],{"className":3270},[561,749],"{",[116,3273,3275,3278],{"className":3274},[137,749],[116,3276,2794],{"className":3277,"style":924},[137,138,749],[116,3279,3281],{"className":3280},[725],[116,3282,3284,3306],{"className":3283},[168,169],[116,3285,3287,3303],{"className":3286},[173],[116,3288,3291],{"className":3289,"style":3290},[177],"height:0.3281em;",[116,3292,3294,3297],{"style":3293},"top:-2.357em;margin-left:-0.1389em;margin-right:0.0714em;",[116,3295],{"className":3296,"style":997},[187],[116,3298,3300],{"className":3299},[746,1001,1002,749],[116,3301,3158],{"className":3302},[137,138,749],[116,3304,234],{"className":3305},[233],[116,3307,3309],{"className":3308},[173],[116,3310,3313],{"className":3311,"style":3312},[177],"height:0.143em;",[116,3314],{},[116,3316,3318],{"className":3317},[651,749],"}",[116,3320,594],{"className":3321},[593,749],[116,3323],{"className":3324,"style":3325},[144,749],"margin-right:0.1952em;",[116,3327,3271],{"className":3328},[561,749],[116,3330,3332,3335],{"className":3331},[137,749],[116,3333,2910],{"className":3334,"style":556},[137,138,749],[116,3336,3338],{"className":3337},[725],[116,3339,3341,3362],{"className":3340},[168,169],[116,3342,3344,3359],{"className":3343},[173],[116,3345,3347],{"className":3346,"style":3290},[177],[116,3348,3350,3353],{"style":3349},"top:-2.357em;margin-left:-0.0785em;margin-right:0.0714em;",[116,3351],{"className":3352,"style":997},[187],[116,3354,3356],{"className":3355},[746,1001,1002,749],[116,3357,3213],{"className":3358,"style":3212},[137,138,749],[116,3360,234],{"className":3361},[233],[116,3363,3365],{"className":3364},[173],[116,3366,3369],{"className":3367,"style":3368},[177],"height:0.2819em;",[116,3370],{},[116,3372,3318],{"className":3373},[651,749],[116,3375,3377,3380],{"style":3376},"top:-3em;",[116,3378],{"className":3379,"style":1119},[187],[116,3381,3382],{},[116,3383,3385],{"className":3384},[1126],[116,3386,3389],{"className":3387},[137,3388],"mathrm","min",[116,3391,234],{"className":3392},[233],[116,3394,3396],{"className":3395},[173],[116,3397,3400],{"className":3398,"style":3399},[177],"height:0.9883em;",[116,3401],{},[116,3403],{"className":3404,"style":279},[144],[116,3406,3408],{"className":3407},[1126,3245],[116,3409,3411,3458],{"className":3410},[168,169],[116,3412,3414,3455],{"className":3413},[173],[116,3415,3418,3443],{"className":3416,"style":3417},[177],"height:1.05em;",[116,3419,3421,3425],{"style":3420},"top:-1.8723em;margin-left:0em;",[116,3422],{"className":3423,"style":3424},[187],"height:3.05em;",[116,3426,3428],{"className":3427},[746,747,748,749],[116,3429,3431,3434,3437,3440],{"className":3430},[137,749],[116,3432,3158],{"className":3433},[137,138,749],[116,3435,594],{"className":3436},[593,749],[116,3438],{"className":3439,"style":3325},[144,749],[116,3441,3213],{"className":3442,"style":3212},[137,138,749],[116,3444,3446,3449],{"style":3445},"top:-3.05em;",[116,3447],{"className":3448,"style":3424},[187],[116,3450,3451],{},[116,3452,1130],{"className":3453},[1126,1127,3454],"large-op",[116,3456,234],{"className":3457},[233],[116,3459,3461],{"className":3460},[173],[116,3462,3465],{"className":3463,"style":3464},[177],"height:1.4138em;",[116,3466],{},[116,3468],{"className":3469,"style":279},[144],[116,3471,3473,3476],{"className":3472},[137],[116,3474,140],{"className":3475,"style":139},[137,138],[116,3477,3479],{"className":3478},[725],[116,3480,3482,3507],{"className":3481},[168,169],[116,3483,3485,3504],{"className":3484},[173],[116,3486,3488],{"className":3487,"style":3145},[177],[116,3489,3491,3494],{"style":3490},"top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;",[116,3492],{"className":3493,"style":742},[187],[116,3495,3497],{"className":3496},[746,747,748,749],[116,3498,3500],{"className":3499},[137,749],[116,3501,3503],{"className":3502,"style":3212},[137,138,749],"ij",[116,3505,234],{"className":3506},[233],[116,3508,3510],{"className":3509},[173],[116,3511,3513],{"className":3512,"style":822},[177],[116,3514],{},[116,3516],{"className":3517,"style":279},[144],[116,3519,3521],{"className":3520},[137],[116,3522,3525],{"className":3523},[1091,3524],"mult",[116,3526,3528,3555],{"className":3527},[168,169],[116,3529,3531,3552],{"className":3530},[173],[116,3532,3535],{"className":3533,"style":3534},[177],"height:0.85em;",[116,3536,3538,3541],{"style":3537},"top:-2.85em;",[116,3539],{"className":3540,"style":188},[187],[116,3542,3544],{"style":3543},"width:0.556em;height:1.2em;",[219,3545,3549],{"xmlns":221,"width":3546,"height":3547,"viewBox":3548},"0.556em","1.2em","0 0 556 1200",[227,3550],{"d":3551},"M145 15 v585 v0 v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v0 v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v0 v585 h43z\nM367 15 v585 v0 v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v0 v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v0 v585 h43z",[116,3553,234],{"className":3554},[233],[116,3556,3558],{"className":3557},[173],[116,3559,3562],{"className":3560,"style":3561},[177],"height:0.35em;",[116,3563],{},[116,3565,3567,3570],{"className":3566},[137],[116,3568,566],{"className":3569},[137,138],[116,3571,3573],{"className":3572},[725],[116,3574,3576,3600],{"className":3575},[168,169],[116,3577,3579,3597],{"className":3578},[173],[116,3580,3582],{"className":3581,"style":3145},[177],[116,3583,3585,3588],{"style":3584},"top:-2.55em;margin-left:0em;margin-right:0.05em;",[116,3586],{"className":3587,"style":742},[187],[116,3589,3591],{"className":3590},[746,747,748,749],[116,3592,3594],{"className":3593},[137,749],[116,3595,3503],{"className":3596,"style":3212},[137,138,749],[116,3598,234],{"className":3599},[233],[116,3601,3603],{"className":3602},[173],[116,3604,3606],{"className":3605,"style":822},[177],[116,3607],{},[116,3609],{"className":3610,"style":570},[144],[116,3612,1610],{"className":3613},[574],[116,3615],{"className":3616,"style":570},[144],[116,3618,3620,3624,3628,3631,3671,3674,3677,3717,3720,3785],{"className":3619},[128],[116,3621],{"className":3622,"style":3623},[132],"height:1.404em;vertical-align:-0.35em;",[116,3625,3627],{"className":3626,"style":139},[137,138],"π",[116,3629,562],{"className":3630},[561],[116,3632,3634,3637],{"className":3633},[137],[116,3635,2794],{"className":3636,"style":924},[137,138],[116,3638,3640],{"className":3639},[725],[116,3641,3643,3663],{"className":3642},[168,169],[116,3644,3646,3660],{"className":3645},[173],[116,3647,3649],{"className":3648,"style":3145},[177],[116,3650,3651,3654],{"style":3148},[116,3652],{"className":3653,"style":742},[187],[116,3655,3657],{"className":3656},[746,747,748,749],[116,3658,3158],{"className":3659},[137,138,749],[116,3661,234],{"className":3662},[233],[116,3664,3666],{"className":3665},[173],[116,3667,3669],{"className":3668,"style":762},[177],[116,3670],{},[116,3672,594],{"className":3673},[593],[116,3675],{"className":3676,"style":279},[144],[116,3678,3680,3683],{"className":3679},[137],[116,3681,2910],{"className":3682,"style":556},[137,138],[116,3684,3686],{"className":3685},[725],[116,3687,3689,3709],{"className":3688},[168,169],[116,3690,3692,3706],{"className":3691},[173],[116,3693,3695],{"className":3694,"style":3145},[177],[116,3696,3697,3700],{"style":738},[116,3698],{"className":3699,"style":742},[187],[116,3701,3703],{"className":3702},[746,747,748,749],[116,3704,3213],{"className":3705,"style":3212},[137,138,749],[116,3707,234],{"className":3708},[233],[116,3710,3712],{"className":3711},[173],[116,3713,3715],{"className":3714,"style":822},[177],[116,3716],{},[116,3718,652],{"className":3719},[651],[116,3721,3723,3760],{"className":3722},[137],[116,3724,3726],{"className":3725},[137],[116,3727,3729],{"className":3728},[1091,3524],[116,3730,3732,3752],{"className":3731},[168,169],[116,3733,3735,3749],{"className":3734},[173],[116,3736,3738],{"className":3737,"style":3534},[177],[116,3739,3740,3743],{"style":3537},[116,3741],{"className":3742,"style":188},[187],[116,3744,3745],{"style":3543},[219,3746,3747],{"xmlns":221,"width":3546,"height":3547,"viewBox":3548},[227,3748],{"d":3551},[116,3750,234],{"className":3751},[233],[116,3753,3755],{"className":3754},[173],[116,3756,3758],{"className":3757,"style":3561},[177],[116,3759],{},[116,3761,3763],{"className":3762},[725],[116,3764,3766],{"className":3765},[168],[116,3767,3769],{"className":3768},[173],[116,3770,3773],{"className":3771,"style":3772},[177],"height:1.054em;",[116,3774,3776,3779],{"style":3775},"top:-3.3029em;margin-right:0.05em;",[116,3777],{"className":3778,"style":742},[187],[116,3780,3782],{"className":3781},[746,747,748,749],[116,3783,359],{"className":3784},[137,749],[116,3786,594],{"className":3787},[593],[73,3789,2532,3790,3805,3806,3862,3863,3918,3919,3935,3936,3952],{},[116,3791,3793],{"className":3792},[119],[116,3794,3796],{"className":3795,"ariaHidden":124},[123],[116,3797,3799,3802],{"className":3798},[128],[116,3800],{"className":3801,"style":133},[132],[116,3803,3627],{"className":3804,"style":139},[137,138]," projects a world point through a camera, ",[116,3807,3809],{"className":3808},[119],[116,3810,3812],{"className":3811,"ariaHidden":124},[123],[116,3813,3815,3819],{"className":3814},[128],[116,3816],{"className":3817,"style":3818},[132],"height:0.7167em;vertical-align:-0.2861em;",[116,3820,3822,3825],{"className":3821},[137],[116,3823,566],{"className":3824},[137,138],[116,3826,3828],{"className":3827},[725],[116,3829,3831,3854],{"className":3830},[168,169],[116,3832,3834,3851],{"className":3833},[173],[116,3835,3837],{"className":3836,"style":3145},[177],[116,3838,3839,3842],{"style":3584},[116,3840],{"className":3841,"style":742},[187],[116,3843,3845],{"className":3844},[746,747,748,749],[116,3846,3848],{"className":3847},[137,749],[116,3849,3503],{"className":3850,"style":3212},[137,138,749],[116,3852,234],{"className":3853},[233],[116,3855,3857],{"className":3856},[173],[116,3858,3860],{"className":3859,"style":822},[177],[116,3861],{}," is the\nobserved pixel, and ",[116,3864,3866],{"className":3865},[119],[116,3867,3869],{"className":3868,"ariaHidden":124},[123],[116,3870,3872,3875],{"className":3871},[128],[116,3873],{"className":3874,"style":3818},[132],[116,3876,3878,3881],{"className":3877},[137],[116,3879,140],{"className":3880,"style":139},[137,138],[116,3882,3884],{"className":3883},[725],[116,3885,3887,3910],{"className":3886},[168,169],[116,3888,3890,3907],{"className":3889},[173],[116,3891,3893],{"className":3892,"style":3145},[177],[116,3894,3895,3898],{"style":3490},[116,3896],{"className":3897,"style":742},[187],[116,3899,3901],{"className":3900},[746,747,748,749],[116,3902,3904],{"className":3903},[137,749],[116,3905,3503],{"className":3906,"style":3212},[137,138,749],[116,3908,234],{"className":3909},[233],[116,3911,3913],{"className":3912},[173],[116,3914,3916],{"className":3915,"style":822},[177],[116,3917],{}," flags whether point ",[116,3920,3922],{"className":3921},[119],[116,3923,3925],{"className":3924,"ariaHidden":124},[123],[116,3926,3928,3932],{"className":3927},[128],[116,3929],{"className":3930,"style":3931},[132],"height:0.854em;vertical-align:-0.1944em;",[116,3933,3213],{"className":3934,"style":3212},[137,138]," is visible in view\n",[116,3937,3939],{"className":3938},[119],[116,3940,3942],{"className":3941,"ariaHidden":124},[123],[116,3943,3945,3949],{"className":3944},[128],[116,3946],{"className":3947,"style":3948},[132],"height:0.6595em;",[116,3950,3158],{"className":3951},[137,138],". It is a large sparse nonlinear least-squares problem, solved with\nLevenberg-Marquardt.",[246,3954],{"hash":3955},"499b26491b39afadb364867c8cfdc103a3c7a442f2b538dfb826a0ae2aeb0207",[73,3957,3958,3959,1852],{},"You can read the full ",[76,3960,3963],{"href":3961,"rel":3962},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Fblob\u002Fmain\u002Fpsets\u002F03\u002Fwriteup\u002Fmain.pdf",[80],"report",{"title":478,"searchDepth":479,"depth":479,"links":3965},[],"2024-02-18","Structure from motion recovers the 3-D structure of a scene\nfrom several photographs taken at slightly different viewpoints. The input\nis only 2-D pixel correspondences across images; the geometry recovers both\nwhere the cameras were and where the world points sit.",{},"\u002Fprojects\u002Fcomputer-vision\u002Freconstruction",[3971,3972,488],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Ffrontiers\u002Freconstructing-the-3d-world","https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Ffrontiers\u002Fvision-and-perception","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Ftree\u002Fmain\u002Fpsets\u002F02",{"title":2370,"description":3967},"projects\u002Fcomputer-vision\u002F2.reconstruction","Recovering a scene's 3-D structure from photographs taken at nearby\nviewpoints — epipolar geometry, triangulation, and bundle adjustment.",[2279,2280,2281],"4EnVOZBO-afyvvYCh2DNSoUARqcvHg0ANRcrnZVW7Ng",{"id":3980,"title":3981,"body":3982,"date":5108,"description":5109,"extension":483,"featured":2354,"meta":5110,"navigation":484,"path":5111,"references":5112,"repo":5116,"seo":5117,"stem":5118,"summary":5119,"tag":2364,"tech":5120,"url":2282,"__hash__":5123},"projects\u002Fprojects\u002Flinguistics\u002F4.neural-net-embeds.md","Neural Networks & Word Embeddings",{"type":70,"value":3983,"toc":5106},[3984,4004,4007,4285,4303,4339,4831,4840,4929,4932,5089,5092,5095,5098],[73,3985,3986,3987,3992,3993,3998,3999,1852],{},"A feedforward neural network in ",[76,3988,3991],{"href":3989,"rel":3990},"https:\u002F\u002Fpytorch.org\u002F",[80],"PyTorch"," for\nmulti-class classification, paired with an inspection of the word\nembeddings it learns — measuring closeness with\n",[76,3994,3997],{"href":3995,"rel":3996},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCosine_similarity",[80],"cosine similarity"," and\nprojecting the high-dimensional space to a plane with\n",[76,4000,4003],{"href":4001,"rel":4002},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FT-distributed_stochastic_neighbor_embedding",[80],"t-SNE",[73,4005,4006],{},"The classifier is a network of linear layers and nonlinearities, mapping an\ninput to class scores by alternating affine maps with an elementwise\nnonlinearity. With one hidden layer,",[116,4008,4010],{"className":4009},[702],[116,4011,4013],{"className":4012},[119],[116,4014,4016,4037,4103,4176,4235],{"className":4015,"ariaHidden":124},[123],[116,4017,4019,4023,4028,4031,4034],{"className":4018},[128],[116,4020],{"className":4021,"style":4022},[132],"height:0.6944em;",[116,4024,4027],{"className":4025},[137,4026],"mathbf","h",[116,4029],{"className":4030,"style":145},[144],[116,4032,150],{"className":4033},[149],[116,4035],{"className":4036,"style":145},[144],[116,4038,4040,4043,4047,4050,4091,4094,4097,4100],{"className":4039},[128],[116,4041],{"className":4042,"style":552},[132],[116,4044,4046],{"className":4045},[137,138],"ϕ",[116,4048,562],{"className":4049},[561],[116,4051,4053,4056],{"className":4052},[137],[116,4054,925],{"className":4055,"style":924},[137,138],[116,4057,4059],{"className":4058},[725],[116,4060,4062,4083],{"className":4061},[168,169],[116,4063,4065,4080],{"className":4064},[173],[116,4066,4069],{"className":4067,"style":4068},[177],"height:0.3011em;",[116,4070,4071,4074],{"style":3148},[116,4072],{"className":4073,"style":742},[187],[116,4075,4077],{"className":4076},[746,747,748,749],[116,4078,345],{"className":4079},[137,749],[116,4081,234],{"className":4082},[233],[116,4084,4086],{"className":4085},[173],[116,4087,4089],{"className":4088,"style":762},[177],[116,4090],{},[116,4092,566],{"className":4093},[137,4026],[116,4095],{"className":4096,"style":570},[144],[116,4098,575],{"className":4099},[574],[116,4101],{"className":4102,"style":570},[144],[116,4104,4106,4109,4150,4153,4156,4160,4163,4167,4170,4173],{"className":4105},[128],[116,4107],{"className":4108,"style":552},[132],[116,4110,4112,4116],{"className":4111},[137],[116,4113,4115],{"className":4114},[137,4026],"b",[116,4117,4119],{"className":4118},[725],[116,4120,4122,4142],{"className":4121},[168,169],[116,4123,4125,4139],{"className":4124},[173],[116,4126,4128],{"className":4127,"style":4068},[177],[116,4129,4130,4133],{"style":3584},[116,4131],{"className":4132,"style":742},[187],[116,4134,4136],{"className":4135},[746,747,748,749],[116,4137,345],{"className":4138},[137,749],[116,4140,234],{"className":4141},[233],[116,4143,4145],{"className":4144},[173],[116,4146,4148],{"className":4147,"style":762},[177],[116,4149],{},[116,4151,652],{"className":4152},[651],[116,4154,594],{"className":4155},[593],[116,4157],{"className":4158,"style":4159},[144],"margin-right:2em;",[116,4161],{"className":4162,"style":279},[144],[116,4164,4166],{"className":4165},[137,4026],"z",[116,4168],{"className":4169,"style":145},[144],[116,4171,150],{"className":4172},[149],[116,4174],{"className":4175,"style":145},[144],[116,4177,4179,4183,4223,4226,4229,4232],{"className":4178},[128],[116,4180],{"className":4181,"style":4182},[132],"height:0.8444em;vertical-align:-0.15em;",[116,4184,4186,4189],{"className":4185},[137],[116,4187,925],{"className":4188,"style":924},[137,138],[116,4190,4192],{"className":4191},[725],[116,4193,4195,4215],{"className":4194},[168,169],[116,4196,4198,4212],{"className":4197},[173],[116,4199,4201],{"className":4200,"style":4068},[177],[116,4202,4203,4206],{"style":3148},[116,4204],{"className":4205,"style":742},[187],[116,4207,4209],{"className":4208},[746,747,748,749],[116,4210,359],{"className":4211},[137,749],[116,4213,234],{"className":4214},[233],[116,4216,4218],{"className":4217},[173],[116,4219,4221],{"className":4220,"style":762},[177],[116,4222],{},[116,4224,4027],{"className":4225},[137,4026],[116,4227],{"className":4228,"style":570},[144],[116,4230,575],{"className":4231},[574],[116,4233],{"className":4234,"style":570},[144],[116,4236,4238,4242,4282],{"className":4237},[128],[116,4239],{"className":4240,"style":4241},[132],"height:0.8889em;vertical-align:-0.1944em;",[116,4243,4245,4248],{"className":4244},[137],[116,4246,4115],{"className":4247},[137,4026],[116,4249,4251],{"className":4250},[725],[116,4252,4254,4274],{"className":4253},[168,169],[116,4255,4257,4271],{"className":4256},[173],[116,4258,4260],{"className":4259,"style":4068},[177],[116,4261,4262,4265],{"style":3584},[116,4263],{"className":4264,"style":742},[187],[116,4266,4268],{"className":4267},[746,747,748,749],[116,4269,359],{"className":4270},[137,749],[116,4272,234],{"className":4273},[233],[116,4275,4277],{"className":4276},[173],[116,4278,4280],{"className":4279,"style":762},[177],[116,4281],{},[116,4283,594],{"className":4284},[593],[73,4286,2532,4287,4302],{},[116,4288,4290],{"className":4289},[119],[116,4291,4293],{"className":4292,"ariaHidden":124},[123],[116,4294,4296,4299],{"className":4295},[128],[116,4297],{"className":4298,"style":4241},[132],[116,4300,4046],{"className":4301},[137,138]," is a nonlinearity such as ReLU. The nonlinearity is what\nlets the network represent functions a single linear layer cannot;\nstacked layers compose into richer decision boundaries.",[73,4304,4305,4306,4322,4323,4338],{},"The output scores ",[116,4307,4309],{"className":4308},[119],[116,4310,4312],{"className":4311,"ariaHidden":124},[123],[116,4313,4315,4319],{"className":4314},[128],[116,4316],{"className":4317,"style":4318},[132],"height:0.4444em;",[116,4320,4166],{"className":4321},[137,4026]," become a distribution over the ",[116,4324,4326],{"className":4325},[119],[116,4327,4329],{"className":4328,"ariaHidden":124},[123],[116,4330,4332,4335],{"className":4331},[128],[116,4333],{"className":4334,"style":272},[132],[116,4336,2667],{"className":4337,"style":2666},[137,138]," classes\nwith softmax, and training minimizes\nthe cross-entropy against the true label:",[116,4340,4342],{"className":4341},[702],[116,4343,4345],{"className":4344},[119],[116,4346,4348,4372,4393,4414,4726,4767,4816],{"className":4347,"ariaHidden":124},[123],[116,4349,4351,4354,4357,4360,4363,4366,4369],{"className":4350},[128],[116,4352],{"className":4353,"style":552},[132],[116,4355,2794],{"className":4356,"style":924},[137,138],[116,4358,562],{"className":4359},[561],[116,4361,601],{"className":4362,"style":139},[137,138],[116,4364],{"className":4365,"style":145},[144],[116,4367,150],{"className":4368},[149],[116,4370],{"className":4371,"style":145},[144],[116,4373,4375,4378,4383,4386,4390],{"className":4374},[128],[116,4376],{"className":4377,"style":552},[132],[116,4379,4382],{"className":4380,"style":4381},[137,138],"margin-right:0.0315em;","k",[116,4384],{"className":4385,"style":145},[144],[116,4387,4389],{"className":4388},[149],"∣",[116,4391],{"className":4392,"style":145},[144],[116,4394,4396,4399,4402,4405,4408,4411],{"className":4395},[128],[116,4397],{"className":4398,"style":552},[132],[116,4400,566],{"className":4401},[137,4026],[116,4403,652],{"className":4404},[651],[116,4406],{"className":4407,"style":145},[144],[116,4409,150],{"className":4410},[149],[116,4412],{"className":4413,"style":145},[144],[116,4415,4417,4421,4703,4706,4709,4712,4717,4720,4723],{"className":4416},[128],[116,4418],{"className":4419,"style":4420},[132],"height:2.6484em;vertical-align:-1.307em;",[116,4422,4424,4428,4700],{"className":4423},[137],[116,4425],{"className":4426},[561,4427],"nulldelimiter",[116,4429,4432],{"className":4430},[4431],"mfrac",[116,4433,4435,4691],{"className":4434},[168,169],[116,4436,4438,4688],{"className":4437},[173],[116,4439,4442,4595,4606],{"className":4440,"style":4441},[177],"height:1.3414em;",[116,4443,4445,4448],{"style":4444},"top:-2.1288em;",[116,4446],{"className":4447,"style":1119},[187],[116,4449,4451,4518,4521],{"className":4450},[137],[116,4452,4454,4457],{"className":4453},[1126],[116,4455,1130],{"className":4456,"style":1129},[1126,1127,1128],[116,4458,4460],{"className":4459},[725],[116,4461,4463,4509],{"className":4462},[168,169],[116,4464,4466,4506],{"className":4465},[173],[116,4467,4470,4491],{"className":4468,"style":4469},[177],"height:0.9812em;",[116,4471,4473,4476],{"style":4472},"top:-2.4003em;margin-left:0em;margin-right:0.05em;",[116,4474],{"className":4475,"style":742},[187],[116,4477,4479],{"className":4478},[746,747,748,749],[116,4480,4482,4485,4488],{"className":4481},[137,749],[116,4483,3213],{"className":4484,"style":3212},[137,138,749],[116,4486,150],{"className":4487},[149,749],[116,4489,345],{"className":4490},[137,749],[116,4492,4494,4497],{"style":4493},"top:-3.2029em;margin-right:0.05em;",[116,4495],{"className":4496,"style":742},[187],[116,4498,4500],{"className":4499},[746,747,748,749],[116,4501,4503],{"className":4502},[137,749],[116,4504,2667],{"className":4505,"style":2666},[137,138,749],[116,4507,234],{"className":4508},[233],[116,4510,4512],{"className":4511},[173],[116,4513,4516],{"className":4514,"style":4515},[177],"height:0.4358em;",[116,4517],{},[116,4519],{"className":4520,"style":279},[144],[116,4522,4524,4528],{"className":4523},[137],[116,4525,4527],{"className":4526},[137,138],"e",[116,4529,4531],{"className":4530},[725],[116,4532,4534],{"className":4533},[168],[116,4535,4537],{"className":4536},[173],[116,4538,4541],{"className":4539,"style":4540},[177],"height:0.6065em;",[116,4542,4544,4547],{"style":4543},"top:-3.0051em;margin-right:0.05em;",[116,4545],{"className":4546,"style":742},[187],[116,4548,4550],{"className":4549},[746,747,748,749],[116,4551,4553],{"className":4552},[137,749],[116,4554,4556,4560],{"className":4555},[137,749],[116,4557,4166],{"className":4558,"style":4559},[137,138,749],"margin-right:0.044em;",[116,4561,4563],{"className":4562},[725],[116,4564,4566,4587],{"className":4565},[168,169],[116,4567,4569,4584],{"className":4568},[173],[116,4570,4572],{"className":4571,"style":3290},[177],[116,4573,4575,4578],{"style":4574},"top:-2.357em;margin-left:-0.044em;margin-right:0.0714em;",[116,4576],{"className":4577,"style":997},[187],[116,4579,4581],{"className":4580},[746,1001,1002,749],[116,4582,3213],{"className":4583,"style":3212},[137,138,749],[116,4585,234],{"className":4586},[233],[116,4588,4590],{"className":4589},[173],[116,4591,4593],{"className":4592,"style":3368},[177],[116,4594],{},[116,4596,4598,4601],{"style":4597},"top:-3.23em;",[116,4599],{"className":4600,"style":1119},[187],[116,4602],{"className":4603,"style":4605},[4604],"frac-line","border-bottom-width:0.04em;",[116,4607,4609,4612],{"style":4608},"top:-3.677em;",[116,4610],{"className":4611,"style":1119},[187],[116,4613,4615],{"className":4614},[137],[116,4616,4618,4621],{"className":4617},[137],[116,4619,4527],{"className":4620},[137,138],[116,4622,4624],{"className":4623},[725],[116,4625,4627],{"className":4626},[168],[116,4628,4630],{"className":4629},[173],[116,4631,4634],{"className":4632,"style":4633},[177],"height:0.6644em;",[116,4635,4636,4639],{"style":1167},[116,4637],{"className":4638,"style":742},[187],[116,4640,4642],{"className":4641},[746,747,748,749],[116,4643,4645],{"className":4644},[137,749],[116,4646,4648,4651],{"className":4647},[137,749],[116,4649,4166],{"className":4650,"style":4559},[137,138,749],[116,4652,4654],{"className":4653},[725],[116,4655,4657,4679],{"className":4656},[168,169],[116,4658,4660,4676],{"className":4659},[173],[116,4661,4664],{"className":4662,"style":4663},[177],"height:0.3448em;",[116,4665,4667,4670],{"style":4666},"top:-2.3488em;margin-left:-0.044em;margin-right:0.0714em;",[116,4668],{"className":4669,"style":997},[187],[116,4671,4673],{"className":4672},[746,1001,1002,749],[116,4674,4382],{"className":4675,"style":4381},[137,138,749],[116,4677,234],{"className":4678},[233],[116,4680,4682],{"className":4681},[173],[116,4683,4686],{"className":4684,"style":4685},[177],"height:0.1512em;",[116,4687],{},[116,4689,234],{"className":4690},[233],[116,4692,4694],{"className":4693},[173],[116,4695,4698],{"className":4696,"style":4697},[177],"height:1.307em;",[116,4699],{},[116,4701],{"className":4702},[651,4427],[116,4704,594],{"className":4705},[593],[116,4707],{"className":4708,"style":4159},[144],[116,4710],{"className":4711,"style":279},[144],[116,4713,4716],{"className":4714},[137,4715],"mathcal","L",[116,4718],{"className":4719,"style":145},[144],[116,4721,150],{"className":4722},[149],[116,4724],{"className":4725,"style":145},[144],[116,4727,4729,4732,4735,4738,4746,4749,4752,4755,4758,4761,4764],{"className":4728},[128],[116,4730],{"className":4731,"style":552},[132],[116,4733,1610],{"className":4734},[137],[116,4736],{"className":4737,"style":279},[144],[116,4739,4741],{"className":4740},[1126],[116,4742,4745],{"className":4743,"style":4744},[137,3388],"margin-right:0.0139em;","log",[116,4747],{"className":4748,"style":279},[144],[116,4750,2794],{"className":4751,"style":924},[137,138],[116,4753,562],{"className":4754},[561],[116,4756,601],{"className":4757,"style":139},[137,138],[116,4759],{"className":4760,"style":145},[144],[116,4762,150],{"className":4763},[149],[116,4765],{"className":4766,"style":145},[144],[116,4768,4770,4773,4807,4810,4813],{"className":4769},[128],[116,4771],{"className":4772,"style":552},[132],[116,4774,4776,4779],{"className":4775},[137],[116,4777,601],{"className":4778,"style":139},[137,138],[116,4780,4782],{"className":4781},[725],[116,4783,4785],{"className":4784},[168],[116,4786,4788],{"className":4787},[173],[116,4789,4792],{"className":4790,"style":4791},[177],"height:0.7387em;",[116,4793,4794,4797],{"style":2488},[116,4795],{"className":4796,"style":742},[187],[116,4798,4800],{"className":4799},[746,747,748,749],[116,4801,4803],{"className":4802},[137,749],[116,4804,4806],{"className":4805},[137,749],"∗",[116,4808],{"className":4809,"style":145},[144],[116,4811,4389],{"className":4812},[149],[116,4814],{"className":4815,"style":145},[144],[116,4817,4819,4822,4825,4828],{"className":4818},[128],[116,4820],{"className":4821,"style":552},[132],[116,4823,566],{"className":4824},[137,4026],[116,4826,652],{"className":4827},[651],[116,4829,1852],{"className":4830},[137],[73,4832,4833,4834,4839],{},"PyTorch handles the gradients by\n",[76,4835,4838],{"href":4836,"rel":4837},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBackpropagation",[80],"backpropagation","; the\nweights update by gradient descent over minibatches.",[73,4841,4842,4843,4924,4925,4928],{},"The softmax carries a cost. That denominator sums ",[116,4844,4846],{"className":4845},[119],[116,4847,4849],{"className":4848,"ariaHidden":124},[123],[116,4850,4852,4855],{"className":4851},[128],[116,4853],{"className":4854,"style":4633},[132],[116,4856,4858,4861],{"className":4857},[137],[116,4859,4527],{"className":4860},[137,138],[116,4862,4864],{"className":4863},[725],[116,4865,4867],{"className":4866},[168],[116,4868,4870],{"className":4869},[173],[116,4871,4873],{"className":4872,"style":4633},[177],[116,4874,4875,4878],{"style":1167},[116,4876],{"className":4877,"style":742},[187],[116,4879,4881],{"className":4880},[746,747,748,749],[116,4882,4884],{"className":4883},[137,749],[116,4885,4887,4890],{"className":4886},[137,749],[116,4888,4166],{"className":4889,"style":4559},[137,138,749],[116,4891,4893],{"className":4892},[725],[116,4894,4896,4916],{"className":4895},[168,169],[116,4897,4899,4913],{"className":4898},[173],[116,4900,4902],{"className":4901,"style":3290},[177],[116,4903,4904,4907],{"style":4574},[116,4905],{"className":4906,"style":997},[187],[116,4908,4910],{"className":4909},[746,1001,1002,749],[116,4911,3213],{"className":4912,"style":3212},[137,138,749],[116,4914,234],{"className":4915},[233],[116,4917,4919],{"className":4918},[173],[116,4920,4922],{"className":4921,"style":3368},[177],[116,4923],{}," over every\nclass, which is cheap for a handful of labels but ruinous when the\n\"classes\" are a whole vocabulary, as in the skip-gram objectives that\nlearn general-purpose embeddings. Negative sampling sidesteps the sum:\neach real (word, context) pair is trained against a few randomly drawn\n",[442,4926,4927],{},"negative"," pairs, and one giant normalization collapses into a handful of\nbinary present-or-absent decisions. The vectors that fall out carry the\nsame geometry, learned at a fraction of the cost.",[73,4930,4931],{},"Embeddings carry meaning as geometry. The first layer maps each word to a\ndense vector, trained end to end. After training, related words sit\nclose together, and closeness is measured by the angle between vectors\nrather than their length:",[116,4933,4935],{"className":4934},[702],[116,4936,4938],{"className":4937},[119],[116,4939,4941,4982],{"className":4940,"ariaHidden":124},[123],[116,4942,4944,4947,4954,4957,4960,4963,4966,4970,4973,4976,4979],{"className":4943},[128],[116,4945],{"className":4946,"style":552},[132],[116,4948,4950],{"className":4949},[1126],[116,4951,4953],{"className":4952},[137,3388],"sim",[116,4955,562],{"className":4956},[561],[116,4958,589],{"className":4959},[137,4026],[116,4961,594],{"className":4962},[593],[116,4964],{"className":4965,"style":279},[144],[116,4967,140],{"className":4968,"style":4969},[137,4026],"margin-right:0.016em;",[116,4971,652],{"className":4972},[651],[116,4974],{"className":4975,"style":145},[144],[116,4977,150],{"className":4978},[149],[116,4980],{"className":4981,"style":145},[144],[116,4983,4985,4989,5086],{"className":4984},[128],[116,4986],{"className":4987,"style":4988},[132],"height:2.0575em;vertical-align:-0.936em;",[116,4990,4992,4995,5083],{"className":4991},[137],[116,4993],{"className":4994},[561,4427],[116,4996,4998],{"className":4997},[4431],[116,4999,5001,5074],{"className":5000},[168,169],[116,5002,5004,5071],{"className":5003},[173],[116,5005,5008,5039,5047],{"className":5006,"style":5007},[177],"height:1.1215em;",[116,5009,5011,5014],{"style":5010},"top:-2.314em;",[116,5012],{"className":5013,"style":1119},[187],[116,5015,5017,5021,5024,5027,5030,5033,5036],{"className":5016},[137],[116,5018,5020],{"className":5019},[561],"∥",[116,5022,589],{"className":5023},[137,4026],[116,5025,5020],{"className":5026},[651],[116,5028],{"className":5029,"style":279},[144],[116,5031,5020],{"className":5032},[561],[116,5034,140],{"className":5035,"style":4969},[137,4026],[116,5037,5020],{"className":5038},[651],[116,5040,5041,5044],{"style":4597},[116,5042],{"className":5043,"style":1119},[187],[116,5045],{"className":5046,"style":4605},[4604],[116,5048,5049,5052],{"style":4608},[116,5050],{"className":5051,"style":1119},[187],[116,5053,5055,5058,5061,5065,5068],{"className":5054},[137],[116,5056,589],{"className":5057},[137,4026],[116,5059],{"className":5060,"style":570},[144],[116,5062,5064],{"className":5063},[574],"⋅",[116,5066],{"className":5067,"style":570},[144],[116,5069,140],{"className":5070,"style":4969},[137,4026],[116,5072,234],{"className":5073},[233],[116,5075,5077],{"className":5076},[173],[116,5078,5081],{"className":5079,"style":5080},[177],"height:0.936em;",[116,5082],{},[116,5084],{"className":5085},[651,4427],[116,5087,1852],{"className":5088},[137],[73,5090,5091],{},"Cosine similarity ignores magnitude, so frequent and rare words compare\non equal footing. t-SNE then compresses the embedding space to two\ndimensions for plotting, preserving local neighborhoods so clusters of\nrelated words show up visually — a qualitative check that the model\nlearned structure and not noise.",[246,5093],{"hash":5094},"02c28af2f0519075075b52372db88c7983ec2b0fb8c5ecd94363b1fd906a02c1",[73,5096,5097],{},"The clusters are the payoff: words with similar usage land near each\nother, and the parallelogram shows that a relation like gender is a single\nshared direction, so the space encodes structure, not just proximity.",[73,5099,5100,5101,1852],{},"You can read the\n",[76,5102,5105],{"href":5103,"rel":5104},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Fblob\u002Fmain\u002FP4\u002Freport\u002F00.report.pdf",[80],"full report",{"title":478,"searchDepth":479,"depth":479,"links":5107},[],"2024-02-09","A feedforward neural network in PyTorch for\nmulti-class classification, paired with an inspection of the word\nembeddings it learns — measuring closeness with\ncosine similarity and\nprojecting the high-dimensional space to a plane with\nt-SNE.",{},"\u002Fprojects\u002Flinguistics\u002Fneural-net-embeds",[5113,5114,5115],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fsemantics\u002Fneural-language-models","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fsemantics\u002Fvector-semantics-and-embeddings","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fsemantics\u002Fstatic-word-embeddings","https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Ftree\u002Fmain\u002FP4",{"title":3981,"description":5109},"projects\u002Flinguistics\u002F4.neural-net-embeds","A PyTorch neural network for multi-class text classification, plus a look at\nthe geometry of its word embeddings via cosine similarity and t-SNE.",[2279,5121,5122],"Neural Networks","Word Embeddings","E1bsZfWBm_BcmzEE4qxid_lS1DRIxVC5BdSS7t3_yJU",{"id":5125,"title":5126,"body":5127,"date":5677,"description":5678,"extension":483,"featured":2354,"meta":5679,"navigation":484,"path":5680,"references":5681,"repo":5672,"seo":5685,"stem":5686,"summary":5687,"tag":2364,"tech":5688,"url":2282,"__hash__":5690},"projects\u002Fprojects\u002Flinguistics\u002F5.attention.md","Attention-Based Machine Translation",{"type":70,"value":5128,"toc":5675},[5129,5138,5141,5434,5635,5638,5645,5664,5667],[73,5130,5131,5132,5137],{},"A ",[76,5133,5136],{"href":5134,"rel":5135},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTransformer_(deep_learning_architecture)",[80],"transformer","\ntrained to translate English into Pig Latin, an artificial mapping with a\nclean, rule-based alignment between input and output. That regularity\nmakes it a good testbed: the attention weights should recover the\nmapping, and they sharpen toward that alignment as the model trains.",[73,5139,5140],{},"Attention works as a weighted lookup. Each output position forms a query\nand compares it against a key for every input position; the match scores\nbecome weights on the corresponding values. Scaled dot-product attention\ncomputes all positions at once:",[116,5142,5144],{"className":5143},[702],[116,5145,5147],{"className":5146},[119],[116,5148,5150,5201],{"className":5149,"ariaHidden":124},[123],[116,5151,5153,5156,5163,5166,5170,5173,5176,5179,5182,5185,5189,5192,5195,5198],{"className":5152},[128],[116,5154],{"className":5155,"style":552},[132],[116,5157,5159],{"className":5158},[1126],[116,5160,5162],{"className":5161},[137,3388],"Attention",[116,5164,562],{"className":5165},[561],[116,5167,5169],{"className":5168},[137,138],"Q",[116,5171,594],{"className":5172},[593],[116,5174],{"className":5175,"style":279},[144],[116,5177,2667],{"className":5178,"style":2666},[137,138],[116,5180,594],{"className":5181},[593],[116,5183],{"className":5184,"style":279},[144],[116,5186,5188],{"className":5187,"style":570},[137,138],"V",[116,5190,652],{"className":5191},[651],[116,5193],{"className":5194,"style":145},[144],[116,5196,150],{"className":5197},[149],[116,5199],{"className":5200,"style":145},[144],[116,5202,5204,5208,5215,5219,5222,5425,5428,5431],{"className":5203},[128],[116,5205],{"className":5206,"style":5207},[132],"height:2.4761em;vertical-align:-0.95em;",[116,5209,5211],{"className":5210},[1126],[116,5212,5214],{"className":5213},[137,3388],"softmax",[116,5216],{"className":5217,"style":5218},[144],"margin-right:-0.1667em;",[116,5220],{"className":5221,"style":279},[144],[116,5223,5225,5231,5419],{"className":5224},[946],[116,5226,5228],{"className":5227,"style":1087},[561,1086],[116,5229,562],{"className":5230},[1091,748],[116,5232,5234,5237,5416],{"className":5233},[137],[116,5235],{"className":5236},[561,4427],[116,5238,5240],{"className":5239},[4431],[116,5241,5243,5407],{"className":5242},[168,169],[116,5244,5246,5404],{"className":5245},[173],[116,5247,5250,5353,5361],{"className":5248,"style":5249},[177],"height:1.5261em;",[116,5251,5253,5256],{"style":5252},"top:-2.2528em;",[116,5254],{"className":5255,"style":1119},[187],[116,5257,5259],{"className":5258},[137],[116,5260,5262],{"className":5261},[137,164],[116,5263,5265,5344],{"className":5264},[168,169],[116,5266,5268,5341],{"className":5267},[173],[116,5269,5272,5324],{"className":5270,"style":5271},[177],"height:0.8572em;",[116,5273,5275,5278],{"className":5274,"style":3376},[182],[116,5276],{"className":5277,"style":1119},[187],[116,5279,5282],{"className":5280,"style":5281},[137],"padding-left:0.833em;",[116,5283,5285,5289],{"className":5284},[137],[116,5286,5288],{"className":5287},[137,138],"d",[116,5290,5292],{"className":5291},[725],[116,5293,5295,5316],{"className":5294},[168,169],[116,5296,5298,5313],{"className":5297},[173],[116,5299,5302],{"className":5300,"style":5301},[177],"height:0.3361em;",[116,5303,5304,5307],{"style":3584},[116,5305],{"className":5306,"style":742},[187],[116,5308,5310],{"className":5309},[746,747,748,749],[116,5311,4382],{"className":5312,"style":4381},[137,138,749],[116,5314,234],{"className":5315},[233],[116,5317,5319],{"className":5318},[173],[116,5320,5322],{"className":5321,"style":762},[177],[116,5323],{},[116,5325,5327,5330],{"style":5326},"top:-2.8172em;",[116,5328],{"className":5329,"style":1119},[187],[116,5331,5334],{"className":5332,"style":5333},[216],"min-width:0.853em;height:1.08em;",[219,5335,5338],{"xmlns":221,"width":222,"height":5336,"viewBox":5337,"preserveAspectRatio":225},"1.08em","0 0 400000 1080",[227,5339],{"d":5340},"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z",[116,5342,234],{"className":5343},[233],[116,5345,5347],{"className":5346},[173],[116,5348,5351],{"className":5349,"style":5350},[177],"height:0.1828em;",[116,5352],{},[116,5354,5355,5358],{"style":4597},[116,5356],{"className":5357,"style":1119},[187],[116,5359],{"className":5360,"style":4605},[4604],[116,5362,5363,5366],{"style":4608},[116,5364],{"className":5365,"style":1119},[187],[116,5367,5369,5372],{"className":5368},[137],[116,5370,5169],{"className":5371},[137,138],[116,5373,5375,5378],{"className":5374},[137],[116,5376,2667],{"className":5377,"style":2666},[137,138],[116,5379,5381],{"className":5380},[725],[116,5382,5384],{"className":5383},[168],[116,5385,5387],{"className":5386},[173],[116,5388,5390],{"className":5389,"style":1907},[177],[116,5391,5392,5395],{"style":1167},[116,5393],{"className":5394,"style":742},[187],[116,5396,5398],{"className":5397},[746,747,748,749],[116,5399,5401],{"className":5400},[137,749],[116,5402,1006],{"className":5403},[137,749],[116,5405,234],{"className":5406},[233],[116,5408,5410],{"className":5409},[173],[116,5411,5414],{"className":5412,"style":5413},[177],"height:0.93em;",[116,5415],{},[116,5417],{"className":5418},[651,4427],[116,5420,5422],{"className":5421,"style":1087},[651,1086],[116,5423,652],{"className":5424},[1091,748],[116,5426],{"className":5427,"style":279},[144],[116,5429,5188],{"className":5430,"style":570},[137,138],[116,5432,594],{"className":5433},[593],[73,5435,2532,5436,5452,5453,5452,5468,5483,5484,5536,5537,5634],{},[116,5437,5439],{"className":5438},[119],[116,5440,5442],{"className":5441,"ariaHidden":124},[123],[116,5443,5445,5449],{"className":5444},[128],[116,5446],{"className":5447,"style":5448},[132],"height:0.8778em;vertical-align:-0.1944em;",[116,5450,5169],{"className":5451},[137,138],", ",[116,5454,5456],{"className":5455},[119],[116,5457,5459],{"className":5458,"ariaHidden":124},[123],[116,5460,5462,5465],{"className":5461},[128],[116,5463],{"className":5464,"style":272},[132],[116,5466,2667],{"className":5467,"style":2666},[137,138],[116,5469,5471],{"className":5470},[119],[116,5472,5474],{"className":5473,"ariaHidden":124},[123],[116,5475,5477,5480],{"className":5476},[128],[116,5478],{"className":5479,"style":272},[132],[116,5481,5188],{"className":5482,"style":570},[137,138]," are the query, key, and value matrices and ",[116,5485,5487],{"className":5486},[119],[116,5488,5490],{"className":5489,"ariaHidden":124},[123],[116,5491,5493,5496],{"className":5492},[128],[116,5494],{"className":5495,"style":4182},[132],[116,5497,5499,5502],{"className":5498},[137],[116,5500,5288],{"className":5501},[137,138],[116,5503,5505],{"className":5504},[725],[116,5506,5508,5528],{"className":5507},[168,169],[116,5509,5511,5525],{"className":5510},[173],[116,5512,5514],{"className":5513,"style":5301},[177],[116,5515,5516,5519],{"style":3584},[116,5517],{"className":5518,"style":742},[187],[116,5520,5522],{"className":5521},[746,747,748,749],[116,5523,4382],{"className":5524,"style":4381},[137,138,749],[116,5526,234],{"className":5527},[233],[116,5529,5531],{"className":5530},[173],[116,5532,5534],{"className":5533,"style":762},[177],[116,5535],{}," is\nthe key dimension. The ",[116,5538,5540],{"className":5539},[119],[116,5541,5543],{"className":5542,"ariaHidden":124},[123],[116,5544,5546,5550],{"className":5545},[128],[116,5547],{"className":5548,"style":5549},[132],"height:1.04em;vertical-align:-0.1828em;",[116,5551,5553],{"className":5552},[137,164],[116,5554,5556,5626],{"className":5555},[168,169],[116,5557,5559,5623],{"className":5558},[173],[116,5560,5562,5611],{"className":5561,"style":5271},[177],[116,5563,5565,5568],{"className":5564,"style":3376},[182],[116,5566],{"className":5567,"style":1119},[187],[116,5569,5571],{"className":5570,"style":5281},[137],[116,5572,5574,5577],{"className":5573},[137],[116,5575,5288],{"className":5576},[137,138],[116,5578,5580],{"className":5579},[725],[116,5581,5583,5603],{"className":5582},[168,169],[116,5584,5586,5600],{"className":5585},[173],[116,5587,5589],{"className":5588,"style":5301},[177],[116,5590,5591,5594],{"style":3584},[116,5592],{"className":5593,"style":742},[187],[116,5595,5597],{"className":5596},[746,747,748,749],[116,5598,4382],{"className":5599,"style":4381},[137,138,749],[116,5601,234],{"className":5602},[233],[116,5604,5606],{"className":5605},[173],[116,5607,5609],{"className":5608,"style":762},[177],[116,5610],{},[116,5612,5613,5616],{"style":5326},[116,5614],{"className":5615,"style":1119},[187],[116,5617,5619],{"className":5618,"style":5333},[216],[219,5620,5621],{"xmlns":221,"width":222,"height":5336,"viewBox":5337,"preserveAspectRatio":225},[227,5622],{"d":5340},[116,5624,234],{"className":5625},[233],[116,5627,5629],{"className":5628},[173],[116,5630,5632],{"className":5631,"style":5350},[177],[116,5633],{}," divisor keeps the dot products from\ngrowing large enough to push softmax into flat regions where gradients\nvanish. The softmax row for an output token is a distribution over input\ntokens — exactly the alignment being learned.",[246,5636],{"hash":5637},"64a4d00c4becc53261db441f28811516a8ffd6299a263e36b405d339d622ea76",[73,5639,5640,5641,5644],{},"Attention grew out of a fixed-vector bottleneck. Earlier sequence-to-sequence\ntranslators encoded the whole source sentence into a single fixed-length\nvector and decoded from that alone. The vector was a bottleneck: a long\nsentence had to be squeezed into the same width as a short one, and\ntranslation quality fell off as length grew. Attention removes the\nbottleneck by letting every decoder step read a weighted sum of ",[442,5642,5643],{},"all","\nencoder states, choosing what to look at per output token instead of\nleaning on one summary of the source.",[73,5646,5647,5648,5663],{},"The encoder self-attends over the source sentence; the decoder attends over its own prefix and, through\ncross-attention, over the encoder output. Because the decoder generates\nleft to right, its self-attention is causally masked so position ",[116,5649,5651],{"className":5650},[119],[116,5652,5654],{"className":5653,"ariaHidden":124},[123],[116,5655,5657,5660],{"className":5656},[128],[116,5658],{"className":5659,"style":3948},[132],[116,5661,3158],{"className":5662},[137,138],"\nnever sees positions after it. Multiple attention heads run in parallel,\neach with its own learned query, key, and value projections, so one head\ncan follow subject-verb agreement while another tracks adjacency or word\norder; their outputs are concatenated and mixed by a final linear map.\nSince attention alone is order-agnostic, positional encodings are added to\nthe token embeddings to inject sequence order.",[73,5665,5666],{},"The alignment sharpens over training. The cross-attention weights, drawn as\na heatmap of output positions against input positions, start diffuse, with\nevery output token attending everywhere, and concentrate along the true\ncorrespondence as training proceeds. For Pig Latin, that correspondence is\nnearly diagonal with a shift at word boundaries, and the weights converge\ntoward it, a direct and legible record of what the model has learned.",[73,5668,5669,5670,1852],{},"You can browse the\n",[76,5671,5674],{"href":5672,"rel":5673},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Ftree\u002Fmain\u002FP5",[80],"project repository",{"title":478,"searchDepth":479,"depth":479,"links":5676},[],"2024-02-06","A transformer\ntrained to translate English into Pig Latin, an artificial mapping with a\nclean, rule-based alignment between input and output. That regularity\nmakes it a good testbed: the attention weights should recover the\nmapping, and they sharpen toward that alignment as the model trains.",{},"\u002Fprojects\u002Flinguistics\u002Fattention",[5682,5683,5684],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Ftransformers\u002Ftransformers-and-attention","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Ftransformers\u002Fthe-transformer-architecture","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fapplications\u002Fmachine-translation",{"title":5126,"description":5678},"projects\u002Flinguistics\u002F5.attention","A transformer that translates English to Pig Latin, with attention weights\nvisualized to show the alignment sharpening as it trains.",[2279,5689,3991],"Attention Mechanism","MFqlgG9WkfXH37czulCq0vJrZSBgK0IeexsVrW278HY",{"id":5692,"title":5693,"body":5694,"date":7062,"description":5698,"extension":483,"featured":484,"meta":7063,"navigation":484,"path":7064,"references":7065,"repo":3973,"seo":7066,"stem":7067,"summary":7068,"tag":2277,"tech":7069,"url":2282,"__hash__":7070},"projects\u002Fprojects\u002Fcomputer-vision\u002F3.augmented-reality.md","Augmented Reality with Planar Homographies",{"type":70,"value":5695,"toc":7060},[5696,5699,5736,6459,6663,6666,6688,6738,7013,7055,7058],[73,5697,5698],{},"Overlaying one image onto another in correct perspective is the classic\naugmented-reality effect. A book cover in a video becomes a screen: find\nwhere the plane sits in every frame, warp the overlay to match, and\ncomposite.",[73,5700,5701,5702,5735],{},"Two views of the same flat surface are related by a ",[116,5703,5705],{"className":5704},[119],[116,5706,5708,5726],{"className":5707,"ariaHidden":124},[123],[116,5709,5711,5714,5717,5720,5723],{"className":5710},[128],[116,5712],{"className":5713,"style":1871},[132],[116,5715,2564],{"className":5716},[137],[116,5718],{"className":5719,"style":570},[144],[116,5721,439],{"className":5722},[574],[116,5724],{"className":5725,"style":570},[144],[116,5727,5729,5732],{"className":5728},[128],[116,5730],{"className":5731,"style":1890},[132],[116,5733,2564],{"className":5734},[137],"\nhomography acting on homogeneous coordinates,",[116,5737,5739],{"className":5738},[702],[116,5740,5742],{"className":5741},[119],[116,5743,5745,5794,5832],{"className":5744,"ariaHidden":124},[123],[116,5746,5748,5752,5784,5787,5791],{"className":5747},[128],[116,5749],{"className":5750,"style":5751},[132],"height:0.8019em;",[116,5753,5755,5758],{"className":5754},[137],[116,5756,566],{"className":5757},[137,4026],[116,5759,5761],{"className":5760},[725],[116,5762,5764],{"className":5763},[168],[116,5765,5767],{"className":5766},[173],[116,5768,5770],{"className":5769,"style":5751},[177],[116,5771,5772,5775],{"style":2488},[116,5773],{"className":5774,"style":742},[187],[116,5776,5778],{"className":5777},[746,747,748,749],[116,5779,5781],{"className":5780},[137,749],[116,5782,2445],{"className":5783},[137,749],[116,5785],{"className":5786,"style":145},[144],[116,5788,5790],{"className":5789},[149],"∼",[116,5792],{"className":5793,"style":145},[144],[116,5795,5797,5800,5805,5808,5811,5814,5817,5820,5823,5826,5829],{"className":5796},[128],[116,5798],{"className":5799,"style":5448},[132],[116,5801,5804],{"className":5802,"style":5803},[137,138],"margin-right:0.0813em;","H",[116,5806],{"className":5807,"style":279},[144],[116,5809,566],{"className":5810},[137,4026],[116,5812,594],{"className":5813},[593],[116,5815],{"className":5816,"style":4159},[144],[116,5818],{"className":5819,"style":279},[144],[116,5821,5804],{"className":5822,"style":5803},[137,138],[116,5824],{"className":5825,"style":145},[144],[116,5827,150],{"className":5828},[149],[116,5830],{"className":5831,"style":145},[144],[116,5833,5835,5839,6453,6456],{"className":5834},[128],[116,5836],{"className":5837,"style":5838},[132],"height:3.6em;vertical-align:-1.55em;",[116,5840,5842,5888,6415],{"className":5841},[946],[116,5843,5845],{"className":5844},[561],[116,5846,5848],{"className":5847},[1091,3524],[116,5849,5851,5879],{"className":5850},[168,169],[116,5852,5854,5876],{"className":5853},[173],[116,5855,5858],{"className":5856,"style":5857},[177],"height:2.05em;",[116,5859,5861,5865],{"style":5860},"top:-4.05em;",[116,5862],{"className":5863,"style":5864},[187],"height:5.6em;",[116,5866,5868],{"style":5867},"width:0.667em;height:3.6em;",[219,5869,5873],{"xmlns":221,"width":5870,"height":5871,"viewBox":5872},"0.667em","3.6em","0 0 667 3600",[227,5874],{"d":5875},"M403 1759 V84 H666 V0 H319 V1759 v0 v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v0 v1759 v84 h84z",[116,5877,234],{"className":5878},[233],[116,5880,5882],{"className":5881},[173],[116,5883,5886],{"className":5884,"style":5885},[177],"height:1.55em;",[116,5887],{},[116,5889,5891],{"className":5890},[137],[116,5892,5894,6066,6069,6072,6241,6244,6247],{"className":5893},[1099],[116,5895,5897],{"className":5896},[1103],[116,5898,5900,6058],{"className":5899},[168,169],[116,5901,5903,6055],{"className":5902},[173],[116,5904,5906,5955,6005],{"className":5905,"style":5857},[177],[116,5907,5909,5912],{"style":5908},"top:-4.21em;",[116,5910],{"className":5911,"style":1119},[187],[116,5913,5915],{"className":5914},[137],[116,5916,5918,5921],{"className":5917},[137],[116,5919,4027],{"className":5920},[137,138],[116,5922,5924],{"className":5923},[725],[116,5925,5927,5947],{"className":5926},[168,169],[116,5928,5930,5944],{"className":5929},[173],[116,5931,5933],{"className":5932,"style":4068},[177],[116,5934,5935,5938],{"style":3584},[116,5936],{"className":5937,"style":742},[187],[116,5939,5941],{"className":5940},[746,747,748,749],[116,5942,345],{"className":5943},[137,749],[116,5945,234],{"className":5946},[233],[116,5948,5950],{"className":5949},[173],[116,5951,5953],{"className":5952,"style":762},[177],[116,5954],{},[116,5956,5958,5961],{"style":5957},"top:-3.01em;",[116,5959],{"className":5960,"style":1119},[187],[116,5962,5964],{"className":5963},[137],[116,5965,5967,5970],{"className":5966},[137],[116,5968,4027],{"className":5969},[137,138],[116,5971,5973],{"className":5972},[725],[116,5974,5976,5997],{"className":5975},[168,169],[116,5977,5979,5994],{"className":5978},[173],[116,5980,5982],{"className":5981,"style":4068},[177],[116,5983,5984,5987],{"style":3584},[116,5985],{"className":5986,"style":742},[187],[116,5988,5990],{"className":5989},[746,747,748,749],[116,5991,5993],{"className":5992},[137,749],"4",[116,5995,234],{"className":5996},[233],[116,5998,6000],{"className":5999},[173],[116,6001,6003],{"className":6002,"style":762},[177],[116,6004],{},[116,6006,6008,6011],{"style":6007},"top:-1.81em;",[116,6009],{"className":6010,"style":1119},[187],[116,6012,6014],{"className":6013},[137],[116,6015,6017,6020],{"className":6016},[137],[116,6018,4027],{"className":6019},[137,138],[116,6021,6023],{"className":6022},[725],[116,6024,6026,6047],{"className":6025},[168,169],[116,6027,6029,6044],{"className":6028},[173],[116,6030,6032],{"className":6031,"style":4068},[177],[116,6033,6034,6037],{"style":3584},[116,6035],{"className":6036,"style":742},[187],[116,6038,6040],{"className":6039},[746,747,748,749],[116,6041,6043],{"className":6042},[137,749],"7",[116,6045,234],{"className":6046},[233],[116,6048,6050],{"className":6049},[173],[116,6051,6053],{"className":6052,"style":762},[177],[116,6054],{},[116,6056,234],{"className":6057},[233],[116,6059,6061],{"className":6060},[173],[116,6062,6064],{"className":6063,"style":5885},[177],[116,6065],{},[116,6067],{"className":6068,"style":1300},[1299],[116,6070],{"className":6071,"style":1300},[1299],[116,6073,6075],{"className":6074},[1103],[116,6076,6078,6233],{"className":6077},[168,169],[116,6079,6081,6230],{"className":6080},[173],[116,6082,6084,6132,6181],{"className":6083,"style":5857},[177],[116,6085,6086,6089],{"style":5908},[116,6087],{"className":6088,"style":1119},[187],[116,6090,6092],{"className":6091},[137],[116,6093,6095,6098],{"className":6094},[137],[116,6096,4027],{"className":6097},[137,138],[116,6099,6101],{"className":6100},[725],[116,6102,6104,6124],{"className":6103},[168,169],[116,6105,6107,6121],{"className":6106},[173],[116,6108,6110],{"className":6109,"style":4068},[177],[116,6111,6112,6115],{"style":3584},[116,6113],{"className":6114,"style":742},[187],[116,6116,6118],{"className":6117},[746,747,748,749],[116,6119,359],{"className":6120},[137,749],[116,6122,234],{"className":6123},[233],[116,6125,6127],{"className":6126},[173],[116,6128,6130],{"className":6129,"style":762},[177],[116,6131],{},[116,6133,6134,6137],{"style":5957},[116,6135],{"className":6136,"style":1119},[187],[116,6138,6140],{"className":6139},[137],[116,6141,6143,6146],{"className":6142},[137],[116,6144,4027],{"className":6145},[137,138],[116,6147,6149],{"className":6148},[725],[116,6150,6152,6173],{"className":6151},[168,169],[116,6153,6155,6170],{"className":6154},[173],[116,6156,6158],{"className":6157,"style":4068},[177],[116,6159,6160,6163],{"style":3584},[116,6161],{"className":6162,"style":742},[187],[116,6164,6166],{"className":6165},[746,747,748,749],[116,6167,6169],{"className":6168},[137,749],"5",[116,6171,234],{"className":6172},[233],[116,6174,6176],{"className":6175},[173],[116,6177,6179],{"className":6178,"style":762},[177],[116,6180],{},[116,6182,6183,6186],{"style":6007},[116,6184],{"className":6185,"style":1119},[187],[116,6187,6189],{"className":6188},[137],[116,6190,6192,6195],{"className":6191},[137],[116,6193,4027],{"className":6194},[137,138],[116,6196,6198],{"className":6197},[725],[116,6199,6201,6222],{"className":6200},[168,169],[116,6202,6204,6219],{"className":6203},[173],[116,6205,6207],{"className":6206,"style":4068},[177],[116,6208,6209,6212],{"style":3584},[116,6210],{"className":6211,"style":742},[187],[116,6213,6215],{"className":6214},[746,747,748,749],[116,6216,6218],{"className":6217},[137,749],"8",[116,6220,234],{"className":6221},[233],[116,6223,6225],{"className":6224},[173],[116,6226,6228],{"className":6227,"style":762},[177],[116,6229],{},[116,6231,234],{"className":6232},[233],[116,6234,6236],{"className":6235},[173],[116,6237,6239],{"className":6238,"style":5885},[177],[116,6240],{},[116,6242],{"className":6243,"style":1300},[1299],[116,6245],{"className":6246,"style":1300},[1299],[116,6248,6250],{"className":6249},[1103],[116,6251,6253,6407],{"className":6252},[168,169],[116,6254,6256,6404],{"className":6255},[173],[116,6257,6259,6307,6355],{"className":6258,"style":5857},[177],[116,6260,6261,6264],{"style":5908},[116,6262],{"className":6263,"style":1119},[187],[116,6265,6267],{"className":6266},[137],[116,6268,6270,6273],{"className":6269},[137],[116,6271,4027],{"className":6272},[137,138],[116,6274,6276],{"className":6275},[725],[116,6277,6279,6299],{"className":6278},[168,169],[116,6280,6282,6296],{"className":6281},[173],[116,6283,6285],{"className":6284,"style":4068},[177],[116,6286,6287,6290],{"style":3584},[116,6288],{"className":6289,"style":742},[187],[116,6291,6293],{"className":6292},[746,747,748,749],[116,6294,2564],{"className":6295},[137,749],[116,6297,234],{"className":6298},[233],[116,6300,6302],{"className":6301},[173],[116,6303,6305],{"className":6304,"style":762},[177],[116,6306],{},[116,6308,6309,6312],{"style":5957},[116,6310],{"className":6311,"style":1119},[187],[116,6313,6315],{"className":6314},[137],[116,6316,6318,6321],{"className":6317},[137],[116,6319,4027],{"className":6320},[137,138],[116,6322,6324],{"className":6323},[725],[116,6325,6327,6347],{"className":6326},[168,169],[116,6328,6330,6344],{"className":6329},[173],[116,6331,6333],{"className":6332,"style":4068},[177],[116,6334,6335,6338],{"style":3584},[116,6336],{"className":6337,"style":742},[187],[116,6339,6341],{"className":6340},[746,747,748,749],[116,6342,1974],{"className":6343},[137,749],[116,6345,234],{"className":6346},[233],[116,6348,6350],{"className":6349},[173],[116,6351,6353],{"className":6352,"style":762},[177],[116,6354],{},[116,6356,6357,6360],{"style":6007},[116,6358],{"className":6359,"style":1119},[187],[116,6361,6363],{"className":6362},[137],[116,6364,6366,6369],{"className":6365},[137],[116,6367,4027],{"className":6368},[137,138],[116,6370,6372],{"className":6371},[725],[116,6373,6375,6396],{"className":6374},[168,169],[116,6376,6378,6393],{"className":6377},[173],[116,6379,6381],{"className":6380,"style":4068},[177],[116,6382,6383,6386],{"style":3584},[116,6384],{"className":6385,"style":742},[187],[116,6387,6389],{"className":6388},[746,747,748,749],[116,6390,6392],{"className":6391},[137,749],"9",[116,6394,234],{"className":6395},[233],[116,6397,6399],{"className":6398},[173],[116,6400,6402],{"className":6401,"style":762},[177],[116,6403],{},[116,6405,234],{"className":6406},[233],[116,6408,6410],{"className":6409},[173],[116,6411,6413],{"className":6412,"style":5885},[177],[116,6414],{},[116,6416,6418],{"className":6417},[651],[116,6419,6421],{"className":6420},[1091,3524],[116,6422,6424,6445],{"className":6423},[168,169],[116,6425,6427,6442],{"className":6426},[173],[116,6428,6430],{"className":6429,"style":5857},[177],[116,6431,6432,6435],{"style":5860},[116,6433],{"className":6434,"style":5864},[187],[116,6436,6437],{"style":5867},[219,6438,6439],{"xmlns":221,"width":5870,"height":5871,"viewBox":5872},[227,6440],{"d":6441},"M347 1759 V0 H0 V84 H263 V1759 v0 v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v0 v1759 h84z",[116,6443,234],{"className":6444},[233],[116,6446,6448],{"className":6447},[173],[116,6449,6451],{"className":6450,"style":5885},[177],[116,6452],{},[116,6454],{"className":6455,"style":279},[144],[116,6457,594],{"className":6458},[593],[73,6460,6461,6462,6465,6466,6503,6504,6543,6544,2911,6559,6562,6563,6578,6579,6594,6595,6598,6599,6662],{},"defined up to scale — eight degrees of freedom, so ",[505,6463,6464],{},"four point\ncorrespondences"," pin it down. Each correspondence contributes two\nlinear constraints, and the direct linear transform stacks them into\nthe ",[116,6467,6469],{"className":6468},[119],[116,6470,6472,6494],{"className":6471,"ariaHidden":124},[123],[116,6473,6475,6478,6481,6485,6488,6491],{"className":6474},[128],[116,6476],{"className":6477,"style":423},[132],[116,6479,359],{"className":6480},[137],[116,6482,6484],{"className":6483,"style":196},[137,138],"N",[116,6486],{"className":6487,"style":570},[144],[116,6489,439],{"className":6490},[574],[116,6492],{"className":6493,"style":570},[144],[116,6495,6497,6500],{"className":6496},[128],[116,6498],{"className":6499,"style":1890},[132],[116,6501,6392],{"className":6502},[137]," system ",[116,6505,6507],{"className":6506},[119],[116,6508,6510,6534],{"className":6509,"ariaHidden":124},[123],[116,6511,6513,6516,6519,6522,6525,6528,6531],{"className":6512},[128],[116,6514],{"className":6515,"style":4022},[132],[116,6517,977],{"className":6518},[137,138],[116,6520],{"className":6521,"style":279},[144],[116,6523,4027],{"className":6524},[137,4026],[116,6526],{"className":6527,"style":145},[144],[116,6529,150],{"className":6530},[149],[116,6532],{"className":6533,"style":145},[144],[116,6535,6537,6540],{"className":6536},[128],[116,6538],{"className":6539,"style":1890},[132],[116,6541,331],{"className":6542},[137],", solved by the smallest\nsingular vector of ",[116,6545,6547],{"className":6546},[119],[116,6548,6550],{"className":6549,"ariaHidden":124},[123],[116,6551,6553,6556],{"className":6552},[128],[116,6554],{"className":6555,"style":272},[132],[116,6557,977],{"className":6558},[137,138],[108,6560,6561],{},"computeH"," builds ",[116,6564,6566],{"className":6565},[119],[116,6567,6569],{"className":6568,"ariaHidden":124},[123],[116,6570,6572,6575],{"className":6571},[128],[116,6573],{"className":6574,"style":272},[132],[116,6576,977],{"className":6577},[137,138]," row by row and reads off\nthe last row of ",[116,6580,6582],{"className":6581},[119],[116,6583,6585],{"className":6584,"ariaHidden":124},[123],[116,6586,6588,6591],{"className":6587},[128],[116,6589],{"className":6590,"style":272},[132],[116,6592,5188],{"className":6593,"style":570},[137,138]," from the SVD; ",[108,6596,6597],{},"computeH_norm"," first conditions each\npoint set (shift the centroid to the origin and scale so the mean\ndistance to it is ",[116,6600,6602],{"className":6601},[119],[116,6603,6605],{"className":6604,"ariaHidden":124},[123],[116,6606,6608,6612],{"className":6607},[128],[116,6609],{"className":6610,"style":6611},[132],"height:1.04em;vertical-align:-0.1328em;",[116,6613,6615],{"className":6614},[137,164],[116,6616,6618,6653],{"className":6617},[168,169],[116,6619,6621,6650],{"className":6620},[173],[116,6622,6625,6637],{"className":6623,"style":6624},[177],"height:0.9072em;",[116,6626,6628,6631],{"className":6627,"style":3376},[182],[116,6629],{"className":6630,"style":1119},[187],[116,6632,6634],{"className":6633,"style":5281},[137],[116,6635,359],{"className":6636},[137],[116,6638,6640,6643],{"style":6639},"top:-2.8672em;",[116,6641],{"className":6642,"style":1119},[187],[116,6644,6646],{"className":6645,"style":5333},[216],[219,6647,6648],{"xmlns":221,"width":222,"height":5336,"viewBox":5337,"preserveAspectRatio":225},[227,6649],{"d":5340},[116,6651,234],{"className":6652},[233],[116,6654,6656],{"className":6655},[173],[116,6657,6660],{"className":6658,"style":6659},[177],"height:0.1328em;",[116,6661],{},"), runs the DLT, then undoes the two\nsimilarity transforms, which keeps the linear system well-behaved.",[246,6664],{"hash":6665},"90197840f7ab23cd6ea3d63f97859cd64ccbe17901fff9bf3e631d8302edaae0",[73,6667,6668,6671,6672,6677,6678,6681,6682,6687],{},[108,6669,6670],{},"matchPics"," detects FAST corners in both grayscale images and describes\neach with a\n",[76,6673,6676],{"href":6674,"rel":6675},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBinary_Robust_Independent_Elementary_Features",[80],"BRIEF","\nbinary descriptor, then keeps a match only when the nearest descriptor\nbeats the runner-up by a ratio test. Real matches are polluted with\noutliers, so ",[108,6679,6680],{},"computeH_ransac"," estimates the homography with\n",[76,6683,6686],{"href":6684,"rel":6685},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRandom_sample_consensus",[80],"RANSAC",": fit\ncandidate models to minimal random samples and keep the one with the\nmost inliers:",[2107,6689,6691],{"className":2109,"code":6690,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Ransac-Homography}(M, N, \\tau)$\ninput: putative matches $M$, iteration budget $N$, inlier threshold $\\tau$\nbest $\\gets$ empty set\nrepeat $N$ times\n  sample 4 matches from $M$ at random; fit $H$ by the direct linear transform\n  inliers $\\gets$ matches in $M$ with reprojection error $\\lVert \\mathbf{x}' - H\\mathbf{x} \\rVert \u003C \\tau$\n  if $\\lvert$inliers$\\rvert > \\lvert$best$\\rvert$ then best $\\gets$ inliers\nrefit $H$ on best by least squares\nreturn $H$\n",[108,6692,6693,6698,6703,6708,6713,6718,6723,6728,6733],{"__ignoreMap":478},[116,6694,6695],{"class":2116,"line":2117},[116,6696,6697],{},"caption: $\\textsc{Ransac-Homography}(M, N, \\tau)$\n",[116,6699,6700],{"class":2116,"line":479},[116,6701,6702],{},"input: putative matches $M$, iteration budget $N$, inlier threshold $\\tau$\n",[116,6704,6705],{"class":2116,"line":2128},[116,6706,6707],{},"best $\\gets$ empty set\n",[116,6709,6710],{"class":2116,"line":2134},[116,6711,6712],{},"repeat $N$ times\n",[116,6714,6715],{"class":2116,"line":2140},[116,6716,6717],{},"  sample 4 matches from $M$ at random; fit $H$ by the direct linear transform\n",[116,6719,6720],{"class":2116,"line":2146},[116,6721,6722],{},"  inliers $\\gets$ matches in $M$ with reprojection error $\\lVert \\mathbf{x}' - H\\mathbf{x} \\rVert \u003C \\tau$\n",[116,6724,6725],{"class":2116,"line":2152},[116,6726,6727],{},"  if $\\lvert$inliers$\\rvert > \\lvert$best$\\rvert$ then best $\\gets$ inliers\n",[116,6729,6730],{"class":2116,"line":2158},[116,6731,6732],{},"refit $H$ on best by least squares\n",[116,6734,6735],{"class":2116,"line":2164},[116,6736,6737],{},"return $H$\n",[73,6739,6740,6741,6756,6757,6773,6774,6789,6790,6805,6806,6849,6850,6865,6866,6996,6997,1852],{},"The implementation samples ",[116,6742,6744],{"className":6743},[119],[116,6745,6747],{"className":6746,"ariaHidden":124},[123],[116,6748,6750,6753],{"className":6749},[128],[116,6751],{"className":6752,"style":1890},[132],[116,6754,5993],{"className":6755},[137]," correspondences per iteration over a\nbudget of ",[116,6758,6760],{"className":6759},[119],[116,6761,6763],{"className":6762,"ariaHidden":124},[123],[116,6764,6766,6769],{"className":6765},[128],[116,6767],{"className":6768,"style":1890},[132],[116,6770,6772],{"className":6771},[137],"100"," iterations, counts a point as an inlier when its\nreprojection error falls under ",[116,6775,6777],{"className":6776},[119],[116,6778,6780],{"className":6779,"ariaHidden":124},[123],[116,6781,6783,6786],{"className":6782},[128],[116,6784],{"className":6785,"style":1890},[132],[116,6787,6169],{"className":6788},[137]," pixels, and refits the homography on\nthe full inlier set at the end. A sample of ",[116,6791,6793],{"className":6792},[119],[116,6794,6796],{"className":6795,"ariaHidden":124},[123],[116,6797,6799,6802],{"className":6798},[128],[116,6800],{"className":6801,"style":1890},[132],[116,6803,5993],{"className":6804},[137]," points is all-inlier\nwith probability ",[116,6807,6809],{"className":6808},[119],[116,6810,6812],{"className":6811,"ariaHidden":124},[123],[116,6813,6815,6818],{"className":6814},[128],[116,6816],{"className":6817,"style":1152},[132],[116,6819,6821,6826],{"className":6820},[137],[116,6822,6825],{"className":6823,"style":6824},[137,138],"margin-right:0.0269em;","w",[116,6827,6829],{"className":6828},[725],[116,6830,6832],{"className":6831},[168],[116,6833,6835],{"className":6834},[173],[116,6836,6838],{"className":6837,"style":1152},[177],[116,6839,6840,6843],{"style":1167},[116,6841],{"className":6842,"style":742},[187],[116,6844,6846],{"className":6845},[746,747,748,749],[116,6847,5993],{"className":6848},[137,749]," at inlier rate ",[116,6851,6853],{"className":6852},[119],[116,6854,6856],{"className":6855,"ariaHidden":124},[123],[116,6857,6859,6862],{"className":6858},[128],[116,6860],{"className":6861,"style":133},[132],[116,6863,6825],{"className":6864,"style":6824},[137,138],", so a principled budget\nfollows from ",[116,6867,6869],{"className":6868},[119],[116,6870,6872,6892,6919,6958],{"className":6871,"ariaHidden":124},[123],[116,6873,6875,6879,6882,6885,6889],{"className":6874},[128],[116,6876],{"className":6877,"style":6878},[132],"height:0.8193em;vertical-align:-0.136em;",[116,6880,6484],{"className":6881,"style":196},[137,138],[116,6883],{"className":6884,"style":145},[144],[116,6886,6888],{"className":6887},[149],"≥",[116,6890],{"className":6891,"style":145},[144],[116,6893,6895,6898,6904,6907,6910,6913,6916],{"className":6894},[128],[116,6896],{"className":6897,"style":552},[132],[116,6899,6901],{"className":6900},[1126],[116,6902,4745],{"className":6903,"style":4744},[137,3388],[116,6905,562],{"className":6906},[561],[116,6908,345],{"className":6909},[137],[116,6911],{"className":6912,"style":570},[144],[116,6914,1610],{"className":6915},[574],[116,6917],{"className":6918,"style":570},[144],[116,6920,6922,6925,6928,6931,6934,6937,6943,6946,6949,6952,6955],{"className":6921},[128],[116,6923],{"className":6924,"style":552},[132],[116,6926,73],{"className":6927},[137,138],[116,6929,652],{"className":6930},[651],[116,6932,201],{"className":6933},[137],[116,6935],{"className":6936,"style":279},[144],[116,6938,6940],{"className":6939},[1126],[116,6941,4745],{"className":6942,"style":4744},[137,3388],[116,6944,562],{"className":6945},[561],[116,6947,345],{"className":6948},[137],[116,6950],{"className":6951,"style":570},[144],[116,6953,1610],{"className":6954},[574],[116,6956],{"className":6957,"style":570},[144],[116,6959,6961,6964,6993],{"className":6960},[128],[116,6962],{"className":6963,"style":2205},[132],[116,6965,6967,6970],{"className":6966},[137],[116,6968,6825],{"className":6969,"style":6824},[137,138],[116,6971,6973],{"className":6972},[725],[116,6974,6976],{"className":6975},[168],[116,6977,6979],{"className":6978},[173],[116,6980,6982],{"className":6981,"style":1152},[177],[116,6983,6984,6987],{"style":1167},[116,6985],{"className":6986,"style":742},[187],[116,6988,6990],{"className":6989},[746,747,748,749],[116,6991,5993],{"className":6992},[137,749],[116,6994,652],{"className":6995},[651]," for a target confidence\n",[116,6998,7000],{"className":6999},[119],[116,7001,7003],{"className":7002,"ariaHidden":124},[123],[116,7004,7006,7010],{"className":7005},[128],[116,7007],{"className":7008,"style":7009},[132],"height:0.625em;vertical-align:-0.1944em;",[116,7011,73],{"className":7012},[137,138],[73,7014,7015,7018,7019,7034,7035,7038,7039,7042,7043,7046,7047,7050,7051,1852],{},[108,7016,7017],{},"compositeH"," warps the overlay and an all-ones mask by ",[116,7020,7022],{"className":7021},[119],[116,7023,7025],{"className":7024,"ariaHidden":124},[123],[116,7026,7028,7031],{"className":7027},[128],[116,7029],{"className":7030,"style":272},[132],[116,7032,5804],{"className":7033,"style":5803},[137,138]," with\n",[108,7036,7037],{},"warpPerspective",", then blends the warped template over the\nscene wherever the mask lands — dropping a new cover onto the book in\n",[108,7040,7041],{},"cv_desk.png",". Frames for the moving version come from ",[108,7044,7045],{},"loadVid",", and an\nextra-credit ",[108,7048,7049],{},"panorama"," script reuses the same match-and-warp pipeline to\nstitch overlapping photos. The full write-up is available as a\n",[76,7052,2261],{"href":7053,"rel":7054},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Fblob\u002Fmain\u002Fpsets\u002F02\u002Fwriteup\u002Fmain.pdf",[80],[246,7056],{"hash":7057},"95603329c482f726b74d1a12b685aeb11a0ea29e93c6e99eb54b41d7c193ec68",[2263,7059,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":7061},[],"2024-02-05",{},"\u002Fprojects\u002Fcomputer-vision\u002Faugmented-reality",[488],{"title":5693,"description":5698},"projects\u002Fcomputer-vision\u002F3.augmented-reality","Overlaying one image onto another in correct perspective — feature matching,\nRANSAC, and the 3×3 homography that maps plane to plane.",[2279,2280,2281],"LFDUT3d1XRuXS3c8sLA969MPUjPiJcLZGZhWGWDVtRY",{"id":7072,"title":7073,"body":7074,"date":8848,"description":8849,"extension":483,"featured":2354,"meta":8850,"navigation":484,"path":8851,"references":8852,"repo":8856,"seo":8857,"stem":8858,"summary":8859,"tag":2364,"tech":8860,"url":2282,"__hash__":8861},"projects\u002Fprojects\u002Flinguistics\u002F3.logistic-regression.md","Logistic Regression",{"type":70,"value":7075,"toc":8846},[7076,7085,7136,7444,7478,7481,7649,7652,8003,8022,8296,8344,8497,8840],[73,7077,7078,7079,7084],{},"A text classifier built on\n",[76,7080,7083],{"href":7081,"rel":7082},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLogistic_regression",[80],"logistic regression",",\nimplemented from scratch. Where naive Bayes is generative — it models how\ndocuments are produced — logistic regression is discriminative: it\nlearns a decision boundary directly, weighting features by how much each\none moves the answer.",[73,7086,7087,7088,7103,7104,7119,7120,7135],{},"The model runs a linear score through a sigmoid. Each document becomes a\nfeature vector ",[116,7089,7091],{"className":7090},[119],[116,7092,7094],{"className":7093,"ariaHidden":124},[123],[116,7095,7097,7100],{"className":7096},[128],[116,7098],{"className":7099,"style":4318},[132],[116,7101,566],{"className":7102},[137,4026]," (word counts and indicators). The model scores it\nwith a weight vector ",[116,7105,7107],{"className":7106},[119],[116,7108,7110],{"className":7109,"ariaHidden":124},[123],[116,7111,7113,7116],{"className":7112},[128],[116,7114],{"className":7115,"style":4318},[132],[116,7117,6825],{"className":7118,"style":4969},[137,4026]," and bias ",[116,7121,7123],{"className":7122},[119],[116,7124,7126],{"className":7125,"ariaHidden":124},[123],[116,7127,7129,7132],{"className":7128},[128],[116,7130],{"className":7131,"style":4022},[132],[116,7133,4115],{"className":7134},[137,138],", then squashes the score\nto a probability with the logistic function:",[116,7137,7139],{"className":7138},[702],[116,7140,7142],{"className":7141},[119],[116,7143,7145,7169,7187,7208,7248,7267,7285,7324],{"className":7144,"ariaHidden":124},[123],[116,7146,7148,7151,7154,7157,7160,7163,7166],{"className":7147},[128],[116,7149],{"className":7150,"style":552},[132],[116,7152,2794],{"className":7153,"style":924},[137,138],[116,7155,562],{"className":7156},[561],[116,7158,601],{"className":7159,"style":139},[137,138],[116,7161],{"className":7162,"style":145},[144],[116,7164,150],{"className":7165},[149],[116,7167],{"className":7168,"style":145},[144],[116,7170,7172,7175,7178,7181,7184],{"className":7171},[128],[116,7173],{"className":7174,"style":552},[132],[116,7176,345],{"className":7177},[137],[116,7179],{"className":7180,"style":145},[144],[116,7182,4389],{"className":7183},[149],[116,7185],{"className":7186,"style":145},[144],[116,7188,7190,7193,7196,7199,7202,7205],{"className":7189},[128],[116,7191],{"className":7192,"style":552},[132],[116,7194,566],{"className":7195},[137,4026],[116,7197,652],{"className":7198},[651],[116,7200],{"className":7201,"style":145},[144],[116,7203,150],{"className":7204},[149],[116,7206],{"className":7207,"style":145},[144],[116,7209,7211,7214,7218,7221,7224,7227,7230,7233,7236,7239,7242,7245],{"className":7210},[128],[116,7212],{"className":7213,"style":552},[132],[116,7215,7217],{"className":7216,"style":139},[137,138],"σ",[116,7219,562],{"className":7220},[561],[116,7222,4166],{"className":7223,"style":4559},[137,138],[116,7225,652],{"className":7226},[651],[116,7228,594],{"className":7229},[593],[116,7231],{"className":7232,"style":4159},[144],[116,7234],{"className":7235,"style":279},[144],[116,7237,4166],{"className":7238,"style":4559},[137,138],[116,7240],{"className":7241,"style":145},[144],[116,7243,150],{"className":7244},[149],[116,7246],{"className":7247,"style":145},[144],[116,7249,7251,7255,7258,7261,7264],{"className":7250},[128],[116,7252],{"className":7253,"style":7254},[132],"height:0.4445em;",[116,7256,6825],{"className":7257,"style":4969},[137,4026],[116,7259],{"className":7260,"style":570},[144],[116,7262,5064],{"className":7263},[574],[116,7265],{"className":7266,"style":570},[144],[116,7268,7270,7273,7276,7279,7282],{"className":7269},[128],[116,7271],{"className":7272,"style":2930},[132],[116,7274,566],{"className":7275},[137,4026],[116,7277],{"className":7278,"style":570},[144],[116,7280,575],{"className":7281},[574],[116,7283],{"className":7284,"style":570},[144],[116,7286,7288,7291,7294,7297,7300,7303,7306,7309,7312,7315,7318,7321],{"className":7287},[128],[116,7289],{"className":7290,"style":552},[132],[116,7292,4115],{"className":7293},[137,138],[116,7295,594],{"className":7296},[593],[116,7298],{"className":7299,"style":4159},[144],[116,7301],{"className":7302,"style":279},[144],[116,7304,7217],{"className":7305,"style":139},[137,138],[116,7307,562],{"className":7308},[561],[116,7310,4166],{"className":7311,"style":4559},[137,138],[116,7313,652],{"className":7314},[651],[116,7316],{"className":7317,"style":145},[144],[116,7319,150],{"className":7320},[149],[116,7322],{"className":7323,"style":145},[144],[116,7325,7327,7331,7441],{"className":7326},[128],[116,7328],{"className":7329,"style":7330},[132],"height:2.0908em;vertical-align:-0.7693em;",[116,7332,7334,7337,7438],{"className":7333},[137],[116,7335],{"className":7336},[561,4427],[116,7338,7340],{"className":7339},[4431],[116,7341,7343,7429],{"className":7342},[168,169],[116,7344,7346,7426],{"className":7345},[173],[116,7347,7350,7407,7415],{"className":7348,"style":7349},[177],"height:1.3214em;",[116,7351,7352,7355],{"style":5010},[116,7353],{"className":7354,"style":1119},[187],[116,7356,7358,7361,7364,7367,7370],{"className":7357},[137],[116,7359,345],{"className":7360},[137],[116,7362],{"className":7363,"style":570},[144],[116,7365,575],{"className":7366},[574],[116,7368],{"className":7369,"style":570},[144],[116,7371,7373,7376],{"className":7372},[137],[116,7374,4527],{"className":7375},[137,138],[116,7377,7379],{"className":7378},[725],[116,7380,7382],{"className":7381},[168],[116,7383,7385],{"className":7384},[173],[116,7386,7389],{"className":7387,"style":7388},[177],"height:0.6973em;",[116,7390,7392,7395],{"style":7391},"top:-2.989em;margin-right:0.05em;",[116,7393],{"className":7394,"style":742},[187],[116,7396,7398],{"className":7397},[746,747,748,749],[116,7399,7401,7404],{"className":7400},[137,749],[116,7402,1610],{"className":7403},[137,749],[116,7405,4166],{"className":7406,"style":4559},[137,138,749],[116,7408,7409,7412],{"style":4597},[116,7410],{"className":7411,"style":1119},[187],[116,7413],{"className":7414,"style":4605},[4604],[116,7416,7417,7420],{"style":4608},[116,7418],{"className":7419,"style":1119},[187],[116,7421,7423],{"className":7422},[137],[116,7424,345],{"className":7425},[137],[116,7427,234],{"className":7428},[233],[116,7430,7432],{"className":7431},[173],[116,7433,7436],{"className":7434,"style":7435},[177],"height:0.7693em;",[116,7437],{},[116,7439],{"className":7440},[651,4427],[116,7442,1852],{"className":7443},[137],[73,7445,7446,7447,7477],{},"The output lies in ",[116,7448,7450],{"className":7449},[119],[116,7451,7453],{"className":7452,"ariaHidden":124},[123],[116,7454,7456,7459,7462,7465,7468,7471,7474],{"className":7455},[128],[116,7457],{"className":7458,"style":552},[132],[116,7460,562],{"className":7461},[561],[116,7463,331],{"className":7464},[137],[116,7466,594],{"className":7467},[593],[116,7469],{"className":7470,"style":279},[144],[116,7472,345],{"className":7473},[137],[116,7475,652],{"className":7476},[651]," and is read as the probability of the\npositive class.",[246,7479],{"hash":7480},"25f9ac072e3947907f25a3c06739721f3740bb9bd9099773eab140fba770f158",[73,7482,7483,7484,7500,7501,7543,7544,7578,7579,7648],{},"The decision rule thresholds that probability at ",[116,7485,7487],{"className":7486},[119],[116,7488,7490],{"className":7489,"ariaHidden":124},[123],[116,7491,7493,7496],{"className":7492},[128],[116,7494],{"className":7495,"style":1890},[132],[116,7497,7499],{"className":7498},[137],"0.5"," to get the label.\nBecause ",[116,7502,7504],{"className":7503},[119],[116,7505,7507,7534],{"className":7506,"ariaHidden":124},[123],[116,7508,7510,7513,7516,7519,7522,7525,7528,7531],{"className":7509},[128],[116,7511],{"className":7512,"style":552},[132],[116,7514,7217],{"className":7515,"style":139},[137,138],[116,7517,562],{"className":7518},[561],[116,7520,4166],{"className":7521,"style":4559},[137,138],[116,7523,652],{"className":7524},[651],[116,7526],{"className":7527,"style":145},[144],[116,7529,6888],{"className":7530},[149],[116,7532],{"className":7533,"style":145},[144],[116,7535,7537,7540],{"className":7536},[128],[116,7538],{"className":7539,"style":1890},[132],[116,7541,7499],{"className":7542},[137]," exactly when ",[116,7545,7547],{"className":7546},[119],[116,7548,7550,7569],{"className":7549,"ariaHidden":124},[123],[116,7551,7553,7557,7560,7563,7566],{"className":7552},[128],[116,7554],{"className":7555,"style":7556},[132],"height:0.7719em;vertical-align:-0.136em;",[116,7558,4166],{"className":7559,"style":4559},[137,138],[116,7561],{"className":7562,"style":145},[144],[116,7564,6888],{"className":7565},[149],[116,7567],{"className":7568,"style":145},[144],[116,7570,7572,7575],{"className":7571},[128],[116,7573],{"className":7574,"style":1890},[132],[116,7576,331],{"className":7577},[137],", the boundary\nis the hyperplane ",[116,7580,7582],{"className":7581},[119],[116,7583,7585,7603,7621,7639],{"className":7584,"ariaHidden":124},[123],[116,7586,7588,7591,7594,7597,7600],{"className":7587},[128],[116,7589],{"className":7590,"style":7254},[132],[116,7592,6825],{"className":7593,"style":4969},[137,4026],[116,7595],{"className":7596,"style":570},[144],[116,7598,5064],{"className":7599},[574],[116,7601],{"className":7602,"style":570},[144],[116,7604,7606,7609,7612,7615,7618],{"className":7605},[128],[116,7607],{"className":7608,"style":2930},[132],[116,7610,566],{"className":7611},[137,4026],[116,7613],{"className":7614,"style":570},[144],[116,7616,575],{"className":7617},[574],[116,7619],{"className":7620,"style":570},[144],[116,7622,7624,7627,7630,7633,7636],{"className":7623},[128],[116,7625],{"className":7626,"style":4022},[132],[116,7628,4115],{"className":7629},[137,138],[116,7631],{"className":7632,"style":145},[144],[116,7634,150],{"className":7635},[149],[116,7637],{"className":7638,"style":145},[144],[116,7640,7642,7645],{"className":7641},[128],[116,7643],{"className":7644,"style":1890},[132],[116,7646,331],{"className":7647},[137],": the classifier\nis linear even though the probability it reports is not.",[73,7650,7651],{},"Training uses cross-entropy as its loss, maximizing the likelihood of the\ntraining labels, equivalently minimizing the average negative\nlog-likelihood. For a single example the loss is",[116,7653,7655],{"className":7654},[702],[116,7656,7658],{"className":7657},[119],[116,7659,7661,7679,7769,7790,7826,7946,7970,7988],{"className":7660,"ariaHidden":124},[123],[116,7662,7664,7667,7670,7673,7676],{"className":7663},[128],[116,7665],{"className":7666,"style":272},[132],[116,7668,4716],{"className":7669},[137,4715],[116,7671],{"className":7672,"style":145},[144],[116,7674,150],{"className":7675},[149],[116,7677],{"className":7678,"style":145},[144],[116,7680,7682,7686,7689,7695,7698,7701,7704,7710,7713,7760,7763,7766],{"className":7681},[128],[116,7683],{"className":7684,"style":7685},[132],"height:1.2em;vertical-align:-0.35em;",[116,7687,1610],{"className":7688},[137],[116,7690,7692],{"className":7691},[137],[116,7693,1092],{"className":7694},[1091,1002],[116,7696],{"className":7697,"style":279},[144],[116,7699,601],{"className":7700,"style":139},[137,138],[116,7702],{"className":7703,"style":279},[144],[116,7705,7707],{"className":7706},[1126],[116,7708,4745],{"className":7709,"style":4744},[137,3388],[116,7711],{"className":7712,"style":279},[144],[116,7714,7717],{"className":7715},[137,7716],"accent",[116,7718,7720,7751],{"className":7719},[168,169],[116,7721,7723,7748],{"className":7722},[173],[116,7724,7726,7734],{"className":7725,"style":4022},[177],[116,7727,7728,7731],{"style":3376},[116,7729],{"className":7730,"style":1119},[187],[116,7732,601],{"className":7733,"style":139},[137,138],[116,7735,7736,7739],{"style":3376},[116,7737],{"className":7738,"style":1119},[187],[116,7740,7744],{"className":7741,"style":7743},[7742],"accent-body","left:-0.1944em;",[116,7745,7747],{"className":7746},[137],"^",[116,7749,234],{"className":7750},[233],[116,7752,7754],{"className":7753},[173],[116,7755,7758],{"className":7756,"style":7757},[177],"height:0.1944em;",[116,7759],{},[116,7761],{"className":7762,"style":570},[144],[116,7764,575],{"className":7765},[574],[116,7767],{"className":7768,"style":570},[144],[116,7770,7772,7775,7778,7781,7784,7787],{"className":7771},[128],[116,7773],{"className":7774,"style":552},[132],[116,7776,562],{"className":7777},[561],[116,7779,345],{"className":7780},[137],[116,7782],{"className":7783,"style":570},[144],[116,7785,1610],{"className":7786},[574],[116,7788],{"className":7789,"style":570},[144],[116,7791,7793,7796,7799,7802,7805,7811,7814,7817,7820,7823],{"className":7792},[128],[116,7794],{"className":7795,"style":552},[132],[116,7797,601],{"className":7798,"style":139},[137,138],[116,7800,652],{"className":7801},[651],[116,7803],{"className":7804,"style":279},[144],[116,7806,7808],{"className":7807},[1126],[116,7809,4745],{"className":7810,"style":4744},[137,3388],[116,7812,562],{"className":7813},[561],[116,7815,345],{"className":7816},[137],[116,7818],{"className":7819,"style":570},[144],[116,7821,1610],{"className":7822},[574],[116,7824],{"className":7825,"style":570},[144],[116,7827,7829,7832,7874,7877,7880,7886,7889,7892,7895,7937,7940,7943],{"className":7828},[128],[116,7830],{"className":7831,"style":7685},[132],[116,7833,7835],{"className":7834},[137,7716],[116,7836,7838,7866],{"className":7837},[168,169],[116,7839,7841,7863],{"className":7840},[173],[116,7842,7844,7852],{"className":7843,"style":4022},[177],[116,7845,7846,7849],{"style":3376},[116,7847],{"className":7848,"style":1119},[187],[116,7850,601],{"className":7851,"style":139},[137,138],[116,7853,7854,7857],{"style":3376},[116,7855],{"className":7856,"style":1119},[187],[116,7858,7860],{"className":7859,"style":7743},[7742],[116,7861,7747],{"className":7862},[137],[116,7864,234],{"className":7865},[233],[116,7867,7869],{"className":7868},[173],[116,7870,7872],{"className":7871,"style":7757},[177],[116,7873],{},[116,7875,652],{"className":7876},[651],[116,7878],{"className":7879,"style":279},[144],[116,7881,7883],{"className":7882},[137],[116,7884,1493],{"className":7885},[1091,1002],[116,7887,594],{"className":7888},[593],[116,7890],{"className":7891,"style":4159},[144],[116,7893],{"className":7894,"style":279},[144],[116,7896,7898],{"className":7897},[137,7716],[116,7899,7901,7929],{"className":7900},[168,169],[116,7902,7904,7926],{"className":7903},[173],[116,7905,7907,7915],{"className":7906,"style":4022},[177],[116,7908,7909,7912],{"style":3376},[116,7910],{"className":7911,"style":1119},[187],[116,7913,601],{"className":7914,"style":139},[137,138],[116,7916,7917,7920],{"style":3376},[116,7918],{"className":7919,"style":1119},[187],[116,7921,7923],{"className":7922,"style":7743},[7742],[116,7924,7747],{"className":7925},[137],[116,7927,234],{"className":7928},[233],[116,7930,7932],{"className":7931},[173],[116,7933,7935],{"className":7934,"style":7757},[177],[116,7936],{},[116,7938],{"className":7939,"style":145},[144],[116,7941,150],{"className":7942},[149],[116,7944],{"className":7945,"style":145},[144],[116,7947,7949,7952,7955,7958,7961,7964,7967],{"className":7948},[128],[116,7950],{"className":7951,"style":552},[132],[116,7953,7217],{"className":7954,"style":139},[137,138],[116,7956,562],{"className":7957},[561],[116,7959,6825],{"className":7960,"style":4969},[137,4026],[116,7962],{"className":7963,"style":570},[144],[116,7965,5064],{"className":7966},[574],[116,7968],{"className":7969,"style":570},[144],[116,7971,7973,7976,7979,7982,7985],{"className":7972},[128],[116,7974],{"className":7975,"style":2930},[132],[116,7977,566],{"className":7978},[137,4026],[116,7980],{"className":7981,"style":570},[144],[116,7983,575],{"className":7984},[574],[116,7986],{"className":7987,"style":570},[144],[116,7989,7991,7994,7997,8000],{"className":7990},[128],[116,7992],{"className":7993,"style":552},[132],[116,7995,4115],{"className":7996},[137,138],[116,7998,652],{"className":7999},[651],[116,8001,1852],{"className":8002},[137],[73,8004,8005,8006,8021],{},"This penalizes a confident wrong prediction sharply and a correct one\nlightly. It is convex in ",[116,8007,8009],{"className":8008},[119],[116,8010,8012],{"className":8011,"ariaHidden":124},[123],[116,8013,8015,8018],{"className":8014},[128],[116,8016],{"className":8017,"style":4318},[132],[116,8019,6825],{"className":8020,"style":4969},[137,4026],", so gradient descent reaches the\nglobal optimum.",[73,8023,8024,8025,8129,8130,8145,8146,8263,8264,8279,8280,8295],{},"Squared error ",[116,8026,8028],{"className":8027},[119],[116,8029,8031,8091],{"className":8030,"ariaHidden":124},[123],[116,8032,8034,8037,8040,8082,8085,8088],{"className":8033},[128],[116,8035],{"className":8036,"style":552},[132],[116,8038,562],{"className":8039},[561],[116,8041,8043],{"className":8042},[137,7716],[116,8044,8046,8074],{"className":8045},[168,169],[116,8047,8049,8071],{"className":8048},[173],[116,8050,8052,8060],{"className":8051,"style":4022},[177],[116,8053,8054,8057],{"style":3376},[116,8055],{"className":8056,"style":1119},[187],[116,8058,601],{"className":8059,"style":139},[137,138],[116,8061,8062,8065],{"style":3376},[116,8063],{"className":8064,"style":1119},[187],[116,8066,8068],{"className":8067,"style":7743},[7742],[116,8069,7747],{"className":8070},[137],[116,8072,234],{"className":8073},[233],[116,8075,8077],{"className":8076},[173],[116,8078,8080],{"className":8079,"style":7757},[177],[116,8081],{},[116,8083],{"className":8084,"style":570},[144],[116,8086,1610],{"className":8087},[574],[116,8089],{"className":8090,"style":570},[144],[116,8092,8094,8097,8100],{"className":8093},[128],[116,8095],{"className":8096,"style":2205},[132],[116,8098,601],{"className":8099,"style":139},[137,138],[116,8101,8103,8106],{"className":8102},[651],[116,8104,652],{"className":8105},[651],[116,8107,8109],{"className":8108},[725],[116,8110,8112],{"className":8111},[168],[116,8113,8115],{"className":8114},[173],[116,8116,8118],{"className":8117,"style":1152},[177],[116,8119,8120,8123],{"style":1167},[116,8121],{"className":8122,"style":742},[187],[116,8124,8126],{"className":8125},[746,747,748,749],[116,8127,359],{"className":8128},[137,749]," would also measure the miss, but paired\nwith a sigmoid it is\nnon-convex in ",[116,8131,8133],{"className":8132},[119],[116,8134,8136],{"className":8135,"ariaHidden":124},[123],[116,8137,8139,8142],{"className":8138},[128],[116,8140],{"className":8141,"style":4318},[132],[116,8143,6825],{"className":8144,"style":4969},[137,4026],", and its gradient carries a factor of\n",[116,8147,8149],{"className":8148},[119],[116,8150,8152,8208,8244],{"className":8151,"ariaHidden":124},[123],[116,8153,8155,8158,8190,8193,8196,8199,8202,8205],{"className":8154},[128],[116,8156],{"className":8157,"style":2846},[132],[116,8159,8161,8164],{"className":8160},[137],[116,8162,7217],{"className":8163,"style":139},[137,138],[116,8165,8167],{"className":8166},[725],[116,8168,8170],{"className":8169},[168],[116,8171,8173],{"className":8172},[173],[116,8174,8176],{"className":8175,"style":2412},[177],[116,8177,8178,8181],{"style":1167},[116,8179],{"className":8180,"style":742},[187],[116,8182,8184],{"className":8183},[746,747,748,749],[116,8185,8187],{"className":8186},[137,749],[116,8188,2445],{"className":8189},[137,749],[116,8191,562],{"className":8192},[561],[116,8194,4166],{"className":8195,"style":4559},[137,138],[116,8197,652],{"className":8198},[651],[116,8200],{"className":8201,"style":145},[144],[116,8203,150],{"className":8204},[149],[116,8206],{"className":8207,"style":145},[144],[116,8209,8211,8214,8217,8220,8223,8226,8229,8232,8235,8238,8241],{"className":8210},[128],[116,8212],{"className":8213,"style":552},[132],[116,8215,7217],{"className":8216,"style":139},[137,138],[116,8218,562],{"className":8219},[561],[116,8221,4166],{"className":8222,"style":4559},[137,138],[116,8224,652],{"className":8225},[651],[116,8227],{"className":8228,"style":279},[144],[116,8230,562],{"className":8231},[561],[116,8233,345],{"className":8234},[137],[116,8236],{"className":8237,"style":570},[144],[116,8239,1610],{"className":8240},[574],[116,8242],{"className":8243,"style":570},[144],[116,8245,8247,8250,8253,8256,8259],{"className":8246},[128],[116,8248],{"className":8249,"style":552},[132],[116,8251,7217],{"className":8252,"style":139},[137,138],[116,8254,562],{"className":8255},[561],[116,8257,4166],{"className":8258,"style":4559},[137,138],[116,8260,8262],{"className":8261},[651],"))",". That factor collapses toward\nzero whenever the model is saturated — confidently near ",[116,8265,8267],{"className":8266},[119],[116,8268,8270],{"className":8269,"ariaHidden":124},[123],[116,8271,8273,8276],{"className":8272},[128],[116,8274],{"className":8275,"style":1890},[132],[116,8277,331],{"className":8278},[137]," or ",[116,8281,8283],{"className":8282},[119],[116,8284,8286],{"className":8285,"ariaHidden":124},[123],[116,8287,8289,8292],{"className":8288},[128],[116,8290],{"className":8291,"style":1890},[132],[116,8293,345],{"className":8294},[137]," — so a\nconfidently wrong prediction produces almost no gradient and learning\nstalls exactly where it should correct hardest. Cross-entropy is designed\nto cancel that factor.",[73,8297,8298,8299,8343],{},"The reward is a clean gradient: with cross-entropy the ",[116,8300,8302],{"className":8301},[119],[116,8303,8305],{"className":8304,"ariaHidden":124},[123],[116,8306,8308,8311],{"className":8307},[128],[116,8309],{"className":8310,"style":2412},[132],[116,8312,8314,8317],{"className":8313},[137],[116,8315,7217],{"className":8316,"style":139},[137,138],[116,8318,8320],{"className":8319},[725],[116,8321,8323],{"className":8322},[168],[116,8324,8326],{"className":8325},[173],[116,8327,8329],{"className":8328,"style":2412},[177],[116,8330,8331,8334],{"style":1167},[116,8332],{"className":8333,"style":742},[187],[116,8335,8337],{"className":8336},[746,747,748,749],[116,8338,8340],{"className":8339},[137,749],[116,8341,2445],{"className":8342},[137,749]," term\ncancels, and the gradient with respect to the weights is just the\nprediction error times the features:",[116,8345,8347],{"className":8346},[702],[116,8348,8350],{"className":8349},[119],[116,8351,8353,8416,8476],{"className":8352,"ariaHidden":124},[123],[116,8354,8356,8359,8404,8407,8410,8413],{"className":8355},[128],[116,8357],{"className":8358,"style":715},[132],[116,8360,8362,8366],{"className":8361},[137],[116,8363,8365],{"className":8364},[137],"∇",[116,8367,8369],{"className":8368},[725],[116,8370,8372,8396],{"className":8371},[168,169],[116,8373,8375,8393],{"className":8374},[173],[116,8376,8379],{"className":8377,"style":8378},[177],"height:0.1611em;",[116,8380,8381,8384],{"style":3584},[116,8382],{"className":8383,"style":742},[187],[116,8385,8387],{"className":8386},[746,747,748,749],[116,8388,8390],{"className":8389},[137,749],[116,8391,6825],{"className":8392,"style":4969},[137,4026,749],[116,8394,234],{"className":8395},[233],[116,8397,8399],{"className":8398},[173],[116,8400,8402],{"className":8401,"style":762},[177],[116,8403],{},[116,8405,4716],{"className":8406},[137,4715],[116,8408],{"className":8409,"style":145},[144],[116,8411,150],{"className":8412},[149],[116,8414],{"className":8415,"style":145},[144],[116,8417,8419,8422,8425,8467,8470,8473],{"className":8418},[128],[116,8420],{"className":8421,"style":552},[132],[116,8423,562],{"className":8424},[561],[116,8426,8428],{"className":8427},[137,7716],[116,8429,8431,8459],{"className":8430},[168,169],[116,8432,8434,8456],{"className":8433},[173],[116,8435,8437,8445],{"className":8436,"style":4022},[177],[116,8438,8439,8442],{"style":3376},[116,8440],{"className":8441,"style":1119},[187],[116,8443,601],{"className":8444,"style":139},[137,138],[116,8446,8447,8450],{"style":3376},[116,8448],{"className":8449,"style":1119},[187],[116,8451,8453],{"className":8452,"style":7743},[7742],[116,8454,7747],{"className":8455},[137],[116,8457,234],{"className":8458},[233],[116,8460,8462],{"className":8461},[173],[116,8463,8465],{"className":8464,"style":7757},[177],[116,8466],{},[116,8468],{"className":8469,"style":570},[144],[116,8471,1610],{"className":8472},[574],[116,8474],{"className":8475,"style":570},[144],[116,8477,8479,8482,8485,8488,8491,8494],{"className":8478},[128],[116,8480],{"className":8481,"style":552},[132],[116,8483,601],{"className":8484,"style":139},[137,138],[116,8486,652],{"className":8487},[651],[116,8489],{"className":8490,"style":279},[144],[116,8492,566],{"className":8493},[137,4026],[116,8495,1852],{"className":8496},[137],[73,8498,8499,8500,8621,8622,8674,8675,8820,8821,8839],{},"Descent repeats ",[116,8501,8503],{"className":8502},[119],[116,8504,8506,8524,8542,8606],{"className":8505,"ariaHidden":124},[123],[116,8507,8509,8512,8515,8518,8521],{"className":8508},[128],[116,8510],{"className":8511,"style":4318},[132],[116,8513,6825],{"className":8514,"style":4969},[137,4026],[116,8516],{"className":8517,"style":145},[144],[116,8519,2195],{"className":8520},[149],[116,8522],{"className":8523,"style":145},[144],[116,8525,8527,8530,8533,8536,8539],{"className":8526},[128],[116,8528],{"className":8529,"style":2930},[132],[116,8531,6825],{"className":8532,"style":4969},[137,4026],[116,8534],{"className":8535,"style":570},[144],[116,8537,1610],{"className":8538},[574],[116,8540],{"className":8541,"style":570},[144],[116,8543,8545,8548,8552,8555,8597,8600,8603],{"className":8544},[128],[116,8546],{"className":8547,"style":552},[132],[116,8549,8551],{"className":8550,"style":139},[137,138],"η",[116,8553,562],{"className":8554},[561],[116,8556,8558],{"className":8557},[137,7716],[116,8559,8561,8589],{"className":8560},[168,169],[116,8562,8564,8586],{"className":8563},[173],[116,8565,8567,8575],{"className":8566,"style":4022},[177],[116,8568,8569,8572],{"style":3376},[116,8570],{"className":8571,"style":1119},[187],[116,8573,601],{"className":8574,"style":139},[137,138],[116,8576,8577,8580],{"style":3376},[116,8578],{"className":8579,"style":1119},[187],[116,8581,8583],{"className":8582,"style":7743},[7742],[116,8584,7747],{"className":8585},[137],[116,8587,234],{"className":8588},[233],[116,8590,8592],{"className":8591},[173],[116,8593,8595],{"className":8594,"style":7757},[177],[116,8596],{},[116,8598],{"className":8599,"style":570},[144],[116,8601,1610],{"className":8602},[574],[116,8604],{"className":8605,"style":570},[144],[116,8607,8609,8612,8615,8618],{"className":8608},[128],[116,8610],{"className":8611,"style":552},[132],[116,8613,601],{"className":8614,"style":139},[137,138],[116,8616,652],{"className":8617},[651],[116,8619,566],{"className":8620},[137,4026]," over the training set until the loss stops falling. An ",[116,8623,8625],{"className":8624},[119],[116,8626,8628],{"className":8627,"ariaHidden":124},[123],[116,8629,8631,8634],{"className":8630},[128],[116,8632],{"className":8633,"style":715},[132],[116,8635,8637,8640],{"className":8636},[137],[116,8638,4716],{"className":8639},[137,138],[116,8641,8643],{"className":8642},[725],[116,8644,8646,8666],{"className":8645},[168,169],[116,8647,8649,8663],{"className":8648},[173],[116,8650,8652],{"className":8651,"style":4068},[177],[116,8653,8654,8657],{"style":3584},[116,8655],{"className":8656,"style":742},[187],[116,8658,8660],{"className":8659},[746,747,748,749],[116,8661,359],{"className":8662},[137,749],[116,8664,234],{"className":8665},[233],[116,8667,8669],{"className":8668},[173],[116,8670,8672],{"className":8671,"style":762},[177],[116,8673],{},"\npenalty ",[116,8676,8678],{"className":8677},[119],[116,8679,8681],{"className":8680,"ariaHidden":124},[123],[116,8682,8684,8688,8761,8764,8767],{"className":8683},[128],[116,8685],{"className":8686,"style":8687},[132],"height:1.2251em;vertical-align:-0.345em;",[116,8689,8691,8694,8758],{"className":8690},[137],[116,8692],{"className":8693},[561,4427],[116,8695,8697],{"className":8696},[4431],[116,8698,8700,8749],{"className":8699},[168,169],[116,8701,8703,8746],{"className":8702},[173],[116,8704,8707,8722,8730],{"className":8705,"style":8706},[177],"height:0.8801em;",[116,8708,8710,8713],{"style":8709},"top:-2.655em;",[116,8711],{"className":8712,"style":1119},[187],[116,8714,8716],{"className":8715},[746,747,748,749],[116,8717,8719],{"className":8718},[137,749],[116,8720,359],{"className":8721},[137,749],[116,8723,8724,8727],{"style":4597},[116,8725],{"className":8726,"style":1119},[187],[116,8728],{"className":8729,"style":4605},[4604],[116,8731,8733,8736],{"style":8732},"top:-3.394em;",[116,8734],{"className":8735,"style":1119},[187],[116,8737,8739],{"className":8738},[746,747,748,749],[116,8740,8742],{"className":8741},[137,749],[116,8743,8745],{"className":8744},[137,138,749],"λ",[116,8747,234],{"className":8748},[233],[116,8750,8752],{"className":8751},[173],[116,8753,8756],{"className":8754,"style":8755},[177],"height:0.345em;",[116,8757],{},[116,8759],{"className":8760},[651,4427],[116,8762,5020],{"className":8763},[561],[116,8765,6825],{"className":8766,"style":4969},[137,4026],[116,8768,8770,8773],{"className":8769},[651],[116,8771,5020],{"className":8772},[651],[116,8774,8776],{"className":8775},[725],[116,8777,8779,8811],{"className":8778},[168,169],[116,8780,8782,8808],{"className":8781},[173],[116,8783,8785,8797],{"className":8784,"style":1152},[177],[116,8786,8788,8791],{"style":8787},"top:-2.4519em;margin-left:0em;margin-right:0.05em;",[116,8789],{"className":8790,"style":742},[187],[116,8792,8794],{"className":8793},[746,747,748,749],[116,8795,359],{"className":8796},[137,749],[116,8798,8799,8802],{"style":1167},[116,8800],{"className":8801,"style":742},[187],[116,8803,8805],{"className":8804},[746,747,748,749],[116,8806,359],{"className":8807},[137,749],[116,8809,234],{"className":8810},[233],[116,8812,8814],{"className":8813},[173],[116,8815,8818],{"className":8816,"style":8817},[177],"height:0.2481em;",[116,8819],{}," on the weights\nadds a ",[116,8822,8824],{"className":8823},[119],[116,8825,8827],{"className":8826,"ariaHidden":124},[123],[116,8828,8830,8833,8836],{"className":8829},[128],[116,8831],{"className":8832,"style":4022},[132],[116,8834,8745],{"className":8835},[137,138],[116,8837,6825],{"className":8838,"style":4969},[137,4026]," term to the gradient, keeping weights from\nblowing up on rare features that appear in only one class. Multi-class\nproblems use the softmax generalization, one weight vector per class.",[73,8841,5100,8842,1852],{},[76,8843,5105],{"href":8844,"rel":8845},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Fblob\u002Fmain\u002FP3\u002Freport\u002F00.report.pdf",[80],{"title":478,"searchDepth":479,"depth":479,"links":8847},[],"2024-02-02","A text classifier built on\nlogistic regression,\nimplemented from scratch. Where naive Bayes is generative — it models how\ndocuments are produced — logistic regression is discriminative: it\nlearns a decision boundary directly, weighting features by how much each\none moves the answer.",{},"\u002Fprojects\u002Flinguistics\u002Flogistic-regression",[8853,8854,8855],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fclassification\u002Flogistic-regression","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fclassification\u002Fevaluating-classifiers","https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fmathematical-algorithms\u002Fgradient-descent","https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Ftree\u002Fmain\u002FP3",{"title":7073,"description":8849},"projects\u002Flinguistics\u002F3.logistic-regression","A from-scratch logistic-regression text classifier: features to a sigmoid, a\nlinear decision boundary, trained by gradient descent on the cross-entropy\nloss.",[2279,7073],"os7EnwM5Mmasn7RgBBGgq05HxyEbfT83cZ65JSYXNBg",{"id":8863,"title":8864,"body":8865,"date":11025,"description":11026,"extension":483,"featured":2354,"meta":11027,"navigation":484,"path":11028,"references":11029,"repo":11033,"seo":11034,"stem":11035,"summary":11036,"tag":2364,"tech":11037,"url":2282,"__hash__":11040},"projects\u002Fprojects\u002Flinguistics\u002F2.naive-bayes.md","Naive Bayes & N-Grams",{"type":70,"value":8866,"toc":11023},[8867,8882,8918,9207,9752,9847,10158,10209,10274,10277,10581,10617,10998,11017],[73,8868,8869,8870,8875,8876,8881],{},"Two text classifiers built from scratch — a\n",[76,8871,8874],{"href":8872,"rel":8873},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FNaive_Bayes_classifier",[80],"naive Bayes","\nbag-of-words model and a set of\n",[76,8877,8880],{"href":8878,"rel":8879},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FN-gram",[80],"n-gram"," language models — that\nlearn word statistics from a corpus and label unseen documents by them.\nBoth estimate probabilities by counting, and both smooth those counts so\nan unseen word does not zero out a whole document.",[73,8883,8884,8885,8900,8901,8917],{},"Naive Bayes picks the most probable class. For a document ",[116,8886,8888],{"className":8887},[119],[116,8889,8891],{"className":8890,"ariaHidden":124},[123],[116,8892,8894,8897],{"className":8893},[128],[116,8895],{"className":8896,"style":4022},[132],[116,8898,5288],{"className":8899},[137,138]," and classes\n",[116,8902,8904],{"className":8903},[119],[116,8905,8907],{"className":8906,"ariaHidden":124},[123],[116,8908,8910,8913],{"className":8909},[128],[116,8911],{"className":8912,"style":133},[132],[116,8914,8916],{"className":8915},[137,138],"c",", the classifier returns the maximum a posteriori class.\nDropping the shared denominator and assuming words are conditionally\nindependent given the class,",[116,8919,8921],{"className":8920},[702],[116,8922,8924],{"className":8923},[119],[116,8925,8927,8973,9192],{"className":8926,"ariaHidden":124},[123],[116,8928,8930,8933,8964,8967,8970],{"className":8929},[128],[116,8931],{"className":8932,"style":4022},[132],[116,8934,8936],{"className":8935},[137,7716],[116,8937,8939],{"className":8938},[168],[116,8940,8942],{"className":8941},[173],[116,8943,8945,8953],{"className":8944,"style":4022},[177],[116,8946,8947,8950],{"style":3376},[116,8948],{"className":8949,"style":1119},[187],[116,8951,8916],{"className":8952},[137,138],[116,8954,8955,8958],{"style":3376},[116,8956],{"className":8957,"style":1119},[187],[116,8959,8961],{"className":8960,"style":7743},[7742],[116,8962,7747],{"className":8963},[137],[116,8965],{"className":8966,"style":145},[144],[116,8968,150],{"className":8969},[149],[116,8971],{"className":8972,"style":145},[144],[116,8974,8976,8980,9040,9043,9046,9049,9052,9055,9058,9061,9133,9136,9139,9142,9183,9186,9189],{"className":8975},[128],[116,8977],{"className":8978,"style":8979},[132],"height:2.9291em;vertical-align:-1.2777em;",[116,8981,8983],{"className":8982},[1126,3245],[116,8984,8986,9031],{"className":8985},[168,169],[116,8987,8989,9028],{"className":8988},[173],[116,8990,8992,9007],{"className":8991,"style":133},[177],[116,8993,8995,8998],{"style":8994},"top:-2.2056em;margin-left:0em;",[116,8996],{"className":8997,"style":1119},[187],[116,8999,9001],{"className":9000},[746,747,748,749],[116,9002,9004],{"className":9003},[137,749],[116,9005,8916],{"className":9006},[137,138,749],[116,9008,9009,9012],{"style":3376},[116,9010],{"className":9011,"style":1119},[187],[116,9013,9014],{},[116,9015,9017,9021,9024],{"className":9016},[1126],[116,9018,9020],{"className":9019,"style":4744},[137,3388],"arg",[116,9022],{"className":9023,"style":279},[144],[116,9025,9027],{"className":9026},[137,3388],"max",[116,9029,234],{"className":9030},[233],[116,9032,9034],{"className":9033},[173],[116,9035,9038],{"className":9036,"style":9037},[177],"height:0.8944em;",[116,9039],{},[116,9041],{"className":9042,"style":145},[144],[116,9044],{"className":9045,"style":279},[144],[116,9047,2794],{"className":9048,"style":924},[137,138],[116,9050,562],{"className":9051},[561],[116,9053,8916],{"className":9054},[137,138],[116,9056,652],{"className":9057},[651],[116,9059],{"className":9060,"style":279},[144],[116,9062,9064],{"className":9063},[1126,3245],[116,9065,9067,9124],{"className":9066},[168,169],[116,9068,9070,9121],{"className":9069},[173],[116,9071,9074,9094,9105],{"className":9072,"style":9073},[177],"height:1.6514em;",[116,9075,9076,9079],{"style":3420},[116,9077],{"className":9078,"style":3424},[187],[116,9080,9082],{"className":9081},[746,747,748,749],[116,9083,9085,9088,9091],{"className":9084},[137,749],[116,9086,3158],{"className":9087},[137,138,749],[116,9089,150],{"className":9090},[149,749],[116,9092,345],{"className":9093},[137,749],[116,9095,9096,9099],{"style":3445},[116,9097],{"className":9098,"style":3424},[187],[116,9100,9101],{},[116,9102,9104],{"className":9103},[1126,1127,3454],"∏",[116,9106,9108,9111],{"style":9107},"top:-4.3em;margin-left:0em;",[116,9109],{"className":9110,"style":3424},[187],[116,9112,9114],{"className":9113},[746,747,748,749],[116,9115,9117],{"className":9116},[137,749],[116,9118,9120],{"className":9119},[137,138,749],"n",[116,9122,234],{"className":9123},[233],[116,9125,9127],{"className":9126},[173],[116,9128,9131],{"className":9129,"style":9130},[177],"height:1.2777em;",[116,9132],{},[116,9134],{"className":9135,"style":279},[144],[116,9137,2794],{"className":9138,"style":924},[137,138],[116,9140,562],{"className":9141},[561],[116,9143,9145,9148],{"className":9144},[137],[116,9146,6825],{"className":9147,"style":6824},[137,138],[116,9149,9151],{"className":9150},[725],[116,9152,9154,9175],{"className":9153},[168,169],[116,9155,9157,9172],{"className":9156},[173],[116,9158,9160],{"className":9159,"style":3145},[177],[116,9161,9163,9166],{"style":9162},"top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;",[116,9164],{"className":9165,"style":742},[187],[116,9167,9169],{"className":9168},[746,747,748,749],[116,9170,3158],{"className":9171},[137,138,749],[116,9173,234],{"className":9174},[233],[116,9176,9178],{"className":9177},[173],[116,9179,9181],{"className":9180,"style":762},[177],[116,9182],{},[116,9184],{"className":9185,"style":145},[144],[116,9187,4389],{"className":9188},[149],[116,9190],{"className":9191,"style":145},[144],[116,9193,9195,9198,9201,9204],{"className":9194},[128],[116,9196],{"className":9197,"style":552},[132],[116,9199,8916],{"className":9200},[137,138],[116,9202,652],{"className":9203},[651],[116,9205,594],{"className":9206},[593],[73,9208,2532,9209,9233,9234,9313,9314,9367,9368,9383,9384,9387,9388,9558,9559,9726,9727,9751],{},[116,9210,9212],{"className":9211},[119],[116,9213,9215],{"className":9214,"ariaHidden":124},[123],[116,9216,9218,9221,9224,9227,9230],{"className":9217},[128],[116,9219],{"className":9220,"style":552},[132],[116,9222,2794],{"className":9223,"style":924},[137,138],[116,9225,562],{"className":9226},[561],[116,9228,8916],{"className":9229},[137,138],[116,9231,652],{"className":9232},[651]," is the class prior and ",[116,9235,9237],{"className":9236},[119],[116,9238,9240,9301],{"className":9239,"ariaHidden":124},[123],[116,9241,9243,9246,9249,9252,9292,9295,9298],{"className":9242},[128],[116,9244],{"className":9245,"style":552},[132],[116,9247,2794],{"className":9248,"style":924},[137,138],[116,9250,562],{"className":9251},[561],[116,9253,9255,9258],{"className":9254},[137],[116,9256,6825],{"className":9257,"style":6824},[137,138],[116,9259,9261],{"className":9260},[725],[116,9262,9264,9284],{"className":9263},[168,169],[116,9265,9267,9281],{"className":9266},[173],[116,9268,9270],{"className":9269,"style":3145},[177],[116,9271,9272,9275],{"style":9162},[116,9273],{"className":9274,"style":742},[187],[116,9276,9278],{"className":9277},[746,747,748,749],[116,9279,3158],{"className":9280},[137,138,749],[116,9282,234],{"className":9283},[233],[116,9285,9287],{"className":9286},[173],[116,9288,9290],{"className":9289,"style":762},[177],[116,9291],{},[116,9293],{"className":9294,"style":145},[144],[116,9296,4389],{"className":9297},[149],[116,9299],{"className":9300,"style":145},[144],[116,9302,9304,9307,9310],{"className":9303},[128],[116,9305],{"className":9306,"style":552},[132],[116,9308,8916],{"className":9309},[137,138],[116,9311,652],{"className":9312},[651]," is the likelihood of\nword ",[116,9315,9317],{"className":9316},[119],[116,9318,9320],{"className":9319,"ariaHidden":124},[123],[116,9321,9323,9327],{"className":9322},[128],[116,9324],{"className":9325,"style":9326},[132],"height:0.5806em;vertical-align:-0.15em;",[116,9328,9330,9333],{"className":9329},[137],[116,9331,6825],{"className":9332,"style":6824},[137,138],[116,9334,9336],{"className":9335},[725],[116,9337,9339,9359],{"className":9338},[168,169],[116,9340,9342,9356],{"className":9341},[173],[116,9343,9345],{"className":9344,"style":3145},[177],[116,9346,9347,9350],{"style":9162},[116,9348],{"className":9349,"style":742},[187],[116,9351,9353],{"className":9352},[746,747,748,749],[116,9354,3158],{"className":9355},[137,138,749],[116,9357,234],{"className":9358},[233],[116,9360,9362],{"className":9361},[173],[116,9363,9365],{"className":9364,"style":762},[177],[116,9366],{}," under class ",[116,9369,9371],{"className":9370},[119],[116,9372,9374],{"className":9373,"ariaHidden":124},[123],[116,9375,9377,9380],{"className":9376},[128],[116,9378],{"className":9379,"style":133},[132],[116,9381,8916],{"className":9382},[137,138],". The product hides a modeling choice: the\n",[505,9385,9386],{},"bag-of-words"," representation treats a document as its multiset of word\ncounts with position discarded, so ",[116,9389,9391],{"className":9390},[119],[116,9392,9394,9418,9439,9546],{"className":9393,"ariaHidden":124},[123],[116,9395,9397,9400,9403,9406,9409,9412,9415],{"className":9396},[128],[116,9398],{"className":9399,"style":552},[132],[116,9401,2794],{"className":9402,"style":924},[137,138],[116,9404,562],{"className":9405},[561],[116,9407,5288],{"className":9408},[137,138],[116,9410],{"className":9411,"style":145},[144],[116,9413,4389],{"className":9414},[149],[116,9416],{"className":9417,"style":145},[144],[116,9419,9421,9424,9427,9430,9433,9436],{"className":9420},[128],[116,9422],{"className":9423,"style":552},[132],[116,9425,8916],{"className":9426},[137,138],[116,9428,652],{"className":9429},[651],[116,9431],{"className":9432,"style":145},[144],[116,9434,150],{"className":9435},[149],[116,9437],{"className":9438,"style":145},[144],[116,9440,9442,9446,9488,9491,9494,9497,9537,9540,9543],{"className":9441},[128],[116,9443],{"className":9444,"style":9445},[132],"height:1.0497em;vertical-align:-0.2997em;",[116,9447,9449,9452],{"className":9448},[1126],[116,9450,9104],{"className":9451,"style":1129},[1126,1127,1128],[116,9453,9455],{"className":9454},[725],[116,9456,9458,9479],{"className":9457},[168,169],[116,9459,9461,9476],{"className":9460},[173],[116,9462,9465],{"className":9463,"style":9464},[177],"height:0.162em;",[116,9466,9467,9470],{"style":4472},[116,9468],{"className":9469,"style":742},[187],[116,9471,9473],{"className":9472},[746,747,748,749],[116,9474,3158],{"className":9475},[137,138,749],[116,9477,234],{"className":9478},[233],[116,9480,9482],{"className":9481},[173],[116,9483,9486],{"className":9484,"style":9485},[177],"height:0.2997em;",[116,9487],{},[116,9489],{"className":9490,"style":279},[144],[116,9492,2794],{"className":9493,"style":924},[137,138],[116,9495,562],{"className":9496},[561],[116,9498,9500,9503],{"className":9499},[137],[116,9501,6825],{"className":9502,"style":6824},[137,138],[116,9504,9506],{"className":9505},[725],[116,9507,9509,9529],{"className":9508},[168,169],[116,9510,9512,9526],{"className":9511},[173],[116,9513,9515],{"className":9514,"style":3145},[177],[116,9516,9517,9520],{"style":9162},[116,9518],{"className":9519,"style":742},[187],[116,9521,9523],{"className":9522},[746,747,748,749],[116,9524,3158],{"className":9525},[137,138,749],[116,9527,234],{"className":9528},[233],[116,9530,9532],{"className":9531},[173],[116,9533,9535],{"className":9534,"style":762},[177],[116,9536],{},[116,9538],{"className":9539,"style":145},[144],[116,9541,4389],{"className":9542},[149],[116,9544],{"className":9545,"style":145},[144],[116,9547,9549,9552,9555],{"className":9548},[128],[116,9550],{"className":9551,"style":552},[132],[116,9553,8916],{"className":9554},[137,138],[116,9556,652],{"className":9557},[651],"\nscores each token as an independent draw from the class's word\ndistribution. That independence is wrong — words in text are correlated —\nbut it keeps estimation to simple counts and still classifies well.\nProducts of many small probabilities underflow, so the implementation\nworks in log space, where the product becomes a sum:\n",[116,9560,9562],{"className":9561},[119],[116,9563,9565,9601,9714],{"className":9564,"ariaHidden":124},[123],[116,9566,9568,9571,9577,9580,9583,9586,9589,9592,9595,9598],{"className":9567},[128],[116,9569],{"className":9570,"style":552},[132],[116,9572,9574],{"className":9573},[1126],[116,9575,4745],{"className":9576,"style":4744},[137,3388],[116,9578],{"className":9579,"style":279},[144],[116,9581,2794],{"className":9582,"style":924},[137,138],[116,9584,562],{"className":9585},[561],[116,9587,8916],{"className":9588},[137,138],[116,9590,652],{"className":9591},[651],[116,9593],{"className":9594,"style":570},[144],[116,9596,575],{"className":9597},[574],[116,9599],{"className":9600,"style":570},[144],[116,9602,9604,9607,9647,9650,9656,9659,9662,9665,9705,9708,9711],{"className":9603},[128],[116,9605],{"className":9606,"style":9445},[132],[116,9608,9610,9613],{"className":9609},[1126],[116,9611,1130],{"className":9612,"style":1129},[1126,1127,1128],[116,9614,9616],{"className":9615},[725],[116,9617,9619,9639],{"className":9618},[168,169],[116,9620,9622,9636],{"className":9621},[173],[116,9623,9625],{"className":9624,"style":9464},[177],[116,9626,9627,9630],{"style":4472},[116,9628],{"className":9629,"style":742},[187],[116,9631,9633],{"className":9632},[746,747,748,749],[116,9634,3158],{"className":9635},[137,138,749],[116,9637,234],{"className":9638},[233],[116,9640,9642],{"className":9641},[173],[116,9643,9645],{"className":9644,"style":9485},[177],[116,9646],{},[116,9648],{"className":9649,"style":279},[144],[116,9651,9653],{"className":9652},[1126],[116,9654,4745],{"className":9655,"style":4744},[137,3388],[116,9657],{"className":9658,"style":279},[144],[116,9660,2794],{"className":9661,"style":924},[137,138],[116,9663,562],{"className":9664},[561],[116,9666,9668,9671],{"className":9667},[137],[116,9669,6825],{"className":9670,"style":6824},[137,138],[116,9672,9674],{"className":9673},[725],[116,9675,9677,9697],{"className":9676},[168,169],[116,9678,9680,9694],{"className":9679},[173],[116,9681,9683],{"className":9682,"style":3145},[177],[116,9684,9685,9688],{"style":9162},[116,9686],{"className":9687,"style":742},[187],[116,9689,9691],{"className":9690},[746,747,748,749],[116,9692,3158],{"className":9693},[137,138,749],[116,9695,234],{"className":9696},[233],[116,9698,9700],{"className":9699},[173],[116,9701,9703],{"className":9702,"style":762},[177],[116,9704],{},[116,9706],{"className":9707,"style":145},[144],[116,9709,4389],{"className":9710},[149],[116,9712],{"className":9713,"style":145},[144],[116,9715,9717,9720,9723],{"className":9716},[128],[116,9718],{"className":9719,"style":552},[132],[116,9721,8916],{"className":9722},[137,138],[116,9724,652],{"className":9725},[651],", and the ",[116,9728,9730],{"className":9729},[119],[116,9731,9733],{"className":9732,"ariaHidden":124},[123],[116,9734,9736,9739],{"className":9735},[128],[116,9737],{"className":9738,"style":7009},[132],[116,9740,9742,9745,9748],{"className":9741},[1126],[116,9743,9020],{"className":9744,"style":4744},[137,3388],[116,9746],{"className":9747,"style":279},[144],[116,9749,9027],{"className":9750},[137,3388],"\nis unchanged.",[73,9753,9754,9755,9815,9816,9831,9832,3225],{},"Smoothing handles unseen words. A word absent from a class in training\ngives ",[116,9756,9758],{"className":9757},[119],[116,9759,9761,9785,9806],{"className":9760,"ariaHidden":124},[123],[116,9762,9764,9767,9770,9773,9776,9779,9782],{"className":9763},[128],[116,9765],{"className":9766,"style":552},[132],[116,9768,2794],{"className":9769,"style":924},[137,138],[116,9771,562],{"className":9772},[561],[116,9774,6825],{"className":9775,"style":6824},[137,138],[116,9777],{"className":9778,"style":145},[144],[116,9780,4389],{"className":9781},[149],[116,9783],{"className":9784,"style":145},[144],[116,9786,9788,9791,9794,9797,9800,9803],{"className":9787},[128],[116,9789],{"className":9790,"style":552},[132],[116,9792,8916],{"className":9793},[137,138],[116,9795,652],{"className":9796},[651],[116,9798],{"className":9799,"style":145},[144],[116,9801,150],{"className":9802},[149],[116,9804],{"className":9805,"style":145},[144],[116,9807,9809,9812],{"className":9808},[128],[116,9810],{"className":9811,"style":1890},[132],[116,9813,331],{"className":9814},[137]," and annihilates the product. Add-",[116,9817,9819],{"className":9818},[119],[116,9820,9822],{"className":9821,"ariaHidden":124},[123],[116,9823,9825,9828],{"className":9824},[128],[116,9826],{"className":9827,"style":4022},[132],[116,9829,4382],{"className":9830,"style":4381},[137,138],"\n(Laplace) smoothing shifts every count up by ",[116,9833,9835],{"className":9834},[119],[116,9836,9838],{"className":9837,"ariaHidden":124},[123],[116,9839,9841,9844],{"className":9840},[128],[116,9842],{"className":9843,"style":4022},[132],[116,9845,4382],{"className":9846,"style":4381},[137,138],[116,9848,9850],{"className":9849},[702],[116,9851,9853],{"className":9852},[119],[116,9854,9856,9880,9901],{"className":9855,"ariaHidden":124},[123],[116,9857,9859,9862,9865,9868,9871,9874,9877],{"className":9858},[128],[116,9860],{"className":9861,"style":552},[132],[116,9863,2794],{"className":9864,"style":924},[137,138],[116,9866,562],{"className":9867},[561],[116,9869,6825],{"className":9870,"style":6824},[137,138],[116,9872],{"className":9873,"style":145},[144],[116,9875,4389],{"className":9876},[149],[116,9878],{"className":9879,"style":145},[144],[116,9881,9883,9886,9889,9892,9895,9898],{"className":9882},[128],[116,9884],{"className":9885,"style":552},[132],[116,9887,8916],{"className":9888},[137,138],[116,9890,652],{"className":9891},[651],[116,9893],{"className":9894,"style":145},[144],[116,9896,150],{"className":9897},[149],[116,9899],{"className":9900,"style":145},[144],[116,9902,9904,9908,10155],{"className":9903},[128],[116,9905],{"className":9906,"style":9907},[132],"height:2.4127em;vertical-align:-0.9857em;",[116,9909,9911,9914,10152],{"className":9910},[137],[116,9912],{"className":9913},[561,4427],[116,9915,9917],{"className":9916},[4431],[116,9918,9920,10143],{"className":9919},[168,169],[116,9921,9923,10140],{"className":9922},[173],[116,9924,9927,10088,10096],{"className":9925,"style":9926},[177],"height:1.427em;",[116,9928,9929,9932],{"style":5010},[116,9930],{"className":9931,"style":1119},[187],[116,9933,9935,10009,10012,10019,10022,10055,10058,10061,10064,10067,10070,10073,10076,10079,10082,10085],{"className":9934},[137],[116,9936,9938,9941],{"className":9937},[1126],[116,9939,1130],{"className":9940,"style":1129},[1126,1127,1128],[116,9942,9944],{"className":9943},[725],[116,9945,9947,10001],{"className":9946},[168,169],[116,9948,9950,9998],{"className":9949},[173],[116,9951,9954],{"className":9952,"style":9953},[177],"height:0.1783em;",[116,9955,9956,9959],{"style":4472},[116,9957],{"className":9958,"style":742},[187],[116,9960,9962],{"className":9961},[746,747,748,749],[116,9963,9965],{"className":9964},[137,749],[116,9966,9968,9971],{"className":9967},[137,749],[116,9969,6825],{"className":9970,"style":6824},[137,138,749],[116,9972,9974],{"className":9973},[725],[116,9975,9977],{"className":9976},[168],[116,9978,9980],{"className":9979},[173],[116,9981,9984],{"className":9982,"style":9983},[177],"height:0.6828em;",[116,9985,9986,9989],{"style":993},[116,9987],{"className":9988,"style":997},[187],[116,9990,9992],{"className":9991},[746,1001,1002,749],[116,9993,9995],{"className":9994},[137,749],[116,9996,2445],{"className":9997},[137,749],[116,9999,234],{"className":10000},[233],[116,10002,10004],{"className":10003},[173],[116,10005,10007],{"className":10006,"style":9485},[177],[116,10008],{},[116,10010],{"className":10011,"style":279},[144],[116,10013,10015],{"className":10014},[1126],[116,10016,10018],{"className":10017},[137,3388],"count",[116,10020,562],{"className":10021},[561],[116,10023,10025,10028],{"className":10024},[137],[116,10026,6825],{"className":10027,"style":6824},[137,138],[116,10029,10031],{"className":10030},[725],[116,10032,10034],{"className":10033},[168],[116,10035,10037],{"className":10036},[173],[116,10038,10041],{"className":10039,"style":10040},[177],"height:0.6779em;",[116,10042,10043,10046],{"style":7391},[116,10044],{"className":10045,"style":742},[187],[116,10047,10049],{"className":10048},[746,747,748,749],[116,10050,10052],{"className":10051},[137,749],[116,10053,2445],{"className":10054},[137,749],[116,10056,594],{"className":10057},[593],[116,10059],{"className":10060,"style":279},[144],[116,10062,8916],{"className":10063},[137,138],[116,10065,652],{"className":10066},[651],[116,10068],{"className":10069,"style":570},[144],[116,10071,575],{"className":10072},[574],[116,10074],{"className":10075,"style":570},[144],[116,10077,4382],{"className":10078,"style":4381},[137,138],[116,10080,4389],{"className":10081},[561],[116,10083,5188],{"className":10084,"style":570},[137,138],[116,10086,4389],{"className":10087},[651],[116,10089,10090,10093],{"style":4597},[116,10091],{"className":10092,"style":1119},[187],[116,10094],{"className":10095,"style":4605},[4604],[116,10097,10098,10101],{"style":4608},[116,10099],{"className":10100,"style":1119},[187],[116,10102,10104,10110,10113,10116,10119,10122,10125,10128,10131,10134,10137],{"className":10103},[137],[116,10105,10107],{"className":10106},[1126],[116,10108,10018],{"className":10109},[137,3388],[116,10111,562],{"className":10112},[561],[116,10114,6825],{"className":10115,"style":6824},[137,138],[116,10117,594],{"className":10118},[593],[116,10120],{"className":10121,"style":279},[144],[116,10123,8916],{"className":10124},[137,138],[116,10126,652],{"className":10127},[651],[116,10129],{"className":10130,"style":570},[144],[116,10132,575],{"className":10133},[574],[116,10135],{"className":10136,"style":570},[144],[116,10138,4382],{"className":10139,"style":4381},[137,138],[116,10141,234],{"className":10142},[233],[116,10144,10146],{"className":10145},[173],[116,10147,10150],{"className":10148,"style":10149},[177],"height:0.9857em;",[116,10151],{},[116,10153],{"className":10154},[651,4427],[116,10156,594],{"className":10157},[593],[73,10159,10160,10161,10176,10177,10192,10193,10208],{},"with ",[116,10162,10164],{"className":10163},[119],[116,10165,10167],{"className":10166,"ariaHidden":124},[123],[116,10168,10170,10173],{"className":10169},[128],[116,10171],{"className":10172,"style":272},[132],[116,10174,5188],{"className":10175,"style":570},[137,138]," the vocabulary. The numerator keeps an unseen word from zeroing\nthe whole product, and the matching term in the denominator keeps the row\nsumming to one, so smoothing rescues the estimate without breaking it into\nan improper distribution. Small ",[116,10178,10180],{"className":10179},[119],[116,10181,10183],{"className":10182,"ariaHidden":124},[123],[116,10184,10186,10189],{"className":10185},[128],[116,10187],{"className":10188,"style":4022},[132],[116,10190,4382],{"className":10191,"style":4381},[137,138]," trusts the counts; large ",[116,10194,10196],{"className":10195},[119],[116,10197,10199],{"className":10198,"ariaHidden":124},[123],[116,10200,10202,10205],{"className":10201},[128],[116,10203],{"className":10204,"style":4022},[132],[116,10206,4382],{"className":10207,"style":4381},[137,138]," pulls\nevery word toward uniform.",[73,10210,10211,10212,10269,10270,10273],{},"For tasks like sentiment, whether a word appears matters more than how many\ntimes. Boolean (binary) naive Bayes clips each document's counts to presence\nor absence, ",[116,10213,10215],{"className":10214},[119],[116,10216,10218],{"className":10217,"ariaHidden":124},[123],[116,10219,10221,10224,10230,10233,10239,10242,10245,10248,10251,10254,10257,10260,10263,10266],{"className":10220},[128],[116,10222],{"className":10223,"style":552},[132],[116,10225,10227],{"className":10226},[1126],[116,10228,3389],{"className":10229},[137,3388],[116,10231,562],{"className":10232},[561],[116,10234,10236],{"className":10235},[1126],[116,10237,10018],{"className":10238},[137,3388],[116,10240,562],{"className":10241},[561],[116,10243,6825],{"className":10244,"style":6824},[137,138],[116,10246,594],{"className":10247},[593],[116,10249],{"className":10250,"style":279},[144],[116,10252,5288],{"className":10253},[137,138],[116,10255,652],{"className":10256},[651],[116,10258,594],{"className":10259},[593],[116,10261],{"className":10262,"style":279},[144],[116,10264,345],{"className":10265},[137],[116,10267,652],{"className":10268},[651],", before estimating and\nscoring, so a review repeating ",[442,10271,10272],{},"great"," ten\ntimes cannot swamp the decision on its own. On short texts this variant\noften edges out the count-based model.",[73,10275,10276],{},"The classifier comes together as four counting steps:",[10278,10279,10280,10287,10318,10383],"ul",{},[10281,10282,10283,10286],"li",{},[505,10284,10285],{},"Tokenize."," Split each document into words and reduce it to its bag of\ncounts.",[10281,10288,10289,10292,10293,10317],{},[505,10290,10291],{},"Estimate the prior."," Set ",[116,10294,10296],{"className":10295},[119],[116,10297,10299],{"className":10298,"ariaHidden":124},[123],[116,10300,10302,10305,10308,10311,10314],{"className":10301},[128],[116,10303],{"className":10304,"style":552},[132],[116,10306,2794],{"className":10307,"style":924},[137,138],[116,10309,562],{"className":10310},[561],[116,10312,8916],{"className":10313},[137,138],[116,10315,652],{"className":10316},[651]," from the fraction of training\ndocuments in each class.",[10281,10319,10320,10323,10324,10366,10367,10382],{},[505,10321,10322],{},"Estimate the likelihoods."," Compute each ",[116,10325,10327],{"className":10326},[119],[116,10328,10330,10354],{"className":10329,"ariaHidden":124},[123],[116,10331,10333,10336,10339,10342,10345,10348,10351],{"className":10332},[128],[116,10334],{"className":10335,"style":552},[132],[116,10337,2794],{"className":10338,"style":924},[137,138],[116,10340,562],{"className":10341},[561],[116,10343,6825],{"className":10344,"style":6824},[137,138],[116,10346],{"className":10347,"style":145},[144],[116,10349,4389],{"className":10350},[149],[116,10352],{"className":10353,"style":145},[144],[116,10355,10357,10360,10363],{"className":10356},[128],[116,10358],{"className":10359,"style":552},[132],[116,10361,8916],{"className":10362},[137,138],[116,10364,652],{"className":10365},[651]," as an add-",[116,10368,10370],{"className":10369},[119],[116,10371,10373],{"className":10372,"ariaHidden":124},[123],[116,10374,10376,10379],{"className":10375},[128],[116,10377],{"className":10378,"style":4022},[132],[116,10380,4382],{"className":10381,"style":4381},[137,138],"\nsmoothed count ratio over the class's text.",[10281,10384,10385,10388,10389,10556,10557,1852],{},[505,10386,10387],{},"Score."," Sum ",[116,10390,10392],{"className":10391},[119],[116,10393,10395,10431,10544],{"className":10394,"ariaHidden":124},[123],[116,10396,10398,10401,10407,10410,10413,10416,10419,10422,10425,10428],{"className":10397},[128],[116,10399],{"className":10400,"style":552},[132],[116,10402,10404],{"className":10403},[1126],[116,10405,4745],{"className":10406,"style":4744},[137,3388],[116,10408],{"className":10409,"style":279},[144],[116,10411,2794],{"className":10412,"style":924},[137,138],[116,10414,562],{"className":10415},[561],[116,10417,8916],{"className":10418},[137,138],[116,10420,652],{"className":10421},[651],[116,10423],{"className":10424,"style":570},[144],[116,10426,575],{"className":10427},[574],[116,10429],{"className":10430,"style":570},[144],[116,10432,10434,10437,10477,10480,10486,10489,10492,10495,10535,10538,10541],{"className":10433},[128],[116,10435],{"className":10436,"style":9445},[132],[116,10438,10440,10443],{"className":10439},[1126],[116,10441,1130],{"className":10442,"style":1129},[1126,1127,1128],[116,10444,10446],{"className":10445},[725],[116,10447,10449,10469],{"className":10448},[168,169],[116,10450,10452,10466],{"className":10451},[173],[116,10453,10455],{"className":10454,"style":9464},[177],[116,10456,10457,10460],{"style":4472},[116,10458],{"className":10459,"style":742},[187],[116,10461,10463],{"className":10462},[746,747,748,749],[116,10464,3158],{"className":10465},[137,138,749],[116,10467,234],{"className":10468},[233],[116,10470,10472],{"className":10471},[173],[116,10473,10475],{"className":10474,"style":9485},[177],[116,10476],{},[116,10478],{"className":10479,"style":279},[144],[116,10481,10483],{"className":10482},[1126],[116,10484,4745],{"className":10485,"style":4744},[137,3388],[116,10487],{"className":10488,"style":279},[144],[116,10490,2794],{"className":10491,"style":924},[137,138],[116,10493,562],{"className":10494},[561],[116,10496,10498,10501],{"className":10497},[137],[116,10499,6825],{"className":10500,"style":6824},[137,138],[116,10502,10504],{"className":10503},[725],[116,10505,10507,10527],{"className":10506},[168,169],[116,10508,10510,10524],{"className":10509},[173],[116,10511,10513],{"className":10512,"style":3145},[177],[116,10514,10515,10518],{"style":9162},[116,10516],{"className":10517,"style":742},[187],[116,10519,10521],{"className":10520},[746,747,748,749],[116,10522,3158],{"className":10523},[137,138,749],[116,10525,234],{"className":10526},[233],[116,10528,10530],{"className":10529},[173],[116,10531,10533],{"className":10532,"style":762},[177],[116,10534],{},[116,10536],{"className":10537,"style":145},[144],[116,10539,4389],{"className":10540},[149],[116,10542],{"className":10543,"style":145},[144],[116,10545,10547,10550,10553],{"className":10546},[128],[116,10548],{"className":10549,"style":552},[132],[116,10551,8916],{"className":10552},[137,138],[116,10554,652],{"className":10555},[651]," for every class\nand return the ",[116,10558,10560],{"className":10559},[119],[116,10561,10563],{"className":10562,"ariaHidden":124},[123],[116,10564,10566,10569],{"className":10565},[128],[116,10567],{"className":10568,"style":7009},[132],[116,10570,10572,10575,10578],{"className":10571},[1126],[116,10573,9020],{"className":10574,"style":4744},[137,3388],[116,10576],{"className":10577,"style":279},[144],[116,10579,9027],{"className":10580},[137,3388],[73,10582,10583,10584,3225],{},"N-grams model the next word. The n-gram side estimates the probability of a\nsequence with the chain rule under a Markov assumption\n— each word depends only on the previous ",[116,10585,10587],{"className":10586},[119],[116,10588,10590,10608],{"className":10589,"ariaHidden":124},[123],[116,10591,10593,10596,10599,10602,10605],{"className":10592},[128],[116,10594],{"className":10595,"style":2930},[132],[116,10597,9120],{"className":10598},[137,138],[116,10600],{"className":10601,"style":570},[144],[116,10603,1610],{"className":10604},[574],[116,10606],{"className":10607,"style":570},[144],[116,10609,10611,10614],{"className":10610},[128],[116,10612],{"className":10613,"style":1890},[132],[116,10615,345],{"className":10616},[137],[116,10618,10620],{"className":10619},[702],[116,10621,10623],{"className":10622},[119],[116,10624,10626,10741,10872],{"className":10625,"ariaHidden":124},[123],[116,10627,10629,10632,10635,10638,10678,10681,10685,10688,10729,10732,10735,10738],{"className":10628},[128],[116,10630],{"className":10631,"style":552},[132],[116,10633,2794],{"className":10634,"style":924},[137,138],[116,10636,562],{"className":10637},[561],[116,10639,10641,10644],{"className":10640},[137],[116,10642,6825],{"className":10643,"style":6824},[137,138],[116,10645,10647],{"className":10646},[725],[116,10648,10650,10670],{"className":10649},[168,169],[116,10651,10653,10667],{"className":10652},[173],[116,10654,10656],{"className":10655,"style":4068},[177],[116,10657,10658,10661],{"style":9162},[116,10659],{"className":10660,"style":742},[187],[116,10662,10664],{"className":10663},[746,747,748,749],[116,10665,345],{"className":10666},[137,749],[116,10668,234],{"className":10669},[233],[116,10671,10673],{"className":10672},[173],[116,10674,10676],{"className":10675,"style":762},[177],[116,10677],{},[116,10679],{"className":10680,"style":279},[144],[116,10682,10684],{"className":10683},[946],"…",[116,10686],{"className":10687,"style":279},[144],[116,10689,10691,10694],{"className":10690},[137],[116,10692,6825],{"className":10693,"style":6824},[137,138],[116,10695,10697],{"className":10696},[725],[116,10698,10700,10721],{"className":10699},[168,169],[116,10701,10703,10718],{"className":10702},[173],[116,10704,10706],{"className":10705,"style":735},[177],[116,10707,10708,10711],{"style":9162},[116,10709],{"className":10710,"style":742},[187],[116,10712,10714],{"className":10713},[746,747,748,749],[116,10715,10717],{"className":10716},[137,138,749],"m",[116,10719,234],{"className":10720},[233],[116,10722,10724],{"className":10723},[173],[116,10725,10727],{"className":10726,"style":762},[177],[116,10728],{},[116,10730,652],{"className":10731},[651],[116,10733],{"className":10734,"style":145},[144],[116,10736,413],{"className":10737},[149],[116,10739],{"className":10740,"style":145},[144],[116,10742,10744,10747,10814,10817,10820,10823,10863,10866,10869],{"className":10743},[128],[116,10745],{"className":10746,"style":8979},[132],[116,10748,10750],{"className":10749},[1126,3245],[116,10751,10753,10806],{"className":10752},[168,169],[116,10754,10756,10803],{"className":10755},[173],[116,10757,10759,10779,10789],{"className":10758,"style":9073},[177],[116,10760,10761,10764],{"style":3420},[116,10762],{"className":10763,"style":3424},[187],[116,10765,10767],{"className":10766},[746,747,748,749],[116,10768,10770,10773,10776],{"className":10769},[137,749],[116,10771,3158],{"className":10772},[137,138,749],[116,10774,150],{"className":10775},[149,749],[116,10777,345],{"className":10778},[137,749],[116,10780,10781,10784],{"style":3445},[116,10782],{"className":10783,"style":3424},[187],[116,10785,10786],{},[116,10787,9104],{"className":10788},[1126,1127,3454],[116,10790,10791,10794],{"style":9107},[116,10792],{"className":10793,"style":3424},[187],[116,10795,10797],{"className":10796},[746,747,748,749],[116,10798,10800],{"className":10799},[137,749],[116,10801,10717],{"className":10802},[137,138,749],[116,10804,234],{"className":10805},[233],[116,10807,10809],{"className":10808},[173],[116,10810,10812],{"className":10811,"style":9130},[177],[116,10813],{},[116,10815],{"className":10816,"style":279},[144],[116,10818,2794],{"className":10819,"style":924},[137,138],[116,10821,562],{"className":10822},[561],[116,10824,10826,10829],{"className":10825},[137],[116,10827,6825],{"className":10828,"style":6824},[137,138],[116,10830,10832],{"className":10831},[725],[116,10833,10835,10855],{"className":10834},[168,169],[116,10836,10838,10852],{"className":10837},[173],[116,10839,10841],{"className":10840,"style":3145},[177],[116,10842,10843,10846],{"style":9162},[116,10844],{"className":10845,"style":742},[187],[116,10847,10849],{"className":10848},[746,747,748,749],[116,10850,3158],{"className":10851},[137,138,749],[116,10853,234],{"className":10854},[233],[116,10856,10858],{"className":10857},[173],[116,10859,10861],{"className":10860,"style":762},[177],[116,10862],{},[116,10864],{"className":10865,"style":145},[144],[116,10867,4389],{"className":10868},[149],[116,10870],{"className":10871,"style":145},[144],[116,10873,10875,10878,10934,10937,10940,10943,10992,10995],{"className":10874},[128],[116,10876],{"className":10877,"style":552},[132],[116,10879,10881,10884],{"className":10880},[137],[116,10882,6825],{"className":10883,"style":6824},[137,138],[116,10885,10887],{"className":10886},[725],[116,10888,10890,10925],{"className":10889},[168,169],[116,10891,10893,10922],{"className":10892},[173],[116,10894,10896],{"className":10895,"style":3145},[177],[116,10897,10898,10901],{"style":9162},[116,10899],{"className":10900,"style":742},[187],[116,10902,10904],{"className":10903},[746,747,748,749],[116,10905,10907,10910,10913,10916,10919],{"className":10906},[137,749],[116,10908,3158],{"className":10909},[137,138,749],[116,10911,1610],{"className":10912},[574,749],[116,10914,9120],{"className":10915},[137,138,749],[116,10917,575],{"className":10918},[574,749],[116,10920,345],{"className":10921},[137,749],[116,10923,234],{"className":10924},[233],[116,10926,10928],{"className":10927},[173],[116,10929,10932],{"className":10930,"style":10931},[177],"height:0.2083em;",[116,10933],{},[116,10935],{"className":10936,"style":279},[144],[116,10938,10684],{"className":10939},[946],[116,10941],{"className":10942,"style":279},[144],[116,10944,10946,10949],{"className":10945},[137],[116,10947,6825],{"className":10948,"style":6824},[137,138],[116,10950,10952],{"className":10951},[725],[116,10953,10955,10984],{"className":10954},[168,169],[116,10956,10958,10981],{"className":10957},[173],[116,10959,10961],{"className":10960,"style":3145},[177],[116,10962,10963,10966],{"style":9162},[116,10964],{"className":10965,"style":742},[187],[116,10967,10969],{"className":10968},[746,747,748,749],[116,10970,10972,10975,10978],{"className":10971},[137,749],[116,10973,3158],{"className":10974},[137,138,749],[116,10976,1610],{"className":10977},[574,749],[116,10979,345],{"className":10980},[137,749],[116,10982,234],{"className":10983},[233],[116,10985,10987],{"className":10986},[173],[116,10988,10990],{"className":10989,"style":10931},[177],[116,10991],{},[116,10993,652],{"className":10994},[651],[116,10996,1852],{"className":10997},[137],[73,10999,11000,11001,11016],{},"Each conditional is a smoothed count ratio, exactly as above but keyed on\nthe preceding context. Larger ",[116,11002,11004],{"className":11003},[119],[116,11005,11007],{"className":11006,"ariaHidden":124},[123],[116,11008,11010,11013],{"className":11009},[128],[116,11011],{"className":11012,"style":133},[132],[116,11014,9120],{"className":11015},[137,138]," captures more context but fragments the\ncounts, so unigram, bigram, and trigram models trade coverage against\nsharpness. Used as a classifier, the model trained on each class scores a\ntest document, and the class whose model assigns higher probability wins.",[73,11018,5100,11019,1852],{},[76,11020,5105],{"href":11021,"rel":11022},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Fblob\u002Fmain\u002FP2\u002Freport\u002Freport.pdf",[80],{"title":478,"searchDepth":479,"depth":479,"links":11024},[],"2024-01-26","Two text classifiers built from scratch — a\nnaive Bayes\nbag-of-words model and a set of\nn-gram language models — that\nlearn word statistics from a corpus and label unseen documents by them.\nBoth estimate probabilities by counting, and both smooth those counts so\nan unseen word does not zero out a whole document.",{},"\u002Fprojects\u002Flinguistics\u002Fnaive-bayes",[11030,11031,11032],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fclassification\u002Fnaive-bayes-and-sentiment","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Ffoundations\u002Fn-gram-language-models","https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Ffoundations\u002Fsmoothing-and-backoff","https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Ftree\u002Fmain\u002FP2",{"title":8864,"description":11026},"projects\u002Flinguistics\u002F2.naive-bayes","Text classification from scratch: a naive Bayes bag-of-words classifier and\nn-gram language models, both with add-k smoothing.",[2279,11038,11039],"Naive Bayes","N-Grams","HdECRTiDaIBfYQnfNaaaoRckr4xfmmczGZ9ytBH3_j8",{"id":11042,"title":11043,"body":11044,"date":12381,"description":11048,"extension":483,"featured":2354,"meta":12382,"navigation":484,"path":12383,"references":12384,"repo":12385,"seo":12386,"stem":12387,"summary":12388,"tag":2277,"tech":12389,"url":2282,"__hash__":12390},"projects\u002Fprojects\u002Fcomputer-vision\u002F1.hough-filters.md","Image Filtering with Hough Transforms",{"type":70,"value":11045,"toc":12379},[11046,11049,11360,11363,11372,11464,11662,11665,11731,11771,11779,12242,12370,12377],[73,11047,11048],{},"This pipeline builds classical edge and feature detection out of convolutions.\nGiven an image, it smooths, estimates gradients, and votes for the geometric\nstructures those gradients imply, lines and corners, all in Python over OpenCV.",[73,11050,11051,11052,11057,11058,11063,11064,11097,11098,11224,11225,11249,11250,11355,11356,11359],{},"Differentiation amplifies high-frequency noise, so\n",[76,11053,11056],{"href":11054,"rel":11055},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGaussian_blur",[80],"Gaussian smoothing"," convolves\nthe image with a Gaussian kernel first; without it, single-pixel intensity jumps\nregister as spurious edges and swamp the real ones. The\n",[76,11059,11062],{"href":11060,"rel":11061},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSobel_operator",[80],"Sobel operator"," then estimates the\nintensity gradient with a pair of ",[116,11065,11067],{"className":11066},[119],[116,11068,11070,11088],{"className":11069,"ariaHidden":124},[123],[116,11071,11073,11076,11079,11082,11085],{"className":11072},[128],[116,11074],{"className":11075,"style":1871},[132],[116,11077,2564],{"className":11078},[137],[116,11080],{"className":11081,"style":570},[144],[116,11083,439],{"className":11084},[574],[116,11086],{"className":11087,"style":570},[144],[116,11089,11091,11094],{"className":11090},[128],[116,11092],{"className":11093,"style":1890},[132],[116,11095,2564],{"className":11096},[137]," kernels, one per axis, giving\n",[116,11099,11101],{"className":11100},[119],[116,11102,11104,11125],{"className":11103,"ariaHidden":124},[123],[116,11105,11107,11110,11113,11116,11119,11122],{"className":11106},[128],[116,11108],{"className":11109,"style":272},[132],[116,11111,8365],{"className":11112},[137],[116,11114,557],{"className":11115,"style":556},[137,138],[116,11117],{"className":11118,"style":145},[144],[116,11120,150],{"className":11121},[149],[116,11123],{"className":11124,"style":145},[144],[116,11126,11128,11132,11135,11175,11178,11181,11221],{"className":11127},[128],[116,11129],{"className":11130,"style":11131},[132],"height:1.0361em;vertical-align:-0.2861em;",[116,11133,562],{"className":11134},[561],[116,11136,11138,11141],{"className":11137},[137],[116,11139,557],{"className":11140,"style":556},[137,138],[116,11142,11144],{"className":11143},[725],[116,11145,11147,11167],{"className":11146},[168,169],[116,11148,11150,11164],{"className":11149},[173],[116,11151,11153],{"className":11152,"style":735},[177],[116,11154,11155,11158],{"style":738},[116,11156],{"className":11157,"style":742},[187],[116,11159,11161],{"className":11160},[746,747,748,749],[116,11162,566],{"className":11163},[137,138,749],[116,11165,234],{"className":11166},[233],[116,11168,11170],{"className":11169},[173],[116,11171,11173],{"className":11172,"style":762},[177],[116,11174],{},[116,11176,594],{"className":11177},[593],[116,11179],{"className":11180,"style":279},[144],[116,11182,11184,11187],{"className":11183},[137],[116,11185,557],{"className":11186,"style":556},[137,138],[116,11188,11190],{"className":11189},[725],[116,11191,11193,11213],{"className":11192},[168,169],[116,11194,11196,11210],{"className":11195},[173],[116,11197,11199],{"className":11198,"style":735},[177],[116,11200,11201,11204],{"style":738},[116,11202],{"className":11203,"style":742},[187],[116,11205,11207],{"className":11206},[746,747,748,749],[116,11208,601],{"className":11209,"style":139},[137,138,749],[116,11211,234],{"className":11212},[233],[116,11214,11216],{"className":11215},[173],[116,11217,11219],{"className":11218,"style":822},[177],[116,11220],{},[116,11222,652],{"className":11223},[651]," at every pixel. Its magnitude ",[116,11226,11228],{"className":11227},[119],[116,11229,11231],{"className":11230,"ariaHidden":124},[123],[116,11232,11234,11237,11240,11243,11246],{"className":11233},[128],[116,11235],{"className":11236,"style":552},[132],[116,11238,5020],{"className":11239},[561],[116,11241,8365],{"className":11242},[137],[116,11244,557],{"className":11245,"style":556},[137,138],[116,11247,5020],{"className":11248},[651],"\nmeasures edge strength and ",[116,11251,11253],{"className":11252},[119],[116,11254,11256],{"className":11255,"ariaHidden":124},[123],[116,11257,11259,11262,11266,11269,11309,11312,11352],{"className":11258},[128],[116,11260],{"className":11261,"style":11131},[132],[116,11263,11265],{"className":11264},[1126],"arctan",[116,11267,562],{"className":11268},[561],[116,11270,11272,11275],{"className":11271},[137],[116,11273,557],{"className":11274,"style":556},[137,138],[116,11276,11278],{"className":11277},[725],[116,11279,11281,11301],{"className":11280},[168,169],[116,11282,11284,11298],{"className":11283},[173],[116,11285,11287],{"className":11286,"style":735},[177],[116,11288,11289,11292],{"style":738},[116,11290],{"className":11291,"style":742},[187],[116,11293,11295],{"className":11294},[746,747,748,749],[116,11296,601],{"className":11297,"style":139},[137,138,749],[116,11299,234],{"className":11300},[233],[116,11302,11304],{"className":11303},[173],[116,11305,11307],{"className":11306,"style":822},[177],[116,11308],{},[116,11310,201],{"className":11311},[137],[116,11313,11315,11318],{"className":11314},[137],[116,11316,557],{"className":11317,"style":556},[137,138],[116,11319,11321],{"className":11320},[725],[116,11322,11324,11344],{"className":11323},[168,169],[116,11325,11327,11341],{"className":11326},[173],[116,11328,11330],{"className":11329,"style":735},[177],[116,11331,11332,11335],{"style":738},[116,11333],{"className":11334,"style":742},[187],[116,11336,11338],{"className":11337},[746,747,748,749],[116,11339,566],{"className":11340},[137,138,749],[116,11342,234],{"className":11343},[233],[116,11345,11347],{"className":11346},[173],[116,11348,11350],{"className":11349,"style":762},[177],[116,11351],{},[116,11353,652],{"className":11354},[651]," gives the edge orientation.\nThresholding the magnitude leaves thick edge bands, so ",[505,11357,11358],{},"non-maximum\nsuppression"," thins them: a pixel survives only when its magnitude exceeds both\nneighbors along the gradient direction, collapsing each band to a one-pixel\nridge.",[246,11361],{"hash":11362},"d7f01a883745f2448bb7656f94824fe56f0894f4f5e1bb135f484a448d478303",[73,11364,11365,11366,11371],{},"The ",[76,11367,11370],{"href":11368,"rel":11369},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHough_transform",[80],"Hough line transform"," detects lines even when their pixels\nare broken or partly occluded. A line is written in\nnormal form,",[116,11373,11375],{"className":11374},[702],[116,11376,11378],{"className":11377},[119],[116,11379,11381,11400,11436],{"className":11380,"ariaHidden":124},[123],[116,11382,11384,11387,11391,11394,11397],{"className":11383},[128],[116,11385],{"className":11386,"style":7009},[132],[116,11388,11390],{"className":11389},[137,138],"ρ",[116,11392],{"className":11393,"style":145},[144],[116,11395,150],{"className":11396},[149],[116,11398],{"className":11399,"style":145},[144],[116,11401,11403,11407,11410,11413,11420,11423,11427,11430,11433],{"className":11402},[128],[116,11404],{"className":11405,"style":11406},[132],"height:0.7778em;vertical-align:-0.0833em;",[116,11408,566],{"className":11409},[137,138],[116,11411],{"className":11412,"style":279},[144],[116,11414,11416],{"className":11415},[1126],[116,11417,11419],{"className":11418},[137,3388],"cos",[116,11421],{"className":11422,"style":279},[144],[116,11424,11426],{"className":11425,"style":205},[137,138],"θ",[116,11428],{"className":11429,"style":570},[144],[116,11431,575],{"className":11432},[574],[116,11434],{"className":11435,"style":570},[144],[116,11437,11439,11442,11445,11448,11455,11458,11461],{"className":11438},[128],[116,11440],{"className":11441,"style":4241},[132],[116,11443,601],{"className":11444,"style":139},[137,138],[116,11446],{"className":11447,"style":279},[144],[116,11449,11451],{"className":11450},[1126],[116,11452,11454],{"className":11453},[137,3388],"sin",[116,11456],{"className":11457,"style":279},[144],[116,11459,11426],{"className":11460,"style":205},[137,138],[116,11462,594],{"className":11463},[593],[73,11465,10160,11466,11481,11482,11497,11498,11552,11553,11583,11584,11599,11600,11630,11631,11661],{},[116,11467,11469],{"className":11468},[119],[116,11470,11472],{"className":11471,"ariaHidden":124},[123],[116,11473,11475,11478],{"className":11474},[128],[116,11476],{"className":11477,"style":7009},[132],[116,11479,11390],{"className":11480},[137,138]," the perpendicular distance from the origin and ",[116,11483,11485],{"className":11484},[119],[116,11486,11488],{"className":11487,"ariaHidden":124},[123],[116,11489,11491,11494],{"className":11490},[128],[116,11492],{"className":11493,"style":4022},[132],[116,11495,11426],{"className":11496,"style":205},[137,138]," the angle of\nthat perpendicular. This parametrization is bounded and avoids the infinite slope\nthat ",[116,11499,11501],{"className":11500},[119],[116,11502,11504,11522,11543],{"className":11503,"ariaHidden":124},[123],[116,11505,11507,11510,11513,11516,11519],{"className":11506},[128],[116,11508],{"className":11509,"style":7009},[132],[116,11511,601],{"className":11512,"style":139},[137,138],[116,11514],{"className":11515,"style":145},[144],[116,11517,150],{"className":11518},[149],[116,11520],{"className":11521,"style":145},[144],[116,11523,11525,11528,11531,11534,11537,11540],{"className":11524},[128],[116,11526],{"className":11527,"style":2930},[132],[116,11529,10717],{"className":11530},[137,138],[116,11532,566],{"className":11533},[137,138],[116,11535],{"className":11536,"style":570},[144],[116,11538,575],{"className":11539},[574],[116,11541],{"className":11542,"style":570},[144],[116,11544,11546,11549],{"className":11545},[128],[116,11547],{"className":11548,"style":133},[132],[116,11550,8916],{"className":11551},[137,138]," hits on vertical lines. A fixed edge point ",[116,11554,11556],{"className":11555},[119],[116,11557,11559],{"className":11558,"ariaHidden":124},[123],[116,11560,11562,11565,11568,11571,11574,11577,11580],{"className":11561},[128],[116,11563],{"className":11564,"style":552},[132],[116,11566,562],{"className":11567},[561],[116,11569,566],{"className":11570},[137,138],[116,11572,594],{"className":11573},[593],[116,11575],{"className":11576,"style":279},[144],[116,11578,601],{"className":11579,"style":139},[137,138],[116,11581,652],{"className":11582},[651]," swept over\n",[116,11585,11587],{"className":11586},[119],[116,11588,11590],{"className":11589,"ariaHidden":124},[123],[116,11591,11593,11596],{"className":11592},[128],[116,11594],{"className":11595,"style":4022},[132],[116,11597,11426],{"className":11598,"style":205},[137,138]," traces a sinusoid in ",[116,11601,11603],{"className":11602},[119],[116,11604,11606],{"className":11605,"ariaHidden":124},[123],[116,11607,11609,11612,11615,11618,11621,11624,11627],{"className":11608},[128],[116,11610],{"className":11611,"style":552},[132],[116,11613,562],{"className":11614},[561],[116,11616,11390],{"className":11617},[137,138],[116,11619,594],{"className":11620},[593],[116,11622],{"className":11623,"style":279},[144],[116,11625,11426],{"className":11626,"style":205},[137,138],[116,11628,652],{"className":11629},[651]," space; collinear edge points share\none line, so their sinusoids all pass through the single ",[116,11632,11634],{"className":11633},[119],[116,11635,11637],{"className":11636,"ariaHidden":124},[123],[116,11638,11640,11643,11646,11649,11652,11655,11658],{"className":11639},[128],[116,11641],{"className":11642,"style":552},[132],[116,11644,562],{"className":11645},[561],[116,11647,11390],{"className":11648},[137,138],[116,11650,594],{"className":11651},[593],[116,11653],{"className":11654,"style":279},[144],[116,11656,11426],{"className":11657,"style":205},[137,138],[116,11659,652],{"className":11660},[651]," that\nnames it.",[246,11663],{"hash":11664},"d3f76b511375fc08d9e4ac94e9092e7237f1e534d136ad1c2536cc26d18bb70e",[73,11666,11667,11668,11698,11699,11714,11715,11730],{},"Detection becomes counting: quantize ",[116,11669,11671],{"className":11670},[119],[116,11672,11674],{"className":11673,"ariaHidden":124},[123],[116,11675,11677,11680,11683,11686,11689,11692,11695],{"className":11676},[128],[116,11678],{"className":11679,"style":552},[132],[116,11681,562],{"className":11682},[561],[116,11684,11390],{"className":11685},[137,138],[116,11687,594],{"className":11688},[593],[116,11690],{"className":11691,"style":279},[144],[116,11693,11426],{"className":11694,"style":205},[137,138],[116,11696,652],{"className":11697},[651]," into a grid (the\naccumulator ",[116,11700,11702],{"className":11701},[119],[116,11703,11705],{"className":11704,"ariaHidden":124},[123],[116,11706,11708,11711],{"className":11707},[128],[116,11709],{"className":11710,"style":272},[132],[116,11712,977],{"className":11713},[137,138],"), and for each edge point add one vote to every cell on its\nsinusoid. Cells where many sinusoids cross collect\nhigh counts, and each such peak is a detected line. Real edges are noisy, so the\nvotes smear across neighboring cells; peaks are recovered by thresholding and\nthen a second non-maximum suppression over ",[116,11716,11718],{"className":11717},[119],[116,11719,11721],{"className":11720,"ariaHidden":124},[123],[116,11722,11724,11727],{"className":11723},[128],[116,11725],{"className":11726,"style":272},[132],[116,11728,977],{"className":11729},[137,138],", so one line yields one detection\ninstead of a cluster.",[2107,11732,11734],{"className":2109,"code":11733,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Hough-Lines}(E)$ — vote for lines in $(\\rho, \\theta)$ space\ninput: a set $E$ of edge points, an accumulator $A$ over quantized $(\\rho, \\theta)$\nfor each point $(x, y)$ in $E$ do\n  for each $\\theta$ in the quantized range do\n    $\\rho \\gets x \\cos\\theta + y \\sin\\theta$\n    $A[\\rho, \\theta] \\gets A[\\rho, \\theta] + 1$\nreturn the $(\\rho, \\theta)$ cells whose vote count exceeds a threshold\n",[108,11735,11736,11741,11746,11751,11756,11761,11766],{"__ignoreMap":478},[116,11737,11738],{"class":2116,"line":2117},[116,11739,11740],{},"caption: $\\textsc{Hough-Lines}(E)$ — vote for lines in $(\\rho, \\theta)$ space\n",[116,11742,11743],{"class":2116,"line":479},[116,11744,11745],{},"input: a set $E$ of edge points, an accumulator $A$ over quantized $(\\rho, \\theta)$\n",[116,11747,11748],{"class":2116,"line":2128},[116,11749,11750],{},"for each point $(x, y)$ in $E$ do\n",[116,11752,11753],{"class":2116,"line":2134},[116,11754,11755],{},"  for each $\\theta$ in the quantized range do\n",[116,11757,11758],{"class":2116,"line":2140},[116,11759,11760],{},"    $\\rho \\gets x \\cos\\theta + y \\sin\\theta$\n",[116,11762,11763],{"class":2116,"line":2146},[116,11764,11765],{},"    $A[\\rho, \\theta] \\gets A[\\rho, \\theta] + 1$\n",[116,11767,11768],{"class":2116,"line":2152},[116,11769,11770],{},"return the $(\\rho, \\theta)$ cells whose vote count exceeds a threshold\n",[73,11772,11773,11778],{},[76,11774,11777],{"href":11775,"rel":11776},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHarris_Corner_Detector",[80],"Harris corner detection"," finds points where intensity changes\nsharply in every direction. Over a window it\nforms the second-moment matrix of gradients",[116,11780,11782],{"className":11781},[702],[116,11783,11785],{"className":11784},[119],[116,11786,11788,11806],{"className":11787,"ariaHidden":124},[123],[116,11789,11791,11794,11797,11800,11803],{"className":11790},[128],[116,11792],{"className":11793,"style":272},[132],[116,11795,435],{"className":11796,"style":196},[137,138],[116,11798],{"className":11799,"style":145},[144],[116,11801,150],{"className":11802},[149],[116,11804],{"className":11805,"style":145},[144],[116,11807,11809,11813,11866,11869,12236,12239],{"className":11808},[128],[116,11810],{"className":11811,"style":11812},[132],"height:2.7637em;vertical-align:-1.3021em;",[116,11814,11816],{"className":11815},[1126,3245],[116,11817,11819,11857],{"className":11818},[168,169],[116,11820,11822,11854],{"className":11821},[173],[116,11823,11825,11844],{"className":11824,"style":3417},[177],[116,11826,11828,11831],{"style":11827},"top:-1.8479em;margin-left:0em;",[116,11829],{"className":11830,"style":3424},[187],[116,11832,11834],{"className":11833},[746,747,748,749],[116,11835,11837],{"className":11836},[137,749],[116,11838,11840],{"className":11839},[137,431,749],[116,11841,11843],{"className":11842},[137,749],"window",[116,11845,11846,11849],{"style":3445},[116,11847],{"className":11848,"style":3424},[187],[116,11850,11851],{},[116,11852,1130],{"className":11853},[1126,1127,3454],[116,11855,234],{"className":11856},[233],[116,11858,11860],{"className":11859},[173],[116,11861,11864],{"className":11862,"style":11863},[177],"height:1.3021em;",[116,11865],{},[116,11867],{"className":11868,"style":279},[144],[116,11870,11872,11878,12230],{"className":11871},[946],[116,11873,11875],{"className":11874,"style":1087},[561,1086],[116,11876,1092],{"className":11877},[1091,748],[116,11879,11881],{"className":11880},[137],[116,11882,11884,12054,12057,12060],{"className":11883},[1099],[116,11885,11887],{"className":11886},[1103],[116,11888,11890,12046],{"className":11889},[168,169],[116,11891,11893,12043],{"className":11892},[173],[116,11894,11896,11955],{"className":11895,"style":957},[177],[116,11897,11898,11901],{"style":1115},[116,11899],{"className":11900,"style":1119},[187],[116,11902,11904],{"className":11903},[137],[116,11905,11907,11910],{"className":11906},[137],[116,11908,557],{"className":11909,"style":556},[137,138],[116,11911,11913],{"className":11912},[725],[116,11914,11916,11947],{"className":11915},[168,169],[116,11917,11919,11944],{"className":11918},[173],[116,11920,11922,11933],{"className":11921,"style":1152},[177],[116,11923,11924,11927],{"style":1155},[116,11925],{"className":11926,"style":742},[187],[116,11928,11930],{"className":11929},[746,747,748,749],[116,11931,566],{"className":11932},[137,138,749],[116,11934,11935,11938],{"style":1167},[116,11936],{"className":11937,"style":742},[187],[116,11939,11941],{"className":11940},[746,747,748,749],[116,11942,359],{"className":11943},[137,749],[116,11945,234],{"className":11946},[233],[116,11948,11950],{"className":11949},[173],[116,11951,11953],{"className":11952,"style":1186},[177],[116,11954],{},[116,11956,11957,11960],{"style":1191},[116,11958],{"className":11959,"style":1119},[187],[116,11961,11963,12003],{"className":11962},[137],[116,11964,11966,11969],{"className":11965},[137],[116,11967,557],{"className":11968,"style":556},[137,138],[116,11970,11972],{"className":11971},[725],[116,11973,11975,11995],{"className":11974},[168,169],[116,11976,11978,11992],{"className":11977},[173],[116,11979,11981],{"className":11980,"style":735},[177],[116,11982,11983,11986],{"style":738},[116,11984],{"className":11985,"style":742},[187],[116,11987,11989],{"className":11988},[746,747,748,749],[116,11990,566],{"className":11991},[137,138,749],[116,11993,234],{"className":11994},[233],[116,11996,11998],{"className":11997},[173],[116,11999,12001],{"className":12000,"style":762},[177],[116,12002],{},[116,12004,12006,12009],{"className":12005},[137],[116,12007,557],{"className":12008,"style":556},[137,138],[116,12010,12012],{"className":12011},[725],[116,12013,12015,12035],{"className":12014},[168,169],[116,12016,12018,12032],{"className":12017},[173],[116,12019,12021],{"className":12020,"style":735},[177],[116,12022,12023,12026],{"style":738},[116,12024],{"className":12025,"style":742},[187],[116,12027,12029],{"className":12028},[746,747,748,749],[116,12030,601],{"className":12031,"style":139},[137,138,749],[116,12033,234],{"className":12034},[233],[116,12036,12038],{"className":12037},[173],[116,12039,12041],{"className":12040,"style":822},[177],[116,12042],{},[116,12044,234],{"className":12045},[233],[116,12047,12049],{"className":12048},[173],[116,12050,12052],{"className":12051,"style":1293},[177],[116,12053],{},[116,12055],{"className":12056,"style":1300},[1299],[116,12058],{"className":12059,"style":1300},[1299],[116,12061,12063],{"className":12062},[1103],[116,12064,12066,12222],{"className":12065},[168,169],[116,12067,12069,12219],{"className":12068},[173],[116,12070,12072,12160],{"className":12071,"style":957},[177],[116,12073,12074,12077],{"style":1115},[116,12075],{"className":12076,"style":1119},[187],[116,12078,12080,12120],{"className":12079},[137],[116,12081,12083,12086],{"className":12082},[137],[116,12084,557],{"className":12085,"style":556},[137,138],[116,12087,12089],{"className":12088},[725],[116,12090,12092,12112],{"className":12091},[168,169],[116,12093,12095,12109],{"className":12094},[173],[116,12096,12098],{"className":12097,"style":735},[177],[116,12099,12100,12103],{"style":738},[116,12101],{"className":12102,"style":742},[187],[116,12104,12106],{"className":12105},[746,747,748,749],[116,12107,566],{"className":12108},[137,138,749],[116,12110,234],{"className":12111},[233],[116,12113,12115],{"className":12114},[173],[116,12116,12118],{"className":12117,"style":762},[177],[116,12119],{},[116,12121,12123,12126],{"className":12122},[137],[116,12124,557],{"className":12125,"style":556},[137,138],[116,12127,12129],{"className":12128},[725],[116,12130,12132,12152],{"className":12131},[168,169],[116,12133,12135,12149],{"className":12134},[173],[116,12136,12138],{"className":12137,"style":735},[177],[116,12139,12140,12143],{"style":738},[116,12141],{"className":12142,"style":742},[187],[116,12144,12146],{"className":12145},[746,747,748,749],[116,12147,601],{"className":12148,"style":139},[137,138,749],[116,12150,234],{"className":12151},[233],[116,12153,12155],{"className":12154},[173],[116,12156,12158],{"className":12157,"style":822},[177],[116,12159],{},[116,12161,12162,12165],{"style":1191},[116,12163],{"className":12164,"style":1119},[187],[116,12166,12168],{"className":12167},[137],[116,12169,12171,12174],{"className":12170},[137],[116,12172,557],{"className":12173,"style":556},[137,138],[116,12175,12177],{"className":12176},[725],[116,12178,12180,12211],{"className":12179},[168,169],[116,12181,12183,12208],{"className":12182},[173],[116,12184,12186,12197],{"className":12185,"style":1152},[177],[116,12187,12188,12191],{"style":1155},[116,12189],{"className":12190,"style":742},[187],[116,12192,12194],{"className":12193},[746,747,748,749],[116,12195,601],{"className":12196,"style":139},[137,138,749],[116,12198,12199,12202],{"style":1167},[116,12200],{"className":12201,"style":742},[187],[116,12203,12205],{"className":12204},[746,747,748,749],[116,12206,359],{"className":12207},[137,749],[116,12209,234],{"className":12210},[233],[116,12212,12214],{"className":12213},[173],[116,12215,12217],{"className":12216,"style":1473},[177],[116,12218],{},[116,12220,234],{"className":12221},[233],[116,12223,12225],{"className":12224},[173],[116,12226,12228],{"className":12227,"style":1293},[177],[116,12229],{},[116,12231,12233],{"className":12232,"style":1087},[651,1086],[116,12234,1493],{"className":12235},[1091,748],[116,12237],{"className":12238,"style":279},[144],[116,12240,594],{"className":12241},[593],[73,12243,12244,12245,12353,12354,12369],{},"and scores each pixel by ",[116,12246,12248],{"className":12247},[119],[116,12249,12251,12269,12297],{"className":12250,"ariaHidden":124},[123],[116,12252,12254,12257,12260,12263,12266],{"className":12253},[128],[116,12255],{"className":12256,"style":272},[132],[116,12258,2756],{"className":12259,"style":2755},[137,138],[116,12261],{"className":12262,"style":145},[144],[116,12264,150],{"className":12265},[149],[116,12267],{"className":12268,"style":145},[144],[116,12270,12272,12275,12282,12285,12288,12291,12294],{"className":12271},[128],[116,12273],{"className":12274,"style":11406},[132],[116,12276,12278],{"className":12277},[1126],[116,12279,12281],{"className":12280},[137,3388],"det",[116,12283],{"className":12284,"style":279},[144],[116,12286,435],{"className":12287,"style":196},[137,138],[116,12289],{"className":12290,"style":570},[144],[116,12292,1610],{"className":12293},[574],[116,12295],{"className":12296,"style":570},[144],[116,12298,12300,12303,12306,12309,12312,12318,12321,12324],{"className":12299},[128],[116,12301],{"className":12302,"style":2205},[132],[116,12304,4382],{"className":12305,"style":4381},[137,138],[116,12307],{"className":12308,"style":279},[144],[116,12310,562],{"className":12311},[561],[116,12313,12315],{"className":12314},[1126],[116,12316,299],{"className":12317},[137,3388],[116,12319],{"className":12320,"style":279},[144],[116,12322,435],{"className":12323,"style":196},[137,138],[116,12325,12327,12330],{"className":12326},[651],[116,12328,652],{"className":12329},[651],[116,12331,12333],{"className":12332},[725],[116,12334,12336],{"className":12335},[168],[116,12337,12339],{"className":12338},[173],[116,12340,12342],{"className":12341,"style":1152},[177],[116,12343,12344,12347],{"style":1167},[116,12345],{"className":12346,"style":742},[187],[116,12348,12350],{"className":12349},[746,747,748,749],[116,12351,359],{"className":12352},[137,749],". Two large\neigenvalues — variation along both axes — make ",[116,12355,12357],{"className":12356},[119],[116,12358,12360],{"className":12359,"ariaHidden":124},[123],[116,12361,12363,12366],{"className":12362},[128],[116,12364],{"className":12365,"style":272},[132],[116,12367,2756],{"className":12368,"style":2755},[137,138]," large and mark a corner; a\nsingle large eigenvalue signals an edge, and neither signals flat texture.",[73,12371,12372,12373,1852],{},"You can read the full\n",[76,12374,3963],{"href":12375,"rel":12376},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Fblob\u002Fmain\u002Fpsets\u002F01\u002Fwriteup\u002Fmain.pdf",[80],[2263,12378,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":12380},[],"2024-01-23",{},"\u002Fprojects\u002Fcomputer-vision\u002Fhough-filters",[3972],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fcomputer-vision\u002Ftree\u002Fmain\u002Fpsets\u002F01",{"title":11043,"description":11048},"projects\u002Fcomputer-vision\u002F1.hough-filters","Detecting lines and corners with classical vision — Gaussian smoothing,\nSobel gradients, the Hough transform, and the Harris corner detector.",[2279,2280,2281],"DRS--YISyKmoAJR4FtkWtsPNHLi5-ghChD6f2C2YyqY",{"id":12392,"title":12393,"body":12394,"date":12653,"description":12654,"extension":483,"featured":2354,"meta":12655,"navigation":484,"path":12656,"references":12657,"repo":12659,"seo":12660,"stem":12661,"summary":12662,"tag":2364,"tech":12663,"url":2282,"__hash__":12665},"projects\u002Fprojects\u002Flinguistics\u002F1.chatbot.md","Swahili Chatbot with RegEx",{"type":70,"value":12395,"toc":12651},[12396,12415,12429,12547,12564,12614,12643,12649],[73,12397,12398,12399,12404,12405,12408,12409,12414],{},"A rule-based chatbot for Swahili, built in the style of\n",[76,12400,12403],{"href":12401,"rel":12402},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FELIZA",[80],"ELIZA",". It holds a conversation\nwith no learned model at all: the single ",[108,12406,12407],{},"eliza"," function runs the input\nthrough a fixed ladder of eight\n",[76,12410,12413],{"href":12411,"rel":12412},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRegular_expression",[80],"regular expressions",",\neach with capture groups, and the first one to match builds the reply.\nAn input that matches nothing falls through to a neutral prompt.",[73,12416,12417,12418,201,12421,12424,12425,12428],{},"The patterns are tried top to bottom in an ",[108,12419,12420],{},"if",[108,12422,12423],{},"elif"," chain, so their\nwritten order ",[442,12426,12427],{},"is"," their priority. Each one\ntargets a family of Swahili sentences:",[10278,12430,12431,12450,12470,12489,12521],{},[10281,12432,12433,106,12436,8279,12439,12442,12443,12446,12447],{},[505,12434,12435],{},"Naming.",[108,12437,12438],{},"Naitwa X",[108,12440,12441],{},"Jina langu ni X"," (",[442,12444,12445],{},"my name is X",") returns\nthe respectful greeting ",[108,12448,12449],{},"Shikamoo, X. Umeshindaje?",[10281,12451,12452,106,12455,12458,12459,12462,12463,201,12466,12469],{},[505,12453,12454],{},"State of mind.",[108,12456,12457],{},"nimefurahi"," \u002F ",[108,12460,12461],{},"sijahuzunika"," and kin, the\n",[108,12464,12465],{},"nime",[108,12467,12468],{},"sija"," prefix plus a mood stem, get reflected back as a\nquestion.",[10281,12471,12472,106,12475,12442,12478,12481,12482,12442,12485,12488],{},[505,12473,12474],{},"Self-description.",[108,12476,12477],{},"Mimi ni …",[442,12479,12480],{},"I am …",") becomes\n",[108,12483,12484],{},"Mbona wewe …?",[442,12486,12487],{},"why are you …?",").",[10281,12490,12491,12494,12495,201,12498,201,12501,201,12504,12507,12508,12442,12511,12514,12515,12442,12518,12488],{},[505,12492,12493],{},"Family."," A ",[108,12496,12497],{},"mama",[108,12499,12500],{},"baba",[108,12502,12503],{},"kaka",[108,12505,12506],{},"dada"," noun with the ",[108,12509,12510],{},"-ngu",[442,12512,12513],{},"my",")\nsuffix draws out ",[108,12516,12517],{},"Niambie mengine kumhusu …ko",[442,12519,12520],{},"tell me more about\nyour …",[10281,12522,12523,12526,12527,201,12530,201,12533,201,12536,201,12539,12542,12543,12546],{},[505,12524,12525],{},"Intent."," Modal stems ",[108,12528,12529],{},"Nataka",[108,12531,12532],{},"Sitaki",[108,12534,12535],{},"Naweza",[108,12537,12538],{},"Siwezi",[108,12540,12541],{},"Nahitaji","\nand the obligation ",[108,12544,12545],{},"Lazima ni…"," are echoed with the person flipped.",[73,12548,12549,12550,201,12553,12556,12557,12442,12560,12563],{},"The remaining rules catch thoughts (",[108,12551,12552],{},"Nadhani",[108,12554,12555],{},"Natumai","), ask for an\nexample on any generic verb, and deflect a short list of insults; the\ndefault reply ",[108,12558,12559],{},"Niambie mengine…",[442,12561,12562],{},"tell me more",") closes the ladder.",[2107,12565,12567],{"className":2109,"code":12566,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Respond}(u, R)$ — first-match pattern reply\ninput: a user utterance $u$, an ordered list $R$ of (pattern $p$, templates $T$) rules\n$x \\gets$ normalize and lowercase $u$\nfor each $(p, T)$ in $R$, in order, do\n  $m \\gets$ match $p$ against $x$\n  if $m$ succeeds then\n    $t \\gets$ choose a template from $T$\n    return $t$ with capture groups of $m$ substituted in\nreturn the default fallback reply\n",[108,12568,12569,12574,12579,12584,12589,12594,12599,12604,12609],{"__ignoreMap":478},[116,12570,12571],{"class":2116,"line":2117},[116,12572,12573],{},"caption: $\\textsc{Respond}(u, R)$ — first-match pattern reply\n",[116,12575,12576],{"class":2116,"line":479},[116,12577,12578],{},"input: a user utterance $u$, an ordered list $R$ of (pattern $p$, templates $T$) rules\n",[116,12580,12581],{"class":2116,"line":2128},[116,12582,12583],{},"$x \\gets$ normalize and lowercase $u$\n",[116,12585,12586],{"class":2116,"line":2134},[116,12587,12588],{},"for each $(p, T)$ in $R$, in order, do\n",[116,12590,12591],{"class":2116,"line":2140},[116,12592,12593],{},"  $m \\gets$ match $p$ against $x$\n",[116,12595,12596],{"class":2116,"line":2146},[116,12597,12598],{},"  if $m$ succeeds then\n",[116,12600,12601],{"class":2116,"line":2152},[116,12602,12603],{},"    $t \\gets$ choose a template from $T$\n",[116,12605,12606],{"class":2116,"line":2158},[116,12607,12608],{},"    return $t$ with capture groups of $m$ substituted in\n",[116,12610,12611],{"class":2116,"line":2164},[116,12612,12613],{},"return the default fallback reply\n",[73,12615,12616,12617,12442,12620,12622,12623,12442,12626,12629,12630,201,12632,12635,12636,201,12639,12642],{},"Reflection keeps the replies coherent. When a captured group is spliced\nback into a reply, its person markers are rewritten so the bot answers\nfrom its own point of view. The possessive ",[108,12618,12619],{},"-angu",[442,12621,12513],{},") is swapped to\n",[108,12624,12625],{},"-ako",[442,12627,12628],{},"your","), and the subject prefixes on verbs flip — a first-person\n",[108,12631,12465],{},[108,12633,12634],{},"nataka"," returns as second-person ",[108,12637,12638],{},"ume",[108,12640,12641],{},"unataka",". Without this\nstep, echoing the user's words reads as nonsense; with it, a statement\nabout \"me\" comes back as a question about \"you\", so the reply stays on\ntopic without any parsing of meaning.",[73,12644,5100,12645,1852],{},[76,12646,5105],{"href":12647,"rel":12648},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Fblob\u002Fmain\u002FP1\u002Freport\u002Freport.pdf",[80],[2263,12650,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":12652},[],"2024-01-12","A rule-based chatbot for Swahili, built in the style of\nELIZA. It holds a conversation\nwith no learned model at all: the single eliza function runs the input\nthrough a fixed ladder of eight\nregular expressions,\neach with capture groups, and the first one to match builds the reply.\nAn input that matches nothing falls through to a neutral prompt.",{},"\u002Fprojects\u002Flinguistics\u002Fchatbot",[12658],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fapplications\u002Fdialogue-and-chatbots","https:\u002F\u002Fgithub.com\u002Flostflux\u002Flinguistics\u002Ftree\u002Fmain\u002FP1",{"title":12393,"description":12654},"projects\u002Flinguistics\u002F1.chatbot","An ELIZA-style Swahili chatbot: ranked regular-expression patterns match the\ninput, and reassembly rules turn the match into a reply.",[2279,12664],"RegEx","sQlr0l_18qNfmZbP6w6MGZ4Z7u23VuooJlbxlDoGhq4",{"id":12667,"title":12668,"body":12669,"date":13024,"description":13025,"extension":483,"featured":484,"meta":13026,"navigation":484,"path":13027,"references":2282,"repo":12684,"seo":13028,"stem":13029,"summary":13030,"tag":13031,"tech":13032,"url":13037,"__hash__":13038},"projects\u002Fprojects\u002Fweb\u002Fdiscite.md","Discite",{"type":70,"value":12670,"toc":13022},[12671,12706,12709,12770,12787,12800,12834,12852,12874,12929,12972,12998,13009],[73,12672,12673,12675,12676,12681,12682,12687,12688,12693,12694,12699,12700,12705],{},[505,12674,12668],{}," turns idle screen time into learning: a short-form video app that\nteaches computer science fundamentals through bite-sized, swipeable clips, built\nfor the way people actually spend an idle minute. I built it as my Dartmouth\n",[76,12677,12680],{"href":12678,"rel":12679},"https:\u002F\u002Fmedium.com\u002Fdartmouth-cs98\u002Fupgrade-your-screen-time-learn-cs-fundamentals-with-discite-14c3337cb074",[80],"CS98 senior capstone",", and it grew into a five-part platform: a\nSwiftUI ",[76,12683,12686],{"href":12684,"rel":12685},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdiscite-frontend",[80],"iOS client",", a TypeScript \u002F Express ",[76,12689,12692],{"href":12690,"rel":12691},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdiscite-backend",[80],"API"," on\nMongoDB, a Python ",[76,12695,12698],{"href":12696,"rel":12697},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdiscite-ml",[80],"ML service"," that cuts long lectures into clips, a\n",[76,12701,12704],{"href":12702,"rel":12703},"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdiscite-recs",[80],"recommendation engine"," over a vector index, and an AWS streaming tier.",[246,12707],{"hash":12708},"540599df601064af7ec0b0202cf7327b2d9dee9722e90013c05c1e2d21e92011",[73,12710,12711,12715,12716,12458,12719,12458,12722,12458,12725,12728,12729,12732,12733,12736,12737,12740,12741,5452,12744,5452,12747,12750,12751,12754,12755,2911,12758,12761,12762,12765,12766,12769],{},[76,12712,12714],{"href":12684,"rel":12713},[80],"The app"," is SwiftUI, organized MVVM with a\n",[108,12717,12718],{},"Views",[108,12720,12721],{},"ViewModels",[108,12723,12724],{},"Models",[108,12726,12727],{},"Service"," split per feature.\n",[108,12730,12731],{},"Authentication"," obtains a JWT and stores it in the Keychain (",[108,12734,12735],{},"KeychainItem","),\nwith a Google sign-in path alongside email. ",[108,12738,12739],{},"Watch"," is the core surface: an\nIGList-backed feed (",[108,12742,12743],{},"PlayerView",[108,12745,12746],{},"EmbeddedVideoCell",[108,12748,12749],{},"NavigationDotsView",")\nwhere a ",[108,12752,12753],{},"SwipeDirection"," enum reads the drag gesture, sideways swipes stepping\nthrough a topic's clips and a downward swipe advancing to the next topic, all\nover a ",[108,12756,12757],{},"CustomVideoPlayer",[108,12759,12760],{},"Explore"," drives topics, playlists, and search;\n",[108,12763,12764],{},"Account"," holds profiles and a ",[108,12767,12768],{},"Friends"," graph. The client keeps no business\nlogic; it is a consumer of the REST API.",[73,12771,12772,12776,12777,5452,12780,5452,12783,12786],{},[76,12773,12775],{"href":12690,"rel":12774},[80],"The backend"," follows Express's\nmodel–controller–router layout in TypeScript, with Passport guarding routes by\nJWT (",[108,12778,12779],{},"requireAuth",[108,12781,12782],{},"requireSignin",[108,12784,12785],{},"requireAdmin","). Mongoose maps a small set\nof collections:",[73,12788,12789,12792,12793,5452,12796,12799],{},[108,12790,12791],{},"user","\n: names, lowercase-unique email and username, bcrypt password, ",[108,12794,12795],{},"savedPlaylists",[108,12797,12798],{},"isAdmin",", email verification",[73,12801,12802,12805,12806,5452,12809,5452,12812,5452,12815,5452,12818,12458,12821,12458,12824,12827,12828,5452,12831],{},[108,12803,12804],{},"video_metadata","\n: ",[108,12807,12808],{},"title",[108,12810,12811],{},"youtubeURL",[108,12813,12814],{},"topicId[]",[108,12816,12817],{},"clips[]",[108,12819,12820],{},"views",[108,12822,12823],{},"likes",[108,12825,12826],{},"dislikes"," sets, ",[108,12829,12830],{},"isVectorized",[108,12832,12833],{},"isClipped",[73,12835,12836,12805,12839,5452,12842,5452,12845,5452,12848,12851],{},[108,12837,12838],{},"clip_metadata",[108,12840,12841],{},"videoId",[108,12843,12844],{},"duration",[108,12846,12847],{},"thumbnailURL",[108,12849,12850],{},"clipURL"," pointing at a CDN manifest, and the same engagement sets",[73,12853,12854,12857,12858,12861,12862,12865,12866,12869,12870,12873],{},[108,12855,12856],{},"user_affinity","\n: per-topic ",[108,12859,12860],{},"affinities"," and ",[108,12863,12864],{},"complexities"," maps in ",[108,12867,12868],{},"[0, 1]",", plus a bounded ",[108,12871,12872],{},"activeAffinities"," buffer of recent watches",[73,12875,12876,12877,5452,12880,12883,12884,5452,12887,12890,12891,12894,12895,12458,12898,12458,12901,12458,12904,12907,12908,5452,12911,5452,12914,12917,12918,5452,12921,5452,12924,5452,12926,12488],{},"Routes cover auth (",[108,12878,12879],{},"\u002Fauth\u002Fsignup",[108,12881,12882],{},"\u002Fauth\u002Fsignin","), the social graph\n(",[108,12885,12886],{},"\u002Frelationships",[108,12888,12889],{},"\u002Fconnections\u002F:userId","), engagement (",[108,12892,12893],{},"GET \u002Fvideos\u002F:videoId",",\nnested comment threads, and ",[108,12896,12897],{},"like",[108,12899,12900],{},"dislike",[108,12902,12903],{},"toohard",[108,12905,12906],{},"tooeasy",", each of\nwhich nudges the caller's affinity), and recommendations. Around fifty Cypress\nspecs exercise it end to end (",[108,12909,12910],{},"affinity",[108,12912,12913],{},"recommendation",[108,12915,12916],{},"vectorized-rec",",\n",[108,12919,12920],{},"watch-history",[108,12922,12923],{},"search",[108,12925,12791],{},[108,12927,12928],{},"video",[73,12930,12931,12932,12936,12937,12940,12941,12944,12945,12948,12949,12952,12953,12442,12956,12959,12960,12963,12964,12967,12968,12971],{},"Turning lectures into clips is the job of ",[76,12933,12935],{"href":12696,"rel":12934},[80],"the ML service",", a Dockerized\nFastAPI app. Its ",[108,12938,12939],{},"\u002Fsplit"," route runs ",[108,12942,12943],{},"process_video",", pulling a YouTube video's frames\nand transcript, then labels both against a topic set: ",[505,12946,12947],{},"CLIP","\n(",[108,12950,12951],{},"clip-vit-base-patch32",") scores each frame and ",[505,12954,12955],{},"BART",[108,12957,12958],{},"bart-large-mnli",")\ndoes zero-shot classification on the transcript around each second. That yields\na per-second topic time-series, which a ",[108,12961,12962],{},"tfidf"," pass reweights so keywords\ncommon to the whole video (",[108,12965,12966],{},"SELECT"," throughout a SQL lecture) count for less\nthan distinctive ones. A sliding-window change detector then compares each\nwindow's topic mixture against a running mean or median; when the gap crosses a\nthreshold it marks a clip boundary. Raw segments go to S3 and their metadata is\n",[108,12969,12970],{},"PUT"," to the API.",[73,12973,12974,12975,12979,12980,12983,12984,12987,12988,12991,12992,12994,12995,12997],{},"Choosing what to play falls to ",[76,12976,12978],{"href":12702,"rel":12977},[80],"the engine",", a separate FastAPI service over\na Pinecone cosine index (namespace ",[108,12981,12982],{},"video-transcripts",") and an Algolia search\nindex. Candidate generation queries Pinecone for videos near a seed clip;\nranking then reorders them by taste, as ",[108,12985,12986],{},"VideoRanker"," adds each viewer's\nper-topic affinity to the similarity score and re-sorts. The backend also\nqueries Pinecone directly for its ",[108,12989,12990],{},"vectorized"," feed. Two signals from the\naffinity model, interest and difficulty, together with vector-space topic\nsimilarity, decide the next clip, and every like, dislike, ",[108,12993,12903],{},", or\n",[108,12996,12906],{}," event feeds back into the scores so the sequence adapts as you learn.",[73,12999,13000,13001,13004,13005,13008],{},"Clips never stream from the database. Bytes\nlive on Amazon S3 and reach the app over HLS through CloudFront. When the client\nwants a clip it asks the API for a signed ",[108,13002,13003],{},".m3u8","; a Lambda fetches and caches\nthe CloudFront private key, checks that the request is authorized, and signs the\nmanifest, appending signed params to every ",[108,13006,13007],{},".ts"," segment so playback loads\nprogressively. The public docs and marketing site is a separate Nuxt Content\napp.",[73,13010,13011,13012,13016,13017,1852],{},"Read more in the ",[76,13013,13015],{"href":12678,"rel":13014},[80],"Medium write-up"," and the project's\n",[76,13018,13021],{"href":13019,"rel":13020},"https:\u002F\u002Fdiscite-website.vercel.app\u002Fdocs\u002Farchitecture",[80],"architecture docs",{"title":478,"searchDepth":479,"depth":479,"links":13023},[],"2023-12-04","Discite turns idle screen time into learning: a short-form video app that\nteaches computer science fundamentals through bite-sized, swipeable clips, built\nfor the way people actually spend an idle minute. I built it as my Dartmouth\nCS98 senior capstone, and it grew into a five-part platform: a\nSwiftUI iOS client, a TypeScript \u002F Express API on\nMongoDB, a Python ML service that cuts long lectures into clips, a\nrecommendation engine over a vector index, and an AWS streaming tier.",{},"\u002Fprojects\u002Fweb\u002Fdiscite",{"title":12668,"description":13025},"projects\u002Fweb\u002Fdiscite","Discite turns idle screen time into learning — a short-form video app that\nteaches computer science fundamentals through bite-sized, swipeable clips,\nspanning a SwiftUI client, an Express API, an ML clipping pipeline, and a\nvector recommendation engine.","design \u002F web",[13033,13034,13035,13036,2279],"Swift","TypeScript","Node","MongoDB","https:\u002F\u002Fdiscite-website.vercel.app\u002F","G7ihtsj1rft0gjG1ew9gKzh-huLxhHy1hbdViTwozRg",{"id":13040,"title":13041,"body":13042,"date":13459,"description":13460,"extension":483,"featured":484,"meta":13461,"navigation":484,"path":13462,"references":13463,"repo":13465,"seo":13466,"stem":13467,"summary":13468,"tag":13469,"tech":13470,"url":13444,"__hash__":13473},"projects\u002Fprojects\u002Fdata-mining\u002Fai-transitions-study.md","Societal Attitudes Toward AI",{"type":70,"value":13043,"toc":13457},[13044,13053,13064,13071,13094,13273,13440],[73,13045,13046,13047,13052],{},"Public sentiment toward AI has shifted over the past two decades, and this\nproject mines the ",[76,13048,13051],{"href":13049,"rel":13050},"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fsiavava\u002Fai-tech-articles",[80],"technology-article dataset","\nfor how, and for the events that moved it. The corpus runs to 17,092 articles\nand 28 million words spanning 2000 to 2023, drawn from news outlets and AI\nlabs. Three Jupyter notebooks carry the work: one profiles the dataset, one\nscores sentiment, and one runs the Procrustes comparison.",[73,13054,13055,13056,13059,13060,13063],{},"After Porter stemming and English stopword removal, a gensim ",[108,13057,13058],{},"LdaModel"," fit\nover a ",[108,13061,13062],{},"corpora.Dictionary"," of the articles extracts ten latent topics, each a distribution over words\nand each article a mixture over topics. The top topics name the recurring\nthreads of the discourse: chatbots and privacy, deep learning and\nDeepMind, autonomy and security, the metaverse.",[73,13065,13066,13067,13070],{},"nltk's ",[108,13068,13069],{},"SentimentIntensityAnalyzer"," scores each article on four axes\n(positive, negative, neutral, and a compound aggregate), averaged by year. The positive, negative, and neutral bands\nstay fairly flat; the compound score is what jumps, and reading it per\ntopic rather than over the whole corpus exposes swings the global average\nsmooths away.",[73,13072,13073,13074,13077,13078,13093],{},"Comparing two years directly is the hard part. Each year's articles produce\nan LDA topic-distribution matrix, and a distribution is defined only up to\nrotation and scale, so two years cannot be lined up as they stand.\n",[108,13075,13076],{},"scipy.spatial.procrustes"," standardizes both matrices and finds the\northogonal ",[116,13079,13081],{"className":13080},[119],[116,13082,13084],{"className":13083,"ariaHidden":124},[123],[116,13085,13087,13090],{"className":13086},[128],[116,13088],{"className":13089,"style":272},[132],[116,13091,2756],{"className":13092,"style":2755},[137,138]," that best overlays one on the other,",[116,13095,13097],{"className":13096},[702],[116,13098,13100],{"className":13099},[119],[116,13101,13103,13218],{"className":13102,"ariaHidden":124},[123],[116,13104,13106,13110,13197,13200,13203,13206,13209,13212,13215],{"className":13105},[128],[116,13107],{"className":13108,"style":13109},[132],"height:1.5634em;vertical-align:-0.8134em;",[116,13111,13113],{"className":13112},[1126,3245],[116,13114,13116,13188],{"className":13115},[168,169],[116,13117,13119,13185],{"className":13118},[173],[116,13120,13122,13172],{"className":13121,"style":3255},[177],[116,13123,13125,13128],{"style":13124},"top:-2.2866em;margin-left:0em;",[116,13126],{"className":13127,"style":1119},[187],[116,13129,13131],{"className":13130},[746,747,748,749],[116,13132,13134,13163,13166,13169],{"className":13133},[137,749],[116,13135,13137,13140],{"className":13136},[137,749],[116,13138,2756],{"className":13139,"style":2755},[137,138,749],[116,13141,13143],{"className":13142},[725],[116,13144,13146],{"className":13145},[168],[116,13147,13149],{"className":13148},[173],[116,13150,13152],{"className":13151,"style":990},[177],[116,13153,13154,13157],{"style":993},[116,13155],{"className":13156,"style":997},[187],[116,13158,13160],{"className":13159},[746,1001,1002,749],[116,13161,1006],{"className":13162},[137,749],[116,13164,2756],{"className":13165,"style":2755},[137,138,749],[116,13167,150],{"className":13168},[149,749],[116,13170,557],{"className":13171,"style":556},[137,138,749],[116,13173,13174,13177],{"style":3376},[116,13175],{"className":13176,"style":1119},[187],[116,13178,13179],{},[116,13180,13182],{"className":13181},[1126],[116,13183,3389],{"className":13184},[137,3388],[116,13186,234],{"className":13187},[233],[116,13189,13191],{"className":13190},[173],[116,13192,13195],{"className":13193,"style":13194},[177],"height:0.8134em;",[116,13196],{},[116,13198],{"className":13199,"style":279},[144],[116,13201,5020],{"className":13202},[561],[116,13204,977],{"className":13205},[137,138],[116,13207,2756],{"className":13208,"style":2755},[137,138],[116,13210],{"className":13211,"style":570},[144],[116,13213,1610],{"className":13214},[574],[116,13216],{"className":13217,"style":570},[144],[116,13219,13221,13224,13229,13270],{"className":13220},[128],[116,13222],{"className":13223,"style":552},[132],[116,13225,13228],{"className":13226,"style":13227},[137,138],"margin-right:0.0502em;","B",[116,13230,13232,13235],{"className":13231},[651],[116,13233,5020],{"className":13234},[651],[116,13236,13238],{"className":13237},[725],[116,13239,13241,13262],{"className":13240},[168,169],[116,13242,13244,13259],{"className":13243},[173],[116,13245,13248],{"className":13246,"style":13247},[177],"height:0.3283em;",[116,13249,13250,13253],{"style":3584},[116,13251],{"className":13252,"style":742},[187],[116,13254,13256],{"className":13255},[746,747,748,749],[116,13257,2505],{"className":13258,"style":924},[137,138,749],[116,13260,234],{"className":13261},[233],[116,13263,13265],{"className":13264},[173],[116,13266,13268],{"className":13267,"style":762},[177],[116,13269],{},[116,13271,594],{"className":13272},[593],[73,13274,13275,13276,13372,13373,13435,13436,13439],{},"solved in closed form from the SVD ",[116,13277,13279],{"className":13278},[119],[116,13280,13282,13329],{"className":13281,"ariaHidden":124},[123],[116,13283,13285,13288,13317,13320,13323,13326],{"className":13284},[128],[116,13286],{"className":13287,"style":1907},[132],[116,13289,13291,13294],{"className":13290},[137],[116,13292,13228],{"className":13293,"style":13227},[137,138],[116,13295,13297],{"className":13296},[725],[116,13298,13300],{"className":13299},[168],[116,13301,13303],{"className":13302},[173],[116,13304,13306],{"className":13305,"style":1907},[177],[116,13307,13308,13311],{"style":1167},[116,13309],{"className":13310,"style":742},[187],[116,13312,13314],{"className":13313},[746,747,748,749],[116,13315,1006],{"className":13316},[137,749],[116,13318,977],{"className":13319},[137,138],[116,13321],{"className":13322,"style":145},[144],[116,13324,150],{"className":13325},[149],[116,13327],{"className":13328,"style":145},[144],[116,13330,13332,13335,13339,13343],{"className":13331},[128],[116,13333],{"className":13334,"style":1907},[132],[116,13336,13338],{"className":13337,"style":196},[137,138],"U",[116,13340,13342],{"className":13341},[137],"Σ",[116,13344,13346,13349],{"className":13345},[137],[116,13347,5188],{"className":13348,"style":570},[137,138],[116,13350,13352],{"className":13351},[725],[116,13353,13355],{"className":13354},[168],[116,13356,13358],{"className":13357},[173],[116,13359,13361],{"className":13360,"style":1907},[177],[116,13362,13363,13366],{"style":1167},[116,13364],{"className":13365,"style":742},[187],[116,13367,13369],{"className":13368},[746,747,748,749],[116,13370,1006],{"className":13371},[137,749],", giving\n",[116,13374,13376],{"className":13375},[119],[116,13377,13379,13397],{"className":13378,"ariaHidden":124},[123],[116,13380,13382,13385,13388,13391,13394],{"className":13381},[128],[116,13383],{"className":13384,"style":272},[132],[116,13386,2756],{"className":13387,"style":2755},[137,138],[116,13389],{"className":13390,"style":145},[144],[116,13392,150],{"className":13393},[149],[116,13395],{"className":13396,"style":145},[144],[116,13398,13400,13403,13406],{"className":13399},[128],[116,13401],{"className":13402,"style":1907},[132],[116,13404,13338],{"className":13405,"style":196},[137,138],[116,13407,13409,13412],{"className":13408},[137],[116,13410,5188],{"className":13411,"style":570},[137,138],[116,13413,13415],{"className":13414},[725],[116,13416,13418],{"className":13417},[168],[116,13419,13421],{"className":13420},[173],[116,13422,13424],{"className":13423,"style":1907},[177],[116,13425,13426,13429],{"style":1167},[116,13427],{"className":13428,"style":742},[187],[116,13430,13432],{"className":13431},[746,747,748,749],[116,13433,1006],{"className":13434},[137,749],"; the leftover residual is the ",[442,13437,13438],{},"disparity"," between the two\nyears. Running it on consecutive years, and on every year against 2022,\nturns the drift of the AI conversation into a single number per pair. The\ndisparities spike around the dot-com bust of 2000–2002, again through\n2013–2016, and then climb sharply from 2018 onward, peaking across\n2021–2023 as large language models entered the discourse.",[73,13441,11365,13442,13446,13447,2344,13452,1852],{},[76,13443,5105],{"href":13444,"rel":13445},"https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fdata-mining-project\u002Fblob\u002Fmain\u002Freport.pdf",[80],"\nhas the results. Collaborative project with\n",[76,13448,13451],{"href":13449,"rel":13450},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Faimen-abdulaziz\u002F",[80],"Aimen Abdulaziz",[76,13453,13456],{"href":13454,"rel":13455},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fangelic-mcpherson\u002F",[80],"Angelic McPherson",{"title":478,"searchDepth":479,"depth":479,"links":13458},[],"2023-11-20","Public sentiment toward AI has shifted over the past two decades, and this\nproject mines the technology-article dataset\nfor how, and for the events that moved it. The corpus runs to 17,092 articles\nand 28 million words spanning 2000 to 2023, drawn from news outlets and AI\nlabs. Three Jupyter notebooks carry the work: one profiles the dataset, one\nscores sentiment, and one runs the Procrustes comparison.",{},"\u002Fprojects\u002Fdata-mining\u002Fai-transitions-study",[5114,13464,488],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fclassification\u002Fsentiment-and-affect-lexicons","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdata-mining-project",{"title":13041,"description":13460},"projects\u002Fdata-mining\u002Fai-transitions-study","Mining a corpus of technology articles for how public sentiment and\nvocabulary around AI have shifted across time.","data mining",[2279,13471,13472],"LaTeX","NLP","NUVwzGGNcVBrwDtnkPeSk_36Fbb10rIv-GYna_feUnM",{"id":13475,"title":13476,"body":13477,"date":13711,"description":13712,"extension":483,"featured":484,"meta":13713,"navigation":484,"path":13714,"references":13715,"repo":13718,"seo":13719,"stem":13720,"summary":13721,"tag":13469,"tech":13722,"url":13049,"__hash__":13725},"projects\u002Fprojects\u002Fdata-mining\u002Fai-tech-dataset.md","AI \u002F Tech Dataset",{"type":70,"value":13478,"toc":13709},[13479,13512,13635,13638,13671,13700],[73,13480,13481,13482,12917,13487,12917,13492,12917,13497,13502,13503,13508,13509,1852],{},"A web scraper written in Haskell that collected 17,000+ articles from\ntechnology publishers — ",[76,13483,13486],{"href":13484,"rel":13485},"https:\u002F\u002Fdeepmind.com\u002F",[80],"DeepMind",[76,13488,13491],{"href":13489,"rel":13490},"https:\u002F\u002Fwww.technologyreview.com\u002F",[80],"MIT Technology Review",[76,13493,13496],{"href":13494,"rel":13495},"https:\u002F\u002Fopenai.com\u002F",[80],"OpenAI",[76,13498,13501],{"href":13499,"rel":13500},"https:\u002F\u002Fsingularityhub.com\u002F",[80],"Singularity Hub",", and\n",[76,13504,13507],{"href":13505,"rel":13506},"https:\u002F\u002Ftechcrunch.com\u002F",[80],"TechCrunch"," — into an open dataset published on\n",[76,13510,27],{"href":13049,"rel":13511},[80],[73,13513,13514,13515,13518,13519,13524,13525,13530,13531,13565,13566,13569,13570,13573,13574,13577,13578,13581,13582,13585,13586,13589,13590,12442,13593,13596,13597,13600,13601,13604,13605,13607,13608,13611,13612,12861,13615,13618,13619,13622,13623,5452,13625,12917,13628,13631,13632,13634],{},"Extraction runs as an arrow pipeline. The parser (",[108,13516,13517],{},"MyData.Parser",") is built\non ",[76,13520,13523],{"href":13521,"rel":13522},"https:\u002F\u002Fwiki.haskell.org\u002FHXT",[80],"HXT",", whose\n",[76,13526,13529],{"href":13527,"rel":13528},"https:\u002F\u002Fwww.cse.chalmers.se\u002F~rjmh\u002Fafp-arrows.pdf",[80],"arrows"," generalize a\nplain function ",[116,13532,13534],{"className":13533},[119],[116,13535,13537,13556],{"className":13536,"ariaHidden":124},[123],[116,13538,13540,13543,13546,13549,13553],{"className":13539},[128],[116,13541],{"className":13542,"style":4022},[132],[116,13544,4115],{"className":13545},[137,138],[116,13547],{"className":13548,"style":145},[144],[116,13550,13552],{"className":13551},[149],"→",[116,13554],{"className":13555,"style":145},[144],[116,13557,13559,13562],{"className":13558},[128],[116,13560],{"className":13561,"style":133},[132],[116,13563,8916],{"className":13564},[137,138]," into a composable stage over an XML tree.\n",[108,13567,13568],{},"loadPage"," fetches the page with ",[108,13571,13572],{},"simpleHttp",", hands the bytes to\n",[108,13575,13576],{},"readString [withParseHTML yes, withWarnings no]",", and runs arrows over\nthe resulting DOM with ",[108,13579,13580],{},"runX",". Each field is its own small arrow chain:\n",[108,13583,13584],{},"getWords"," descends with ",[108,13587,13588],{},"\u002F\u002F>"," and merges paragraph and heading nodes with\nthe choice operator ",[108,13591,13592],{},"\u003C+>",[108,13594,13595],{},"hasName \"p\" \u003C+> hasName \"h1\" \u003C+> ...","), then\n",[108,13598,13599],{},"deep (isText >>> getText)"," pulls their text; ",[108,13602,13603],{},"getLinks"," selects ",[108,13606,76],{}," nodes\nand reads ",[108,13609,13610],{},"getAttrValue \"href\"","; ",[108,13613,13614],{},"getTitle",[108,13616,13617],{},"getYear"," do the same over\ntheir tags. The results assemble a ",[108,13620,13621],{},"WebPage"," record — ",[108,13624,12808],{},[108,13626,13627],{},"year",[108,13629,13630],{},"links",", and the body ",[108,13633,431],{}," as a prefix tree.",[246,13636],{"hash":13637},"725904e987e558aef2f9e5e16e1bfe76118505935853651432c86f40dcae0288",[73,13639,5131,13640,13643,13644,13647,13648,13651,13652,13655,13656,13659,13660,13663,13664,13667,13668,13670],{},[108,13641,13642],{},"Config"," record loaded from ",[108,13645,13646],{},"config.yml"," with ",[108,13649,13650],{},"Data.Yaml"," drives the run,\nkeeping the tuning in configuration rather than code: ",[108,13653,13654],{},"domains"," are the seed URLs, ",[108,13657,13658],{},"targets","\nare the keywords a page is scored against, ",[108,13661,13662],{},"limit"," caps the work queue,\nand ",[108,13665,13666],{},"wordcount"," sets how many keyword hits a page needs to be kept.\nRetargeting the scraper at a new publisher is a line in ",[108,13669,13646],{},", not\na change to the parser.",[73,13672,13673,13676,13677,13680,13681,13684,13685,13688,13689,13692,13693,13696,13697,13699],{},[108,13674,13675],{},"Main.iter"," walks each publisher's page graph outward from the seed URLs by\nbreadth-first search, holding the frontier as a queue and the visited URLs as\na ",[108,13678,13679],{},"Data.Set","; set difference (",[108,13682,13683],{},"\\\\",") drops links already\nseen, and ",[108,13686,13687],{},"isAllowed"," keeps the crawl inside the seed domains. Each fetched\npage's body is folded into a ",[108,13690,13691],{},"Trie"," of words, and ",[108,13694,13695],{},"hasKeyWords"," accepts the\npage only when at least ",[108,13698,13666],{}," targets are present — the filter that\nkept the collection on-topic across a run of 17,000-plus articles.",[73,13701,13702,13703,2344,13706,1852],{},"The result is cleaned, titled, dated article text, released open-source\nfor downstream mining. Collaborative project with\n",[76,13704,13451],{"href":13449,"rel":13705},[80],[76,13707,13456],{"href":13454,"rel":13708},[80],{"title":478,"searchDepth":479,"depth":479,"links":13710},[],"2023-11-04","A web scraper written in Haskell that collected 17,000+ articles from\ntechnology publishers — DeepMind,\nMIT Technology Review,\nOpenAI,\nSingularity Hub, and\nTechCrunch — into an open dataset published on\nHuggingFace.",{},"\u002Fprojects\u002Fdata-mining\u002Fai-tech-dataset",[13716,13717],"https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fgraphs\u002Frepresentations-and-traversal","https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fdata-structures\u002Fhash-tables","https:\u002F\u002Fgithub.com\u002Flostflux\u002Ffunctional-scraper",{"title":13476,"description":13712},"projects\u002Fdata-mining\u002Fai-tech-dataset","A concurrent web scraper in Haskell that collected 17,000+ technology\narticles into an open dataset, built from composable arrow pipelines.",[13723,2279,13724],"Haskell","Data Mining","tw4YU-vyC_siDlrQtislVADdnmFXKIxHsmGxxCE9jA8",{"id":13727,"title":13728,"body":13729,"date":13814,"description":13815,"extension":483,"featured":2354,"meta":13816,"navigation":484,"path":13817,"references":2282,"repo":13818,"seo":13819,"stem":13820,"summary":13821,"tag":13031,"tech":13822,"url":13748,"__hash__":13824},"projects\u002Fprojects\u002Fweb\u002Fslides.md","Dev Slides",{"type":70,"value":13730,"toc":13812},[13731,13751,13777],[73,13732,13733,13734,13739,13740,13745,13746,1852],{},"A personal presentation platform for my dev work, built on\n",[76,13735,13738],{"href":13736,"rel":13737},"https:\u002F\u002Fsli.dev",[80],"Slidev"," — the ",[76,13741,13744],{"href":13742,"rel":13743},"https:\u002F\u002Fvuejs.org",[80],"Vue","-based deck tool. It\nlives at ",[76,13747,13750],{"href":13748,"rel":13749},"https:\u002F\u002Fslides.amittai.studio",[80],"slides.amittai.studio",[73,13752,13753,13754,13757,13758,13761,13762,5452,13765,13768,13769,13772,13773,13776],{},"Every deck is Markdown: a single ",[108,13755,13756],{},"slides.md"," where ",[108,13759,13760],{},"---"," separates\nslides and per-slide frontmatter picks the layout and theme; the decks draw on\nSlidev's ",[108,13763,13764],{},"default",[108,13766,13767],{},"apple-basic",", and ",[108,13770,13771],{},"seriph"," themes. Because Slidev compiles\nMarkdown to Vue, a slide can hold more than text — Shiki-highlighted code and\nlive components like a ",[108,13774,13775],{},"Counter.vue"," dropped straight onto the page.",[73,13778,13779,13780,13782,13783,13786,13787,5452,13790,13793,13794,13797,13798,13801,13802,13807,13808,13811],{},"One root index fans out to many sub-decks. The root ",[108,13781,13756],{}," links out to\nstandalone decks — Dartmouth Robotics and a quadcopter project — each its own\nSlidev deck under ",[108,13784,13785],{},"children\u002F"," and each deployed to its own subdomain\n(",[108,13788,13789],{},"robotics.slides.amittai.studio",[108,13791,13792],{},"copter.slides.amittai.studio","). ",[108,13795,13796],{},"slidev build"," emits a static bundle to ",[108,13799,13800],{},"dist\u002F",", which ",[76,13803,13806],{"href":13804,"rel":13805},"https:\u002F\u002Fvercel.com",[80],"Vercel","\nserves from its edge with a catch-all rewrite to ",[108,13809,13810],{},"index.html",", so there is no\nbackend to run or scale.",{"title":478,"searchDepth":479,"depth":479,"links":13813},[],"2023-10-22","A personal presentation platform for my dev work, built on\nSlidev — the Vue-based deck tool. It\nlives at slides.amittai.studio.",{},"\u002Fprojects\u002Fweb\u002Fslides","https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fslides",{"title":13728,"description":13815},"projects\u002Fweb\u002Fslides","A personal presentation platform built on Slidev — decks authored in\nMarkdown, rendered as Vue, and served as static sites on Vercel.",[13823,13034,13744],"design","aBN86VpJMt39jmip1RQSdVLcaIud3nIdapu2de2X334",{"id":13826,"title":13827,"body":13828,"date":13990,"description":13991,"extension":483,"featured":2354,"meta":13992,"navigation":484,"path":13993,"references":2282,"repo":13994,"seo":13995,"stem":13996,"summary":13997,"tag":13031,"tech":13998,"url":2282,"__hash__":13999},"projects\u002Fprojects\u002Fweb\u002Frust-api.md","Rust API",{"type":70,"value":13829,"toc":13988},[13830,13861,13864,13928,13957,13960,13974],[73,13831,13832,13833,13838,13839,13844,13845,13849,13850,13854,13855,13860],{},"A REST API written in ",[76,13834,13837],{"href":13835,"rel":13836},"https:\u002F\u002Fwww.rust-lang.org",[80],"Rust"," with the\n",[76,13840,13843],{"href":13841,"rel":13842},"https:\u002F\u002Frocket.rs",[80],"Rocket"," framework and a ",[76,13846,13036],{"href":13847,"rel":13848},"https:\u002F\u002Fwww.mongodb.com",[80],"\nbackend. Building the same service in ",[76,13851,13034],{"href":13852,"rel":13853},"https:\u002F\u002Fwww.typescriptlang.org",[80],"\non ",[76,13856,13859],{"href":13857,"rel":13858},"https:\u002F\u002Fexpressjs.com",[80],"Express"," is routine; this was a proof-of-concept for a\nlarger project, testing whether Rust's guarantees carry into everyday web\nplumbing.",[73,13862,13863],{},"I reached for Rust here because it offers C-like performance without a garbage\ncollector, and its borrow checker rules out use-after-free and data races at\ncompile time rather than at runtime. For an API expected to stay up under\nconcurrent load, that moves a class of failures from production to the build.",[73,13865,13866,13867,13870,13871,13874,13875,5452,13878,13881,13882,13885,13886,13889,13890,13893,13894,13897,13898,13901,13902,13904,13905,13908,13909,13912,13913,13916,13917,12861,13920,13923,13924,13927],{},"The service is a small events API built on one model and four routes. A single ",[108,13868,13869],{},"Event","\nstruct in ",[108,13872,13873],{},"events.rs"," carries a ",[108,13876,13877],{},"name",[108,13879,13880],{},"description",", a BSON ",[108,13883,13884],{},"time",", a\n",[108,13887,13888],{},"location",", and a ",[108,13891,13892],{},"Vec\u003CString>"," of ",[108,13895,13896],{},"participants",", plus an optional ",[108,13899,13900],{},"_id"," that\nserde skips when it is absent — so a client can ",[108,13903,12970],{}," an event without inventing\nan id, and Mongo mints the ",[108,13906,13907],{},"ObjectId"," on insert. ",[108,13910,13911],{},"main.rs"," mounts exactly four\nhandlers: ",[108,13914,13915],{},"GET \u002F"," (a health check), ",[108,13918,13919],{},"GET \u002Fevents",[108,13921,13922],{},"GET \u002Fevents\u002F\u003Cid>"," to read\nall events or one by id, and ",[108,13925,13926],{},"PUT \u002Fevents"," to insert one. It is create-and-read,\nnot full CRUD.",[73,13929,13930,13931,13933,13934,13936,13937,13940,13941,13944,13945,13948,13949,13952,13953,13956],{},"Rocket owns the request lifecycle. Routes are ordinary async functions\nannotated with a method and path. Rocket parses the path and the JSON body into\ntyped arguments before the handler runs, so a ",[108,13932,12970],{}," whose body does not\ndeserialize into an ",[108,13935,13869],{}," is rejected before any logic executes. The Mongo\nclient connects once at startup — ",[108,13938,13939],{},"Database::init"," reads ",[108,13942,13943],{},"MONGODB_URI"," from the\nenvironment and opens a handle to the ",[108,13946,13947],{},"events"," collection — and that ",[108,13950,13951],{},"Database","\nlives in Rocket's managed state, so every handler borrows the same shared handle\nthrough a ",[108,13954,13955],{},"&State\u003CDatabase>"," argument instead of opening its own.",[246,13958],{"hash":13959},"649e25ed7aa2c664dd102289ee0fd62361323c62e443d5bf0b3945c9236ad2d5",[73,13961,13962,13963,13966,13967,13970,13971,13973],{},"Serde bridges the three type systems in play. A document crosses three representations,\nJSON on the wire, BSON in the database, and a Rust struct in the handler, and\nserde derives the serialization and deserialization between them straight from\nthe struct definition. The friction is front-loaded: getting the types and\nlifetimes to line up across async handlers is the work, after which the compiler\nguarantees the wiring is sound. Two small macros round it off — ",[108,13964,13965],{},"db!"," builds and\nunwraps the connection at launch, and ",[108,13968,13969],{},"event!"," constructs an ",[108,13972,13869],{}," from its\nfields.",[73,13975,13976,13977,2344,13982,13987],{},"This service backs the live comment features on\n",[76,13978,13981],{"href":13979,"rel":13980},"https:\u002F\u002Famittai.space",[80],"my blog",[76,13983,13986],{"href":13984,"rel":13985},"https:\u002F\u002Fnotes.amittai.studio",[80],"my reference notes"," — open any article\nand leave a note to see it at work.",{"title":478,"searchDepth":479,"depth":479,"links":13989},[],"2023-10-09","A REST API written in Rust with the\nRocket framework and a MongoDB\nbackend. Building the same service in TypeScript\non Express is routine; this was a proof-of-concept for a\nlarger project, testing whether Rust's guarantees carry into everyday web\nplumbing.",{},"\u002Fprojects\u002Fweb\u002Frust-api","https:\u002F\u002Fgithub.com\u002Fentendr\u002Fdemo-rs-api",{"title":13827,"description":13991},"projects\u002Fweb\u002Frust-api","A proof-of-concept REST API in Rust with the Rocket framework and a MongoDB\nbackend, trading Express familiarity for compile-time memory safety.",[13837,13843,13036],"knzSYJMy_tomwwLhWJjRYgwPwLXBjN8J36YCJ4XD1rk",{"id":14001,"title":14002,"body":14003,"date":14932,"description":14933,"extension":483,"featured":484,"meta":14934,"navigation":484,"path":14935,"references":14936,"repo":14938,"seo":14939,"stem":14940,"summary":14941,"tag":14942,"tech":14943,"url":2282,"__hash__":14945},"projects\u002Fprojects\u002Fdeep-learning\u002Ftransfusion.md","Generative Pre-trained Transformer",{"type":70,"value":14004,"toc":14930},[14005,14025,14028,14299,14481,14484,14525,14531,14639,14642,14911],[73,14006,14007,14008,14013,14014,14017,14018,14024],{},"A character-level\n",[76,14009,14012],{"href":14010,"rel":14011},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGenerative_pre-trained_transformer",[80],"GPT","\nimplemented from scratch in PyTorch — every module written out by hand, no\n",[108,14015,14016],{},"nn.Transformer"," shortcuts. It trains on a corpus of 2023 AI and technology\nwriting (the\n",[76,14019,14021],{"href":13049,"rel":14020},[80],[108,14022,14023],{},"siavava\u002Fai-tech-articles","\ndataset, filtered to that year), building its vocabulary from the sorted set\nof characters in the text, and generates one character at a time.",[73,14026,14027],{},"Attention works as a soft lookup: each token emits a query, a key, and a\nvalue, and attends to the others by how well its query matches their keys:",[116,14029,14031],{"className":14030},[702],[116,14032,14034],{"className":14033},[119],[116,14035,14037,14085],{"className":14036,"ariaHidden":124},[123],[116,14038,14040,14043,14049,14052,14055,14058,14061,14064,14067,14070,14073,14076,14079,14082],{"className":14039},[128],[116,14041],{"className":14042,"style":552},[132],[116,14044,14046],{"className":14045},[1126],[116,14047,5162],{"className":14048},[137,3388],[116,14050,562],{"className":14051},[561],[116,14053,5169],{"className":14054},[137,138],[116,14056,594],{"className":14057},[593],[116,14059],{"className":14060,"style":279},[144],[116,14062,2667],{"className":14063,"style":2666},[137,138],[116,14065,594],{"className":14066},[593],[116,14068],{"className":14069,"style":279},[144],[116,14071,5188],{"className":14072,"style":570},[137,138],[116,14074,652],{"className":14075},[651],[116,14077],{"className":14078,"style":145},[144],[116,14080,150],{"className":14081},[149],[116,14083],{"className":14084,"style":145},[144],[116,14086,14088,14091,14097,14100,14103,14290,14293,14296],{"className":14087},[128],[116,14089],{"className":14090,"style":5207},[132],[116,14092,14094],{"className":14093},[1126],[116,14095,5214],{"className":14096},[137,3388],[116,14098],{"className":14099,"style":5218},[144],[116,14101],{"className":14102,"style":279},[144],[116,14104,14106,14112,14284],{"className":14105},[946],[116,14107,14109],{"className":14108,"style":1087},[561,1086],[116,14110,562],{"className":14111},[1091,748],[116,14113,14115,14118,14281],{"className":14114},[137],[116,14116],{"className":14117},[561,4427],[116,14119,14121],{"className":14120},[4431],[116,14122,14124,14273],{"className":14123},[168,169],[116,14125,14127,14270],{"className":14126},[173],[116,14128,14130,14222,14230],{"className":14129,"style":5249},[177],[116,14131,14132,14135],{"style":5252},[116,14133],{"className":14134,"style":1119},[187],[116,14136,14138],{"className":14137},[137],[116,14139,14141],{"className":14140},[137,164],[116,14142,14144,14214],{"className":14143},[168,169],[116,14145,14147,14211],{"className":14146},[173],[116,14148,14150,14199],{"className":14149,"style":5271},[177],[116,14151,14153,14156],{"className":14152,"style":3376},[182],[116,14154],{"className":14155,"style":1119},[187],[116,14157,14159],{"className":14158,"style":5281},[137],[116,14160,14162,14165],{"className":14161},[137],[116,14163,5288],{"className":14164},[137,138],[116,14166,14168],{"className":14167},[725],[116,14169,14171,14191],{"className":14170},[168,169],[116,14172,14174,14188],{"className":14173},[173],[116,14175,14177],{"className":14176,"style":5301},[177],[116,14178,14179,14182],{"style":3584},[116,14180],{"className":14181,"style":742},[187],[116,14183,14185],{"className":14184},[746,747,748,749],[116,14186,4382],{"className":14187,"style":4381},[137,138,749],[116,14189,234],{"className":14190},[233],[116,14192,14194],{"className":14193},[173],[116,14195,14197],{"className":14196,"style":762},[177],[116,14198],{},[116,14200,14201,14204],{"style":5326},[116,14202],{"className":14203,"style":1119},[187],[116,14205,14207],{"className":14206,"style":5333},[216],[219,14208,14209],{"xmlns":221,"width":222,"height":5336,"viewBox":5337,"preserveAspectRatio":225},[227,14210],{"d":5340},[116,14212,234],{"className":14213},[233],[116,14215,14217],{"className":14216},[173],[116,14218,14220],{"className":14219,"style":5350},[177],[116,14221],{},[116,14223,14224,14227],{"style":4597},[116,14225],{"className":14226,"style":1119},[187],[116,14228],{"className":14229,"style":4605},[4604],[116,14231,14232,14235],{"style":4608},[116,14233],{"className":14234,"style":1119},[187],[116,14236,14238,14241],{"className":14237},[137],[116,14239,5169],{"className":14240},[137,138],[116,14242,14244,14247],{"className":14243},[137],[116,14245,2667],{"className":14246,"style":2666},[137,138],[116,14248,14250],{"className":14249},[725],[116,14251,14253],{"className":14252},[168],[116,14254,14256],{"className":14255},[173],[116,14257,14259],{"className":14258,"style":1907},[177],[116,14260,14261,14264],{"style":1167},[116,14262],{"className":14263,"style":742},[187],[116,14265,14267],{"className":14266},[746,747,748,749],[116,14268,1006],{"className":14269},[137,749],[116,14271,234],{"className":14272},[233],[116,14274,14276],{"className":14275},[173],[116,14277,14279],{"className":14278,"style":5413},[177],[116,14280],{},[116,14282],{"className":14283},[651,4427],[116,14285,14287],{"className":14286,"style":1087},[651,1086],[116,14288,652],{"className":14289},[1091,748],[116,14291],{"className":14292,"style":279},[144],[116,14294,5188],{"className":14295,"style":570},[137,138],[116,14297,594],{"className":14298},[593],[73,14300,14301,14302,14398,14399,14402,14403,14406,14407,14410,14411,14414,14415,14418,14419,14422,14423,14480],{},"with the ",[116,14303,14305],{"className":14304},[119],[116,14306,14308],{"className":14307,"ariaHidden":124},[123],[116,14309,14311,14314],{"className":14310},[128],[116,14312],{"className":14313,"style":5549},[132],[116,14315,14317],{"className":14316},[137,164],[116,14318,14320,14390],{"className":14319},[168,169],[116,14321,14323,14387],{"className":14322},[173],[116,14324,14326,14375],{"className":14325,"style":5271},[177],[116,14327,14329,14332],{"className":14328,"style":3376},[182],[116,14330],{"className":14331,"style":1119},[187],[116,14333,14335],{"className":14334,"style":5281},[137],[116,14336,14338,14341],{"className":14337},[137],[116,14339,5288],{"className":14340},[137,138],[116,14342,14344],{"className":14343},[725],[116,14345,14347,14367],{"className":14346},[168,169],[116,14348,14350,14364],{"className":14349},[173],[116,14351,14353],{"className":14352,"style":5301},[177],[116,14354,14355,14358],{"style":3584},[116,14356],{"className":14357,"style":742},[187],[116,14359,14361],{"className":14360},[746,747,748,749],[116,14362,4382],{"className":14363,"style":4381},[137,138,749],[116,14365,234],{"className":14366},[233],[116,14368,14370],{"className":14369},[173],[116,14371,14373],{"className":14372,"style":762},[177],[116,14374],{},[116,14376,14377,14380],{"style":5326},[116,14378],{"className":14379,"style":1119},[187],[116,14381,14383],{"className":14382,"style":5333},[216],[219,14384,14385],{"xmlns":221,"width":222,"height":5336,"viewBox":5337,"preserveAspectRatio":225},[227,14386],{"d":5340},[116,14388,234],{"className":14389},[233],[116,14391,14393],{"className":14392},[173],[116,14394,14396],{"className":14395,"style":5350},[177],[116,14397],{}," keeping dot products in softmax's well-behaved\nrange. In code a ",[108,14400,14401],{},"Head"," is three bias-free ",[108,14404,14405],{},"nn.Linear"," projections into a\n",[108,14408,14409],{},"head_size"," subspace, a registered lower-triangular ",[108,14412,14413],{},"tril"," buffer for the\n",[505,14416,14417],{},"causal mask"," that zeroes attention to future positions, and dropout on\nthe weights. ",[108,14420,14421],{},"MultiHeadAttention"," runs six such heads in parallel\n(",[116,14424,14426],{"className":14425},[119],[116,14427,14429,14451,14470],{"className":14428,"ariaHidden":124},[123],[116,14430,14432,14436,14442,14445,14448],{"className":14431},[128],[116,14433],{"className":14434,"style":14435},[132],"height:1.0044em;vertical-align:-0.31em;",[116,14437,14439],{"className":14438},[137,431],[116,14440,14409],{"className":14441},[137],[116,14443],{"className":14444,"style":145},[144],[116,14446,150],{"className":14447},[149],[116,14449],{"className":14450,"style":145},[144],[116,14452,14454,14457,14461,14464,14467],{"className":14453},[128],[116,14455],{"className":14456,"style":552},[132],[116,14458,14460],{"className":14459},[137],"384\u002F6",[116,14462],{"className":14463,"style":145},[144],[116,14465,150],{"className":14466},[149],[116,14468],{"className":14469,"style":145},[144],[116,14471,14473,14476],{"className":14472},[128],[116,14474],{"className":14475,"style":1890},[132],[116,14477,14479],{"className":14478},[137],"64",") and projects their concatenation back\nto the model width, so different heads track different relationships.",[246,14482],{"hash":14483},"63bdd438904711970063deefa57c2877705e95914efd615eb39c8c2baaa30d58",[73,14485,5131,14486,14489,14490,14493,14494,14497,14498,14501,14502,14505,14506,14509,14510,14513,14514,14517,14518,14521,14522,1852],{},[108,14487,14488],{},"Block"," is pre-norm: ",[108,14491,14492],{},"x = x + sa(ln1(x))"," then\n",[108,14495,14496],{},"x = x + ffwd(ln2(x))",", where ",[108,14499,14500],{},"FeedFoward"," widens to four times the model\ndimension through a ",[108,14503,14504],{},"ReLU"," and back. ",[108,14507,14508],{},"GPTLanguageModel"," stacks six of these\nin an ",[108,14511,14512],{},"nn.Sequential",", fronted by a token embedding table and a learned\nposition embedding table — attention alone is permutation-invariant, so the\npositions supply order — and closed by a final ",[108,14515,14516],{},"LayerNorm"," and an ",[108,14519,14520],{},"lm_head","\nlinear tie to the vocabulary. Weights initialize from a normal with standard\ndeviation ",[108,14523,14524],{},"0.02",[73,14526,14527,14528,14530],{},"The trained configuration (",[108,14529,13646],{},") is small enough to run on one GPU:",[10278,14532,14533,14551,14633],{},[10281,14534,14535,14538,14539,14542,14543,14546,14547,14550],{},[505,14536,14537],{},"context"," 256 tokens, ",[505,14540,14541],{},"model width"," 384, ",[505,14544,14545],{},"heads"," 6, ",[505,14548,14549],{},"layers"," 6.",[10281,14552,14553,14556,14557,14560,14561,14564,14565,1852],{},[505,14554,14555],{},"dropout"," 0.2, ",[505,14558,14559],{},"batch"," 32, ",[505,14562,14563],{},"AdamW"," at learning rate ",[116,14566,14568],{"className":14567},[119],[116,14569,14571,14589],{"className":14570,"ariaHidden":124},[123],[116,14572,14574,14577,14580,14583,14586],{"className":14573},[128],[116,14575],{"className":14576,"style":1871},[132],[116,14578,2564],{"className":14579},[137],[116,14581],{"className":14582,"style":570},[144],[116,14584,439],{"className":14585},[574],[116,14587],{"className":14588,"style":570},[144],[116,14590,14592,14595,14598],{"className":14591},[128],[116,14593],{"className":14594,"style":1152},[132],[116,14596,345],{"className":14597},[137],[116,14599,14601,14604],{"className":14600},[137],[116,14602,331],{"className":14603},[137],[116,14605,14607],{"className":14606},[725],[116,14608,14610],{"className":14609},[168],[116,14611,14613],{"className":14612},[173],[116,14614,14616],{"className":14615,"style":1152},[177],[116,14617,14618,14621],{"style":1167},[116,14619],{"className":14620,"style":742},[187],[116,14622,14624],{"className":14623},[746,747,748,749],[116,14625,14627,14630],{"className":14626},[137,749],[116,14628,1610],{"className":14629},[137,749],[116,14631,5993],{"className":14632},[137,749],[10281,14634,14635,14638],{},[505,14636,14637],{},"10,000 iterations",", with train and validation loss estimated over 200\nbatches every 500 steps.",[73,14640,14641],{},"Training minimizes cross-entropy",[116,14643,14645],{"className":14644},[702],[116,14646,14648],{"className":14647},[119],[116,14649,14651,14669],{"className":14650,"ariaHidden":124},[123],[116,14652,14654,14657,14660,14663,14666],{"className":14653},[128],[116,14655],{"className":14656,"style":272},[132],[116,14658,4716],{"className":14659},[137,4715],[116,14661],{"className":14662,"style":145},[144],[116,14664,150],{"className":14665},[149],[116,14667],{"className":14668,"style":145},[144],[116,14670,14672,14676,14679,14682,14731,14734,14740,14743,14783,14786,14789,14905,14908],{"className":14671},[128],[116,14673],{"className":14674,"style":14675},[132],"height:2.3em;vertical-align:-1.25em;",[116,14677,1610],{"className":14678},[137],[116,14680],{"className":14681,"style":279},[144],[116,14683,14685],{"className":14684},[1126,3245],[116,14686,14688,14722],{"className":14687},[168,169],[116,14689,14691,14719],{"className":14690},[173],[116,14692,14694,14709],{"className":14693,"style":3417},[177],[116,14695,14697,14700],{"style":14696},"top:-1.9em;margin-left:0em;",[116,14698],{"className":14699,"style":3424},[187],[116,14701,14703],{"className":14702},[746,747,748,749],[116,14704,14706],{"className":14705},[137,749],[116,14707,287],{"className":14708},[137,138,749],[116,14710,14711,14714],{"style":3445},[116,14712],{"className":14713,"style":3424},[187],[116,14715,14716],{},[116,14717,1130],{"className":14718},[1126,1127,3454],[116,14720,234],{"className":14721},[233],[116,14723,14725],{"className":14724},[173],[116,14726,14729],{"className":14727,"style":14728},[177],"height:1.25em;",[116,14730],{},[116,14732],{"className":14733,"style":279},[144],[116,14735,14737],{"className":14736},[1126],[116,14738,4745],{"className":14739,"style":4744},[137,3388],[116,14741],{"className":14742,"style":279},[144],[116,14744,14746,14749],{"className":14745},[137],[116,14747,73],{"className":14748},[137,138],[116,14750,14752],{"className":14751},[725],[116,14753,14755,14775],{"className":14754},[168,169],[116,14756,14758,14772],{"className":14757},[173],[116,14759,14761],{"className":14760,"style":5301},[177],[116,14762,14763,14766],{"style":3584},[116,14764],{"className":14765,"style":742},[187],[116,14767,14769],{"className":14768},[746,747,748,749],[116,14770,11426],{"className":14771,"style":205},[137,138,749],[116,14773,234],{"className":14774},[233],[116,14776,14778],{"className":14777},[173],[116,14779,14781],{"className":14780,"style":762},[177],[116,14782],{},[116,14784],{"className":14785,"style":5218},[144],[116,14787],{"className":14788,"style":279},[144],[116,14790,14792,14795,14844,14847,14850,14853,14902],{"className":14791},[946],[116,14793,562],{"className":14794,"style":1087},[561,1086],[116,14796,14798,14801],{"className":14797},[137],[116,14799,566],{"className":14800},[137,138],[116,14802,14804],{"className":14803},[725],[116,14805,14807,14836],{"className":14806},[168,169],[116,14808,14810,14833],{"className":14809},[173],[116,14811,14813],{"className":14812,"style":4068},[177],[116,14814,14815,14818],{"style":3584},[116,14816],{"className":14817,"style":742},[187],[116,14819,14821],{"className":14820},[746,747,748,749],[116,14822,14824,14827,14830],{"className":14823},[137,749],[116,14825,287],{"className":14826},[137,138,749],[116,14828,575],{"className":14829},[574,749],[116,14831,345],{"className":14832},[137,749],[116,14834,234],{"className":14835},[233],[116,14837,14839],{"className":14838},[173],[116,14840,14842],{"className":14841,"style":10931},[177],[116,14843],{},[116,14845],{"className":14846,"style":145},[144],[116,14848,4389],{"className":14849},[149],[116,14851],{"className":14852,"style":145},[144],[116,14854,14856,14859],{"className":14855},[137],[116,14857,566],{"className":14858},[137,138],[116,14860,14862],{"className":14861},[725],[116,14863,14865,14893],{"className":14864},[168,169],[116,14866,14868,14890],{"className":14867},[173],[116,14869,14872],{"className":14870,"style":14871},[177],"height:0.2952em;",[116,14873,14874,14877],{"style":3584},[116,14875],{"className":14876,"style":742},[187],[116,14878,14880],{"className":14879},[746,747,748,749],[116,14881,14883,14887],{"className":14882},[137,749],[116,14884,14886],{"className":14885},[149,749],"≤",[116,14888,287],{"className":14889},[137,138,749],[116,14891,234],{"className":14892},[233],[116,14894,14896],{"className":14895},[173],[116,14897,14900],{"className":14898,"style":14899},[177],"height:0.2452em;",[116,14901],{},[116,14903,652],{"className":14904,"style":1087},[651,1086],[116,14906],{"className":14907,"style":279},[144],[116,14909,594],{"className":14910},[593],[73,14912,14913,14914,14917,14918,14921,14922,14925,14926,14929],{},"and ",[108,14915,14916],{},"generate"," samples autoregressively — crop the context to the last 256\ntokens, softmax the final logits, draw one character with\n",[108,14919,14920],{},"torch.multinomial",", append it, and repeat. A FastAPI layer (",[108,14923,14924],{},"main.py",") loads\na saved checkpoint and exposes ",[108,14927,14928],{},"GET \u002Fapi\u002F{query}",", returning 150 generated\ncharacters as JSON.",{"title":478,"searchDepth":479,"depth":479,"links":14931},[],"2023-09-17","A character-level\nGPT\nimplemented from scratch in PyTorch — every module written out by hand, no\nnn.Transformer shortcuts. It trains on a corpus of 2023 AI and technology\nwriting (the\nsiavava\u002Fai-tech-articles\ndataset, filtered to that year), building its vocabulary from the sorted set\nof characters in the text, and generates one character at a time.",{},"\u002Fprojects\u002Fdeep-learning\u002Ftransfusion",[14937,488],"https:\u002F\u002Fnotes.amittai.studio\u002Fdeep-learning","https:\u002F\u002Fgithub.com\u002Flostflux\u002Ftransfusion",{"title":14002,"description":14933},"projects\u002Fdeep-learning\u002Ftransfusion","A GPT built from scratch in PyTorch — causal self-attention, learned\npositional embeddings, and six pre-norm transformer blocks — trained\ncharacter by character on a corpus of 2023 AI articles and served behind a\nFastAPI endpoint.","deep learning",[2279,3991,14944],"Deep Learning","HWrmPXQzjQcCE-UsJj35LgBqW3veAfrcf1F7kWGfyc0",{"id":14947,"title":14948,"body":14949,"date":15288,"description":15289,"extension":483,"featured":2354,"meta":15290,"navigation":484,"path":15291,"references":2282,"repo":15292,"seo":15293,"stem":15294,"summary":15295,"tag":13031,"tech":15296,"url":13979,"__hash__":15297},"projects\u002Fprojects\u002Fweb\u002Fblog.md","Blog",{"type":70,"value":14950,"toc":15282},[14951,14980,15035,15060,15065,15135,15138,15142,15175,15179,15250,15253,15257,15270],[73,14952,14953,14954,14958,14959,14962,14963,14968,14969,14974,14975,1852],{},"A ground-up redesign of my personal blog, with a new domain to go with it\nat ",[76,14955,14957],{"href":13979,"rel":14956},[80],"amittai.space",". It is built with ",[76,14960,99],{"href":97,"rel":14961},[80]," 4 (Vue) and\n",[76,14964,14967],{"href":14965,"rel":14966},"https:\u002F\u002Fsass-lang.com",[80],"Sass"," on ",[76,14970,14973],{"href":14971,"rel":14972},"https:\u002F\u002Fbun.sh",[80],"Bun",", statically generated and deployed on\n",[76,14976,14979],{"href":14977,"rel":14978},"https:\u002F\u002Fnetlify.com",[80],"Netlify",[73,14981,14982,14983,14986,14987,14990,14991,14994,14995,15000,15001,15004,15005,15010,15011,15016,15017,15020,15021,13611,15024,15027,15028,13889,15031,15034],{},"The content compiles through a build pipeline rather than sitting as a\nfolder of HTML. Posts are Markdown in a ",[76,14984,105],{"href":103,"rel":14985},[80]," collection;\nbuild-time hooks rewrite each file before parsing (display-math\n",[108,14988,14989],{},"tikzpicture"," blocks become fenced ",[108,14992,14993],{},"tikz",", Markdown quotes become\ntypographic ones), then every TikZ block is rendered to SVG with\n",[76,14996,14999],{"href":14997,"rel":14998},"https:\u002F\u002Fgithub.com\u002Fprinsss\u002Fnode-tikzjax",[80],"node-tikzjax",", math runs through\n",[108,15002,15003],{},"rehype-katex"," against a custom macro layer, and code is highlighted by\n",[76,15006,15009],{"href":15007,"rel":15008},"https:\u002F\u002Fshiki.style",[80],"Shiki",". Parsed pages land in a\n",[76,15012,15015],{"href":15013,"rel":15014},"https:\u002F\u002Fwww.sqlite.org",[80],"SQLite"," store (",[108,15018,15019],{},"better-sqlite3","), each keeping its\npost-transform ",[108,15022,15023],{},"rawbody",[108,15025,15026],{},"nuxi generate"," then crawls the link graph and\nfreezes the site to static files, prerendering RSS, Atom, and JSON feeds, a\nsitemap, an ",[108,15029,15030],{},"llms.txt",[108,15032,15033],{},"\u002Fraw\u002F*.md"," route off the same store.",[73,15036,15037,15038,15041,15042,15047,15048,15051,15052,15055,15056,15059],{},"A live layer sits on top of the otherwise static pages. The browser opens\none WebSocket, once, via a ",[108,15039,15040],{},"useSocket"," singleton to a companion Rust service\n(",[76,15043,15046],{"href":15044,"rel":15045},"https:\u002F\u002Factix.rs",[80],"Actix-Web"," + ",[76,15049,13036],{"href":13847,"rel":15050},[80],") at ",[108,15053,15054],{},"api.amittai.studio\u002Fconnect",".\nEvery frame is tagged with a ",[108,15057,15058],{},"scope",", and each store subscribes only to the\nscopes it cares about; the connection queues messages while offline and\nreconnects on its own. Four features ride it.",[15061,15062,15064],"h2",{"id":15063},"comments","Comments",[73,15066,15067,15068,15073,15074,15076,15077,15080,15081,15083,15084,15087,15088,15091,15092,15094,15095,15098,15099,15101,15102,15105,15106,15109,15110,15115,15116,15119,15120,15123,15124,15127,15128,15130,15131,15134],{},"Comments are written in a ",[76,15069,15072],{"href":15070,"rel":15071},"https:\u002F\u002Ftiptap.dev",[80],"TipTap"," editor that emits two\nfields, ",[108,15075,431],{}," (plain) and ",[108,15078,15079],{},"markup"," (pre-rendered HTML). A new comment goes up\nas a ",[108,15082,15063],{},"-scope ",[108,15085,15086],{},"create"," frame. The service parses the scope, writes a\n",[108,15089,15090],{},"BlogComment"," into MongoDB's ",[108,15093,15063],{}," collection — stamping ",[108,15096,15097],{},"created_time",",\nzeroing ",[108,15100,12823],{},", and, for a reply, pushing the new id into the parent's\n",[108,15103,15104],{},"replies"," array — then publishes a ",[108,15107,15108],{},"CommentEvent"," on a\n",[76,15111,15114],{"href":15112,"rel":15113},"https:\u002F\u002Ftokio.rs",[80],"Tokio"," broadcast channel. The socket forwards that event to\na peer only when the peer's ",[442,15117,15118],{},"active path"," matches the comment's page; that path\nis set by a separate ",[108,15121,15122],{},"watch"," frame and is the same filter that gates live view\ncounts. Replies are stored flat (each document keeps a ",[108,15125,15126],{},"reply_to"," pointer and a\n",[108,15129,15104],{}," id list) and reassembled into a nested tree in memory on read.\nPrivate notes are comments with ",[108,15132,15133],{},"is_private"," set: the list query returns public\ncomments plus the caller's own private ones.",[246,15136],{"hash":15137},"4ece7e0a8939fb6590ff52a245f4475fb131455d3bd8b3ae1e0e7743ca6b9a07",[15061,15139,15141],{"id":15140},"inline-highlights","Inline highlights",[73,15143,15144,15145,15147,15148,15151,15152,15155,15156,15158,15159,15162,15163,15166,15167,15170,15171,15174],{},"A highlight is a comment, not a separate record. When you select text, the\nanchor is serialized into the comment's ",[108,15146,15079],{}," string as ",[108,15149,15150],{},"scope:index|quoted text"," followed by an occurrence index and the words on either side, joined by\nASCII unit separators. No DOM offsets are stored, so the anchor survives a\nre-render. On load, ",[108,15153,15154],{},"applyHighlights"," groups the page's comments by ",[108,15157,15079],{},",\nnormalizes the article's text, and searches for each quote inside\n",[108,15160,15161],{},".content-container","; when a quote appears more than once it disambiguates\nfirst by the saved context words, then by the occurrence index, and wraps the\nmatched range in a ",[108,15164,15165],{},"\u003Cmark>"," with a margin annotation. Because highlights are\ncomments, they arrive over the same socket and light up live for everyone on\nthe same page. A highlight can also be shared as a link: ",[108,15168,15169],{},"shareMarkup"," packs\nthe anchor into a ",[108,15172,15173],{},"?hl=...&by=..."," query, and the recipient's page finds the\ntext and marks it green with the sharer's name on hover.",[15061,15176,15178],{"id":15177},"now-playing","Now playing",[73,15180,15181,15182,5452,15185,5452,15188,5452,15191,15194,15195,15198,15199,15201,15202,15205,15206,15209,15210,15213,15214,15217,15218,15221,15222,15225,15226,15229,15230,15233,15234,15237,15238,15241,15242,15245,15246,15249],{},"The dynamic island carries two independent things. Owner-published status\nslots — ",[108,15183,15184],{},"watching",[108,15186,15187],{},"reading",[108,15189,15190],{},"working_on",[108,15192,15193],{},"status"," — live in the ",[108,15196,15197],{},"now","\nscope: each edit is written to a MongoDB ",[108,15200,15197],{}," collection with a TTL on\n",[108,15203,15204],{},"expires_at",", and the write broadcasts a ",[108,15207,15208],{},"NowEvent"," to ",[442,15211,15212],{},"every"," connected\nclient, so all islands update at once. Music is separate. The ",[108,15215,15216],{},"playback"," scope\nis request-and-reply, on demand: when the page asks for the current track, the\nservice spawns a task that calls the Spotify Web API through ",[108,15219,15220],{},"SpotifyClient",".\nThat client holds an OAuth token, refreshing it against ",[108,15223,15224],{},"accounts.spotify.com","\nwith a stored refresh token, then hits ",[108,15227,15228],{},"me\u002Fplayer\u002Fcurrently-playing","; a ",[108,15231,15232],{},"204","\n(nothing playing) falls back to the most recent track from ",[108,15235,15236],{},"recently-played",".\nSpotify dropped ",[108,15239,15240],{},"preview_url"," from that response, so the client scrapes each\ntrack's ",[108,15243,15244],{},"\u002Fembed\u002F"," page for the ",[108,15247,15248],{},"audioPreview"," URL. Nothing is polled\nserver-side and there are no webhooks; the reply returns only to the client\nthat asked.",[246,15251],{"hash":15252},"11e17666cf01292f961ce815e17d60feafbdf1730d1f102a0cfa72ccf6d71023",[15061,15254,15256],{"id":15255},"view-counts","View counts",[73,15258,15259,15260,15262,15263,15265,15266,15269],{},"View counts are never requested directly. When a client's ",[108,15261,15122],{}," path\nchanges, the service atomically increments that route's document in the ",[108,15264,12820],{},"\ncollection and broadcasts the new total; a client sees the update only for the\npage it is on, with the archive view the one exception, which receives every\nroute's count. A second counter tracks presence: an atomic client tally moves\non each connect and disconnect and is broadcast to all sockets as a live\nreader count. A REST-plus-SSE ",[108,15267,15268],{},"\u002Fviews\u002F"," route, backed by a MongoDB change\nstream with a heartbeat, mirrors the same data for consumers that are not on\nthe socket.",[73,15271,15272,15273,15278,15279,15281],{},"The visual language follows ",[76,15274,15277],{"href":15275,"rel":15276},"https:\u002F\u002Fminimalism.com",[80],"minimalism",": a restrained type\nscale, generous whitespace, few colors. Type, color, and spacing rules live\nin shared Sass partials rather than per-component scopes, so a single change\npropagates everywhere, and a light and dark color mode plus a stricter \"Rams\nmode\" toggle (applied before first paint to avoid a flash) sit on top. The\nmove to\n",[108,15280,14957],{}," was the occasion to retire the old design entirely rather\nthan patch it, so nothing carried over except the writing.",{"title":478,"searchDepth":479,"depth":479,"links":15283},[15284,15285,15286,15287],{"id":15063,"depth":479,"text":15064},{"id":15140,"depth":479,"text":15141},{"id":15177,"depth":479,"text":15178},{"id":15255,"depth":479,"text":15256},"2023-08-21","A ground-up redesign of my personal blog, with a new domain to go with it\nat amittai.space. It is built with Nuxt 4 (Vue) and\nSass on Bun, statically generated and deployed on\nNetlify.",{},"\u002Fprojects\u002Fweb\u002Fblog","https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fblog",{"title":14948,"description":15289},"projects\u002Fweb\u002Fblog","A ground-up redesign of my personal blog — statically generated with Nuxt\nand SCSS, deployed on Netlify at amittai.space, over a live layer of\ncomments, inline highlights, a Spotify-fed dynamic island, and view counts\nserved by a Rust WebSocket API.",[99,13034,14967],"gvAxmdv8_nOgvZ_tv4bxx71y8v0_H0PRv0ZILdOwNNk",{"id":15299,"title":15300,"body":15301,"date":15288,"description":15338,"extension":483,"featured":2354,"meta":15339,"navigation":484,"path":15340,"references":2282,"repo":15341,"seo":15342,"stem":15343,"summary":15344,"tag":13031,"tech":15345,"url":62,"__hash__":15346},"projects\u002Fprojects\u002Fweb\u002Fresume.md","Portfolio",{"type":70,"value":15302,"toc":15336},[15303,15327,15330,15333],[73,15304,15305,15306,12861,15309,15312,15313,15317,15318,15321,15322,15326],{},"A redesigned personal site, and with it a new domain. Built on\n",[76,15307,99],{"href":97,"rel":15308},[80],[76,15310,13744],{"href":13742,"rel":15311},[80],", styled in\n",[76,15314,15316],{"href":14965,"rel":15315},[80],"SCSS",", and deployed on\n",[76,15319,14979],{"href":14977,"rel":15320},[80],". The design follows\n",[76,15323,15325],{"href":15275,"rel":15324},[80],"the ideals of minimalism",": keep the surface\nquiet and let the work carry the page.",[73,15328,15329],{},"Projects like this one are Markdown documents with\nYAML front matter, not rows in a database. Nuxt reads them at build time,\nand each becomes a route. Adding a project means writing a file — title,\ndate, tags, and body — and the index page and its detail view follow from\nthe front matter. Prose and metadata stay in one place, versioned in the\nsame repository as the site.",[73,15331,15332],{},"Nuxt pre-renders the site to static HTML and\nassets by default, which Netlify serves from its edge. There is no server on the\ncritical path: a visitor gets plain files, and a deploy is a rebuild\ntriggered by a push. The trade is that new content ships on a build\nrather than instantly, which suits a portfolio that changes in batches.",[73,15334,15335],{},"The page draws on a small component vocabulary. Vue's single-file components keep layout,\nlogic, and scoped SCSS together, so the page's small set of pieces — the\nproject card, the tag chip, the article shell — are defined once and\nreused. The minimalist direction shows up in the constraints: a tight\ntype scale, generous whitespace, and few colors, chosen so the reading\nview stays out of the way of the content.",{"title":478,"searchDepth":479,"depth":479,"links":15337},[],"A redesigned personal site, and with it a new domain. Built on\nNuxt and Vue, styled in\nSCSS, and deployed on\nNetlify. The design follows\nthe ideals of minimalism: keep the surface\nquiet and let the work carry the page.",{},"\u002Fprojects\u002Fweb\u002Fresume","https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fportfolio",{"title":15300,"description":15338},"projects\u002Fweb\u002Fresume","A redesigned personal site on a new domain — content-driven Nuxt, statically\ngenerated, and deployed on Netlify.",[99,13034,15316],"WeSma34ylEffw-s-Gg6QZ5TtDJ9vUVNeJ0pwGK0vsNc",{"id":15348,"title":15349,"body":15350,"date":15460,"description":15461,"extension":483,"featured":2354,"meta":15462,"navigation":484,"path":15463,"references":2282,"repo":15464,"seo":15465,"stem":15466,"summary":15467,"tag":13031,"tech":15468,"url":15357,"__hash__":15469},"projects\u002Fprojects\u002Fweb\u002Fdartmouth-robotics.md","Dartmouth Robotics Club Website",{"type":70,"value":15351,"toc":15458},[15352,15374,15420],[73,15353,15354,15355,15360,15361,15366,15367,15370,15371,1852],{},"A redesign of the ",[76,15356,15359],{"href":15357,"rel":15358},"https:\u002F\u002Fdartmouthrobotics.com",[80],"Dartmouth Robotics Club"," website,\nbuilt with ",[76,15362,15365],{"href":15363,"rel":15364},"https:\u002F\u002Fnextjs.org",[80],"Next"," 13 (App Router, React) and ",[76,15368,15316],{"href":14965,"rel":15369},[80]," and\ndeployed on ",[76,15372,13806],{"href":13804,"rel":15373},[80],[73,15375,15376,15377,15380,15381,5452,15384,5452,15387,5452,15390,5452,15393,15396,15397,15399,15400,15405,15406,5452,15409,12917,15412,15415,15416,15419],{},"The site is a single page composed of sections. ",[108,15378,15379],{},"app\u002Fpage.tsx"," stacks five\nsection components (",[108,15382,15383],{},"Header",[108,15385,15386],{},"Hero",[108,15388,15389],{},"Projects",[108,15391,15392],{},"Members",[108,15394,15395],{},"Footer",") under\na single root layout that sets the Inter font and the \"Making Things Move.\"\nmetadata. Most of it is static club content: who the team is, what the\nprojects are, how to join. The ",[108,15398,15386],{}," runs a\n",[76,15401,15404],{"href":15402,"rel":15403},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftypewriter-effect",[80],"typewriter effect"," over that tagline, and everything\nelse is plain markup and per-section SCSS (",[108,15407,15408],{},"hero.scss",[108,15410,15411],{},"members.scss",[108,15413,15414],{},"projects.scss",", and a shared ",[108,15417,15418],{},"colors.scss"," holding the palette).",[73,15421,15422,15423,15425,15426,15429,15430,15435,15436,15439,15440,5452,15442,12917,15445,5452,15448,13768,15451,15454,15455,15457],{},"The one moving part is the roster. ",[108,15424,15392],{}," fetches\n",[108,15427,15428],{},"public\u002Fdata\u002Fmembers.yml"," at runtime, parses it with ",[76,15431,15434],{"href":15432,"rel":15433},"https:\u002F\u002Fgithub.com\u002Fnodeca\u002Fjs-yaml",[80],"js-yaml",", and\nrenders a ",[108,15437,15438],{},"MemberCard"," per entry, each member carrying a ",[108,15441,13877],{},[108,15443,15444],{},"roles",[108,15446,15447],{},"categories",[108,15449,15450],{},"link",[108,15452,15453],{},"image",". Filter buttons (All, Leadership,\nCompetitive, Product Design) narrow the grid by matching against a member's\n",[108,15456,15447],{},", so adding or recategorizing someone is an edit to the YAML\nfile rather than a code change.",{"title":478,"searchDepth":479,"depth":479,"links":15459},[],"2023-08-10","A redesign of the Dartmouth Robotics Club website,\nbuilt with Next 13 (App Router, React) and SCSS and\ndeployed on Vercel.",{},"\u002Fprojects\u002Fweb\u002Fdartmouth-robotics","https:\u002F\u002Fgithub.com\u002Flostflux\u002Frobotics-website",{"title":15349,"description":15461},"projects\u002Fweb\u002Fdartmouth-robotics","A redesigned website for the Dartmouth Robotics Club, built with Next.js and\nSCSS and deployed on Vercel.",[13823,13034,15365],"-qaUjv8exsffzWCIuLaaP8iJK9tSJ6g8xuVyBS_EB9s",{"id":15471,"title":15472,"body":15473,"date":15641,"description":15642,"extension":483,"featured":2354,"meta":15643,"navigation":484,"path":15644,"references":2282,"repo":15645,"seo":15646,"stem":15647,"summary":15648,"tag":13031,"tech":15649,"url":15650,"__hash__":15651},"projects\u002Fprojects\u002Fweb\u002Fnetworking.md","Networking Platform",{"type":70,"value":15474,"toc":15639},[15475,15505,15508,15536,15586,15596,15616],[73,15476,15477,15480,15481,12917,15486,13502,15489,15494,15495,15500,15501,15504],{},[505,15478,15479],{},"goloco"," is a networking tool for the job hunt. It keeps the companies\nyou are targeting, the people you know at each, the tasks that chase them\ndown, and the notes from every call in one workspace, instead of scattered\nacross spreadsheets and shared folders. Built with\n",[76,15482,15485],{"href":15483,"rel":15484},"https:\u002F\u002Freactjs.org",[80],"React",[76,15487,13034],{"href":13852,"rel":15488},[80],[76,15490,15493],{"href":15491,"rel":15492},"https:\u002F\u002Fredux.js.org",[80],"Redux",", bundled with ",[76,15496,15499],{"href":15497,"rel":15498},"https:\u002F\u002Fvitejs.dev",[80],"Vite",",\ntalking to a separate Express\u002FMongoose API backed by\n",[76,15502,13036],{"href":13847,"rel":15503},[80]," Atlas.",[246,15506],{"hash":15507},"3f36544ea0f6cb67868fe9305d8e1b87654343f290f421f26eee2dc2aa0dbb0b",[73,15509,15510,15511,15514,15515,5452,15517,5452,15520,5452,15523,13768,15526,15529,15530,15535],{},"One store holds five slices. The Redux root in ",[108,15512,15513],{},"store\u002Freducers"," combines\nfive reducers: ",[108,15516,12791],{},[108,15518,15519],{},"company",[108,15521,15522],{},"person",[108,15524,15525],{},"task",[108,15527,15528],{},"note",". Each holds\nthe authoritative client copy of one entity, written through\n",[76,15531,15534],{"href":15532,"rel":15533},"https:\u002F\u002Fimmerjs.github.io\u002Fimmer\u002F",[80],"Immer"," so a handler mutates a draft and\nRedux hands back fresh state. A company, the people at it, and the tasks\nand notes attached to either are read from whichever view needs them, a\nprofile page, a list, or a modal, without threading data through props.",[73,15537,15538,15539,15542,15543,15548,15549,15552,15553,15556,15557,15560,15561,15564,15565,15568,15569,5452,15572,12917,15575,5452,15578,15581,15582,15585],{},"Every action in ",[108,15540,15541],{},"store\u002Factions"," is an async thunk over ",[76,15544,15547],{"href":15545,"rel":15546},"https:\u002F\u002Faxios-http.com",[80],"axios",",\neach carrying a bearer token. Sign-in posts to\n",[108,15550,15551],{},"\u002Fapi\u002Fsignin","; the token that comes back is kept in ",[108,15554,15555],{},"localStorage"," and\nattached as the ",[108,15558,15559],{},"authorization"," header on every later request, and\n",[108,15562,15563],{},"user_reducer"," flips ",[108,15566,15567],{},"authenticated"," once the profile returns. The entity\nthunks map onto the API directly: ",[108,15570,15571],{},"\u002Fapi\u002Fcompanies",[108,15573,15574],{},"\u002Fapi\u002Fpeople",[108,15576,15577],{},"\u002Fapi\u002Ftasks",[108,15579,15580],{},"\u002Fapi\u002Fnotes",", each with create, get-one, list, update,\ndelete, and a ",[108,15583,15584],{},"find?q="," search. Tasks and notes are also fetched by\nassociation, so a company profile can pull every note tied to it.",[73,15587,15588,15589,12861,15592,15595],{},"Contacts carry their own email history. The person and company views\ncall ",[108,15590,15591],{},"\u002Fapi\u002Femails?person=",[108,15593,15594],{},"?company=",", and the API reads Gmail through\nthe Google APIs client, so a contact's recent correspondence sits beside\nthe call notes on them.",[73,15597,15598,15599,15604,15605,12861,15608,15611,15612,15615],{},"On the interface itself, ",[76,15600,15603],{"href":15601,"rel":15602},"https:\u002F\u002Fuiwjs.github.io\u002Freact-md-editor\u002F",[80],"react-md-editor","\nhandles note bodies, ",[108,15606,15607],{},"react-select",[108,15609,15610],{},"react-datepicker"," sit in the\ncreate-task and create-person modals, and ",[108,15613,15614],{},"react-window"," keeps long people\nand company lists cheap to render, all styled with Bootstrap and Sass.",[73,15617,15618,15619,12917,15624,12917,15629,13502,15634,1852],{},"Built as a collaborative project with\n",[76,15620,15623],{"href":15621,"rel":15622},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fbansharee-ireen-184712274\u002F",[80],"Bansharee Ireen",[76,15625,15628],{"href":15626,"rel":15627},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fyizhen-zhen\u002F",[80],"Yizhen Zhen",[76,15630,15633],{"href":15631,"rel":15632},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fcindylwang\u002F",[80],"Cindy Li Wang",[76,15635,15638],{"href":15636,"rel":15637},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjohan-cruz-hernandez-2204b9183\u002F",[80],"Johan Cruz Hernandez",{"title":478,"searchDepth":479,"depth":479,"links":15640},[],"2023-06-03","goloco is a networking tool for the job hunt. It keeps the companies\nyou are targeting, the people you know at each, the tasks that chase them\ndown, and the notes from every call in one workspace, instead of scattered\nacross spreadsheets and shared folders. Built with\nReact,\nTypeScript, and\nRedux, bundled with Vite,\ntalking to a separate Express\u002FMongoose API backed by\nMongoDB Atlas.",{},"\u002Fprojects\u002Fweb\u002Fnetworking","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fnetworking-platform",{"title":15472,"description":15642},"projects\u002Fweb\u002Fnetworking","goloco, a networking tool that keeps companies, contacts, tasks, and call\nnotes in one workspace, with a five-slice Redux store over a\ntoken-authenticated Express\u002FMongoose API and Gmail integration.",[15485,15493,13036,14967],"https:\u002F\u002Fnet.amittai.studio","di9eQCcbyZ-Rv2aq-XecNvmv_6JgAZvoRceBe4WWMSk",{"id":15653,"title":15654,"body":15655,"date":17716,"description":17717,"extension":483,"featured":484,"meta":17718,"navigation":484,"path":17719,"references":17720,"repo":2282,"seo":17722,"stem":17723,"summary":17724,"tag":14942,"tech":17725,"url":17727,"__hash__":17728},"projects\u002Fprojects\u002Fdeep-learning\u002Fxai-autonomous-driving.md","Explainable AI for Autonomous Driving",{"type":70,"value":15656,"toc":17714},[15657,15664,15667,15673,15699,15790,16404,16480,16845,16848,16851,16857,16863,16866,16910,16916,17253,17272,17677,17696,17699,17705,17711],[73,15658,15659,15660,15663],{},"An autonomous vehicle is a decision procedure whose interior is opaque even to\nits authors. The networks that drive it are accurate and unaccountable at once,\nand the two properties are not in tension by accident: capacity purchased\nthrough depth is capacity withdrawn from inspection. Acceptance of such agents\nturns on a narrower question than accuracy. When a car brakes, swerves, or\ndeclines to act, an operator, a passenger, and an accident investigator each\nrequire an answer to ",[442,15661,15662],{},"why",", and the answer must be legible to them rather than\nto the optimizer. This team study surveys the explanation methods available to\nself-driving agents, subjects them to experiment on crash footage, and proposes\nwhere in the pipeline explanation ought to live.",[246,15665],{"hash":15666},"f273473325ffd5169e381805839922ef234ef204d4dbe50fb95fe9d4f42100d5",[73,15668,15669,15672],{},[505,15670,15671],{},"The partition."," Explainability in the driving stack is not one problem. It\nfactors along the pipeline, and each factor admits a different species of\nanswer:",[10278,15674,15675,15681,15687,15693],{},[10281,15676,15677,15680],{},[505,15678,15679],{},"Perception"," turns camera, LiDAR, RADAR, and GPS returns into a\nrepresentation of the scene. Its explanations are attributions over input:\ngradient methods (class saliency maps, Grad-CAM, DeConvNet, guided\nbackpropagation), activation methods (CAM, attention branch networks,\nlayer-wise relevance propagation), and perturbational methods (LIME, SHAP)\nthat interrogate the model by occlusion.",[10281,15682,15683,15686],{},[505,15684,15685],{},"Localization"," places the vehicle inside that representation. The lineage\nruns from landmark-based maximum a posteriori estimation through the extended\nKalman filter — convergent but brittle under compounding association error —\nto the graph-based formulation, where raw measurements become edges encoding\ntransition distributions between candidate poses. Explanation here is\nattribution over sensors rather than pixels.",[10281,15688,15689,15692],{},[505,15690,15691],{},"Planning"," selects trajectories against a predicted cost over progress,\ncomfort, safety, and fuel. It is the least explained stage of the stack;\nsearch-based planners compose motion, behavior, and mission planning in\nparallel, and almost no interpretive tooling exists for the composite.",[10281,15694,15695,15698],{},[505,15696,15697],{},"System management"," governs what the vehicle records about itself.\nAuthenticity is served by a blockchain event recorder: vehicles within\ndedicated short-range communication form a federation, a lead verifier\nwrites accident data to the chain, and an adversary must compromise a\nmajority of community or federation in real time. Integrity is served by a\nsmart black box built on deterministic memory machines with local buffer\noptimization, compressing gigabit-per-second onboard streams by data value\nrather than recency, with a priority queue evicting the cheap.",[73,15700,15701,15704,15705,15747,15748,15789],{},[505,15702,15703],{},"Attribution formalized."," For a class score ",[116,15706,15708],{"className":15707},[119],[116,15709,15711],{"className":15710,"ariaHidden":124},[123],[116,15712,15714,15718],{"className":15713},[128],[116,15715],{"className":15716,"style":15717},[132],"height:0.8588em;vertical-align:-0.1944em;",[116,15719,15721,15724],{"className":15720},[137],[116,15722,601],{"className":15723,"style":139},[137,138],[116,15725,15727],{"className":15726},[725],[116,15728,15730],{"className":15729},[168],[116,15731,15733],{"className":15732},[173],[116,15734,15736],{"className":15735,"style":4633},[177],[116,15737,15738,15741],{"style":1167},[116,15739],{"className":15740,"style":742},[187],[116,15742,15744],{"className":15743},[746,747,748,749],[116,15745,8916],{"className":15746},[137,138,749]," and the activation maps\n",[116,15749,15751],{"className":15750},[119],[116,15752,15754],{"className":15753,"ariaHidden":124},[123],[116,15755,15757,15760],{"className":15756},[128],[116,15758],{"className":15759,"style":1907},[132],[116,15761,15763,15766],{"className":15762},[137],[116,15764,977],{"className":15765},[137,138],[116,15767,15769],{"className":15768},[725],[116,15770,15772],{"className":15771},[168],[116,15773,15775],{"className":15774},[173],[116,15776,15778],{"className":15777,"style":1907},[177],[116,15779,15780,15783],{"style":1167},[116,15781],{"className":15782,"style":742},[187],[116,15784,15786],{"className":15785},[746,747,748,749],[116,15787,4382],{"className":15788,"style":4381},[137,138,749]," of a final convolutional layer, Grad-CAM weights each map by the\nspatially pooled gradient",[116,15791,15793],{"className":15792},[702],[116,15794,15796],{"className":15795},[119],[116,15797,15799,15870,16239],{"className":15798,"ariaHidden":124},[123],[116,15800,15802,15806,15861,15864,15867],{"className":15801},[128],[116,15803],{"className":15804,"style":15805},[132],"height:0.9614em;vertical-align:-0.247em;",[116,15807,15809,15814],{"className":15808},[137],[116,15810,15813],{"className":15811,"style":15812},[137,138],"margin-right:0.0037em;","α",[116,15815,15817],{"className":15816},[725],[116,15818,15820,15853],{"className":15819},[168,169],[116,15821,15823,15850],{"className":15822},[173],[116,15824,15827,15839],{"className":15825,"style":15826},[177],"height:0.7144em;",[116,15828,15830,15833],{"style":15829},"top:-2.453em;margin-left:-0.0037em;margin-right:0.05em;",[116,15831],{"className":15832,"style":742},[187],[116,15834,15836],{"className":15835},[746,747,748,749],[116,15837,4382],{"className":15838,"style":4381},[137,138,749],[116,15840,15841,15844],{"style":2488},[116,15842],{"className":15843,"style":742},[187],[116,15845,15847],{"className":15846},[746,747,748,749],[116,15848,8916],{"className":15849},[137,138,749],[116,15851,234],{"className":15852},[233],[116,15854,15856],{"className":15855},[173],[116,15857,15859],{"className":15858,"style":1186},[177],[116,15860],{},[116,15862],{"className":15863,"style":145},[144],[116,15865,150],{"className":15866},[149],[116,15868],{"className":15869,"style":145},[144],[116,15871,15873,15877,15941,15944,15988,15991,16035,16038,16192,16195,16198,16201,16230,16233,16236],{"className":15872},[128],[116,15874],{"className":15875,"style":15876},[132],"height:2.7852em;vertical-align:-1.4138em;",[116,15878,15880,15883,15938],{"className":15879},[137],[116,15881],{"className":15882},[561,4427],[116,15884,15886],{"className":15885},[4431],[116,15887,15889,15929],{"className":15888},[168,169],[116,15890,15892,15926],{"className":15891},[173],[116,15893,15895,15907,15915],{"className":15894,"style":7349},[177],[116,15896,15897,15900],{"style":5010},[116,15898],{"className":15899,"style":1119},[187],[116,15901,15903],{"className":15902},[137],[116,15904,15906],{"className":15905,"style":2666},[137,138],"Z",[116,15908,15909,15912],{"style":4597},[116,15910],{"className":15911,"style":1119},[187],[116,15913],{"className":15914,"style":4605},[4604],[116,15916,15917,15920],{"style":4608},[116,15918],{"className":15919,"style":1119},[187],[116,15921,15923],{"className":15922},[137],[116,15924,345],{"className":15925},[137],[116,15927,234],{"className":15928},[233],[116,15930,15932],{"className":15931},[173],[116,15933,15936],{"className":15934,"style":15935},[177],"height:0.686em;",[116,15937],{},[116,15939],{"className":15940},[651,4427],[116,15942],{"className":15943,"style":279},[144],[116,15945,15947],{"className":15946},[1126,3245],[116,15948,15950,15980],{"className":15949},[168,169],[116,15951,15953,15977],{"className":15952},[173],[116,15954,15956,15967],{"className":15955,"style":3417},[177],[116,15957,15958,15961],{"style":3420},[116,15959],{"className":15960,"style":3424},[187],[116,15962,15964],{"className":15963},[746,747,748,749],[116,15965,3158],{"className":15966},[137,138,749],[116,15968,15969,15972],{"style":3445},[116,15970],{"className":15971,"style":3424},[187],[116,15973,15974],{},[116,15975,1130],{"className":15976},[1126,1127,3454],[116,15978,234],{"className":15979},[233],[116,15981,15983],{"className":15982},[173],[116,15984,15986],{"className":15985,"style":9130},[177],[116,15987],{},[116,15989],{"className":15990,"style":279},[144],[116,15992,15994],{"className":15993},[1126,3245],[116,15995,15997,16027],{"className":15996},[168,169],[116,15998,16000,16024],{"className":15999},[173],[116,16001,16003,16014],{"className":16002,"style":3417},[177],[116,16004,16005,16008],{"style":3420},[116,16006],{"className":16007,"style":3424},[187],[116,16009,16011],{"className":16010},[746,747,748,749],[116,16012,3213],{"className":16013,"style":3212},[137,138,749],[116,16015,16016,16019],{"style":3445},[116,16017],{"className":16018,"style":3424},[187],[116,16020,16021],{},[116,16022,1130],{"className":16023},[1126,1127,3454],[116,16025,234],{"className":16026},[233],[116,16028,16030],{"className":16029},[173],[116,16031,16033],{"className":16032,"style":3464},[177],[116,16034],{},[116,16036],{"className":16037,"style":279},[144],[116,16039,16041,16044,16189],{"className":16040},[137],[116,16042],{"className":16043},[561,4427],[116,16045,16047],{"className":16046},[4431],[116,16048,16050,16180],{"className":16049},[168,169],[116,16051,16053,16177],{"className":16052},[173],[116,16054,16057,16129,16137],{"className":16055,"style":16056},[177],"height:1.3714em;",[116,16058,16060,16063],{"style":16059},"top:-2.2791em;",[116,16061],{"className":16062,"style":1119},[187],[116,16064,16066,16071],{"className":16065},[137],[116,16067,16070],{"className":16068,"style":16069},[137],"margin-right:0.0556em;","∂",[116,16072,16074,16077],{"className":16073},[137],[116,16075,977],{"className":16076},[137,138],[116,16078,16080],{"className":16079},[725],[116,16081,16083,16120],{"className":16082},[168,169],[116,16084,16086,16117],{"className":16085},[173],[116,16087,16090,16105],{"className":16088,"style":16089},[177],"height:0.8309em;",[116,16091,16093,16096],{"style":16092},"top:-2.4231em;margin-left:0em;margin-right:0.05em;",[116,16094],{"className":16095,"style":742},[187],[116,16097,16099],{"className":16098},[746,747,748,749],[116,16100,16102],{"className":16101},[137,749],[116,16103,3503],{"className":16104,"style":3212},[137,138,749],[116,16106,16108,16111],{"style":16107},"top:-3.0448em;margin-right:0.05em;",[116,16109],{"className":16110,"style":742},[187],[116,16112,16114],{"className":16113},[746,747,748,749],[116,16115,4382],{"className":16116,"style":4381},[137,138,749],[116,16118,234],{"className":16119},[233],[116,16121,16123],{"className":16122},[173],[116,16124,16127],{"className":16125,"style":16126},[177],"height:0.413em;",[116,16128],{},[116,16130,16131,16134],{"style":4597},[116,16132],{"className":16133,"style":1119},[187],[116,16135],{"className":16136,"style":4605},[4604],[116,16138,16139,16142],{"style":4608},[116,16140],{"className":16141,"style":1119},[187],[116,16143,16145,16148],{"className":16144},[137],[116,16146,16070],{"className":16147,"style":16069},[137],[116,16149,16151,16154],{"className":16150},[137],[116,16152,601],{"className":16153,"style":139},[137,138],[116,16155,16157],{"className":16156},[725],[116,16158,16160],{"className":16159},[168],[116,16161,16163],{"className":16162},[173],[116,16164,16166],{"className":16165,"style":4633},[177],[116,16167,16168,16171],{"style":1167},[116,16169],{"className":16170,"style":742},[187],[116,16172,16174],{"className":16173},[746,747,748,749],[116,16175,8916],{"className":16176},[137,138,749],[116,16178,234],{"className":16179},[233],[116,16181,16183],{"className":16182},[173],[116,16184,16187],{"className":16185,"style":16186},[177],"height:1.1339em;",[116,16188],{},[116,16190],{"className":16191},[651,4427],[116,16193,594],{"className":16194},[593],[116,16196],{"className":16197,"style":4159},[144],[116,16199],{"className":16200,"style":279},[144],[116,16202,16204,16207],{"className":16203},[137],[116,16205,4716],{"className":16206},[137,138],[116,16208,16210],{"className":16209},[725],[116,16211,16213],{"className":16212},[168],[116,16214,16216],{"className":16215},[173],[116,16217,16219],{"className":16218,"style":15826},[177],[116,16220,16221,16224],{"style":2488},[116,16222],{"className":16223,"style":742},[187],[116,16225,16227],{"className":16226},[746,747,748,749],[116,16228,8916],{"className":16229},[137,138,749],[116,16231],{"className":16232,"style":145},[144],[116,16234,150],{"className":16235},[149],[116,16237],{"className":16238,"style":145},[144],[116,16240,16242,16246,16252,16255,16258,16265,16268,16312,16315,16366,16395,16401],{"className":16241},[128],[116,16243],{"className":16244,"style":16245},[132],"height:2.4521em;vertical-align:-1.3021em;",[116,16247,16249],{"className":16248},[1126],[116,16250,14504],{"className":16251},[137,3388],[116,16253],{"className":16254,"style":5218},[144],[116,16256],{"className":16257,"style":279},[144],[116,16259,16261],{"className":16260},[137],[116,16262,562],{"className":16263},[1091,16264],"size2",[116,16266],{"className":16267,"style":279},[144],[116,16269,16271],{"className":16270},[1126,3245],[116,16272,16274,16304],{"className":16273},[168,169],[116,16275,16277,16301],{"className":16276},[173],[116,16278,16280,16291],{"className":16279,"style":3417},[177],[116,16281,16282,16285],{"style":11827},[116,16283],{"className":16284,"style":3424},[187],[116,16286,16288],{"className":16287},[746,747,748,749],[116,16289,4382],{"className":16290,"style":4381},[137,138,749],[116,16292,16293,16296],{"style":3445},[116,16294],{"className":16295,"style":3424},[187],[116,16297,16298],{},[116,16299,1130],{"className":16300},[1126,1127,3454],[116,16302,234],{"className":16303},[233],[116,16305,16307],{"className":16306},[173],[116,16308,16310],{"className":16309,"style":11863},[177],[116,16311],{},[116,16313],{"className":16314,"style":279},[144],[116,16316,16318,16321],{"className":16317},[137],[116,16319,15813],{"className":16320,"style":15812},[137,138],[116,16322,16324],{"className":16323},[725],[116,16325,16327,16358],{"className":16326},[168,169],[116,16328,16330,16355],{"className":16329},[173],[116,16331,16333,16344],{"className":16332,"style":15826},[177],[116,16334,16335,16338],{"style":15829},[116,16336],{"className":16337,"style":742},[187],[116,16339,16341],{"className":16340},[746,747,748,749],[116,16342,4382],{"className":16343,"style":4381},[137,138,749],[116,16345,16346,16349],{"style":2488},[116,16347],{"className":16348,"style":742},[187],[116,16350,16352],{"className":16351},[746,747,748,749],[116,16353,8916],{"className":16354},[137,138,749],[116,16356,234],{"className":16357},[233],[116,16359,16361],{"className":16360},[173],[116,16362,16364],{"className":16363,"style":1186},[177],[116,16365],{},[116,16367,16369,16372],{"className":16368},[137],[116,16370,977],{"className":16371},[137,138],[116,16373,16375],{"className":16374},[725],[116,16376,16378],{"className":16377},[168],[116,16379,16381],{"className":16380},[173],[116,16382,16384],{"className":16383,"style":2467},[177],[116,16385,16386,16389],{"style":2488},[116,16387],{"className":16388,"style":742},[187],[116,16390,16392],{"className":16391},[746,747,748,749],[116,16393,4382],{"className":16394,"style":4381},[137,138,749],[116,16396,16398],{"className":16397},[137],[116,16399,652],{"className":16400},[1091,16264],[116,16402,594],{"className":16403},[593],[73,16405,16406,16407,16448,16449,16464,16465,594],{},"and the rectified combination ",[116,16408,16410],{"className":16409},[119],[116,16411,16413],{"className":16412,"ariaHidden":124},[123],[116,16414,16416,16419],{"className":16415},[128],[116,16417],{"className":16418,"style":272},[132],[116,16420,16422,16425],{"className":16421},[137],[116,16423,4716],{"className":16424},[137,138],[116,16426,16428],{"className":16427},[725],[116,16429,16431],{"className":16430},[168],[116,16432,16434],{"className":16433},[173],[116,16435,16437],{"className":16436,"style":4633},[177],[116,16438,16439,16442],{"style":1167},[116,16440],{"className":16441,"style":742},[187],[116,16443,16445],{"className":16444},[746,747,748,749],[116,16446,8916],{"className":16447},[137,138,749]," localizes the evidence for ",[116,16450,16452],{"className":16451},[119],[116,16453,16455],{"className":16454,"ariaHidden":124},[123],[116,16456,16458,16461],{"className":16457},[128],[116,16459],{"className":16460,"style":133},[132],[116,16462,8916],{"className":16463},[137,138]," without\naltering the architecture — the property CAM lacks, being confined to networks\nwithout fully connected heads. For localization, the analogous instrument is\nthe Shapley value over the sensor set ",[116,16466,16468],{"className":16467},[119],[116,16469,16471],{"className":16470,"ariaHidden":124},[123],[116,16472,16474,16477],{"className":16473},[128],[116,16475],{"className":16476,"style":272},[132],[116,16478,2505],{"className":16479,"style":924},[137,138],[116,16481,16483],{"className":16482},[702],[116,16484,16486],{"className":16485},[119],[116,16487,16489,16544,16787,16817],{"className":16488,"ariaHidden":124},[123],[116,16490,16492,16495,16535,16538,16541],{"className":16491},[128],[116,16493],{"className":16494,"style":4241},[132],[116,16496,16498,16501],{"className":16497},[137],[116,16499,4046],{"className":16500},[137,138],[116,16502,16504],{"className":16503},[725],[116,16505,16507,16527],{"className":16506},[168,169],[116,16508,16510,16524],{"className":16509},[173],[116,16511,16513],{"className":16512,"style":3145},[177],[116,16514,16515,16518],{"style":3584},[116,16516],{"className":16517,"style":742},[187],[116,16519,16521],{"className":16520},[746,747,748,749],[116,16522,3158],{"className":16523},[137,138,749],[116,16525,234],{"className":16526},[233],[116,16528,16530],{"className":16529},[173],[116,16531,16533],{"className":16532,"style":762},[177],[116,16534],{},[116,16536],{"className":16537,"style":145},[144],[116,16539,150],{"className":16540},[149],[116,16542],{"className":16543,"style":145},[144],[116,16545,16547,16551,16621,16624,16759,16765,16768,16774,16777,16780,16784],{"className":16546},[128],[116,16548],{"className":16549,"style":16550},[132],"height:3.106em;vertical-align:-1.516em;",[116,16552,16554],{"className":16553},[1126,3245],[116,16555,16557,16612],{"className":16556},[168,169],[116,16558,16560,16609],{"className":16559},[173],[116,16561,16563,16599],{"className":16562,"style":3417},[177],[116,16564,16566,16569],{"style":16565},"top:-1.809em;margin-left:0em;",[116,16567],{"className":16568,"style":3424},[187],[116,16570,16572],{"className":16571},[746,747,748,749],[116,16573,16575,16579,16583,16586,16590,16593,16596],{"className":16574},[137,749],[116,16576,16578],{"className":16577,"style":2684},[137,138,749],"S",[116,16580,16582],{"className":16581},[149,749],"⊆",[116,16584,2505],{"className":16585,"style":924},[137,138,749],[116,16587,16589],{"className":16588},[574,749],"∖",[116,16591,3271],{"className":16592},[561,749],[116,16594,3158],{"className":16595},[137,138,749],[116,16597,3318],{"className":16598},[651,749],[116,16600,16601,16604],{"style":3445},[116,16602],{"className":16603,"style":3424},[187],[116,16605,16606],{},[116,16607,1130],{"className":16608},[1126,1127,3454],[116,16610,234],{"className":16611},[233],[116,16613,16615],{"className":16614},[173],[116,16616,16619],{"className":16617,"style":16618},[177],"height:1.516em;",[116,16620],{},[116,16622],{"className":16623,"style":279},[144],[116,16625,16627,16630,16756],{"className":16626},[137],[116,16628],{"className":16629},[561,4427],[116,16631,16633],{"className":16632},[4431],[116,16634,16636,16748],{"className":16635},[168,169],[116,16637,16639,16745],{"className":16638},[173],[116,16640,16643,16661,16669],{"className":16641,"style":16642},[177],"height:1.59em;",[116,16644,16645,16648],{"style":5010},[116,16646],{"className":16647,"style":1119},[187],[116,16649,16651,16654,16657],{"className":16650},[137],[116,16652,4389],{"className":16653},[561],[116,16655,2505],{"className":16656,"style":924},[137,138],[116,16658,16660],{"className":16659},[651],"∣!",[116,16662,16663,16666],{"style":4597},[116,16664],{"className":16665,"style":1119},[187],[116,16667],{"className":16668,"style":4605},[4604],[116,16670,16672,16675],{"style":16671},"top:-3.74em;",[116,16673],{"className":16674,"style":1119},[187],[116,16676,16678,16681,16684,16687,16690,16696,16699,16702,16705,16708,16711,16714,16717,16720,16723,16726,16729,16732,16735,16741],{"className":16677},[137],[116,16679,4389],{"className":16680},[561],[116,16682,16578],{"className":16683,"style":2684},[137,138],[116,16685,16660],{"className":16686},[651],[116,16688],{"className":16689,"style":279},[144],[116,16691,16693],{"className":16692},[137],[116,16694,562],{"className":16695},[1091,1002],[116,16697,4389],{"className":16698},[561],[116,16700,2505],{"className":16701,"style":924},[137,138],[116,16703,4389],{"className":16704},[651],[116,16706],{"className":16707,"style":570},[144],[116,16709,1610],{"className":16710},[574],[116,16712],{"className":16713,"style":570},[144],[116,16715,4389],{"className":16716},[561],[116,16718,16578],{"className":16719,"style":2684},[137,138],[116,16721,4389],{"className":16722},[651],[116,16724],{"className":16725,"style":570},[144],[116,16727,1610],{"className":16728},[574],[116,16730],{"className":16731,"style":570},[144],[116,16733,345],{"className":16734},[137],[116,16736,16738],{"className":16737},[137],[116,16739,652],{"className":16740},[1091,1002],[116,16742,16744],{"className":16743},[651],"!",[116,16746,234],{"className":16747},[233],[116,16749,16751],{"className":16750},[173],[116,16752,16754],{"className":16753,"style":5080},[177],[116,16755],{},[116,16757],{"className":16758},[651,4427],[116,16760,16762],{"className":16761},[137],[116,16763,562],{"className":16764},[1091,16264],[116,16766,140],{"className":16767,"style":139},[137,138],[116,16769,16771],{"className":16770},[137],[116,16772,562],{"className":16773},[1091,1002],[116,16775,16578],{"className":16776,"style":2684},[137,138],[116,16778],{"className":16779,"style":570},[144],[116,16781,16783],{"className":16782},[574],"∪",[116,16785],{"className":16786,"style":570},[144],[116,16788,16790,16793,16796,16799,16802,16808,16811,16814],{"className":16789},[128],[116,16791],{"className":16792,"style":7685},[132],[116,16794,3271],{"className":16795},[561],[116,16797,3158],{"className":16798},[137,138],[116,16800,3318],{"className":16801},[651],[116,16803,16805],{"className":16804},[137],[116,16806,652],{"className":16807},[1091,1002],[116,16809],{"className":16810,"style":570},[144],[116,16812,1610],{"className":16813},[574],[116,16815],{"className":16816,"style":570},[144],[116,16818,16820,16824,16827,16830,16833,16836,16842],{"className":16819},[128],[116,16821],{"className":16822,"style":16823},[132],"height:1.8em;vertical-align:-0.65em;",[116,16825,140],{"className":16826,"style":139},[137,138],[116,16828,562],{"className":16829},[561],[116,16831,16578],{"className":16832,"style":2684},[137,138],[116,16834,652],{"className":16835},[651],[116,16837,16839],{"className":16838},[137],[116,16840,652],{"className":16841},[1091,16264],[116,16843,594],{"className":16844},[593],[73,16846,16847],{},"which prices the marginal contribution of LiDAR against GNSS against inertial\nmeasurement for a given pose estimate, averaged over every coalition of the\nremaining sensors.",[246,16849],{"hash":16850},"a0085cab26156af2d06795dbfd16070d5772d429cac644130d6e608a972ef8ef",[73,16852,16853,16856],{},[505,16854,16855],{},"Benchmarking on crash footage."," The experimental substrate is the CarCrash\nDataset, restricted to clips whose ego vehicle is directly involved so that\nevery attribution is egocentric. Over a Faster R-CNN backbone, class activation\nmapping localizes cleanly when a single object owns the frame and degrades\nprecisely where an investigator needs it: with several vehicles of one class\npresent, the heat assigns credit to a neighboring car whose pixels dominate the\nclass score while the detector's boxes track a smaller, nearer one — and when\nthe frame truncates the salient vehicle, boxes fail to appear at all. A\nsemantic segmentation backbone repairs the granularity, scoring each pixel\nwithin its own predicted class, though its maps decentralize as the subject\ncloses on the egocentric view. Deep feature factorization proved the sturdiest\nof the visual methods, clustering the frame into abstract objects with no\noutput labels supplied, and segmenting the consequential regions of the crash\nfootage unsupervised.",[73,16858,16859,16862],{},[505,16860,16861],{},"Explaining a control output."," PilotNet maps pixels to a steering command,\nwhich makes its explanations answer for an action rather than a label. Grad-CAM\nover the steering head attributed a recorded accident to the ego vehicle's own\nlane crossing; the same model, modified to accept live OpenCV input, met the\nfailure mode that matters operationally — sun glare degrading attribution and\nperception alike, an argument for redundant explainers rather than any single\none. ADAPT, a captioning transformer trained on the Berkeley DeepDrive\neXplanation corpus, narrates and justifies each control decision in natural\nlanguage; on crash clips its narration is accurate and myopic at once,\ndescribing the ego vehicle's motion faithfully while missing the holistic\ncontext of the collision.",[246,16864],{"hash":16865},"e379c2d989915fad9efc90eb4669835f67d129322e403a326fae0ada26e811d3",[73,16867,16868,16871,16872,16875,16876,16892,16893,16909],{},[505,16869,16870],{},"Where the explanation stops transferring."," The sharpest result is negative.\nPilotNet, trained on road video, was run against maritime data collected by the\nDartmouth Robotics Lab — seventy gigabytes of ",[108,16873,16874],{},"ROSBAG"," recordings, two and a\nhalf hours of time-synchronized RGB and inertial steering signal. The\ntransferred model failed outright; a model retrained on the marine data fared\nlittle better, holding near ",[116,16877,16879],{"className":16878},[119],[116,16880,16882],{"className":16881,"ariaHidden":124},[123],[116,16883,16885,16888],{"className":16884},[128],[116,16886],{"className":16887,"style":1890},[132],[116,16889,16891],{"className":16890},[137],"3.0"," mean squared error against under ",[116,16894,16896],{"className":16895},[119],[116,16897,16899],{"className":16898,"ariaHidden":124},[123],[116,16900,16902,16905],{"className":16901},[128],[116,16903],{"className":16904,"style":1890},[132],[116,16906,16908],{"className":16907},[137],"1.0"," in the\ncar domain. Grad-CAM diagnosed the gap: road-domain saliency rests its mass on\nthe lane boundary, and open water supplies no such feature. The attribution did\nnot merely lose precision under domain shift; the causal anchor it had been\nresting on was absent from the new domain entirely.",[73,16911,16912,16915],{},[505,16913,16914],{},"Explaining a policy."," The planning stage answers to a different formalism.\nAn action-value satisfies the Bellman recursion over reward,",[116,16917,16919],{"className":16918},[702],[116,16920,16922],{"className":16921},[119],[116,16923,16925,16962,16998],{"className":16924,"ariaHidden":124},[123],[116,16926,16928,16931,16934,16937,16941,16944,16947,16950,16953,16956,16959],{"className":16927},[128],[116,16929],{"className":16930,"style":552},[132],[116,16932,5169],{"className":16933},[137,138],[116,16935,562],{"className":16936},[561],[116,16938,16940],{"className":16939},[137,138],"s",[116,16942,594],{"className":16943},[593],[116,16945],{"className":16946,"style":279},[144],[116,16948,76],{"className":16949},[137,138],[116,16951,652],{"className":16952},[651],[116,16954],{"className":16955,"style":145},[144],[116,16957,150],{"className":16958},[149],[116,16960],{"className":16961,"style":145},[144],[116,16963,16965,16968,16971,16974,16977,16980,16983,16986,16989,16992,16995],{"className":16964},[128],[116,16966],{"className":16967,"style":552},[132],[116,16969,2756],{"className":16970,"style":2755},[137,138],[116,16972,562],{"className":16973},[561],[116,16975,16940],{"className":16976},[137,138],[116,16978,594],{"className":16979},[593],[116,16981],{"className":16982,"style":279},[144],[116,16984,76],{"className":16985},[137,138],[116,16987,652],{"className":16988},[651],[116,16990],{"className":16991,"style":570},[144],[116,16993,575],{"className":16994},[574],[116,16996],{"className":16997,"style":570},[144],[116,16999,17001,17005,17009,17012,17090,17093,17097,17100,17103,17106,17109,17112,17115,17118,17150,17153,17156,17159,17165,17197,17200,17203,17206,17209,17241,17244,17250],{"className":17000},[128],[116,17002],{"className":17003,"style":17004},[132],"height:2.344em;vertical-align:-1.294em;",[116,17006,17008],{"className":17007,"style":16069},[137,138],"γ",[116,17010],{"className":17011,"style":279},[144],[116,17013,17015],{"className":17014},[1126,3245],[116,17016,17018,17081],{"className":17017},[168,169],[116,17019,17021,17078],{"className":17020},[173],[116,17022,17024,17068],{"className":17023,"style":3417},[177],[116,17025,17027,17030],{"style":17026},"top:-1.856em;margin-left:0em;",[116,17028],{"className":17029,"style":3424},[187],[116,17031,17033],{"className":17032},[746,747,748,749],[116,17034,17036],{"className":17035},[137,749],[116,17037,17039,17042],{"className":17038},[137,749],[116,17040,16940],{"className":17041},[137,138,749],[116,17043,17045],{"className":17044},[725],[116,17046,17048],{"className":17047},[168],[116,17049,17051],{"className":17050},[173],[116,17052,17054],{"className":17053,"style":9983},[177],[116,17055,17056,17059],{"style":993},[116,17057],{"className":17058,"style":997},[187],[116,17060,17062],{"className":17061},[746,1001,1002,749],[116,17063,17065],{"className":17064},[137,749],[116,17066,2445],{"className":17067},[137,749],[116,17069,17070,17073],{"style":3445},[116,17071],{"className":17072,"style":3424},[187],[116,17074,17075],{},[116,17076,1130],{"className":17077},[1126,1127,3454],[116,17079,234],{"className":17080},[233],[116,17082,17084],{"className":17083},[173],[116,17085,17088],{"className":17086,"style":17087},[177],"height:1.294em;",[116,17089],{},[116,17091],{"className":17092,"style":279},[144],[116,17094,17096],{"className":17095,"style":924},[137,138],"T",[116,17098,562],{"className":17099},[561],[116,17101,16940],{"className":17102},[137,138],[116,17104,594],{"className":17105},[593],[116,17107],{"className":17108,"style":279},[144],[116,17110,76],{"className":17111},[137,138],[116,17113,594],{"className":17114},[593],[116,17116],{"className":17117,"style":279},[144],[116,17119,17121,17124],{"className":17120},[137],[116,17122,16940],{"className":17123},[137,138],[116,17125,17127],{"className":17126},[725],[116,17128,17130],{"className":17129},[168],[116,17131,17133],{"className":17132},[173],[116,17134,17136],{"className":17135,"style":5751},[177],[116,17137,17138,17141],{"style":2488},[116,17139],{"className":17140,"style":742},[187],[116,17142,17144],{"className":17143},[746,747,748,749],[116,17145,17147],{"className":17146},[137,749],[116,17148,2445],{"className":17149},[137,749],[116,17151,652],{"className":17152},[651],[116,17154],{"className":17155,"style":279},[144],[116,17157,5169],{"className":17158},[137,138],[116,17160,17162],{"className":17161},[137],[116,17163,562],{"className":17164},[1091,1002],[116,17166,17168,17171],{"className":17167},[137],[116,17169,16940],{"className":17170},[137,138],[116,17172,17174],{"className":17173},[725],[116,17175,17177],{"className":17176},[168],[116,17178,17180],{"className":17179},[173],[116,17181,17183],{"className":17182,"style":5751},[177],[116,17184,17185,17188],{"style":2488},[116,17186],{"className":17187,"style":742},[187],[116,17189,17191],{"className":17190},[746,747,748,749],[116,17192,17194],{"className":17193},[137,749],[116,17195,2445],{"className":17196},[137,749],[116,17198,594],{"className":17199},[593],[116,17201],{"className":17202,"style":279},[144],[116,17204,3627],{"className":17205,"style":139},[137,138],[116,17207,562],{"className":17208},[561],[116,17210,17212,17215],{"className":17211},[137],[116,17213,16940],{"className":17214},[137,138],[116,17216,17218],{"className":17217},[725],[116,17219,17221],{"className":17220},[168],[116,17222,17224],{"className":17223},[173],[116,17225,17227],{"className":17226,"style":5751},[177],[116,17228,17229,17232],{"style":2488},[116,17230],{"className":17231,"style":742},[187],[116,17233,17235],{"className":17234},[746,747,748,749],[116,17236,17238],{"className":17237},[137,749],[116,17239,2445],{"className":17240},[137,749],[116,17242,652],{"className":17243},[651],[116,17245,17247],{"className":17246},[137],[116,17248,652],{"className":17249},[1091,1002],[116,17251,594],{"className":17252},[593],[73,17254,17255,17256,17271],{},"which states what the policy is worth while remaining silent on what the agent\nwill do. Substituting a named feature ",[116,17257,17259],{"className":17258},[119],[116,17260,17262],{"className":17261,"ariaHidden":124},[123],[116,17263,17265,17268],{"className":17264},[128],[116,17266],{"className":17267,"style":272},[132],[116,17269,2505],{"className":17270,"style":924},[137,138]," for the reward yields the generalized\nvalue function,",[116,17273,17275],{"className":17274},[702],[116,17276,17278],{"className":17277},[119],[116,17279,17281,17354,17390],{"className":17280,"ariaHidden":124},[123],[116,17282,17284,17287,17327,17330,17333,17336,17339,17342,17345,17348,17351],{"className":17283},[128],[116,17285],{"className":17286,"style":552},[132],[116,17288,17290,17293],{"className":17289},[137],[116,17291,5169],{"className":17292},[137,138],[116,17294,17296],{"className":17295},[725],[116,17297,17299,17319],{"className":17298},[168,169],[116,17300,17302,17316],{"className":17301},[173],[116,17303,17305],{"className":17304,"style":13247},[177],[116,17306,17307,17310],{"style":3584},[116,17308],{"className":17309,"style":742},[187],[116,17311,17313],{"className":17312},[746,747,748,749],[116,17314,2505],{"className":17315,"style":924},[137,138,749],[116,17317,234],{"className":17318},[233],[116,17320,17322],{"className":17321},[173],[116,17323,17325],{"className":17324,"style":762},[177],[116,17326],{},[116,17328,562],{"className":17329},[561],[116,17331,16940],{"className":17332},[137,138],[116,17334,594],{"className":17335},[593],[116,17337],{"className":17338,"style":279},[144],[116,17340,76],{"className":17341},[137,138],[116,17343,652],{"className":17344},[651],[116,17346],{"className":17347,"style":145},[144],[116,17349,150],{"className":17350},[149],[116,17352],{"className":17353,"style":145},[144],[116,17355,17357,17360,17363,17366,17369,17372,17375,17378,17381,17384,17387],{"className":17356},[128],[116,17358],{"className":17359,"style":552},[132],[116,17361,2505],{"className":17362,"style":924},[137,138],[116,17364,562],{"className":17365},[561],[116,17367,16940],{"className":17368},[137,138],[116,17370,594],{"className":17371},[593],[116,17373],{"className":17374,"style":279},[144],[116,17376,76],{"className":17377},[137,138],[116,17379,652],{"className":17380},[651],[116,17382],{"className":17383,"style":570},[144],[116,17385,575],{"className":17386},[574],[116,17388],{"className":17389,"style":570},[144],[116,17391,17393,17396,17399,17402,17478,17481,17484,17487,17490,17493,17496,17499,17502,17505,17537,17540,17543,17583,17589,17621,17624,17627,17630,17633,17665,17668,17674],{"className":17392},[128],[116,17394],{"className":17395,"style":17004},[132],[116,17397,17008],{"className":17398,"style":16069},[137,138],[116,17400],{"className":17401,"style":279},[144],[116,17403,17405],{"className":17404},[1126,3245],[116,17406,17408,17470],{"className":17407},[168,169],[116,17409,17411,17467],{"className":17410},[173],[116,17412,17414,17457],{"className":17413,"style":3417},[177],[116,17415,17416,17419],{"style":17026},[116,17417],{"className":17418,"style":3424},[187],[116,17420,17422],{"className":17421},[746,747,748,749],[116,17423,17425],{"className":17424},[137,749],[116,17426,17428,17431],{"className":17427},[137,749],[116,17429,16940],{"className":17430},[137,138,749],[116,17432,17434],{"className":17433},[725],[116,17435,17437],{"className":17436},[168],[116,17438,17440],{"className":17439},[173],[116,17441,17443],{"className":17442,"style":9983},[177],[116,17444,17445,17448],{"style":993},[116,17446],{"className":17447,"style":997},[187],[116,17449,17451],{"className":17450},[746,1001,1002,749],[116,17452,17454],{"className":17453},[137,749],[116,17455,2445],{"className":17456},[137,749],[116,17458,17459,17462],{"style":3445},[116,17460],{"className":17461,"style":3424},[187],[116,17463,17464],{},[116,17465,1130],{"className":17466},[1126,1127,3454],[116,17468,234],{"className":17469},[233],[116,17471,17473],{"className":17472},[173],[116,17474,17476],{"className":17475,"style":17087},[177],[116,17477],{},[116,17479],{"className":17480,"style":279},[144],[116,17482,17096],{"className":17483,"style":924},[137,138],[116,17485,562],{"className":17486},[561],[116,17488,16940],{"className":17489},[137,138],[116,17491,594],{"className":17492},[593],[116,17494],{"className":17495,"style":279},[144],[116,17497,76],{"className":17498},[137,138],[116,17500,594],{"className":17501},[593],[116,17503],{"className":17504,"style":279},[144],[116,17506,17508,17511],{"className":17507},[137],[116,17509,16940],{"className":17510},[137,138],[116,17512,17514],{"className":17513},[725],[116,17515,17517],{"className":17516},[168],[116,17518,17520],{"className":17519},[173],[116,17521,17523],{"className":17522,"style":5751},[177],[116,17524,17525,17528],{"style":2488},[116,17526],{"className":17527,"style":742},[187],[116,17529,17531],{"className":17530},[746,747,748,749],[116,17532,17534],{"className":17533},[137,749],[116,17535,2445],{"className":17536},[137,749],[116,17538,652],{"className":17539},[651],[116,17541],{"className":17542,"style":279},[144],[116,17544,17546,17549],{"className":17545},[137],[116,17547,5169],{"className":17548},[137,138],[116,17550,17552],{"className":17551},[725],[116,17553,17555,17575],{"className":17554},[168,169],[116,17556,17558,17572],{"className":17557},[173],[116,17559,17561],{"className":17560,"style":13247},[177],[116,17562,17563,17566],{"style":3584},[116,17564],{"className":17565,"style":742},[187],[116,17567,17569],{"className":17568},[746,747,748,749],[116,17570,2505],{"className":17571,"style":924},[137,138,749],[116,17573,234],{"className":17574},[233],[116,17576,17578],{"className":17577},[173],[116,17579,17581],{"className":17580,"style":762},[177],[116,17582],{},[116,17584,17586],{"className":17585},[137],[116,17587,562],{"className":17588},[1091,1002],[116,17590,17592,17595],{"className":17591},[137],[116,17593,16940],{"className":17594},[137,138],[116,17596,17598],{"className":17597},[725],[116,17599,17601],{"className":17600},[168],[116,17602,17604],{"className":17603},[173],[116,17605,17607],{"className":17606,"style":5751},[177],[116,17608,17609,17612],{"style":2488},[116,17610],{"className":17611,"style":742},[187],[116,17613,17615],{"className":17614},[746,747,748,749],[116,17616,17618],{"className":17617},[137,749],[116,17619,2445],{"className":17620},[137,749],[116,17622,594],{"className":17623},[593],[116,17625],{"className":17626,"style":279},[144],[116,17628,3627],{"className":17629,"style":139},[137,138],[116,17631,562],{"className":17632},[561],[116,17634,17636,17639],{"className":17635},[137],[116,17637,16940],{"className":17638},[137,138],[116,17640,17642],{"className":17641},[725],[116,17643,17645],{"className":17644},[168],[116,17646,17648],{"className":17647},[173],[116,17649,17651],{"className":17650,"style":5751},[177],[116,17652,17653,17656],{"style":2488},[116,17654],{"className":17655,"style":742},[187],[116,17657,17659],{"className":17658},[746,747,748,749],[116,17660,17662],{"className":17661},[137,749],[116,17663,2445],{"className":17664},[137,749],[116,17666,652],{"className":17667},[651],[116,17669,17671],{"className":17670},[137],[116,17672,652],{"className":17673},[1091,1002],[116,17675,594],{"className":17676},[593],[73,17678,17679,17680,17695],{},"the expected future course of a quantity a person chose: velocity, tilt angle,\ndistance to goal, landing-leg state. Learned alongside the policy of an\nautonomous lunar lander, these functions trace each feature's trajectory as the\nagent descends, and the trace reads as a statement of intent where the plain\n",[116,17681,17683],{"className":17682},[119],[116,17684,17686],{"className":17685,"ariaHidden":124},[123],[116,17687,17689,17692],{"className":17688},[128],[116,17690],{"className":17691,"style":5448},[132],[116,17693,5169],{"className":17694},[137,138]," reads as a score.",[246,17697],{"hash":17698},"9d55e9543c84d0321f31d37b27476b1c45832ba4f47a3da3fc27701f67974100",[73,17700,17701,17704],{},[505,17702,17703],{},"The framework."," Intrinsic and post-hoc explanations already fall out of each\nstage as by-products of prediction; the proposal is to stop discarding them.\nEach stage acquires a contingency model estimating how far its own prediction\ndeserves trust, and that estimate travels forward with the prediction — so\nplanning receives what perception saw together with a price on the seeing.\nExplanation becomes a first-class signal in the pipeline rather than an\nartifact rendered for the postmortem.",[73,17706,17707,17710],{},[505,17708,17709],{},"Scaling the instrumentation."," Interpretability work intervenes on\nintermediate activations, and the prevailing tooling binds those interventions\nto a particular authorship of the network: hook systems presuppose the\nobject-oriented module tree the model happened to be written as, while the\nmethods themselves grow stranger and the models larger. As proof of concept,\nthe study implements a system representing a model as a computational graph\nover which a user matches sub-graphs to arbitrary functions — collecting and\nmanipulating activations with no reference to the model's internals or to the\nidioms of its construction.",[73,17712,17713],{},"The conclusions are the experiments' own. No single method explains the\npipeline; the methods that read most clearly to a person are not the ones that\nscale; and an attribution is only as durable as the feature it rests on, which\na change of domain may simply delete.",{"title":478,"searchDepth":479,"depth":479,"links":17715},[],"2023-06-01","An autonomous vehicle is a decision procedure whose interior is opaque even to\nits authors. The networks that drive it are accurate and unaccountable at once,\nand the two properties are not in tension by accident: capacity purchased\nthrough depth is capacity withdrawn from inspection. Acceptance of such agents\nturns on a narrower question than accuracy. When a car brakes, swerves, or\ndeclines to act, an operator, a passenger, and an accident investigator each\nrequire an answer to why, and the answer must be legible to them rather than\nto the optimizer. This team study surveys the explanation methods available to\nself-driving agents, subjects them to experiment on crash footage, and proposes\nwhere in the pipeline explanation ought to live.",{},"\u002Fprojects\u002Fdeep-learning\u002Fxai-autonomous-driving",[14937,17721],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence",{"title":15654,"description":17717},"projects\u002Fdeep-learning\u002Fxai-autonomous-driving","An eight-author study of what it takes for a self-driving agent to explain\nitself: benchmarking saliency, factorization, and captioning methods on crash\nfootage, measuring what survives a shift to the marine domain, and proposing a\ncontingency-aware framework for the driving pipeline.",[2279,3991,2281,17726],"Reinforcement Learning","\u002Fpapers\u002Fxai-autonomous-driving.pdf","vbQyrfQclryQZNp1LTVPnivyRBDdYYNwwYHphn46CGI",{"id":17730,"title":17731,"body":17732,"date":19191,"description":19192,"extension":483,"featured":484,"meta":19193,"navigation":484,"path":19194,"references":19195,"repo":19196,"seo":19197,"stem":19198,"summary":19199,"tag":14942,"tech":19200,"url":2282,"__hash__":19201},"projects\u002Fprojects\u002Fdeep-learning\u002Fadversarial.md","Adversarial Training for Neural Networks",{"type":70,"value":17733,"toc":19189},[17734,17743,17842,18068,18267,18468,18471,18474,18615,18957,18960,19100,19114,19161,19170],[73,17735,17736,17737,17742],{},"Neural networks are brittle: a small, deliberately chosen perturbation of\nthe input can flip a confident prediction. This project trains a\n",[76,17738,17741],{"href":17739,"rel":17740},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FResidual_neural_network",[80],"ResNet-18"," image\nclassifier on CIFAR-10 to resist that noise, then measures the cost of doing\nso.",[73,17744,17745,17746,17826,17827,3225],{},"An adversary wants the smallest input change\nthat most increases the loss. Bound the change in max norm,\n",[116,17747,17749],{"className":17748},[119],[116,17750,17752,17816],{"className":17751,"ariaHidden":124},[123],[116,17753,17755,17758,17761,17766,17807,17810,17813],{"className":17754},[128],[116,17756],{"className":17757,"style":552},[132],[116,17759,5020],{"className":17760},[561],[116,17762,17765],{"className":17763,"style":17764},[137,138],"margin-right:0.0379em;","δ",[116,17767,17769,17772],{"className":17768},[651],[116,17770,5020],{"className":17771},[651],[116,17773,17775],{"className":17774},[725],[116,17776,17778,17799],{"className":17777},[168,169],[116,17779,17781,17796],{"className":17780},[173],[116,17782,17784],{"className":17783,"style":735},[177],[116,17785,17786,17789],{"style":3584},[116,17787],{"className":17788,"style":742},[187],[116,17790,17792],{"className":17791},[746,747,748,749],[116,17793,17795],{"className":17794},[137,749],"∞",[116,17797,234],{"className":17798},[233],[116,17800,17802],{"className":17801},[173],[116,17803,17805],{"className":17804,"style":762},[177],[116,17806],{},[116,17808],{"className":17809,"style":145},[144],[116,17811,14886],{"className":17812},[149],[116,17814],{"className":17815,"style":145},[144],[116,17817,17819,17822],{"className":17818},[128],[116,17820],{"className":17821,"style":133},[132],[116,17823,17825],{"className":17824},[137,138],"ϵ",", and take a first-order\nexpansion of the loss around the input ",[116,17828,17830],{"className":17829},[119],[116,17831,17833],{"className":17832,"ariaHidden":124},[123],[116,17834,17836,17839],{"className":17835},[128],[116,17837],{"className":17838,"style":133},[132],[116,17840,566],{"className":17841},[137,138],[116,17843,17845],{"className":17844},[702],[116,17846,17848],{"className":17847},[119],[116,17849,17851,17884,17914,17959],{"className":17850,"ariaHidden":124},[123],[116,17852,17854,17857,17860,17863,17866,17869,17872,17875,17878,17881],{"className":17853},[128],[116,17855],{"className":17856,"style":552},[132],[116,17858,4716],{"className":17859},[137,138],[116,17861,562],{"className":17862},[561],[116,17864,11426],{"className":17865,"style":205},[137,138],[116,17867,594],{"className":17868},[593],[116,17870],{"className":17871,"style":279},[144],[116,17873,566],{"className":17874},[137,138],[116,17876],{"className":17877,"style":570},[144],[116,17879,575],{"className":17880},[574],[116,17882],{"className":17883,"style":570},[144],[116,17885,17887,17890,17893,17896,17899,17902,17905,17908,17911],{"className":17886},[128],[116,17888],{"className":17889,"style":552},[132],[116,17891,17765],{"className":17892,"style":17764},[137,138],[116,17894,594],{"className":17895},[593],[116,17897],{"className":17898,"style":279},[144],[116,17900,601],{"className":17901,"style":139},[137,138],[116,17903,652],{"className":17904},[651],[116,17906],{"className":17907,"style":145},[144],[116,17909,413],{"className":17910},[149],[116,17912],{"className":17913,"style":145},[144],[116,17915,17917,17920,17923,17926,17929,17932,17935,17938,17941,17944,17947,17950,17953,17956],{"className":17916},[128],[116,17918],{"className":17919,"style":552},[132],[116,17921,4716],{"className":17922},[137,138],[116,17924,562],{"className":17925},[561],[116,17927,11426],{"className":17928,"style":205},[137,138],[116,17930,594],{"className":17931},[593],[116,17933],{"className":17934,"style":279},[144],[116,17936,566],{"className":17937},[137,138],[116,17939,594],{"className":17940},[593],[116,17942],{"className":17943,"style":279},[144],[116,17945,601],{"className":17946,"style":139},[137,138],[116,17948,652],{"className":17949},[651],[116,17951],{"className":17952,"style":570},[144],[116,17954,575],{"className":17955},[574],[116,17957],{"className":17958,"style":570},[144],[116,17960,17962,17966,18006,18009,18012,18015,18018,18021,18024,18027,18030,18033,18062,18065],{"className":17961},[128],[116,17963],{"className":17964,"style":17965},[132],"height:1.1491em;vertical-align:-0.25em;",[116,17967,17969,17972],{"className":17968},[137],[116,17970,8365],{"className":17971},[137],[116,17973,17975],{"className":17974},[725],[116,17976,17978,17998],{"className":17977},[168,169],[116,17979,17981,17995],{"className":17980},[173],[116,17982,17984],{"className":17983,"style":735},[177],[116,17985,17986,17989],{"style":3584},[116,17987],{"className":17988,"style":742},[187],[116,17990,17992],{"className":17991},[746,747,748,749],[116,17993,566],{"className":17994},[137,138,749],[116,17996,234],{"className":17997},[233],[116,17999,18001],{"className":18000},[173],[116,18002,18004],{"className":18003,"style":762},[177],[116,18005],{},[116,18007,4716],{"className":18008},[137,138],[116,18010,562],{"className":18011},[561],[116,18013,11426],{"className":18014,"style":205},[137,138],[116,18016,594],{"className":18017},[593],[116,18019],{"className":18020,"style":279},[144],[116,18022,566],{"className":18023},[137,138],[116,18025,594],{"className":18026},[593],[116,18028],{"className":18029,"style":279},[144],[116,18031,601],{"className":18032,"style":139},[137,138],[116,18034,18036,18039],{"className":18035},[651],[116,18037,652],{"className":18038},[651],[116,18040,18042],{"className":18041},[725],[116,18043,18045],{"className":18044},[168],[116,18046,18048],{"className":18047},[173],[116,18049,18051],{"className":18050,"style":2467},[177],[116,18052,18053,18056],{"style":2488},[116,18054],{"className":18055,"style":742},[187],[116,18057,18059],{"className":18058},[746,747,748,749],[116,18060,1006],{"className":18061},[137,749],[116,18063,17765],{"className":18064,"style":17764},[137,138],[116,18066,1852],{"className":18067},[137],[73,18069,18070,18071,18124,18125,18266],{},"Maximizing the linear term under the box constraint is separable per\ncoordinate: each ",[116,18072,18074],{"className":18073},[119],[116,18075,18077],{"className":18076,"ariaHidden":124},[123],[116,18078,18080,18083],{"className":18079},[128],[116,18081],{"className":18082,"style":4182},[132],[116,18084,18086,18089],{"className":18085},[137],[116,18087,17765],{"className":18088,"style":17764},[137,138],[116,18090,18092],{"className":18091},[725],[116,18093,18095,18116],{"className":18094},[168,169],[116,18096,18098,18113],{"className":18097},[173],[116,18099,18101],{"className":18100,"style":3145},[177],[116,18102,18104,18107],{"style":18103},"top:-2.55em;margin-left:-0.0379em;margin-right:0.05em;",[116,18105],{"className":18106,"style":742},[187],[116,18108,18110],{"className":18109},[746,747,748,749],[116,18111,3158],{"className":18112},[137,138,749],[116,18114,234],{"className":18115},[233],[116,18117,18119],{"className":18118},[173],[116,18120,18122],{"className":18121,"style":762},[177],[116,18123],{}," should point along its gradient component and\nsaturate the bound, so ",[116,18126,18128],{"className":18127},[119],[116,18129,18131,18186],{"className":18130,"ariaHidden":124},[123],[116,18132,18134,18137,18177,18180,18183],{"className":18133},[128],[116,18135],{"className":18136,"style":4182},[132],[116,18138,18140,18143],{"className":18139},[137],[116,18141,17765],{"className":18142,"style":17764},[137,138],[116,18144,18146],{"className":18145},[725],[116,18147,18149,18169],{"className":18148},[168,169],[116,18150,18152,18166],{"className":18151},[173],[116,18153,18155],{"className":18154,"style":3145},[177],[116,18156,18157,18160],{"style":18103},[116,18158],{"className":18159,"style":742},[187],[116,18161,18163],{"className":18162},[746,747,748,749],[116,18164,3158],{"className":18165},[137,138,749],[116,18167,234],{"className":18168},[233],[116,18170,18172],{"className":18171},[173],[116,18173,18175],{"className":18174,"style":762},[177],[116,18176],{},[116,18178],{"className":18179,"style":145},[144],[116,18181,150],{"className":18182},[149],[116,18184],{"className":18185,"style":145},[144],[116,18187,18189,18192,18195,18198,18201,18208,18211,18214,18217,18220,18223,18263],{"className":18188},[128],[116,18190],{"className":18191,"style":552},[132],[116,18193,17825],{"className":18194},[137,138],[116,18196],{"className":18197,"style":279},[144],[116,18199],{"className":18200,"style":279},[144],[116,18202,18204],{"className":18203},[1126],[116,18205,18207],{"className":18206},[137,3388],"sign",[116,18209,562],{"className":18210},[561],[116,18212,16070],{"className":18213,"style":16069},[137],[116,18215,4716],{"className":18216},[137,138],[116,18218,201],{"className":18219},[137],[116,18221,16070],{"className":18222,"style":16069},[137],[116,18224,18226,18229],{"className":18225},[137],[116,18227,566],{"className":18228},[137,138],[116,18230,18232],{"className":18231},[725],[116,18233,18235,18255],{"className":18234},[168,169],[116,18236,18238,18252],{"className":18237},[173],[116,18239,18241],{"className":18240,"style":3145},[177],[116,18242,18243,18246],{"style":3584},[116,18244],{"className":18245,"style":742},[187],[116,18247,18249],{"className":18248},[746,747,748,749],[116,18250,3158],{"className":18251},[137,138,749],[116,18253,234],{"className":18254},[233],[116,18256,18258],{"className":18257},[173],[116,18259,18261],{"className":18260,"style":762},[177],[116,18262],{},[116,18264,652],{"className":18265},[651],".\nStacking the coordinates gives one signed-gradient step,",[116,18268,18270],{"className":18269},[702],[116,18271,18273],{"className":18272},[119],[116,18274,18276,18338,18356],{"className":18275,"ariaHidden":124},[123],[116,18277,18279,18282,18329,18332,18335],{"className":18278},[128],[116,18280],{"className":18281,"style":9326},[132],[116,18283,18285,18288],{"className":18284},[137],[116,18286,566],{"className":18287},[137,138],[116,18289,18291],{"className":18290},[725],[116,18292,18294,18321],{"className":18293},[168,169],[116,18295,18297,18318],{"className":18296},[173],[116,18298,18300],{"className":18299,"style":5301},[177],[116,18301,18302,18305],{"style":3584},[116,18303],{"className":18304,"style":742},[187],[116,18306,18308],{"className":18307},[746,747,748,749],[116,18309,18311],{"className":18310},[137,749],[116,18312,18314],{"className":18313},[137,431,749],[116,18315,18317],{"className":18316},[137,749],"adv",[116,18319,234],{"className":18320},[233],[116,18322,18324],{"className":18323},[173],[116,18325,18327],{"className":18326,"style":762},[177],[116,18328],{},[116,18330],{"className":18331,"style":145},[144],[116,18333,150],{"className":18334},[149],[116,18336],{"className":18337,"style":145},[144],[116,18339,18341,18344,18347,18350,18353],{"className":18340},[128],[116,18342],{"className":18343,"style":2930},[132],[116,18345,566],{"className":18346},[137,138],[116,18348],{"className":18349,"style":570},[144],[116,18351,575],{"className":18352},[574],[116,18354],{"className":18355,"style":570},[144],[116,18357,18359,18362,18365,18368,18371,18377,18380,18383,18389,18429,18432,18435,18438,18441,18444,18447,18450,18453,18456,18459,18465],{"className":18358},[128],[116,18360],{"className":18361,"style":7685},[132],[116,18363,17825],{"className":18364},[137,138],[116,18366],{"className":18367,"style":279},[144],[116,18369],{"className":18370,"style":279},[144],[116,18372,18374],{"className":18373},[1126],[116,18375,18207],{"className":18376},[137,3388],[116,18378],{"className":18379,"style":5218},[144],[116,18381],{"className":18382,"style":279},[144],[116,18384,18386],{"className":18385},[137],[116,18387,562],{"className":18388},[1091,1002],[116,18390,18392,18395],{"className":18391},[137],[116,18393,8365],{"className":18394},[137],[116,18396,18398],{"className":18397},[725],[116,18399,18401,18421],{"className":18400},[168,169],[116,18402,18404,18418],{"className":18403},[173],[116,18405,18407],{"className":18406,"style":735},[177],[116,18408,18409,18412],{"style":3584},[116,18410],{"className":18411,"style":742},[187],[116,18413,18415],{"className":18414},[746,747,748,749],[116,18416,566],{"className":18417},[137,138,749],[116,18419,234],{"className":18420},[233],[116,18422,18424],{"className":18423},[173],[116,18425,18427],{"className":18426,"style":762},[177],[116,18428],{},[116,18430,4716],{"className":18431},[137,138],[116,18433,562],{"className":18434},[561],[116,18436,11426],{"className":18437,"style":205},[137,138],[116,18439,594],{"className":18440},[593],[116,18442],{"className":18443,"style":279},[144],[116,18445,566],{"className":18446},[137,138],[116,18448,594],{"className":18449},[593],[116,18451],{"className":18452,"style":279},[144],[116,18454,601],{"className":18455,"style":139},[137,138],[116,18457,652],{"className":18458},[651],[116,18460,18462],{"className":18461},[137],[116,18463,652],{"className":18464},[1091,1002],[116,18466,594],{"className":18467},[593],[73,18469,18470],{},"a single gradient evaluation that pushes every pixel the largest allowed\nstep in the direction that hurts most.",[246,18472],{"hash":18473},"28922522faddba19b4f8e2ea5ca002cf4edf59f9059a06200a920a06c996930a",[73,18475,18476,18477,18480,18481,18514,18515,18549,18550,18584,18585,3225],{},"A single step is easy to defend against, so the code uses the stronger\niterated version, ",[108,18478,18479],{},"LinfPGDAttack",". It\ntakes ",[116,18482,18484],{"className":18483},[119],[116,18485,18487,18505],{"className":18486,"ariaHidden":124},[123],[116,18488,18490,18493,18496,18499,18502],{"className":18489},[128],[116,18491],{"className":18492,"style":4022},[132],[116,18494,4382],{"className":18495,"style":4381},[137,138],[116,18497],{"className":18498,"style":145},[144],[116,18500,150],{"className":18501},[149],[116,18503],{"className":18504,"style":145},[144],[116,18506,18508,18511],{"className":18507},[128],[116,18509],{"className":18510,"style":1890},[132],[116,18512,6043],{"className":18513},[137]," smaller steps of size ",[116,18516,18518],{"className":18517},[119],[116,18519,18521,18539],{"className":18520,"ariaHidden":124},[123],[116,18522,18524,18527,18530,18533,18536],{"className":18523},[128],[116,18525],{"className":18526,"style":133},[132],[116,18528,15813],{"className":18529,"style":15812},[137,138],[116,18531],{"className":18532,"style":145},[144],[116,18534,150],{"className":18535},[149],[116,18537],{"className":18538,"style":145},[144],[116,18540,18542,18545],{"className":18541},[128],[116,18543],{"className":18544,"style":1890},[132],[116,18546,18548],{"className":18547},[137],"0.00784",", and after each one\nprojects the result back into the ",[116,18551,18553],{"className":18552},[119],[116,18554,18556,18574],{"className":18555,"ariaHidden":124},[123],[116,18557,18559,18562,18565,18568,18571],{"className":18558},[128],[116,18560],{"className":18561,"style":133},[132],[116,18563,17825],{"className":18564},[137,138],[116,18566],{"className":18567,"style":145},[144],[116,18569,150],{"className":18570},[149],[116,18572],{"className":18573,"style":145},[144],[116,18575,18577,18580],{"className":18576},[128],[116,18578],{"className":18579,"style":1890},[132],[116,18581,18583],{"className":18582},[137],"0.0314"," box around the clean\nimage and clamps it to valid pixel range ",[116,18586,18588],{"className":18587},[119],[116,18589,18591],{"className":18590,"ariaHidden":124},[123],[116,18592,18594,18597,18600,18603,18606,18609,18612],{"className":18593},[128],[116,18595],{"className":18596,"style":552},[132],[116,18598,1092],{"className":18599},[561],[116,18601,331],{"className":18602},[137],[116,18604,594],{"className":18605},[593],[116,18607],{"className":18608,"style":279},[144],[116,18610,345],{"className":18611},[137],[116,18613,1493],{"className":18614},[651],[116,18616,18618],{"className":18617},[702],[116,18619,18621],{"className":18620},[119],[116,18622,18624,18684,18872],{"className":18623,"ariaHidden":124},[123],[116,18625,18627,18631,18675,18678,18681],{"className":18626},[128],[116,18628],{"className":18629,"style":18630},[132],"height:0.938em;",[116,18632,18634,18637],{"className":18633},[137],[116,18635,566],{"className":18636},[137,138],[116,18638,18640],{"className":18639},[725],[116,18641,18643],{"className":18642},[168],[116,18644,18646],{"className":18645},[173],[116,18647,18649],{"className":18648,"style":18630},[177],[116,18650,18651,18654],{"style":2488},[116,18652],{"className":18653,"style":742},[187],[116,18655,18657],{"className":18656},[746,747,748,749],[116,18658,18660,18663,18666,18669,18672],{"className":18659},[137,749],[116,18661,562],{"className":18662},[561,749],[116,18664,287],{"className":18665},[137,138,749],[116,18667,575],{"className":18668},[574,749],[116,18670,345],{"className":18671},[137,749],[116,18673,652],{"className":18674},[651,749],[116,18676],{"className":18677,"style":145},[144],[116,18679,150],{"className":18680},[149],[116,18682],{"className":18683,"style":145},[144],[116,18685,18687,18690,18752,18755,18758,18764,18767,18816,18819,18825,18863,18866,18869],{"className":18686},[128],[116,18688],{"className":18689,"style":16823},[132],[116,18691,18693,18700],{"className":18692},[1126],[116,18694,18696],{"className":18695},[1126],[116,18697,18699],{"className":18698},[137,3388],"clip",[116,18701,18703],{"className":18702},[725],[116,18704,18706,18743],{"className":18705},[168,169],[116,18707,18709,18740],{"className":18708},[173],[116,18710,18713],{"className":18711,"style":18712},[177],"height:0.2809em;",[116,18714,18716,18719],{"style":18715},"top:-2.4559em;margin-right:0.05em;",[116,18717],{"className":18718,"style":742},[187],[116,18720,18722],{"className":18721},[746,747,748,749],[116,18723,18725,18728,18731,18734,18737],{"className":18724},[137,749],[116,18726,1092],{"className":18727},[561,749],[116,18729,331],{"className":18730},[137,749],[116,18732,594],{"className":18733},[593,749],[116,18735,345],{"className":18736},[137,749],[116,18738,1493],{"className":18739},[651,749],[116,18741,234],{"className":18742},[233],[116,18744,18746],{"className":18745},[173],[116,18747,18750],{"className":18748,"style":18749},[177],"height:0.4191em;",[116,18751],{},[116,18753],{"className":18754,"style":5218},[144],[116,18756],{"className":18757,"style":279},[144],[116,18759,18761],{"className":18760},[137],[116,18762,562],{"className":18763},[1091,16264],[116,18765],{"className":18766,"style":279},[144],[116,18768,18770,18777],{"className":18769},[1126],[116,18771,18773],{"className":18772},[1126],[116,18774,18776],{"className":18775},[137,3388],"proj",[116,18778,18780],{"className":18779},[725],[116,18781,18783,18807],{"className":18782},[168,169],[116,18784,18786,18804],{"className":18785},[173],[116,18787,18790],{"className":18788,"style":18789},[177],"height:0.0573em;",[116,18791,18792,18795],{"style":18715},[116,18793],{"className":18794,"style":742},[187],[116,18796,18798],{"className":18797},[746,747,748,749],[116,18799,18801],{"className":18800},[137,749],[116,18802,17825],{"className":18803},[137,138,749],[116,18805,234],{"className":18806},[233],[116,18808,18810],{"className":18809},[173],[116,18811,18814],{"className":18812,"style":18813},[177],"height:0.2441em;",[116,18815],{},[116,18817],{"className":18818,"style":279},[144],[116,18820,18822],{"className":18821},[137],[116,18823,562],{"className":18824},[1091,1002],[116,18826,18828,18831],{"className":18827},[137],[116,18829,566],{"className":18830},[137,138],[116,18832,18834],{"className":18833},[725],[116,18835,18837],{"className":18836},[168],[116,18838,18840],{"className":18839},[173],[116,18841,18843],{"className":18842,"style":18630},[177],[116,18844,18845,18848],{"style":2488},[116,18846],{"className":18847,"style":742},[187],[116,18849,18851],{"className":18850},[746,747,748,749],[116,18852,18854,18857,18860],{"className":18853},[137,749],[116,18855,562],{"className":18856},[561,749],[116,18858,287],{"className":18859},[137,138,749],[116,18861,652],{"className":18862},[651,749],[116,18864],{"className":18865,"style":570},[144],[116,18867,575],{"className":18868},[574],[116,18870],{"className":18871,"style":570},[144],[116,18873,18875,18878,18881,18884,18887,18893,18896,18936,18939,18942,18948,18954],{"className":18874},[128],[116,18876],{"className":18877,"style":16823},[132],[116,18879,15813],{"className":18880,"style":15812},[137,138],[116,18882],{"className":18883,"style":279},[144],[116,18885],{"className":18886,"style":279},[144],[116,18888,18890],{"className":18889},[1126],[116,18891,18207],{"className":18892},[137,3388],[116,18894,562],{"className":18895},[561],[116,18897,18899,18902],{"className":18898},[137],[116,18900,8365],{"className":18901},[137],[116,18903,18905],{"className":18904},[725],[116,18906,18908,18928],{"className":18907},[168,169],[116,18909,18911,18925],{"className":18910},[173],[116,18912,18914],{"className":18913,"style":735},[177],[116,18915,18916,18919],{"style":3584},[116,18917],{"className":18918,"style":742},[187],[116,18920,18922],{"className":18921},[746,747,748,749],[116,18923,566],{"className":18924},[137,138,749],[116,18926,234],{"className":18927},[233],[116,18929,18931],{"className":18930},[173],[116,18932,18934],{"className":18933,"style":762},[177],[116,18935],{},[116,18937,4716],{"className":18938},[137,138],[116,18940,652],{"className":18941},[651],[116,18943,18945],{"className":18944},[137],[116,18946,652],{"className":18947},[1091,1002],[116,18949,18951],{"className":18950},[137],[116,18952,652],{"className":18953},[1091,16264],[116,18955,1852],{"className":18956},[137],[73,18958,18959],{},"Projected gradient descent is iterated signed-gradient ascent — the single\nstep above, run seven times, staying inside the allowed perturbation.",[73,18961,18962,18963,18966,18967,19022,19023,19026,19027,19030,19031,19099],{},"Adversarial training scores each batch twice, once on clean images and once\non freshly perturbed ones, with the total loss the mean of the two. Both passes go through ",[108,18964,18965],{},"mixup"," first — inputs and their\nlabels are blended in a random ratio ",[116,18968,18970],{"className":18969},[119],[116,18971,18973,18991],{"className":18972,"ariaHidden":124},[123],[116,18974,18976,18979,18982,18985,18988],{"className":18975},[128],[116,18977],{"className":18978,"style":4022},[132],[116,18980,8745],{"className":18981},[137,138],[116,18983],{"className":18984,"style":145},[144],[116,18986,5790],{"className":18987},[149],[116,18989],{"className":18990,"style":145},[144],[116,18992,18994,18997,19004,19007,19010,19013,19016,19019],{"className":18993},[128],[116,18995],{"className":18996,"style":552},[132],[116,18998,19000],{"className":18999},[1126],[116,19001,19003],{"className":19002},[137,3388],"Beta",[116,19005,562],{"className":19006},[561],[116,19008,345],{"className":19009},[137],[116,19011,594],{"className":19012},[593],[116,19014],{"className":19015,"style":279},[144],[116,19017,345],{"className":19018},[137],[116,19020,652],{"className":19021},[651],",\nand the loss is the matching convex combination of the two label targets.\nThe perturbation is regenerated every step from the current weights, so the\nadversary moves as the model learns. The network trains with SGD (learning\nrate ",[108,19024,19025],{},"0.1",", momentum ",[108,19028,19029],{},"0.9",", weight decay ",[116,19032,19034],{"className":19033},[119],[116,19035,19037,19055],{"className":19036,"ariaHidden":124},[123],[116,19038,19040,19043,19046,19049,19052],{"className":19039},[128],[116,19041],{"className":19042,"style":1871},[132],[116,19044,359],{"className":19045},[137],[116,19047],{"className":19048,"style":570},[144],[116,19050,439],{"className":19051},[574],[116,19053],{"className":19054,"style":570},[144],[116,19056,19058,19061,19064],{"className":19057},[128],[116,19059],{"className":19060,"style":1152},[132],[116,19062,345],{"className":19063},[137],[116,19065,19067,19070],{"className":19066},[137],[116,19068,331],{"className":19069},[137],[116,19071,19073],{"className":19072},[725],[116,19074,19076],{"className":19075},[168],[116,19077,19079],{"className":19078},[173],[116,19080,19082],{"className":19081,"style":1152},[177],[116,19083,19084,19087],{"style":1167},[116,19085],{"className":19086,"style":742},[187],[116,19088,19090],{"className":19089},[746,747,748,749],[116,19091,19093,19096],{"className":19092},[137,749],[116,19094,1610],{"className":19095},[137,749],[116,19097,5993],{"className":19098},[137,749],") for 25 epochs,\nunder random crops and horizontal flips.",[73,19101,19102,19103,15209,19106,19109,19110,19113],{},"Over those epochs the logged runs show robust accuracy — accuracy on the PGD\nexamples — climbing from about ",[505,19104,19105],{},"23%",[505,19107,19108],{},"41%",", while clean accuracy rises\nto about ",[505,19111,19112],{},"82%",". The persistent gap between the two is the point.",[73,19115,19116,19117,19120,19121,19154,19155,19160],{},"A separate experiment fine-tunes a pretrained ResNet-18 (its head swapped for a ",[108,19118,19119],{},"512 → 64 → 20"," classifier with\ndropout ",[116,19122,19124],{"className":19123},[119],[116,19125,19127,19145],{"className":19126,"ariaHidden":124},[123],[116,19128,19130,19133,19136,19139,19142],{"className":19129},[128],[116,19131],{"className":19132,"style":7009},[132],[116,19134,73],{"className":19135},[137,138],[116,19137],{"className":19138,"style":145},[144],[116,19140,150],{"className":19141},[149],[116,19143],{"className":19144,"style":145},[144],[116,19146,19148,19151],{"className":19147},[128],[116,19149],{"className":19150,"style":1890},[132],[116,19152,7499],{"className":19153},[137],") on a 20-class flowers dataset under four augmentation\npipelines of increasing strength — resized crop; plus horizontal flip; plus\n30-degree rotation; plus color jitter — at 10, 30, and 50 epochs.\n",[76,19156,19159],{"href":19157,"rel":19158},"https:\u002F\u002Fwww.datacamp.com\u002Ftutorial\u002Fcomplete-guide-data-augmentation",[80],"Augmentation","\nwidens the training distribution, but heavier pipelines converge slower: at\n50 epochs the crop-and-flip pipeline reaches the best test accuracy (~0.76),\nwhile the rotation and color-jitter variants still trail.",[73,19162,19163,19164,19169],{},"A defense can look robust for the wrong reason.\nMany early methods only degrade the gradient the attacker relies on —\nshattered, stochastic, or vanishing gradients — so a\n",[76,19165,19168],{"href":19166,"rel":19167},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAdversarial_machine_learning",[80],"gradient-based attack","\nstalls while the model stays just as fragile underneath. This obfuscated- or\nmasked-gradient failure hides until an adaptive attack routes around it:\nbackward pass differentiable approximation (BPDA) substitutes a usable\ngradient for the non-differentiable step, and expectation over transformation\naverages the randomness away. Apparent robustness therefore has to be checked\nagainst adaptive attacks tuned to the defense, not against FGSM or one fixed\nPGD budget alone.",[73,19171,19172,19173,19188],{},"Robustness and clean accuracy pull against each other, so these defenses are\nnot free. Training against worst-case perturbations optimizes a harder\nobjective than clean classification, and the two disagree: capacity spent\nflattening the loss\naround each training point blunts the sharp boundaries that fit clean data\nbest. The 82%-versus-41% split is that tension made numeric — the right\n",[116,19174,19176],{"className":19175},[119],[116,19177,19179],{"className":19178,"ariaHidden":124},[123],[116,19180,19182,19185],{"className":19181},[128],[116,19183],{"className":19184,"style":133},[132],[116,19186,17825],{"className":19187},[137,138]," is the one whose robustness is worth the clean accuracy it costs\nfor the threat you actually expect.",{"title":478,"searchDepth":479,"depth":479,"links":19190},[],"2023-05-17","Neural networks are brittle: a small, deliberately chosen perturbation of\nthe input can flip a confident prediction. This project trains a\nResNet-18 image\nclassifier on CIFAR-10 to resist that noise, then measures the cost of doing\nso.",{},"\u002Fprojects\u002Fdeep-learning\u002Fadversarial",[14937],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdeep-learning\u002Ftree\u002Fmain\u002Fhomeworks\u002F02",{"title":17731,"description":19192},"projects\u002Fdeep-learning\u002Fadversarial","Hardening a CIFAR-10 ResNet-18 against worst-case input noise: an iterated\nprojected-gradient attack, adversarial training mixed with mixup, and a\nseparate data-augmentation sweep.",[2279,3991,14944],"5B8sYyWMLAV_XCNEpoqtanH7CWrA31rhDoS_wCFlsHI",{"id":19203,"title":19204,"body":19205,"date":19309,"description":19310,"extension":483,"featured":2354,"meta":19311,"navigation":484,"path":19312,"references":2282,"repo":19313,"seo":19314,"stem":19315,"summary":19316,"tag":13031,"tech":19317,"url":19318,"__hash__":19319},"projects\u002Fprojects\u002Fweb\u002Fmnml-yt.md","Minimal Youtube Player",{"type":70,"value":19206,"toc":19307},[19207,19230,19273,19304],[73,19208,19209,19210,2344,19213,19216,19217,19220,19221,19224,19225,1852],{},"A minimal YouTube player: search for a video, watch it, and nothing else.\nNo recommended-video rail, no comments, no autoplay into an unrelated\nfeed. Built with ",[76,19211,15485],{"href":15483,"rel":19212},[80],[76,19214,13034],{"href":13852,"rel":19215},[80]," on\n",[76,19218,15499],{"href":15497,"rel":19219},[80],", styled in ",[76,19222,14967],{"href":14965,"rel":19223},[80],", over\nthe ",[76,19226,19229],{"href":19227,"rel":19228},"https:\u002F\u002Fdevelopers.google.com\u002Fyoutube\u002Fv3",[80],"YouTube Data API",[73,19231,19232,19233,19236,19237,19239,19240,12861,19243,19246,19247,19250,19251,19254,19255,19257,19258,19261,19262,19265,19266,13768,19269,19272],{},"Search and playback stay separate concerns. ",[108,19234,19235],{},"youtubeSearch"," calls the\nData API's ",[108,19238,12923],{}," endpoint with ",[108,19241,19242],{},"part=snippet",[108,19244,19245],{},"type=video",",\nreturning a list of ",[108,19248,19249],{},"Video"," objects, each an ",[108,19252,19253],{},"id.videoId"," plus the\nsnippet title, description, and thumbnail. The app renders those as a\nplain list; selecting one drops its ",[108,19256,12841],{}," into a\n",[108,19259,19260],{},"youtube.com\u002Fembed\u002F{id}"," iframe. The search request supplies ",[442,19263,19264],{},"what to\nwatch",", the embed supplies ",[442,19267,19268],{},"how to watch it",[108,19270,19271],{},"VideoDetail"," wires the\ntwo together.",[73,19274,19275,19276,19279,19280,19283,19284,19286,19287,12917,19290,13768,19293,19295,19296,19299,19300,19303],{},"All the state lives in one place. ",[108,19277,19278],{},"App"," holds two pieces of ",[108,19281,19282],{},"useState",", the result\narray and the selected ",[108,19285,19249],{},", and passes them down to ",[108,19288,19289],{},"SearchBar",[108,19291,19292],{},"VideoList",[108,19294,19271],{},". Typing runs through a hand-written\n",[108,19297,19298],{},"debounce"," (500ms) so a call fires only once the keystrokes pause, sparing\nthe API quota; the mount seeds one query so the first paint is not blank.\nThere is no account and no persistence, so a reload starts clean, and the\nAPI key is the one piece of configuration, read from ",[108,19301,19302],{},"import.meta.env","\nrather than committed.",[73,19305,19306],{},"The design goal drove every cut: the interface is a search field and a\nsingle player, styled in Sass to stay out of the way. Removing YouTube's\nsurrounding surface is the whole feature.",{"title":478,"searchDepth":479,"depth":479,"links":19308},[],"2023-05-13","A minimal YouTube player: search for a video, watch it, and nothing else.\nNo recommended-video rail, no comments, no autoplay into an unrelated\nfeed. Built with React and\nTypeScript on\nVite, styled in Sass, over\nthe YouTube Data API.",{},"\u002Fprojects\u002Fweb\u002Fmnml-yt","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fmnml-yt",{"title":19204,"description":19310},"projects\u002Fweb\u002Fmnml-yt","A distraction-free YouTube player — search and playback over the Data API,\nwith none of the recommendations, comments, or sidebars.",[13823,15485,13034,14967],"https:\u002F\u002Fmnml-yt.amittai.studio","V-CLEi_oSn7UOtqIGWnpcbvvIoYO3UEII-FjTk70yxc",{"id":19321,"title":19322,"body":19323,"date":19447,"description":19448,"extension":483,"featured":2354,"meta":19449,"navigation":484,"path":19450,"references":2282,"repo":19451,"seo":19452,"stem":19453,"summary":19454,"tag":13031,"tech":19455,"url":19456,"__hash__":19457},"projects\u002Fprojects\u002Fweb\u002Fposts-platform.md","Posts Platform",{"type":70,"value":19324,"toc":19445},[19325,19346,19393],[73,19326,19327,19328,12917,19331,13502,19336,15494,19339,19342,19343,1852],{},"A small blog-style front-end for writing and reading posts: a list of\neverything, a page per post, and forms to create, edit, or delete one.\nBuilt with ",[76,19329,15485],{"href":15483,"rel":19330},[80],[76,19332,19335],{"href":19333,"rel":19334},"https:\u002F\u002Fwww.javascript.com",[80],"JavaScript",[76,19337,14967],{"href":14965,"rel":19338},[80],[76,19340,15499],{"href":15497,"rel":19341},[80],",\nwith global state in ",[76,19344,15493],{"href":15491,"rel":19345},[80],[73,19347,19348,19349,19352,19353,19356,19357,19362,19363,19366,19367,19370,19371,5452,19374,13768,19377,19380,19381,19384,19385,19388,19389,19392],{},"The front-end is a client over an API, owning no database of its own. Every action in\n",[108,19350,19351],{},"actions\u002Findex.js"," is a thunk over ",[76,19354,15547],{"href":15545,"rel":19355},[80]," against\nthe ",[76,19358,19361],{"href":19359,"rel":19360},"https:\u002F\u002Fplatform-api.amittai.studio",[80],"Posts Platform API",": ",[108,19364,19365],{},"fetchPosts","\nand ",[108,19368,19369],{},"fetchPost"," read, ",[108,19372,19373],{},"createPost",[108,19375,19376],{},"updatePost",[108,19378,19379],{},"deletePost"," write,\neach hitting the ",[108,19382,19383],{},"\u002Fposts"," routes at the deployed API root. After a\nmutation the thunk re-fetches the list and uses ",[108,19386,19387],{},"react-router"," to navigate\nto the affected post, so the store follows the server rather than guessing\nahead of it. ",[76,19390,13036],{"href":13847,"rel":19391},[80]," persists everything behind\nthat service, so the board is the same on the next visit.",[73,19394,19395,19396,19399,19400,19403,19404,19407,19408,13768,19411,19414,19415,19417,19418,19423,19424,19426,19427,19430,19431,19434,19435,19438,19439,19444],{},"State and routing stay cleanly separated. A single ",[108,19397,19398],{},"PostsReducer",", written with\n",[76,19401,15534],{"href":15532,"rel":19402},[80],", holds ",[108,19405,19406],{},"posts"," and the\n",[108,19409,19410],{},"currentPost",[108,19412,19413],{},"combineReducers"," mounts it under ",[108,19416,19406],{},".\n",[76,19419,19422],{"href":19420,"rel":19421},"https:\u002F\u002Freactrouter.com",[80],"react-router-dom"," lays out the pages: ",[108,19425,201],{}," for the\nlist, ",[108,19428,19429],{},"\u002Fposts\u002Fnew"," to compose, ",[108,19432,19433],{},"\u002Fposts\u002F:postID"," to read, and\n",[108,19436,19437],{},"\u002Fposts\u002F:postID\u002Fedit"," to revise, with a catch-all for anything else. Post\nbodies render as Markdown through\n",[76,19440,19443],{"href":19441,"rel":19442},"https:\u002F\u002Fgithub.com\u002Fremarkjs\u002Freact-markdown",[80],"react-markdown",", the nav pulls\nits links from the current post list in the store, and Sass carries the\nstyling down to a cursor-following flourish on the page.",{"title":478,"searchDepth":479,"depth":479,"links":19446},[],"2023-05-10","A small blog-style front-end for writing and reading posts: a list of\neverything, a page per post, and forms to create, edit, or delete one.\nBuilt with React,\nJavaScript, and\nSass, bundled with Vite,\nwith global state in Redux.",{},"\u002Fprojects\u002Fweb\u002Fposts-platform","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fposts-platform",{"title":19322,"description":19448},"projects\u002Fweb\u002Fposts-platform","A small blog-style posts front-end: React and Redux over the Posts Platform\nAPI, with routed pages for reading, writing, and editing Markdown posts.",[13823,15485,19335,14967,13036],"https:\u002F\u002Fposts-platform.amittai.studio","xMcLU74LVWmOd1R0cCeyt6vdQE00yLAnQc4rAZ6rmHg",{"id":19459,"title":19460,"body":19461,"date":19873,"description":19874,"extension":483,"featured":2354,"meta":19875,"navigation":484,"path":19876,"references":2282,"repo":19877,"seo":19878,"stem":19879,"summary":19880,"tag":13031,"tech":19881,"url":19882,"__hash__":19883},"projects\u002Fprojects\u002Fweb\u002Fkahoots-api.md","Kahoots API",{"type":70,"value":19462,"toc":19871},[19463,19486,19501,19536,19790,19868],[73,19464,19465,19466,19471,19472,12917,19475,13768,19478,19482,19483,1852],{},"An HTTP API for running ",[76,19467,19470],{"href":19468,"rel":19469},"https:\u002F\u002Fkahoot.com",[80],"Kahoot","-style quiz games: a\nhost builds a quiz, players join a live session with a game code, and\neveryone answers the same timed multiple-choice questions. Built with\n",[76,19473,13034],{"href":13852,"rel":19474},[80],[76,19476,13859],{"href":13857,"rel":19477},[80],[76,19479,13035],{"href":19480,"rel":19481},"https:\u002F\u002Fnodejs.org",[80],", with\nquizzes and game state persisted in ",[76,19484,13036],{"href":13847,"rel":19485},[80],[73,19487,19488,19489,19492,19493,19496,19497,19500],{},"The API is organized around three resources exposed over HTTP.\nA ",[505,19490,19491],{},"quiz"," is an ordered list of questions, each with its choices and the\nindex of the correct one. A ",[505,19494,19495],{},"game"," is a session created from a quiz,\nidentified by a join code. A ",[505,19498,19499],{},"player"," belongs to a game and accumulates\na running score. Express routers expose create, read, update, and delete\nover each, and Mongo stores them as documents so a session survives\nbetween requests rather than living in process memory.",[73,19502,19503,19504,19519,19520,19535],{},"Scoring is time-weighted: a correct answer earns points scaled by how\nquickly it arrives inside the question's time limit, and a wrong answer earns\nnothing. With response time ",[116,19505,19507],{"className":19506},[119],[116,19508,19510],{"className":19509,"ariaHidden":124},[123],[116,19511,19513,19516],{"className":19512},[128],[116,19514],{"className":19515,"style":2770},[132],[116,19517,287],{"className":19518},[137,138]," and question limit ",[116,19521,19523],{"className":19522},[119],[116,19524,19526],{"className":19525,"ariaHidden":124},[123],[116,19527,19529,19532],{"className":19528},[128],[116,19530],{"className":19531,"style":272},[132],[116,19533,17096],{"className":19534,"style":924},[137,138],", the standard rule\nawards",[116,19537,19539],{"className":19538},[702],[116,19540,19542],{"className":19541},[119],[116,19543,19545,19567],{"className":19544,"ariaHidden":124},[123],[116,19546,19548,19551,19558,19561,19564],{"className":19547},[128],[116,19549],{"className":19550,"style":133},[132],[116,19552,19554],{"className":19553},[1126],[116,19555,19557],{"className":19556},[137,3388],"score",[116,19559],{"className":19560,"style":145},[144],[116,19562,150],{"className":19563},[149],[116,19565],{"className":19566,"style":145},[144],[116,19568,19570,19573,19741,19744],{"className":19569},[128],[116,19571],{"className":19572,"style":7685},[132],[116,19574,19576,19582,19585,19588,19591,19594,19663,19666,19735],{"className":19575},[946],[116,19577,19579],{"className":19578,"style":1087},[561,1086],[116,19580,562],{"className":19581},[1091,1002],[116,19583,345],{"className":19584},[137],[116,19586],{"className":19587,"style":570},[144],[116,19589,1610],{"className":19590},[574],[116,19592],{"className":19593,"style":570},[144],[116,19595,19597,19600,19660],{"className":19596},[137],[116,19598],{"className":19599},[561,4427],[116,19601,19603],{"className":19602},[4431],[116,19604,19606,19652],{"className":19605},[168,169],[116,19607,19609,19649],{"className":19608},[173],[116,19610,19613,19627,19635],{"className":19611,"style":19612},[177],"height:0.8451em;",[116,19614,19615,19618],{"style":8709},[116,19616],{"className":19617,"style":1119},[187],[116,19619,19621],{"className":19620},[746,747,748,749],[116,19622,19624],{"className":19623},[137,749],[116,19625,359],{"className":19626},[137,749],[116,19628,19629,19632],{"style":4597},[116,19630],{"className":19631,"style":1119},[187],[116,19633],{"className":19634,"style":4605},[4604],[116,19636,19637,19640],{"style":8732},[116,19638],{"className":19639,"style":1119},[187],[116,19641,19643],{"className":19642},[746,747,748,749],[116,19644,19646],{"className":19645},[137,749],[116,19647,345],{"className":19648},[137,749],[116,19650,234],{"className":19651},[233],[116,19653,19655],{"className":19654},[173],[116,19656,19658],{"className":19657,"style":8755},[177],[116,19659],{},[116,19661],{"className":19662},[651,4427],[116,19664],{"className":19665,"style":279},[144],[116,19667,19669,19672,19732],{"className":19668},[137],[116,19670],{"className":19671},[561,4427],[116,19673,19675],{"className":19674},[4431],[116,19676,19678,19724],{"className":19677},[168,169],[116,19679,19681,19721],{"className":19680},[173],[116,19682,19685,19699,19707],{"className":19683,"style":19684},[177],"height:0.8246em;",[116,19686,19687,19690],{"style":8709},[116,19688],{"className":19689,"style":1119},[187],[116,19691,19693],{"className":19692},[746,747,748,749],[116,19694,19696],{"className":19695},[137,749],[116,19697,17096],{"className":19698,"style":924},[137,138,749],[116,19700,19701,19704],{"style":4597},[116,19702],{"className":19703,"style":1119},[187],[116,19705],{"className":19706,"style":4605},[4604],[116,19708,19709,19712],{"style":8732},[116,19710],{"className":19711,"style":1119},[187],[116,19713,19715],{"className":19714},[746,747,748,749],[116,19716,19718],{"className":19717},[137,749],[116,19719,287],{"className":19720},[137,138,749],[116,19722,234],{"className":19723},[233],[116,19725,19727],{"className":19726},[173],[116,19728,19730],{"className":19729,"style":8755},[177],[116,19731],{},[116,19733],{"className":19734},[651,4427],[116,19736,19738],{"className":19737,"style":1087},[651,1086],[116,19739,652],{"className":19740},[1091,1002],[116,19742],{"className":19743,"style":279},[144],[116,19745,19747,19750],{"className":19746},[137],[116,19748,2794],{"className":19749,"style":924},[137,138],[116,19751,19753],{"className":19752},[725],[116,19754,19756,19782],{"className":19755},[168,169],[116,19757,19759,19779],{"className":19758},[173],[116,19760,19762],{"className":19761,"style":735},[177],[116,19763,19764,19767],{"style":3148},[116,19765],{"className":19766,"style":742},[187],[116,19768,19770],{"className":19769},[746,747,748,749],[116,19771,19773],{"className":19772},[137,749],[116,19774,19776],{"className":19775},[1126,749],[116,19777,9027],{"className":19778},[137,3388,749],[116,19780,234],{"className":19781},[233],[116,19783,19785],{"className":19784},[173],[116,19786,19788],{"className":19787,"style":762},[177],[116,19789],{},[73,19791,19792,19793,19808,19809,19867],{},"for a correct answer and ",[116,19794,19796],{"className":19795},[119],[116,19797,19799],{"className":19798,"ariaHidden":124},[123],[116,19800,19802,19805],{"className":19801},[128],[116,19803],{"className":19804,"style":1890},[132],[116,19806,331],{"className":19807},[137]," otherwise, so an instant answer is worth the\nfull ",[116,19810,19812],{"className":19811},[119],[116,19813,19815],{"className":19814,"ariaHidden":124},[123],[116,19816,19818,19821],{"className":19817},[128],[116,19819],{"className":19820,"style":715},[132],[116,19822,19824,19827],{"className":19823},[137],[116,19825,2794],{"className":19826,"style":924},[137,138],[116,19828,19830],{"className":19829},[725],[116,19831,19833,19859],{"className":19832},[168,169],[116,19834,19836,19856],{"className":19835},[173],[116,19837,19839],{"className":19838,"style":735},[177],[116,19840,19841,19844],{"style":3148},[116,19842],{"className":19843,"style":742},[187],[116,19845,19847],{"className":19846},[746,747,748,749],[116,19848,19850],{"className":19849},[137,749],[116,19851,19853],{"className":19852},[1126,749],[116,19854,9027],{"className":19855},[137,3388,749],[116,19857,234],{"className":19858},[233],[116,19860,19862],{"className":19861},[173],[116,19863,19865],{"className":19864,"style":762},[177],[116,19866],{}," and one at the buzzer is worth half. The server times each\nquestion from when it is served, which keeps scoring authoritative on the\nbackend rather than trusting a client-reported clock.",[73,19869,19870],{},"The game flow runs as a small state machine: a session moves through a lobby\nwhile players join, then one question phase per question, then a results phase that reveals the\nanswer and the updated standings. The server holds the current phase and\nadvances it, so every client reads the same state from one source.",{"title":478,"searchDepth":479,"depth":479,"links":19872},[],"2023-05-04","An HTTP API for running Kahoot-style quiz games: a\nhost builds a quiz, players join a live session with a game code, and\neveryone answers the same timed multiple-choice questions. Built with\nTypeScript,\nExpress, and Node, with\nquizzes and game state persisted in MongoDB.",{},"\u002Fprojects\u002Fweb\u002Fkahoots-api","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fkahoots-api.amitt.ai",{"title":19460,"description":19874},"projects\u002Fweb\u002Fkahoots-api","An HTTP API for Kahoot-style quiz games — quizzes, live sessions, and\ntime-weighted scoring, built on TypeScript, Express, and MongoDB.",[13034,13859,13035],"https:\u002F\u002Fkahoots-api.amittai.studio","OciuGeeQklstjUTSVUtiM88gMW9ilwe6VPreRx52Djs",{"id":19885,"title":19886,"body":19887,"date":19993,"description":19994,"extension":483,"featured":2354,"meta":19995,"navigation":484,"path":19996,"references":2282,"repo":19997,"seo":19998,"stem":19999,"summary":20000,"tag":13031,"tech":20001,"url":20002,"__hash__":20003},"projects\u002Fprojects\u002Fweb\u002Fnotes-platform.md","Notes Platform",{"type":70,"value":19888,"toc":19991},[19889,19914,19959],[73,19890,19891,19894,19895,12917,19898,13502,19901,15494,19904,19907,19908,19913],{},[505,19892,19893],{},"NotePad"," is a board of sticky notes: create a note, drag it anywhere,\nresize it, and stack it over the others. Built with\n",[76,19896,15485],{"href":15483,"rel":19897},[80],[76,19899,13034],{"href":13852,"rel":19900},[80],[76,19902,14967],{"href":14965,"rel":19903},[80],[76,19905,15499],{"href":15497,"rel":19906},[80],",\nwith the ",[76,19909,19912],{"href":19910,"rel":19911},"https:\u002F\u002Ffirebase.google.com",[80],"Firebase"," Realtime Database holding\nthe notes.",[73,19915,19916,19917,19920,19921,2911,19924,19927,19928,19931,19932,19935,19936,19939,19940,13768,19943,19946,19947,19950,19951,19954,19955,19958],{},"Firebase carries the backend, so there is no server to run. A single\nservice, ",[108,19918,19919],{},"services\u002Fdatastore.ts",", wraps one Realtime Database reference,\n",[108,19922,19923],{},"notes",[108,19925,19926],{},"onNotesValueChange"," subscribes with ",[108,19929,19930],{},".on('value')"," and fires a\ncallback on every snapshot; ",[108,19933,19934],{},"addNote"," pushes a new record, ",[108,19937,19938],{},"updateNote","\ncalls ",[108,19941,19942],{},".child(id).update",[108,19944,19945],{},"deleteNote"," calls ",[108,19948,19949],{},".child(id).remove",". The\n",[108,19952,19953],{},"Notes"," container keeps the snapshot as a ",[108,19956,19957],{},"Map\u003Cstring, NoteType>"," and\nre-renders whenever Firebase pushes a change, so a note moved in one tab\nlands in another without a reload.",[73,19960,19961,19962,19965,19966,12861,19968,19970,19971,5452,19973,5452,19975,5452,19978,13889,19981,19983,19984,19986,19987,19990],{},"Every note carries its own geometry. A ",[108,19963,19964],{},"NoteType"," is ",[108,19967,12808],{},[108,19969,431],{}," plus\n",[108,19972,566],{},[108,19974,601],{},[108,19976,19977],{},"width",[108,19979,19980],{},"height",[108,19982,4166],{}," index. Dragging and resizing write\nthose coordinates back, and focusing a note lifts its ",[108,19985,4166],{}," above the rest so\nit comes to the front. Bodies render as Markdown through\n",[76,19988,19443],{"href":19441,"rel":19989},[80],", and a search\nbox filters the board by substring across each note's title and text,\nhighlighting the matches in place. Because persistence and sync are\ndelegated to Firebase, the code that remains is mostly the note-editing\nsurface itself.",{"title":478,"searchDepth":479,"depth":479,"links":19992},[],"2023-05-03","NotePad is a board of sticky notes: create a note, drag it anywhere,\nresize it, and stack it over the others. Built with\nReact,\nTypeScript, and\nSass, bundled with Vite,\nwith the Firebase Realtime Database holding\nthe notes.",{},"\u002Fprojects\u002Fweb\u002Fnotes-platform","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fnotes-platform",{"title":19886,"description":19994},"projects\u002Fweb\u002Fnotes-platform","NotePad, a board of draggable, resizable sticky notes backed by the Firebase\nRealtime Database, with live sync and client-side search.",[13823,15485,19335,14967,19912],"https:\u002F\u002Fnotes-platform.amittai.studio","RVujES0QPA3AvRVmiDVlpj0YYHxyD_lmOxKS76jRuqM",{"id":20005,"title":19361,"body":20006,"date":19993,"description":20155,"extension":483,"featured":2354,"meta":20156,"navigation":484,"path":20157,"references":2282,"repo":20158,"seo":20159,"stem":20160,"summary":20161,"tag":13031,"tech":20162,"url":19359,"__hash__":20163},"projects\u002Fprojects\u002Fweb\u002Fplatform-api.md",{"type":70,"value":20007,"toc":20153},[20008,20035,20038,20110,20128],[73,20009,20010,20011,20014,20015,12917,20018,13768,20021,20024,20025,20028,20029,20034],{},"The backend that serves the ",[76,20012,19322],{"href":19456,"rel":20013},[80],":\na small REST service that stores posts and hands them back to the\nfront-end. Built with ",[76,20016,13034],{"href":13852,"rel":20017},[80],[76,20019,13859],{"href":13857,"rel":20020},[80],[76,20022,13035],{"href":19480,"rel":20023},[80],", with\nposts persisted in ",[76,20026,13036],{"href":13847,"rel":20027},[80]," through\n",[76,20030,20033],{"href":20031,"rel":20032},"https:\u002F\u002Fmongoosejs.com",[80],"Mongoose",", and deployed on Vercel.",[246,20036],{"hash":20037},"37473b44b8349c57f9390a2e18dbf0a79abf9414fb2d2943ea38de42b475c2b1",[73,20039,20040,20041,12442,20044,20047,20048,20050,20051,20054,20055,13889,20058,20061,20062,20065,20066,20069,20070,20073,20074,20077,20078,20081,20082,20085,20086,20089,20090,20093,20094,12442,20097,5452,20099,12917,20102,5452,20105,5452,20107,20109],{},"The service does CRUD over one resource, a single Mongoose model,\n",[108,20042,20043],{},"Post",[108,20045,20046],{},"models\u002Fpost_model.ts","): a ",[108,20049,12808],{},", a ",[108,20052,20053],{},"tags"," array of strings,\n",[108,20056,20057],{},"content",[108,20059,20060],{},"coverUrl",". The router in ",[108,20063,20064],{},"router.ts",", mounted at ",[108,20067,20068],{},"\u002Fapi",",\nmaps HTTP verbs onto it: ",[108,20071,20072],{},"POST \u002Fposts"," creates, ",[108,20075,20076],{},"GET \u002Fposts"," lists, ",[108,20079,20080],{},"GET \u002Fposts\u002F:id"," fetches one, ",[108,20083,20084],{},"PUT \u002Fposts\u002F:id"," edits, and ",[108,20087,20088],{},"DELETE \u002Fposts\u002F:id","\nremoves. Each route stays thin, reading the body or the ",[108,20091,20092],{},":id",", calling the\nmatching function in ",[108,20095,20096],{},"post_controller.ts",[108,20098,19373],{},[108,20100,20101],{},"getPosts",[108,20103,20104],{},"getPost",[108,20106,19376],{},[108,20108,19379],{},"), and returning JSON.",[73,20111,20112,20113,20116,20117,20119,20120,20123,20124,20127],{},"A single ",[108,20114,20115],{},"PostType"," interface carries the types across the boundary,\ndeclaring a post's shape once and reusing it for the controller signatures\nand the request and response bodies, so a renamed field surfaces as a\ncompile error rather than a runtime surprise. One wrinkle rides on it: a post stores ",[108,20118,20053],{}," as an\narray, and ",[108,20121,20122],{},"reformatPostTags"," in ",[108,20125,20126],{},"utils"," joins them into a comma string on\nthe way out, so list and single-post responses both hand the front-end the\nform it expects.",[73,20129,20130,20131,20134,20135,5452,20138,20141,20142,20144,20145,20148,20149,20152],{},"The API stands alone by design. ",[108,20132,20133],{},"server.ts"," wires up ",[108,20136,20137],{},"cors",[108,20139,20140],{},"morgan"," request\nlogging, and JSON body parsing, then connects to ",[108,20143,13943],{}," and mounts\nthe router; ",[108,20146,20147],{},"api\u002Findex.ts"," re-exports the app for Vercel's serverless\nruntime. Keeping the API separate lets the\n",[76,20150,19322],{"href":19456,"rel":20151},[80]," front-end stay a\npure client while storage and validation live behind a stable set of\nroutes.",{"title":478,"searchDepth":479,"depth":479,"links":20154},[],"The backend that serves the Posts Platform:\na small REST service that stores posts and hands them back to the\nfront-end. Built with TypeScript,\nExpress, and Node, with\nposts persisted in MongoDB through\nMongoose, and deployed on Vercel.",{},"\u002Fprojects\u002Fweb\u002Fplatform-api","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fplatform-api",{"title":19361,"description":20155},"projects\u002Fweb\u002Fplatform-api","The REST backend for the Posts Platform — a single-resource CRUD service\nover posts, built on TypeScript, Express, and Mongoose, deployed on Vercel.",[13034,13859,13035,13036],"qNCDDZQx7LS6YrgicTAlmEsKHPyOTqG1hptCNvxEcaY",{"id":20165,"title":20166,"body":20167,"date":20243,"description":20244,"extension":483,"featured":2354,"meta":20245,"navigation":484,"path":20246,"references":2282,"repo":20247,"seo":20248,"stem":20249,"summary":20250,"tag":13031,"tech":20251,"url":20252,"__hash__":20253},"projects\u002Fprojects\u002Fweb\u002Fbuzzquiz.md","BuzzQuiz",{"type":70,"value":20168,"toc":20241},[20169,20197,20234],[73,20170,5131,20171,20176,20177,12917,20182,13768,20187,20190,20191,20196],{},[76,20172,20175],{"href":20173,"rel":20174},"https:\u002F\u002Fwww.buzzfeed.com",[80],"BuzzFeed","-style personality quiz that ends by picking one of\nsix dystopian sci-fi worlds: Foundation, Krypton, The Mandalorian, Rings of\nPower, The Expanse, or Westworld. It is built with vanilla ",[76,20178,20181],{"href":20179,"rel":20180},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FHTML",[80],"HTML",[76,20183,20186],{"href":20184,"rel":20185},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FCSS",[80],"CSS",[76,20188,19335],{"href":19333,"rel":20189},[80],", leaning on ",[76,20192,20195],{"href":20193,"rel":20194},"https:\u002F\u002Fjquery.com",[80],"jQuery"," for\nthe DOM work.",[73,20198,20199,20200,20203,20204,20207,20208,20050,20211,20214,20215,20218,20219,20222,20223,20225,20226,20229,20230,20233],{},"Everything runs in the browser, no backend. A ",[108,20201,20202],{},"State"," object loads\n",[108,20205,20206],{},"questions.json"," (each question a ",[108,20209,20210],{},"prompt",[108,20212,20213],{},"weight",", and six ",[108,20216,20217],{},"answers","\nkeyed to the worlds), then shuffles the questions and the answer order on\nevery run. Some questions are text, some are images, resolved by whether an\nanswer's ",[108,20220,20221],{},"value"," is empty. Selecting an answer adds that question's ",[108,20224,20213],{},"\nto the chosen world's tally in ",[108,20227,20228],{},"answerCounts",", and a progress bar fills as\n",[108,20231,20232],{},"currentQuestion"," advances.",[73,20235,20236,20237,20240],{},"When the questions run out, ",[108,20238,20239],{},"tally"," sorts the six counts and shows the top\nthree, with the winner as the recommendation. jQuery handles all of it —\nswapping in each question, wiring the answer inputs, driving the reset\nbutton and the result overlay — which is enough machinery for a single-page\nquiz and keeps the whole thing a static file anyone can host.",{"title":478,"searchDepth":479,"depth":479,"links":20242},[],"2023-04-24","A BuzzFeed-style personality quiz that ends by picking one of\nsix dystopian sci-fi worlds: Foundation, Krypton, The Mandalorian, Rings of\nPower, The Expanse, or Westworld. It is built with vanilla HTML,\nCSS, and JavaScript, leaning on jQuery for\nthe DOM work.",{},"\u002Fprojects\u002Fweb\u002Fbuzzquiz","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fbuzzquiz",{"title":20166,"description":20244},"projects\u002Fweb\u002Fbuzzquiz","A BuzzFeed-style quiz that maps your answers to one of six dystopian sci-fi\nworlds, built in vanilla HTML, CSS, and JavaScript with jQuery.",[13823,20181,20186,19335],"https:\u002F\u002Fbuzzquiz.amittai.studio","m_ZCNDQ_l0QLOth56NSW37xxGMbEDPO05xbkZ2o9PpU",{"id":20255,"title":20256,"body":20257,"date":20314,"description":20315,"extension":483,"featured":2354,"meta":20316,"navigation":484,"path":20317,"references":2282,"repo":20318,"seo":20319,"stem":20320,"summary":20321,"tag":13031,"tech":20322,"url":20274,"__hash__":20323},"projects\u002Fprojects\u002Fweb\u002Ftictoc.md","TicToc",{"type":70,"value":20258,"toc":20312},[20259,20277,20290],[73,20260,20261,20262,20267,20268,20271,20272,1852],{},"An ",[76,20263,20266],{"href":20264,"rel":20265},"https:\u002F\u002Fapple.com",[80],"Apple","-inspired page that turns the passing of time into\nsomething to watch. The README asks whether you can feel the dreadful ticking of\nit: a clock counts ",[442,20269,20270],{},"upward"," second by second while a progress ring sweeps six\ndegrees a tick — a full turn each minute — and the numerals counter-rotate\nagainst it. It lives at ",[76,20273,20276],{"href":20274,"rel":20275},"https:\u002F\u002Ftictoc.amittai.studio",[80],"tictoc.amittai.studio",[73,20278,20279,20280,20285,20286,20289],{},"The quotes are the real point. Every ten seconds a shuffled deck of lines fades\none out and the next in, mostly from\n",[76,20281,20284],{"href":20282,"rel":20283},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFoundation_(TV_series)",[80],"Foundation",", my favorite\nshow — Salvor Hardin, Gaal Dornick, Brother Day, Demerzel — with a few from\nelsewhere. When the deck runs out it reshuffles, so the order never repeats.\nClicking anywhere pauses both the clock and the rotation and puts up a ",[442,20287,20288],{},"Paused","\ncard until you click again.",[73,20291,20292,20293,20296,20297,12917,20300,20303,20304,20307,20308,20311],{},"It all runs on one small script. A soft blob trails the cursor, easing toward each new\npointer position over three seconds so it always lags a little behind. There is\nno build framework — a single ",[108,20294,20295],{},"Counter"," class in\n",[76,20298,13034],{"href":13852,"rel":20299},[80],[76,20301,20195],{"href":20193,"rel":20302},[80]," for the DOM and the quote fetch,\n",[76,20305,14967],{"href":14965,"rel":20306},[80]," for style, and ",[76,20309,15499],{"href":15497,"rel":20310},[80]," to\nbundle it. The page is static, so it loads instantly.",{"title":478,"searchDepth":479,"depth":479,"links":20313},[],"2023-04-23","An Apple-inspired page that turns the passing of time into\nsomething to watch. The README asks whether you can feel the dreadful ticking of\nit: a clock counts upward second by second while a progress ring sweeps six\ndegrees a tick — a full turn each minute — and the numerals counter-rotate\nagainst it. It lives at tictoc.amittai.studio.",{},"\u002Fprojects\u002Fweb\u002Ftictoc","https:\u002F\u002Fgithub.com\u002Flostflux\u002Ftictoc",{"title":20256,"description":20315},"projects\u002Fweb\u002Ftictoc","An Apple-inspired page: a clock that ticks upward, a blob that trails your\ncursor, and rotating quotes from Foundation and a few other favorites.",[13823,13034,14967],"EX_vswBpWZI7BoXWCWZW2b1LA8yEpAuDHZWHbaSCDBg",{"id":20325,"title":20326,"body":20327,"date":20922,"description":20923,"extension":483,"featured":2354,"meta":20924,"navigation":484,"path":20925,"references":20926,"repo":20927,"seo":20928,"stem":20929,"summary":20930,"tag":14942,"tech":20931,"url":2282,"__hash__":20932},"projects\u002Fprojects\u002Fdeep-learning\u002Fhyperparameter-tuning.md","Hyperparameter Tuning for Neural Networks",{"type":70,"value":20328,"toc":20920},[20329,20336,20339,20451,20470,20473,20575,20644,20914],[73,20330,20331,20332,20335],{},"Hyperparameters are the knobs set before training rather than learned during\nit, and they decide whether a network converges, overfits, or stalls. The\nlearning rate is the canonical example, but the knob this project actually\nvaried was ",[505,20333,20334],{},"capacity",", and it scored the effect with more than the\nheld-out error.",[73,20337,20338],{},"The learning rate sets the scale of every step. Gradient descent updates the\nweights by",[116,20340,20342],{"className":20341},[702],[116,20343,20345],{"className":20344},[119],[116,20346,20348,20366,20384],{"className":20347,"ariaHidden":124},[123],[116,20349,20351,20354,20357,20360,20363],{"className":20350},[128],[116,20352],{"className":20353,"style":4022},[132],[116,20355,11426],{"className":20356,"style":205},[137,138],[116,20358],{"className":20359,"style":145},[144],[116,20361,2195],{"className":20362},[149],[116,20364],{"className":20365,"style":145},[144],[116,20367,20369,20372,20375,20378,20381],{"className":20368},[128],[116,20370],{"className":20371,"style":11406},[132],[116,20373,11426],{"className":20374,"style":205},[137,138],[116,20376],{"className":20377,"style":570},[144],[116,20379,1610],{"className":20380},[574],[116,20382],{"className":20383,"style":570},[144],[116,20385,20387,20390,20393,20396,20436,20439,20442,20445,20448],{"className":20386},[128],[116,20388],{"className":20389,"style":552},[132],[116,20391,8551],{"className":20392,"style":139},[137,138],[116,20394],{"className":20395,"style":279},[144],[116,20397,20399,20402],{"className":20398},[137],[116,20400,8365],{"className":20401},[137],[116,20403,20405],{"className":20404},[725],[116,20406,20408,20428],{"className":20407},[168,169],[116,20409,20411,20425],{"className":20410},[173],[116,20412,20414],{"className":20413,"style":5301},[177],[116,20415,20416,20419],{"style":3584},[116,20417],{"className":20418,"style":742},[187],[116,20420,20422],{"className":20421},[746,747,748,749],[116,20423,11426],{"className":20424,"style":205},[137,138,749],[116,20426,234],{"className":20427},[233],[116,20429,20431],{"className":20430},[173],[116,20432,20434],{"className":20433,"style":762},[177],[116,20435],{},[116,20437,4716],{"className":20438},[137,138],[116,20440,562],{"className":20441},[561],[116,20443,11426],{"className":20444,"style":205},[137,138],[116,20446,652],{"className":20447},[651],[116,20449,594],{"className":20450},[593],[73,20452,20453,20454,20469],{},"so the step size ",[116,20455,20457],{"className":20456},[119],[116,20458,20460],{"className":20459,"ariaHidden":124},[123],[116,20461,20463,20466],{"className":20462},[128],[116,20464],{"className":20465,"style":7009},[132],[116,20467,8551],{"className":20468,"style":139},[137,138]," scales every update. Set it too large and each step\novershoots the minimum it is aiming at: the loss oscillates across the valley\nand, past a threshold, diverges. Set it too small and the same descent still\npoints downhill, but the walk is so short that training crawls and can settle\ninto the first poor basin it reaches.",[246,20471],{"hash":20472},"cbd69b99d93f116254683e9da393a1ea9bd1e24f09fc3ba48e5e8e1c47db8435",[73,20474,20475,20476,20479,20480,19026,20483,20485,20486,20488,20489,20504,20505,20539,20540,20574],{},"The experiment holds everything constant but capacity. The network is a\ntwo-layer fully connected classifier on CIFAR-10,\n",[108,20477,20478],{},"Linear(3072 → H) → ReLU → Linear(H → 10) → Softmax",", trained with SGD\n(learning rate ",[108,20481,20482],{},"0.001",[108,20484,19029],{},", batch size ",[108,20487,14479],{},") for 25 epochs. Only\nthe hidden width ",[116,20490,20492],{"className":20491},[119],[116,20493,20495],{"className":20494,"ariaHidden":124},[123],[116,20496,20498,20501],{"className":20497},[128],[116,20499],{"className":20500,"style":272},[132],[116,20502,5804],{"className":20503,"style":5803},[137,138]," changes: a wide model with ",[116,20506,20508],{"className":20507},[119],[116,20509,20511,20529],{"className":20510,"ariaHidden":124},[123],[116,20512,20514,20517,20520,20523,20526],{"className":20513},[128],[116,20515],{"className":20516,"style":272},[132],[116,20518,5804],{"className":20519,"style":5803},[137,138],[116,20521],{"className":20522,"style":145},[144],[116,20524,150],{"className":20525},[149],[116,20527],{"className":20528,"style":145},[144],[116,20530,20532,20535],{"className":20531},[128],[116,20533],{"className":20534,"style":1890},[132],[116,20536,20538],{"className":20537},[137],"1024"," (3.16M parameters)\nand a narrow one with ",[116,20541,20543],{"className":20542},[119],[116,20544,20546,20564],{"className":20545,"ariaHidden":124},[123],[116,20547,20549,20552,20555,20558,20561],{"className":20548},[128],[116,20550],{"className":20551,"style":272},[132],[116,20553,5804],{"className":20554,"style":5803},[137,138],[116,20556],{"className":20557,"style":145},[144],[116,20559,150],{"className":20560},[149],[116,20562],{"className":20563,"style":145},[144],[116,20565,20567,20570],{"className":20566},[128],[116,20568],{"className":20569,"style":1890},[132],[116,20571,20573],{"className":20572},[137],"256"," (0.79M). Wider means more freedom to fit the\ntraining set; the question is what that freedom costs on held-out data.",[73,20576,20577,20578,20639,20640,20643],{},"Training loss almost always improves with capacity, since it measures fit\nrather than generalization, so the code reads several\nother quantities off the trained weights: their Frobenius and spectral norms,\ntheir distance from initialization, an ",[116,20579,20581],{"className":20580},[119],[116,20582,20584],{"className":20583,"ariaHidden":124},[123],[116,20585,20587,20590],{"className":20586},[128],[116,20588],{"className":20589,"style":783},[132],[116,20591,20593,20596],{"className":20592},[137],[116,20594,4716],{"className":20595},[137,138],[116,20597,20599],{"className":20598},[725],[116,20600,20602,20631],{"className":20601},[168,169],[116,20603,20605,20628],{"className":20604},[173],[116,20606,20608],{"className":20607,"style":4068},[177],[116,20609,20610,20613],{"style":3584},[116,20611],{"className":20612,"style":742},[187],[116,20614,20616],{"className":20615},[746,747,748,749],[116,20617,20619,20622,20625],{"className":20618},[137,749],[116,20620,345],{"className":20621},[137,749],[116,20623,594],{"className":20624},[593,749],[116,20626,17795],{"className":20627},[137,749],[116,20629,234],{"className":20630},[233],[116,20632,20634],{"className":20633},[173],[116,20635,20637],{"className":20636,"style":822},[177],[116,20638],{}," norm, and the\n5th-percentile output ",[505,20641,20642],{},"margin"," (the correct-class logit minus the best\ncompetitor). These feed classical generalization bounds — a VC-dimension\nbound, a spectral–margin bound, and a Frobenius–margin bound — that estimate\nthe train\u002Ftest gap from the weights alone.",[73,20645,20646,20647,15209,20713,20779,20780,15209,20847,20913],{},"The two capacities separated on the bounds, not the error. The wide network\nreached a final training error of 0.47 against a validation error of 0.51; the\nnarrow one, 0.48 against 0.52. The error is nearly identical, yet every\ngeneralization bound shrank by roughly\nfour to five times when capacity dropped from 3.16M to 0.79M parameters (the\nVC bound from ",[116,20648,20650],{"className":20649},[119],[116,20651,20653,20672],{"className":20652,"ariaHidden":124},[123],[116,20654,20656,20659,20663,20666,20669],{"className":20655},[128],[116,20657],{"className":20658,"style":1871},[132],[116,20660,20662],{"className":20661},[137],"9.2",[116,20664],{"className":20665,"style":570},[144],[116,20667,439],{"className":20668},[574],[116,20670],{"className":20671,"style":570},[144],[116,20673,20675,20678,20681],{"className":20674},[128],[116,20676],{"className":20677,"style":1152},[132],[116,20679,345],{"className":20680},[137],[116,20682,20684,20687],{"className":20683},[137],[116,20685,331],{"className":20686},[137],[116,20688,20690],{"className":20689},[725],[116,20691,20693],{"className":20692},[168],[116,20694,20696],{"className":20695},[173],[116,20697,20699],{"className":20698,"style":1152},[177],[116,20700,20701,20704],{"style":1167},[116,20702],{"className":20703,"style":742},[187],[116,20705,20707],{"className":20706},[746,747,748,749],[116,20708,20710],{"className":20709},[137,749],[116,20711,6392],{"className":20712},[137,749],[116,20714,20716],{"className":20715},[119],[116,20717,20719,20738],{"className":20718,"ariaHidden":124},[123],[116,20720,20722,20725,20729,20732,20735],{"className":20721},[128],[116,20723],{"className":20724,"style":1871},[132],[116,20726,20728],{"className":20727},[137],"2.0",[116,20730],{"className":20731,"style":570},[144],[116,20733,439],{"className":20734},[574],[116,20736],{"className":20737,"style":570},[144],[116,20739,20741,20744,20747],{"className":20740},[128],[116,20742],{"className":20743,"style":1152},[132],[116,20745,345],{"className":20746},[137],[116,20748,20750,20753],{"className":20749},[137],[116,20751,331],{"className":20752},[137],[116,20754,20756],{"className":20755},[725],[116,20757,20759],{"className":20758},[168],[116,20760,20762],{"className":20761},[173],[116,20763,20765],{"className":20764,"style":1152},[177],[116,20766,20767,20770],{"style":1167},[116,20768],{"className":20769,"style":742},[187],[116,20771,20773],{"className":20772},[746,747,748,749],[116,20774,20776],{"className":20775},[137,749],[116,20777,6392],{"className":20778},[137,749],", the Frobenius–margin\nbound from ",[116,20781,20783],{"className":20782},[119],[116,20784,20786,20805],{"className":20785,"ariaHidden":124},[123],[116,20787,20789,20792,20796,20799,20802],{"className":20788},[128],[116,20790],{"className":20791,"style":1871},[132],[116,20793,20795],{"className":20794},[137],"1.9",[116,20797],{"className":20798,"style":570},[144],[116,20800,439],{"className":20801},[574],[116,20803],{"className":20804,"style":570},[144],[116,20806,20808,20811,20814],{"className":20807},[128],[116,20809],{"className":20810,"style":1152},[132],[116,20812,345],{"className":20813},[137],[116,20815,20817,20820],{"className":20816},[137],[116,20818,331],{"className":20819},[137],[116,20821,20823],{"className":20822},[725],[116,20824,20826],{"className":20825},[168],[116,20827,20829],{"className":20828},[173],[116,20830,20832],{"className":20831,"style":1152},[177],[116,20833,20834,20837],{"style":1167},[116,20835],{"className":20836,"style":742},[187],[116,20838,20840],{"className":20839},[746,747,748,749],[116,20841,20843],{"className":20842},[137,749],[116,20844,20846],{"className":20845},[137,749],"10",[116,20848,20850],{"className":20849},[119],[116,20851,20853,20872],{"className":20852,"ariaHidden":124},[123],[116,20854,20856,20859,20863,20866,20869],{"className":20855},[128],[116,20857],{"className":20858,"style":1871},[132],[116,20860,20862],{"className":20861},[137],"4.9",[116,20864],{"className":20865,"style":570},[144],[116,20867,439],{"className":20868},[574],[116,20870],{"className":20871,"style":570},[144],[116,20873,20875,20878,20881],{"className":20874},[128],[116,20876],{"className":20877,"style":1152},[132],[116,20879,345],{"className":20880},[137],[116,20882,20884,20887],{"className":20883},[137],[116,20885,331],{"className":20886},[137],[116,20888,20890],{"className":20889},[725],[116,20891,20893],{"className":20892},[168],[116,20894,20896],{"className":20895},[173],[116,20897,20899],{"className":20898,"style":1152},[177],[116,20900,20901,20904],{"style":1167},[116,20902],{"className":20903,"style":742},[187],[116,20905,20907],{"className":20906},[746,747,748,749],[116,20908,20910],{"className":20909},[137,749],[116,20911,6392],{"className":20912},[137,749],"). The bounds are\nnumerically vacuous — orders of magnitude above 1 — yet they track relative\ncapacity in the right direction, which is the point of computing them.",[73,20915,20916,20919],{},[505,20917,20918],{},"Early stopping"," caps the run cheaply: the loop halts once training loss\ndrops below a set threshold rather than always running to the fixed epoch\nbudget, so a model that fits fast does not keep grinding against noise it has\nalready learned.",{"title":478,"searchDepth":479,"depth":479,"links":20921},[],"2023-04-14","Hyperparameters are the knobs set before training rather than learned during\nit, and they decide whether a network converges, overfits, or stalls. The\nlearning rate is the canonical example, but the knob this project actually\nvaried was capacity, and it scored the effect with more than the\nheld-out error.",{},"\u002Fprojects\u002Fdeep-learning\u002Fhyperparameter-tuning",[14937,8855],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fdeep-learning\u002Ftree\u002Fmain\u002Fhomeworks\u002F01",{"title":20326,"description":20923},"projects\u002Fdeep-learning\u002Fhyperparameter-tuning","How capacity trades against generalization on a two-layer CIFAR-10\nclassifier — comparing a 1024- and a 256-unit network by their\ntrain\u002Fvalidation gap and by norm-based generalization bounds.",[2279,3991,14944],"mZwPc3H1dO1YG_cAHX7dufZer-dO6SynGbQvzpiXVks",{"id":20934,"title":20935,"body":20936,"date":21000,"description":21001,"extension":483,"featured":2354,"meta":21002,"navigation":484,"path":21003,"references":2282,"repo":21004,"seo":21005,"stem":21006,"summary":21007,"tag":13031,"tech":21008,"url":21009,"__hash__":21010},"projects\u002Fprojects\u002Fweb\u002Fjekyll.md","Jekyll Blog",{"type":70,"value":20937,"toc":20998},[20938,20953,20995],[73,20939,20940,20941,20946,20947,20952],{},"A small demo blog built on ",[76,20942,20945],{"href":20943,"rel":20944},"https:\u002F\u002Fjekyllrb.com",[80],"Jekyll",", the\n",[76,20948,20951],{"href":20949,"rel":20950},"https:\u002F\u002Fwww.ruby-lang.org",[80],"Ruby"," static-site generator. There is no\nserver and no database: posts are Markdown files with YAML front matter,\nand the whole site compiles to plain HTML at build time, served straight\nfrom disk.",[73,20954,20955,20956,20961,20962,20965,20966,20968,20969,20972,20973,20978,20979,20982,20983,20986,20987,20990,20991,20994],{},"It starts from the ",[76,20957,20960],{"href":20958,"rel":20959},"https:\u002F\u002Fgithub.com\u002Fcotes2020\u002Fjekyll-theme-chirpy",[80],"Chirpy","\ntheme, pulled in as a gem with its static assets vendored as a git\nsubmodule, then customized. ",[108,20963,20964],{},"_config.yml"," sets the site identity (\"Moon\nPod\"), ",[108,20967,13810],{}," selects the ",[108,20970,20971],{},"home"," layout, and the one real content\npage is a starter post on getting started with Jekyll. The custom work is a\nteam section: a ",[76,20974,20977],{"href":20975,"rel":20976},"https:\u002F\u002Fshopify.github.io\u002Fliquid\u002F",[80],"Liquid"," include\n(",[108,20980,20981],{},"_includes\u002Fteam.html",") loops over ",[108,20984,20985],{},"_data\u002Fteam.yaml"," — name, title, image,\nbio lines per member — and a hand-written ",[108,20988,20989],{},"team.scss"," styles the grid it\nproduces. A small Ruby plugin sets each post's ",[108,20992,20993],{},"last_modified_at"," from its\ngit history.",[73,20996,20997],{},"The point of the demo is the workflow: write a Markdown file, commit, and\nthe static output rebuilds. It is the same idea this portfolio site uses,\nscaled down to its smallest form.",{"title":478,"searchDepth":479,"depth":479,"links":20999},[],"2023-04-13","A small demo blog built on Jekyll, the\nRuby static-site generator. There is no\nserver and no database: posts are Markdown files with YAML front matter,\nand the whole site compiles to plain HTML at build time, served straight\nfrom disk.",{},"\u002Fprojects\u002Fweb\u002Fjekyll","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fjekyll-blog",{"title":20935,"description":21001},"projects\u002Fweb\u002Fjekyll","A minimal blog built on Jekyll — Markdown posts and Liquid templates\ncompiled to static HTML, with a hand-written Sass theme.",[13823,20945,20951,14967],"https:\u002F\u002Fjekyll-blog.amittai.studio","cFp4ykIjSEGS1JLAQEwFMM8KDpKdx1WOpNb_C4BYy-s",{"id":21012,"title":21013,"body":21014,"date":21094,"description":21095,"extension":483,"featured":2354,"meta":21096,"navigation":484,"path":21097,"references":2282,"repo":21098,"seo":21099,"stem":21100,"summary":21101,"tag":13031,"tech":21102,"url":50,"__hash__":21103},"projects\u002Fprojects\u002Fweb\u002Fblog.v1.md","Blog v1",{"type":70,"value":21015,"toc":21092},[21016,21035,21084],[73,21017,21018,21019,21023,21024,21027,21028,21031,21032,1852],{},"The first iteration of my personal blog and portfolio, kept online at\n",[76,21020,21022],{"href":50,"rel":21021},[80],"v1.amittai.studio",". It was built with ",[76,21025,99],{"href":97,"rel":21026},[80]," 3 (Vue) and\n",[76,21029,15316],{"href":14965,"rel":21030},[80],", and deployed on ",[76,21033,14979],{"href":14977,"rel":21034},[80],[73,21036,21037,21038,21041,21042,21044,21045,21048,21049,5452,21051,12917,21054,5452,21056,5452,21059,21062,21063,12861,21066,5452,21068,21073,21074,21077,21078,21083],{},"The content is Markdown under ",[76,21039,105],{"href":103,"rel":21040},[80],",\nrunning in document-driven mode so the folder tree ",[442,21043,12427],{}," the route tree —\n",[108,21046,21047],{},"content\u002F"," splits into jobs, projects, writing, research, and publications.\nAn atomic component library renders it: Prose overrides for the base\nMarkdown tags, custom MDC components, and root sections (",[108,21050,15386],{},[108,21052,21053],{},"About",[108,21055,15389],{},[108,21057,21058],{},"Jobs",[108,21060,21061],{},"Contact",") composing the landing page. Math runs through\n",[108,21064,21065],{},"remark-math",[108,21067,15003],{},[76,21069,21072],{"href":21070,"rel":21071},"https:\u002F\u002Fwww.algolia.com",[80],"Algolia"," backs\nsearch, ",[76,21075,19912],{"href":19910,"rel":21076},[80]," handles auth, and\n",[76,21079,21082],{"href":21080,"rel":21081},"https:\u002F\u002Fwww.dicebear.com",[80],"DiceBear"," generates avatars.",[73,21085,21086,21087,21091],{},"This version established the shape everything after it reused: Nuxt\nprerendering routes to static HTML, a component library for the recurring\nsections, and SCSS partials holding the type and color rules. The later\n",[76,21088,21090],{"href":13979,"rel":21089},[80],"blog"," rebuilt the design from scratch on the same\nfoundation; v1 stays up as the record of where it started.",{"title":478,"searchDepth":479,"depth":479,"links":21093},[],"2023-02-11","The first iteration of my personal blog and portfolio, kept online at\nv1.amittai.studio. It was built with Nuxt 3 (Vue) and\nSCSS, and deployed on Netlify.",{},"\u002Fprojects\u002Fweb\u002Fblog.v1","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fblog.v1",{"title":21013,"description":21095},"projects\u002Fweb\u002Fblog.v1","The first iteration of my personal blog and portfolio, built with Nuxt and\nSCSS, preserved at v1.amittai.studio.",[13823,13034,99],"spJhanZAuSJVXBBMDG8QNs5p0k6T0-EhpVXGoSaTRkg",{"id":21105,"title":21106,"body":21107,"date":21236,"description":21237,"extension":483,"featured":2354,"meta":21238,"navigation":484,"path":21239,"references":21240,"repo":21242,"seo":21243,"stem":21244,"summary":21245,"tag":21246,"tech":21247,"url":2282,"__hash__":21250},"projects\u002Fprojects\u002Fsystems\u002F61-nosql-app.md","NoSQL App",{"type":70,"value":21108,"toc":21234},[21109,21140,21178,21198,21224,21227],[73,21110,21111,21112,21116,21117,21121,21122,21125,21126,5452,21129,5452,21132,21135,21136,21139],{},"A blog server backed by ",[76,21113,13036],{"href":21114,"rel":21115},"https:\u002F\u002Fwww.mongodb.com\u002F",[80]," and driven\nby a ",[76,21118,2279],{"href":21119,"rel":21120},"https:\u002F\u002Fwww.python.org\u002F",[80]," client. One class,\n",[108,21123,21124],{},"MongoBlogServer",", maps four text commands — ",[108,21127,21128],{},"post",[108,21130,21131],{},"show",[108,21133,21134],{},"comment",",\nand ",[108,21137,21138],{},"delete"," — onto operations against a single collection.",[73,21141,21142,21143,21145,21146,21148,21149,5452,21152,5452,21155,5452,21157,20050,21160,21162,21163,20050,21166,13889,21169,21171,21172,21174,21175,21177],{},"Everything lives in database ",[108,21144,21090],{},", collection ",[108,21147,19406],{},", where both posts\nand comments are documents in that one collection. A post carries\n",[108,21150,21151],{},"blogName",[108,21153,21154],{},"userName",[108,21156,12808],{},[108,21158,21159],{},"postBody",[108,21161,20053],{},"\narray, a ",[108,21164,21165],{},"timestamp",[108,21167,21168],{},"permalink",[108,21170,15063],{}," array. The\npermalink is derived, not supplied: a post's is its blog name joined to\nits title with every non-alphanumeric run replaced by an underscore, and\na comment's is its timestamp. A unique index on ",[108,21173,21168],{}," enforces\nthat each is distinct, and a second index on ",[108,21176,21151],{}," turns \"show this\nblog\" into a keyed lookup rather than a scan of the collection.",[73,21179,21180,21181,21183,21184,21186,21187,21190,21191,21193,21194,21197],{},"Comments are stored as references rather than embedded. A comment is its\nown document in the same ",[108,21182,19406],{}," collection; the parent's ",[108,21185,15063],{}," array\nholds only the permalink strings of its children. A thread is therefore\na tree linked by permalink: ",[108,21188,21189],{},"show_posts"," finds a blog's posts, then walks\neach ",[108,21192,15063],{}," array with a ",[108,21195,21196],{},"find_one"," by permalink, recursing into\nnested replies. That is adjacency-by-reference in a store with no joins —\nthe relationship the application maintains, because MongoDB does not.",[73,21199,21200,21201,21203,21204,21206,21207,21210,21211,13611,21214,21216,21217,21220,21221,21223],{},"Each command is a short sequence of collection operations. ",[108,21202,21128],{}," inserts\na document; ",[108,21205,21134],{}," inserts a comment document and then ",[108,21208,21209],{},"$push","es its\npermalink into the parent with an ",[108,21212,21213],{},"update_one",[108,21215,21138],{}," is a soft delete\nthat ",[108,21218,21219],{},"$set","s ",[108,21222,21159],{}," to \"deleted by \u003Cuser>\" rather than removing the\ndocument, so replies that still reference it stay reachable.",[73,21225,21226],{},"The index behind those keyed lookups is a B-tree — the same balanced tree\nrelational engines reach for.",[73,21228,2338,21229,1852],{},[76,21230,21233],{"href":21231,"rel":21232},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fke-lou-898301133",[80],"Ke Lou",{"title":478,"searchDepth":479,"depth":479,"links":21235},[],"2022-11-03","A blog server backed by MongoDB and driven\nby a Python client. One class,\nMongoBlogServer, maps four text commands — post, show, comment,\nand delete — onto operations against a single collection.",{},"\u002Fprojects\u002Fsystems\u002F61-nosql-app",[21241],"https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fdata-structures\u002Fb-trees","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fnosql",{"title":21106,"description":21237},"projects\u002Fsystems\u002F61-nosql-app","A blog server on a MongoDB document store, driven by a Python client that\nposts, shows, comments on, and deletes threads in a single collection.","systems",[2279,13036,21248,21249],"NoSQL","Database Systems","zoFViOFEWwqzjOsAnD83PwtdkswL-Azd_5xazz-KmZc",{"id":21252,"title":21253,"body":21254,"date":21475,"description":21476,"extension":483,"featured":484,"meta":21477,"navigation":484,"path":21478,"references":21479,"repo":21480,"seo":21481,"stem":21482,"summary":21483,"tag":21246,"tech":21484,"url":2282,"__hash__":21485},"projects\u002Fprojects\u002Fsystems\u002F61-relational-app.md","Relational Database App",{"type":70,"value":21255,"toc":21473},[21256,21288,21348,21351,21406,21437,21465,21468],[73,21257,5131,21258,21263,21264,21267,21268,5452,21271,5452,21274,21277,21278,21281,21282,21287],{},[76,21259,21262],{"href":21260,"rel":21261},"https:\u002F\u002Fwww.mysql.com\u002F",[80],"MySQL"," editorial-management system for an\nacademic journal, driven from a ",[76,21265,2279],{"href":21119,"rel":21266},[80],"\ncommand-line client. People sign in as an ",[108,21269,21270],{},"Admin",[108,21272,21273],{},"Author",[108,21275,21276],{},"Reviewer",",\nor ",[108,21279,21280],{},"Editor",", and the schema carries a manuscript through its whole life:\nsubmission, assignment to reviewers, scoring, an accept\u002Freject decision,\ntypesetting, and finally placement in a published issue. The invariants\nthat keep that pipeline honest live in ",[76,21283,21286],{"href":21284,"rel":21285},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSQL",[80],"SQL","\ntriggers and stored routines, not in the client.",[73,21289,21290,21293,21294,21297,21298,21300,21301,21304,21305,21308,21309,21312,21313,21316,21317,2344,21320,21323,21324,12861,21326,21328,21329,13768,21332,2344,21334,21328,21336,21339,21340,21343,21344,21347],{},[108,21291,21292],{},"Manuscript"," is the hub of the schema. Each manuscript carries a\nresearch-interest code (",[108,21295,21296],{},"RICodes","), an assigned ",[108,21299,21280],{},", and, once\nplaced, an ",[108,21302,21303],{},"Issue",". Two junction tables record the many-to-many facts:\n",[108,21306,21307],{},"Manuscript_Author"," links a manuscript to its authors and keeps an\n",[108,21310,21311],{},"author_ordinal"," so the lead author is just ordinal 1, and\n",[108,21314,21315],{},"Reviewer_has_Manuscript"," holds each reviewer's five scores\n(appropriateness, clarity, methodology, experimental, recommendation),\nconstrained to the range 1 to 10. ",[108,21318,21319],{},"Reviewer_has_RICodes",[108,21321,21322],{},"Journal_has_RICodes"," attach interest codes to reviewers and journals;\n",[108,21325,21273],{},[108,21327,21276],{}," both point at ",[108,21330,21331],{},"Affiliation",[108,21333,21280],{},[108,21335,21303],{},[108,21337,21338],{},"Journal",". A single ",[108,21341,21342],{},"credentials"," table unifies\nlogins across all four roles through a ",[108,21345,21346],{},"(user_type, type_id)"," pair.",[246,21349],{"hash":21350},"09abace55b33db274651c3919b0b356576d585fdb4193ac475ac8146a1a29dc1",[73,21352,21353,21354,21357,21358,21361,21362,21365,21366,21369,21370,21373,21374,21377,21378,19417,21381,21384,21385,21388,21389,21392,21393,5452,21396,21135,21399,21402,21403,21405],{},"Triggers move the workflow rules out of the client and into the engine,\nwhere they fire for every writer.\n",[108,21355,21356],{},"AutoRejectManuscriptOnNoReviewers"," runs before a manuscript is inserted:\nif no reviewer holds its research-interest code, the row is stamped\n",[108,21359,21360],{},"rejected"," on arrival rather than entering a queue that can never clear.\nWhen a reviewer resigns, ",[108,21363,21364],{},"DeleteAssignmentOnReviewerResign"," clears their\nassignments and code links, and ",[108,21367,21368],{},"ResetManuscriptStatusonReviewerResign","\ninspects each manuscript they leave behind: if it now has no reviewer but\nanother qualified one exists, the manuscript is reset to ",[108,21371,21372],{},"Submitted"," and\na ",[108,21375,21376],{},"SIGNAL"," message is raised; otherwise it is set to ",[108,21379,21380],{},"Rejected",[108,21382,21383],{},"AutoAcceptManuscript"," collapses a step: a status set to ",[108,21386,21387],{},"Accepted","\nimmediately becomes ",[108,21390,21391],{},"Typesetting",". And ",[108,21394,21395],{},"IndexAuthor",[108,21397,21398],{},"IndexReviewer",[108,21400,21401],{},"IndexEditor"," each fire after an insert to create the matching\n",[108,21404,21342],{}," row, so every new person is a valid login without a second\nstatement from the client.",[73,21407,21408,21409,21412,21413,21415,21416,21418,21419,21422,21423,21426,21427,21430,21431,21433,21434,1852],{},"Decision logic and read-side rollups round out the database side. The\n",[108,21410,21411],{},"MakeDecision"," procedure averages a manuscript's reviewer scores and\nreturns ",[108,21414,21387],{}," when the total reaches 40, ",[108,21417,21380],{}," below it. The\nrollups are packaged as views: ",[108,21420,21421],{},"ReviewQueue"," gathers every under-review\nmanuscript with its\nreviewers concatenated into one row, ",[108,21424,21425],{},"PublishedIssues"," lists the\ncontents of each completed issue in page order, and\n",[108,21428,21429],{},"LeadAuthorManuscripts"," filters ",[108,21432,21307],{}," down to\n",[108,21435,21436],{},"author_ordinal = 1",[73,21438,21439,21440,21442,21443,5452,21446,5452,21449,21452,21453,21456,21457,21460,21461,21464],{},"The Python side stays thin. ",[108,21441,14924],{}," opens the connection and reads a\nuser ID; role modules (",[108,21444,21445],{},"author.py",[108,21447,21448],{},"editor.py",[108,21450,21451],{},"reviewer.py",") issue\nparameterized statements through ",[108,21454,21455],{},"dbutils.py",". A ",[108,21458,21459],{},"\u002Frebuild"," flag\nreconstructs the tables and a ",[108,21462,21463],{},"\u002Fpopulate"," flag seeds sample data;\notherwise only the two admin accounts exist. The interesting work sits in\nthe schema: the constraints, the automation, the consistency guarantees.",[73,21466,21467],{},"Lookups by key resolve through the engine's indexes — balanced\nB-trees — rather than a full table scan.",[73,21469,2338,21470,1852],{},[76,21471,21233],{"href":21231,"rel":21472},[80],{"title":478,"searchDepth":479,"depth":479,"links":21474},[],"2022-10-20","A MySQL editorial-management system for an\nacademic journal, driven from a Python\ncommand-line client. People sign in as an Admin, Author, Reviewer,\nor Editor, and the schema carries a manuscript through its whole life:\nsubmission, assignment to reviewers, scoring, an accept\u002Freject decision,\ntypesetting, and finally placement in a published issue. The invariants\nthat keep that pipeline honest live in SQL\ntriggers and stored routines, not in the client.",{},"\u002Fprojects\u002Fsystems\u002F61-relational-app",[21241],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Frelational",{"title":21253,"description":21476},"projects\u002Fsystems\u002F61-relational-app","A MySQL editorial-management system for an academic journal, driven from a\nPython CLI, with the manuscript lifecycle enforced by foreign keys,\ntriggers, and stored routines on the database side.",[2279,21262,21249],"EZ75R32dYYC63kaJI2DixIbKfx948WCiF_bRmsO0Fho",{"id":21487,"title":21488,"body":21489,"date":22804,"description":22805,"extension":483,"featured":2354,"meta":22806,"navigation":484,"path":22807,"references":22808,"repo":22810,"seo":22811,"stem":22812,"summary":22813,"tag":22814,"tech":22815,"url":2282,"__hash__":22817},"projects\u002Fprojects\u002Fml\u002Fml-ridge-lasso.md","Linear Regression Classifiers",{"type":70,"value":21490,"toc":22802},[21491,21505,21523,21991,22166,22241,22244,22352,22355,22641,22767],[73,21492,21493,21494,2344,21499,21504],{},"Linear regression with regularization, comparing\n",[76,21495,21498],{"href":21496,"rel":21497},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTikhonov_regularization",[80],"ridge",[76,21500,21503],{"href":21501,"rel":21502},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLasso_(statistics)",[80],"lasso"," on the same\ndata. Both add a penalty on the coefficient magnitudes to the\nleast-squares objective; the difference in the penalty's shape changes\nwhat the fitted model looks like.",[73,21506,21507,21508,3225],{},"Both share the same fit term and differ only in the penalty. Ordinary\nleast squares minimizes squared error alone, which overfits when features\nare many or correlated. Ridge and lasso add a norm penalty scaled by\n",[116,21509,21511],{"className":21510},[119],[116,21512,21514],{"className":21513,"ariaHidden":124},[123],[116,21515,21517,21520],{"className":21516},[128],[116,21518],{"className":21519,"style":4022},[132],[116,21521,8745],{"className":21522},[137,138],[116,21524,21526],{"className":21525},[702],[116,21527,21529],{"className":21528},[119],[116,21530,21532,21605,21629,21701,21840,21864,21933],{"className":21531,"ariaHidden":124},[123],[116,21533,21535,21538,21587,21590,21593,21596,21599,21602],{"className":21534},[128],[116,21536],{"className":21537,"style":11131},[132],[116,21539,21541,21546],{"className":21540},[137],[116,21542,21545],{"className":21543,"style":21544},[137,138],"margin-right:0.0962em;","J",[116,21547,21549],{"className":21548},[725],[116,21550,21552,21579],{"className":21551},[168,169],[116,21553,21555,21576],{"className":21554},[173],[116,21556,21558],{"className":21557,"style":5301},[177],[116,21559,21561,21564],{"style":21560},"top:-2.55em;margin-left:-0.0962em;margin-right:0.05em;",[116,21562],{"className":21563,"style":742},[187],[116,21565,21567],{"className":21566},[746,747,748,749],[116,21568,21570],{"className":21569},[137,749],[116,21571,21573],{"className":21572},[137,431,749],[116,21574,21498],{"className":21575},[137,749],[116,21577,234],{"className":21578},[233],[116,21580,21582],{"className":21581},[173],[116,21583,21585],{"className":21584,"style":822},[177],[116,21586],{},[116,21588,562],{"className":21589},[561],[116,21591,6825],{"className":21592,"style":4969},[137,4026],[116,21594,652],{"className":21595},[651],[116,21597],{"className":21598,"style":145},[144],[116,21600,150],{"className":21601},[149],[116,21603],{"className":21604,"style":145},[144],[116,21606,21608,21611,21614,21617,21620,21623,21626],{"className":21607},[128],[116,21609],{"className":21610,"style":552},[132],[116,21612,5020],{"className":21613},[561],[116,21615,2910],{"className":21616,"style":556},[137,138],[116,21618,6825],{"className":21619,"style":4969},[137,4026],[116,21621],{"className":21622,"style":570},[144],[116,21624,1610],{"className":21625},[574],[116,21627],{"className":21628,"style":570},[144],[116,21630,21632,21636,21639,21692,21695,21698],{"className":21631},[128],[116,21633],{"className":21634,"style":21635},[132],"height:1.1141em;vertical-align:-0.25em;",[116,21637,601],{"className":21638,"style":139},[137,138],[116,21640,21642,21645],{"className":21641},[651],[116,21643,5020],{"className":21644},[651],[116,21646,21648],{"className":21647},[725],[116,21649,21651,21684],{"className":21650},[168,169],[116,21652,21654,21681],{"className":21653},[173],[116,21655,21658,21670],{"className":21656,"style":21657},[177],"height:0.8641em;",[116,21659,21661,21664],{"style":21660},"top:-2.453em;margin-left:0em;margin-right:0.05em;",[116,21662],{"className":21663,"style":742},[187],[116,21665,21667],{"className":21666},[746,747,748,749],[116,21668,359],{"className":21669},[137,749],[116,21671,21672,21675],{"style":2488},[116,21673],{"className":21674,"style":742},[187],[116,21676,21678],{"className":21677},[746,747,748,749],[116,21679,359],{"className":21680},[137,749],[116,21682,234],{"className":21683},[233],[116,21685,21687],{"className":21686},[173],[116,21688,21690],{"className":21689,"style":1186},[177],[116,21691],{},[116,21693],{"className":21694,"style":570},[144],[116,21696,575],{"className":21697},[574],[116,21699],{"className":21700,"style":570},[144],[116,21702,21704,21707,21710,21713,21716,21767,21770,21773,21776,21822,21825,21828,21831,21834,21837],{"className":21703},[128],[116,21705],{"className":21706,"style":21635},[132],[116,21708,8745],{"className":21709},[137,138],[116,21711,5020],{"className":21712},[561],[116,21714,6825],{"className":21715,"style":4969},[137,4026],[116,21717,21719,21722],{"className":21718},[651],[116,21720,5020],{"className":21721},[651],[116,21723,21725],{"className":21724},[725],[116,21726,21728,21759],{"className":21727},[168,169],[116,21729,21731,21756],{"className":21730},[173],[116,21732,21734,21745],{"className":21733,"style":21657},[177],[116,21735,21736,21739],{"style":21660},[116,21737],{"className":21738,"style":742},[187],[116,21740,21742],{"className":21741},[746,747,748,749],[116,21743,359],{"className":21744},[137,749],[116,21746,21747,21750],{"style":2488},[116,21748],{"className":21749,"style":742},[187],[116,21751,21753],{"className":21752},[746,747,748,749],[116,21754,359],{"className":21755},[137,749],[116,21757,234],{"className":21758},[233],[116,21760,21762],{"className":21761},[173],[116,21763,21765],{"className":21764,"style":1186},[177],[116,21766],{},[116,21768,594],{"className":21769},[593],[116,21771],{"className":21772,"style":4159},[144],[116,21774],{"className":21775,"style":279},[144],[116,21777,21779,21782],{"className":21778},[137],[116,21780,21545],{"className":21781,"style":21544},[137,138],[116,21783,21785],{"className":21784},[725],[116,21786,21788,21814],{"className":21787},[168,169],[116,21789,21791,21811],{"className":21790},[173],[116,21792,21794],{"className":21793,"style":5301},[177],[116,21795,21796,21799],{"style":21560},[116,21797],{"className":21798,"style":742},[187],[116,21800,21802],{"className":21801},[746,747,748,749],[116,21803,21805],{"className":21804},[137,749],[116,21806,21808],{"className":21807},[137,431,749],[116,21809,21503],{"className":21810},[137,749],[116,21812,234],{"className":21813},[233],[116,21815,21817],{"className":21816},[173],[116,21818,21820],{"className":21819,"style":762},[177],[116,21821],{},[116,21823,562],{"className":21824},[561],[116,21826,6825],{"className":21827,"style":4969},[137,4026],[116,21829,652],{"className":21830},[651],[116,21832],{"className":21833,"style":145},[144],[116,21835,150],{"className":21836},[149],[116,21838],{"className":21839,"style":145},[144],[116,21841,21843,21846,21849,21852,21855,21858,21861],{"className":21842},[128],[116,21844],{"className":21845,"style":552},[132],[116,21847,5020],{"className":21848},[561],[116,21850,2910],{"className":21851,"style":556},[137,138],[116,21853,6825],{"className":21854,"style":4969},[137,4026],[116,21856],{"className":21857,"style":570},[144],[116,21859,1610],{"className":21860},[574],[116,21862],{"className":21863,"style":570},[144],[116,21865,21867,21870,21873,21924,21927,21930],{"className":21866},[128],[116,21868],{"className":21869,"style":21635},[132],[116,21871,601],{"className":21872,"style":139},[137,138],[116,21874,21876,21879],{"className":21875},[651],[116,21877,5020],{"className":21878},[651],[116,21880,21882],{"className":21881},[725],[116,21883,21885,21916],{"className":21884},[168,169],[116,21886,21888,21913],{"className":21887},[173],[116,21889,21891,21902],{"className":21890,"style":21657},[177],[116,21892,21893,21896],{"style":21660},[116,21894],{"className":21895,"style":742},[187],[116,21897,21899],{"className":21898},[746,747,748,749],[116,21900,359],{"className":21901},[137,749],[116,21903,21904,21907],{"style":2488},[116,21905],{"className":21906,"style":742},[187],[116,21908,21910],{"className":21909},[746,747,748,749],[116,21911,359],{"className":21912},[137,749],[116,21914,234],{"className":21915},[233],[116,21917,21919],{"className":21918},[173],[116,21920,21922],{"className":21921,"style":1186},[177],[116,21923],{},[116,21925],{"className":21926,"style":570},[144],[116,21928,575],{"className":21929},[574],[116,21931],{"className":21932,"style":570},[144],[116,21934,21936,21939,21942,21945,21948,21988],{"className":21935},[128],[116,21937],{"className":21938,"style":552},[132],[116,21940,8745],{"className":21941},[137,138],[116,21943,5020],{"className":21944},[561],[116,21946,6825],{"className":21947,"style":4969},[137,4026],[116,21949,21951,21954],{"className":21950},[651],[116,21952,5020],{"className":21953},[651],[116,21955,21957],{"className":21956},[725],[116,21958,21960,21980],{"className":21959},[168,169],[116,21961,21963,21977],{"className":21962},[173],[116,21964,21966],{"className":21965,"style":4068},[177],[116,21967,21968,21971],{"style":3584},[116,21969],{"className":21970,"style":742},[187],[116,21972,21974],{"className":21973},[746,747,748,749],[116,21975,345],{"className":21976},[137,749],[116,21978,234],{"className":21979},[233],[116,21981,21983],{"className":21982},[173],[116,21984,21986],{"className":21985,"style":762},[177],[116,21987],{},[116,21989,1852],{"className":21990},[137],[73,21992,21993,21994,22046,22047,22099,22100,22115,22116,22149,22150,22165],{},"Ridge penalizes the sum of squared coefficients (",[116,21995,21997],{"className":21996},[119],[116,21998,22000],{"className":21999,"ariaHidden":124},[123],[116,22001,22003,22006],{"className":22002},[128],[116,22004],{"className":22005,"style":715},[132],[116,22007,22009,22012],{"className":22008},[137],[116,22010,4716],{"className":22011},[137,138],[116,22013,22015],{"className":22014},[725],[116,22016,22018,22038],{"className":22017},[168,169],[116,22019,22021,22035],{"className":22020},[173],[116,22022,22024],{"className":22023,"style":4068},[177],[116,22025,22026,22029],{"style":3584},[116,22027],{"className":22028,"style":742},[187],[116,22030,22032],{"className":22031},[746,747,748,749],[116,22033,359],{"className":22034},[137,749],[116,22036,234],{"className":22037},[233],[116,22039,22041],{"className":22040},[173],[116,22042,22044],{"className":22043,"style":762},[177],[116,22045],{},"); lasso penalizes\nthe sum of absolute values (",[116,22048,22050],{"className":22049},[119],[116,22051,22053],{"className":22052,"ariaHidden":124},[123],[116,22054,22056,22059],{"className":22055},[128],[116,22057],{"className":22058,"style":715},[132],[116,22060,22062,22065],{"className":22061},[137],[116,22063,4716],{"className":22064},[137,138],[116,22066,22068],{"className":22067},[725],[116,22069,22071,22091],{"className":22070},[168,169],[116,22072,22074,22088],{"className":22073},[173],[116,22075,22077],{"className":22076,"style":4068},[177],[116,22078,22079,22082],{"style":3584},[116,22080],{"className":22081,"style":742},[187],[116,22083,22085],{"className":22084},[746,747,748,749],[116,22086,345],{"className":22087},[137,749],[116,22089,234],{"className":22090},[233],[116,22092,22094],{"className":22093},[173],[116,22095,22097],{"className":22096,"style":762},[177],[116,22098],{},"). In both, ",[116,22101,22103],{"className":22102},[119],[116,22104,22106],{"className":22105,"ariaHidden":124},[123],[116,22107,22109,22112],{"className":22108},[128],[116,22110],{"className":22111,"style":4022},[132],[116,22113,8745],{"className":22114},[137,138]," trades fit against\nmodel complexity: ",[116,22117,22119],{"className":22118},[119],[116,22120,22122,22140],{"className":22121,"ariaHidden":124},[123],[116,22123,22125,22128,22131,22134,22137],{"className":22124},[128],[116,22126],{"className":22127,"style":4022},[132],[116,22129,8745],{"className":22130},[137,138],[116,22132],{"className":22133,"style":145},[144],[116,22135,150],{"className":22136},[149],[116,22138],{"className":22139,"style":145},[144],[116,22141,22143,22146],{"className":22142},[128],[116,22144],{"className":22145,"style":1890},[132],[116,22147,331],{"className":22148},[137]," recovers plain least squares, and larger\n",[116,22151,22153],{"className":22152},[119],[116,22154,22156],{"className":22155,"ariaHidden":124},[123],[116,22157,22159,22162],{"className":22158},[128],[116,22160],{"className":22161,"style":4022},[132],[116,22163,8745],{"className":22164},[137,138]," shrinks the coefficients further toward zero.",[73,22167,22168,22169,22208,22209,22224,22225,22240],{},"Whether a penalty zeros coefficients comes down to the geometry of its\nconstraint region. Each penalized objective has an equivalent constrained\nform: minimize the squared error\nsubject to ",[116,22170,22172],{"className":22171},[119],[116,22173,22175,22199],{"className":22174,"ariaHidden":124},[123],[116,22176,22178,22181,22184,22187,22190,22193,22196],{"className":22177},[128],[116,22179],{"className":22180,"style":552},[132],[116,22182,5020],{"className":22183},[561],[116,22185,6825],{"className":22186,"style":4969},[137,4026],[116,22188,5020],{"className":22189},[651],[116,22191],{"className":22192,"style":145},[144],[116,22194,14886],{"className":22195},[149],[116,22197],{"className":22198,"style":145},[144],[116,22200,22202,22205],{"className":22201},[128],[116,22203],{"className":22204,"style":2770},[132],[116,22206,287],{"className":22207},[137,138],", with ",[116,22210,22212],{"className":22211},[119],[116,22213,22215],{"className":22214,"ariaHidden":124},[123],[116,22216,22218,22221],{"className":22217},[128],[116,22219],{"className":22220,"style":2770},[132],[116,22222,287],{"className":22223},[137,138]," set by ",[116,22226,22228],{"className":22227},[119],[116,22229,22231],{"className":22230,"ariaHidden":124},[123],[116,22232,22234,22237],{"className":22233},[128],[116,22235],{"className":22236,"style":4022},[132],[116,22238,8745],{"className":22239},[137,138],".\nThe squared-error term draws elliptical contours around the\nunconstrained least-squares solution, and the fit is the point where the\nsmallest contour first touches the feasible region. That region's shape\ndecides where they meet.",[246,22242],{"hash":22243},"324669d7b58a89276e582521d518e63b25920aa497b85342d3b4b34be919ce7a",[73,22245,11365,22246,22298,22299,22351],{},[116,22247,22249],{"className":22248},[119],[116,22250,22252],{"className":22251,"ariaHidden":124},[123],[116,22253,22255,22258],{"className":22254},[128],[116,22256],{"className":22257,"style":715},[132],[116,22259,22261,22264],{"className":22260},[137],[116,22262,4716],{"className":22263},[137,138],[116,22265,22267],{"className":22266},[725],[116,22268,22270,22290],{"className":22269},[168,169],[116,22271,22273,22287],{"className":22272},[173],[116,22274,22276],{"className":22275,"style":4068},[177],[116,22277,22278,22281],{"style":3584},[116,22279],{"className":22280,"style":742},[187],[116,22282,22284],{"className":22283},[746,747,748,749],[116,22285,345],{"className":22286},[137,749],[116,22288,234],{"className":22289},[233],[116,22291,22293],{"className":22292},[173],[116,22294,22296],{"className":22295,"style":762},[177],[116,22297],{}," region is a diamond with corners on the axes, and expanding\nellipses tend to first touch it at a corner — where some coordinate is\nexactly zero. The ",[116,22300,22302],{"className":22301},[119],[116,22303,22305],{"className":22304,"ariaHidden":124},[123],[116,22306,22308,22311],{"className":22307},[128],[116,22309],{"className":22310,"style":715},[132],[116,22312,22314,22317],{"className":22313},[137],[116,22315,4716],{"className":22316},[137,138],[116,22318,22320],{"className":22319},[725],[116,22321,22323,22343],{"className":22322},[168,169],[116,22324,22326,22340],{"className":22325},[173],[116,22327,22329],{"className":22328,"style":4068},[177],[116,22330,22331,22334],{"style":3584},[116,22332],{"className":22333,"style":742},[187],[116,22335,22337],{"className":22336},[746,747,748,749],[116,22338,359],{"className":22339},[137,749],[116,22341,234],{"className":22342},[233],[116,22344,22346],{"className":22345},[173],[116,22347,22349],{"className":22348,"style":762},[177],[116,22350],{}," region is a smooth ball with no corners, so the\ncontour touches at a generic point off the axes and ridge shrinks every\ncoefficient without setting any to zero. Ridge keeps all features with\nsmall weights; lasso performs feature selection, producing a sparse model\nthat names the few features that matter.",[73,22353,22354],{},"Ridge is differentiable everywhere, so setting its gradient to zero,",[116,22356,22358],{"className":22357},[702],[116,22359,22361],{"className":22360},[119],[116,22362,22364,22420,22441,22465,22491,22509,22559],{"className":22363,"ariaHidden":124},[123],[116,22365,22367,22370,22373,22402,22405,22408,22411,22414,22417],{"className":22366},[128],[116,22368],{"className":22369,"style":17965},[132],[116,22371,359],{"className":22372},[137],[116,22374,22376,22379],{"className":22375},[137],[116,22377,2910],{"className":22378,"style":556},[137,138],[116,22380,22382],{"className":22381},[725],[116,22383,22385],{"className":22384},[168],[116,22386,22388],{"className":22387},[173],[116,22389,22391],{"className":22390,"style":2467},[177],[116,22392,22393,22396],{"style":2488},[116,22394],{"className":22395,"style":742},[187],[116,22397,22399],{"className":22398},[746,747,748,749],[116,22400,1006],{"className":22401},[137,749],[116,22403,562],{"className":22404},[561],[116,22406,2910],{"className":22407,"style":556},[137,138],[116,22409,6825],{"className":22410,"style":4969},[137,4026],[116,22412],{"className":22413,"style":570},[144],[116,22415,1610],{"className":22416},[574],[116,22418],{"className":22419,"style":570},[144],[116,22421,22423,22426,22429,22432,22435,22438],{"className":22422},[128],[116,22424],{"className":22425,"style":552},[132],[116,22427,601],{"className":22428,"style":139},[137,138],[116,22430,652],{"className":22431},[651],[116,22433],{"className":22434,"style":570},[144],[116,22436,575],{"className":22437},[574],[116,22439],{"className":22440,"style":570},[144],[116,22442,22444,22447,22450,22453,22456,22459,22462],{"className":22443},[128],[116,22445],{"className":22446,"style":4022},[132],[116,22448,359],{"className":22449},[137],[116,22451,8745],{"className":22452},[137,138],[116,22454,6825],{"className":22455,"style":4969},[137,4026],[116,22457],{"className":22458,"style":145},[144],[116,22460,150],{"className":22461},[149],[116,22463],{"className":22464,"style":145},[144],[116,22466,22468,22472,22475,22478,22481,22485,22488],{"className":22467},[128],[116,22469],{"className":22470,"style":22471},[132],"height:0.6684em;vertical-align:-0.024em;",[116,22473,331],{"className":22474},[137],[116,22476],{"className":22477,"style":145},[144],[116,22479],{"className":22480,"style":145},[144],[116,22482,22484],{"className":22483},[149],"⟹",[116,22486],{"className":22487,"style":145},[144],[116,22489],{"className":22490,"style":145},[144],[116,22492,22494,22497,22500,22503,22506],{"className":22493},[128],[116,22495],{"className":22496,"style":4318},[132],[116,22498,6825],{"className":22499,"style":4969},[137,4026],[116,22501],{"className":22502,"style":145},[144],[116,22504,150],{"className":22505},[149],[116,22507],{"className":22508,"style":145},[144],[116,22510,22512,22515,22518,22547,22550,22553,22556],{"className":22511},[128],[116,22513],{"className":22514,"style":17965},[132],[116,22516,562],{"className":22517},[561],[116,22519,22521,22524],{"className":22520},[137],[116,22522,2910],{"className":22523,"style":556},[137,138],[116,22525,22527],{"className":22526},[725],[116,22528,22530],{"className":22529},[168],[116,22531,22533],{"className":22532},[173],[116,22534,22536],{"className":22535,"style":2467},[177],[116,22537,22538,22541],{"style":2488},[116,22539],{"className":22540,"style":742},[187],[116,22542,22544],{"className":22543},[746,747,748,749],[116,22545,1006],{"className":22546},[137,749],[116,22548,2910],{"className":22549,"style":556},[137,138],[116,22551],{"className":22552,"style":570},[144],[116,22554,575],{"className":22555},[574],[116,22557],{"className":22558,"style":570},[144],[116,22560,22562,22565,22568,22571,22606,22635,22638],{"className":22561},[128],[116,22563],{"className":22564,"style":17965},[132],[116,22566,8745],{"className":22567},[137,138],[116,22569,557],{"className":22570,"style":556},[137,138],[116,22572,22574,22577],{"className":22573},[651],[116,22575,652],{"className":22576},[651],[116,22578,22580],{"className":22579},[725],[116,22581,22583],{"className":22582},[168],[116,22584,22586],{"className":22585},[173],[116,22587,22589],{"className":22588,"style":21657},[177],[116,22590,22591,22594],{"style":2488},[116,22592],{"className":22593,"style":742},[187],[116,22595,22597],{"className":22596},[746,747,748,749],[116,22598,22600,22603],{"className":22599},[137,749],[116,22601,1610],{"className":22602},[137,749],[116,22604,345],{"className":22605},[137,749],[116,22607,22609,22612],{"className":22608},[137],[116,22610,2910],{"className":22611,"style":556},[137,138],[116,22613,22615],{"className":22614},[725],[116,22616,22618],{"className":22617},[168],[116,22619,22621],{"className":22620},[173],[116,22622,22624],{"className":22623,"style":2467},[177],[116,22625,22626,22629],{"style":2488},[116,22627],{"className":22628,"style":742},[187],[116,22630,22632],{"className":22631},[746,747,748,749],[116,22633,1006],{"className":22634},[137,749],[116,22636,601],{"className":22637,"style":139},[137,138],[116,22639,594],{"className":22640},[593],[73,22642,22643,22644,22662,22663,22707,22708,22766],{},"gives a closed form; the added ",[116,22645,22647],{"className":22646},[119],[116,22648,22650],{"className":22649,"ariaHidden":124},[123],[116,22651,22653,22656,22659],{"className":22652},[128],[116,22654],{"className":22655,"style":4022},[132],[116,22657,8745],{"className":22658},[137,138],[116,22660,557],{"className":22661,"style":556},[137,138]," also makes the inverse stable\nwhen ",[116,22664,22666],{"className":22665},[119],[116,22667,22669],{"className":22668,"ariaHidden":124},[123],[116,22670,22672,22675,22704],{"className":22671},[128],[116,22673],{"className":22674,"style":1907},[132],[116,22676,22678,22681],{"className":22677},[137],[116,22679,2910],{"className":22680,"style":556},[137,138],[116,22682,22684],{"className":22683},[725],[116,22685,22687],{"className":22686},[168],[116,22688,22690],{"className":22689},[173],[116,22691,22693],{"className":22692,"style":1907},[177],[116,22694,22695,22698],{"style":1167},[116,22696],{"className":22697,"style":742},[187],[116,22699,22701],{"className":22700},[746,747,748,749],[116,22702,1006],{"className":22703},[137,749],[116,22705,2910],{"className":22706,"style":556},[137,138]," is near-singular. Lasso has no closed form because\n",[116,22709,22711],{"className":22710},[119],[116,22712,22714],{"className":22713,"ariaHidden":124},[123],[116,22715,22717,22720,22723,22726],{"className":22716},[128],[116,22718],{"className":22719,"style":552},[132],[116,22721,5020],{"className":22722},[561],[116,22724,6825],{"className":22725,"style":4969},[137,4026],[116,22727,22729,22732],{"className":22728},[651],[116,22730,5020],{"className":22731},[651],[116,22733,22735],{"className":22734},[725],[116,22736,22738,22758],{"className":22737},[168,169],[116,22739,22741,22755],{"className":22740},[173],[116,22742,22744],{"className":22743,"style":4068},[177],[116,22745,22746,22749],{"style":3584},[116,22747],{"className":22748,"style":742},[187],[116,22750,22752],{"className":22751},[746,747,748,749],[116,22753,345],{"className":22754},[137,749],[116,22756,234],{"className":22757},[233],[116,22759,22761],{"className":22760},[173],[116,22762,22764],{"className":22763,"style":762},[177],[116,22765],{}," is not differentiable at zero — the very\nkink that produces the sparse corner — so it is solved iteratively with\ncoordinate descent or a subgradient method.",[73,22768,22769,22770,22785,22786,22801],{},"The penalty strength ",[116,22771,22773],{"className":22772},[119],[116,22774,22776],{"className":22775,"ariaHidden":124},[123],[116,22777,22779,22782],{"className":22778},[128],[116,22780],{"className":22781,"style":4022},[132],[116,22783,8745],{"className":22784},[137,138]," is a hyperparameter, tuned by\ncross-validation: fit at a grid of ",[116,22787,22789],{"className":22788},[119],[116,22790,22792],{"className":22791,"ariaHidden":124},[123],[116,22793,22795,22798],{"className":22794},[128],[116,22796],{"className":22797,"style":4022},[132],[116,22799,8745],{"className":22800},[137,138]," values, score each on\nheld-out folds, and keep the one that generalizes best.",{"title":478,"searchDepth":479,"depth":479,"links":22803},[],"2022-05-02","Linear regression with regularization, comparing\nridge and\nlasso on the same\ndata. Both add a penalty on the coefficient magnitudes to the\nleast-squares objective; the difference in the penalty's shape changes\nwhat the fitted model looks like.",{},"\u002Fprojects\u002Fml\u002Fml-ridge-lasso",[8855,22809],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Flearning\u002Flearning-from-examples","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fmachine-learning\u002Fblob\u002Fmain\u002FHW2\u002FHW2.ipynb",{"title":21488,"description":22805},"projects\u002Fml\u002Fml-ridge-lasso","Regularized linear regression — ridge (L2) and lasso (L1) — comparing how\neach penalty shrinks coefficients and why the L1 corner drives some to\nexactly zero.","machine learning",[2279,22816],"Machine Learning","3Yt9mBD_q5_rETOL2z8N1b6obm-EYv0mJ8Ak9-d_Wx4",{"id":22819,"title":22820,"body":22821,"date":24563,"description":24564,"extension":483,"featured":2354,"meta":24565,"navigation":484,"path":24566,"references":24567,"repo":24568,"seo":24569,"stem":24570,"summary":24571,"tag":22814,"tech":24572,"url":2282,"__hash__":24573},"projects\u002Fprojects\u002Fml\u002Fml-gradient-descent.md","Gradient Descent",{"type":70,"value":22822,"toc":24561},[22823,22832,22876,22991,23010,23211,23452,23859,24241,24244,24361,24364,24480,24524,24559],[73,22824,22825,22826,22831],{},"Regression models fit to a labeled dataset with no closed-form solver in\nplay: the parameters start arbitrary and\n",[76,22827,22830],{"href":22828,"rel":22829},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGradient_descent",[80],"gradient descent"," moves\nthem toward the values that minimize the loss. The point of the exercise\nis the optimizer itself — deriving the gradient of the loss and stepping\nagainst it.",[73,22833,22834,22835,22850,22851,22875],{},"For parameters ",[116,22836,22838],{"className":22837},[119],[116,22839,22841],{"className":22840,"ariaHidden":124},[123],[116,22842,22844,22847],{"className":22843},[128],[116,22845],{"className":22846,"style":4318},[132],[116,22848,6825],{"className":22849,"style":4969},[137,4026]," and a loss\n",[116,22852,22854],{"className":22853},[119],[116,22855,22857],{"className":22856,"ariaHidden":124},[123],[116,22858,22860,22863,22866,22869,22872],{"className":22859},[128],[116,22861],{"className":22862,"style":552},[132],[116,22864,21545],{"className":22865,"style":21544},[137,138],[116,22867,562],{"className":22868},[561],[116,22870,6825],{"className":22871,"style":4969},[137,4026],[116,22873,652],{"className":22874},[651]," averaged over the training set, gradient descent\nrepeatedly steps opposite the gradient:",[116,22877,22879],{"className":22878},[702],[116,22880,22882],{"className":22881},[119],[116,22883,22885,22903,22921],{"className":22884,"ariaHidden":124},[123],[116,22886,22888,22891,22894,22897,22900],{"className":22887},[128],[116,22889],{"className":22890,"style":4318},[132],[116,22892,6825],{"className":22893,"style":4969},[137,4026],[116,22895],{"className":22896,"style":145},[144],[116,22898,2195],{"className":22899},[149],[116,22901],{"className":22902,"style":145},[144],[116,22904,22906,22909,22912,22915,22918],{"className":22905},[128],[116,22907],{"className":22908,"style":2930},[132],[116,22910,6825],{"className":22911,"style":4969},[137,4026],[116,22913],{"className":22914,"style":570},[144],[116,22916,1610],{"className":22917},[574],[116,22919],{"className":22920,"style":570},[144],[116,22922,22924,22927,22930,22933,22976,22979,22982,22985,22988],{"className":22923},[128],[116,22925],{"className":22926,"style":552},[132],[116,22928,8551],{"className":22929,"style":139},[137,138],[116,22931],{"className":22932,"style":279},[144],[116,22934,22936,22939],{"className":22935},[137],[116,22937,8365],{"className":22938},[137],[116,22940,22942],{"className":22941},[725],[116,22943,22945,22968],{"className":22944},[168,169],[116,22946,22948,22965],{"className":22947},[173],[116,22949,22951],{"className":22950,"style":8378},[177],[116,22952,22953,22956],{"style":3584},[116,22954],{"className":22955,"style":742},[187],[116,22957,22959],{"className":22958},[746,747,748,749],[116,22960,22962],{"className":22961},[137,749],[116,22963,6825],{"className":22964,"style":4969},[137,4026,749],[116,22966,234],{"className":22967},[233],[116,22969,22971],{"className":22970},[173],[116,22972,22974],{"className":22973,"style":762},[177],[116,22975],{},[116,22977,21545],{"className":22978,"style":21544},[137,138],[116,22980,562],{"className":22981},[561],[116,22983,6825],{"className":22984,"style":4969},[137,4026],[116,22986,652],{"className":22987},[651],[116,22989,594],{"className":22990},[593],[73,22992,22993,22994,23009],{},"where the learning rate ",[116,22995,22997],{"className":22996},[119],[116,22998,23000],{"className":22999,"ariaHidden":124},[123],[116,23001,23003,23006],{"className":23002},[128],[116,23004],{"className":23005,"style":7009},[132],[116,23007,8551],{"className":23008,"style":139},[137,138]," sets the step size. The gradient points\nuphill, so its negation is the direction of steepest local decrease. For\na convex loss the iteration reaches the global minimum; otherwise it\nsettles into a local one.",[73,23011,23012,23013,23028,23029,3225],{},"Take squared-error loss over ",[116,23014,23016],{"className":23015},[119],[116,23017,23019],{"className":23018,"ariaHidden":124},[123],[116,23020,23022,23025],{"className":23021},[128],[116,23023],{"className":23024,"style":133},[132],[116,23026,10717],{"className":23027},[137,138]," examples, and\nwrite the per-example residual ",[116,23030,23032],{"className":23031},[119],[116,23033,23035,23091,23109,23165],{"className":23034,"ariaHidden":124},[123],[116,23036,23038,23041,23082,23085,23088],{"className":23037},[128],[116,23039],{"className":23040,"style":9326},[132],[116,23042,23044,23047],{"className":23043},[137],[116,23045,206],{"className":23046,"style":205},[137,138],[116,23048,23050],{"className":23049},[725],[116,23051,23053,23074],{"className":23052},[168,169],[116,23054,23056,23071],{"className":23055},[173],[116,23057,23059],{"className":23058,"style":3145},[177],[116,23060,23062,23065],{"style":23061},"top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;",[116,23063],{"className":23064,"style":742},[187],[116,23066,23068],{"className":23067},[746,747,748,749],[116,23069,3158],{"className":23070},[137,138,749],[116,23072,234],{"className":23073},[233],[116,23075,23077],{"className":23076},[173],[116,23078,23080],{"className":23079,"style":762},[177],[116,23081],{},[116,23083],{"className":23084,"style":145},[144],[116,23086,150],{"className":23087},[149],[116,23089],{"className":23090,"style":145},[144],[116,23092,23094,23097,23100,23103,23106],{"className":23093},[128],[116,23095],{"className":23096,"style":7254},[132],[116,23098,6825],{"className":23099,"style":4969},[137,4026],[116,23101],{"className":23102,"style":570},[144],[116,23104,5064],{"className":23105},[574],[116,23107],{"className":23108,"style":570},[144],[116,23110,23112,23116,23156,23159,23162],{"className":23111},[128],[116,23113],{"className":23114,"style":23115},[132],"height:0.7333em;vertical-align:-0.15em;",[116,23117,23119,23122],{"className":23118},[137],[116,23120,566],{"className":23121},[137,4026],[116,23123,23125],{"className":23124},[725],[116,23126,23128,23148],{"className":23127},[168,169],[116,23129,23131,23145],{"className":23130},[173],[116,23132,23134],{"className":23133,"style":3145},[177],[116,23135,23136,23139],{"style":3584},[116,23137],{"className":23138,"style":742},[187],[116,23140,23142],{"className":23141},[746,747,748,749],[116,23143,3158],{"className":23144},[137,138,749],[116,23146,234],{"className":23147},[233],[116,23149,23151],{"className":23150},[173],[116,23152,23154],{"className":23153,"style":762},[177],[116,23155],{},[116,23157],{"className":23158,"style":570},[144],[116,23160,1610],{"className":23161},[574],[116,23163],{"className":23164,"style":570},[144],[116,23166,23168,23171],{"className":23167},[128],[116,23169],{"className":23170,"style":7009},[132],[116,23172,23174,23177],{"className":23173},[137],[116,23175,601],{"className":23176,"style":139},[137,138],[116,23178,23180],{"className":23179},[725],[116,23181,23183,23203],{"className":23182},[168,169],[116,23184,23186,23200],{"className":23185},[173],[116,23187,23189],{"className":23188,"style":3145},[177],[116,23190,23191,23194],{"style":3490},[116,23192],{"className":23193,"style":742},[187],[116,23195,23197],{"className":23196},[746,747,748,749],[116,23198,3158],{"className":23199},[137,138,749],[116,23201,234],{"className":23202},[233],[116,23204,23206],{"className":23205},[173],[116,23207,23209],{"className":23208,"style":762},[177],[116,23210],{},[116,23212,23214],{"className":23213},[702],[116,23215,23217],{"className":23216},[119],[116,23218,23220,23247],{"className":23219,"ariaHidden":124},[123],[116,23221,23223,23226,23229,23232,23235,23238,23241,23244],{"className":23222},[128],[116,23224],{"className":23225,"style":552},[132],[116,23227,21545],{"className":23228,"style":21544},[137,138],[116,23230,562],{"className":23231},[561],[116,23233,6825],{"className":23234,"style":4969},[137,4026],[116,23236,652],{"className":23237},[651],[116,23239],{"className":23240,"style":145},[144],[116,23242,150],{"className":23243},[149],[116,23245],{"className":23246,"style":145},[144],[116,23248,23250,23253,23318,23321,23388,23391,23449],{"className":23249},[128],[116,23251],{"className":23252,"style":8979},[132],[116,23254,23256,23259,23315],{"className":23255},[137],[116,23257],{"className":23258},[561,4427],[116,23260,23262],{"className":23261},[4431],[116,23263,23265,23307],{"className":23264},[168,169],[116,23266,23268,23304],{"className":23267},[173],[116,23269,23271,23285,23293],{"className":23270,"style":7349},[177],[116,23272,23273,23276],{"style":5010},[116,23274],{"className":23275,"style":1119},[187],[116,23277,23279,23282],{"className":23278},[137],[116,23280,359],{"className":23281},[137],[116,23283,10717],{"className":23284},[137,138],[116,23286,23287,23290],{"style":4597},[116,23288],{"className":23289,"style":1119},[187],[116,23291],{"className":23292,"style":4605},[4604],[116,23294,23295,23298],{"style":4608},[116,23296],{"className":23297,"style":1119},[187],[116,23299,23301],{"className":23300},[137],[116,23302,345],{"className":23303},[137],[116,23305,234],{"className":23306},[233],[116,23308,23310],{"className":23309},[173],[116,23311,23313],{"className":23312,"style":15935},[177],[116,23314],{},[116,23316],{"className":23317},[651,4427],[116,23319],{"className":23320,"style":279},[144],[116,23322,23324],{"className":23323},[1126,3245],[116,23325,23327,23380],{"className":23326},[168,169],[116,23328,23330,23377],{"className":23329},[173],[116,23331,23333,23353,23363],{"className":23332,"style":9073},[177],[116,23334,23335,23338],{"style":3420},[116,23336],{"className":23337,"style":3424},[187],[116,23339,23341],{"className":23340},[746,747,748,749],[116,23342,23344,23347,23350],{"className":23343},[137,749],[116,23345,3158],{"className":23346},[137,138,749],[116,23348,150],{"className":23349},[149,749],[116,23351,345],{"className":23352},[137,749],[116,23354,23355,23358],{"style":3445},[116,23356],{"className":23357,"style":3424},[187],[116,23359,23360],{},[116,23361,1130],{"className":23362},[1126,1127,3454],[116,23364,23365,23368],{"style":9107},[116,23366],{"className":23367,"style":3424},[187],[116,23369,23371],{"className":23370},[746,747,748,749],[116,23372,23374],{"className":23373},[137,749],[116,23375,10717],{"className":23376},[137,138,749],[116,23378,234],{"className":23379},[233],[116,23381,23383],{"className":23382},[173],[116,23384,23386],{"className":23385,"style":9130},[177],[116,23387],{},[116,23389],{"className":23390,"style":279},[144],[116,23392,23394,23397],{"className":23393},[137],[116,23395,206],{"className":23396,"style":205},[137,138],[116,23398,23400],{"className":23399},[725],[116,23401,23403,23441],{"className":23402},[168,169],[116,23404,23406,23438],{"className":23405},[173],[116,23407,23409,23421],{"className":23408,"style":21657},[177],[116,23410,23412,23415],{"style":23411},"top:-2.453em;margin-left:-0.0278em;margin-right:0.05em;",[116,23413],{"className":23414,"style":742},[187],[116,23416,23418],{"className":23417},[746,747,748,749],[116,23419,3158],{"className":23420},[137,138,749],[116,23422,23423,23426],{"style":2488},[116,23424],{"className":23425,"style":742},[187],[116,23427,23429],{"className":23428},[746,747,748,749],[116,23430,23432,23435],{"className":23431},[137,749],[116,23433],{"className":23434,"style":3325},[144,749],[116,23436,359],{"className":23437},[137,749],[116,23439,234],{"className":23440},[233],[116,23442,23444],{"className":23443},[173],[116,23445,23447],{"className":23446,"style":1186},[177],[116,23448],{},[116,23450,1852],{"className":23451},[137],[73,23453,23454,23455,23575,23576,23858],{},"Each residual depends on the weights through ",[116,23456,23458],{"className":23457},[119],[116,23459,23461,23528],{"className":23460,"ariaHidden":124},[123],[116,23462,23464,23467,23470,23510,23513,23516,23519,23522,23525],{"className":23463},[128],[116,23465],{"className":23466,"style":552},[132],[116,23468,16070],{"className":23469,"style":16069},[137],[116,23471,23473,23476],{"className":23472},[137],[116,23474,206],{"className":23475,"style":205},[137,138],[116,23477,23479],{"className":23478},[725],[116,23480,23482,23502],{"className":23481},[168,169],[116,23483,23485,23499],{"className":23484},[173],[116,23486,23488],{"className":23487,"style":3145},[177],[116,23489,23490,23493],{"style":23061},[116,23491],{"className":23492,"style":742},[187],[116,23494,23496],{"className":23495},[746,747,748,749],[116,23497,3158],{"className":23498},[137,138,749],[116,23500,234],{"className":23501},[233],[116,23503,23505],{"className":23504},[173],[116,23506,23508],{"className":23507,"style":762},[177],[116,23509],{},[116,23511,201],{"className":23512},[137],[116,23514,16070],{"className":23515,"style":16069},[137],[116,23517,6825],{"className":23518,"style":4969},[137,4026],[116,23520],{"className":23521,"style":145},[144],[116,23523,150],{"className":23524},[149],[116,23526],{"className":23527,"style":145},[144],[116,23529,23531,23535],{"className":23530},[128],[116,23532],{"className":23533,"style":23534},[132],"height:0.5944em;vertical-align:-0.15em;",[116,23536,23538,23541],{"className":23537},[137],[116,23539,566],{"className":23540},[137,4026],[116,23542,23544],{"className":23543},[725],[116,23545,23547,23567],{"className":23546},[168,169],[116,23548,23550,23564],{"className":23549},[173],[116,23551,23553],{"className":23552,"style":3145},[177],[116,23554,23555,23558],{"style":3584},[116,23556],{"className":23557,"style":742},[187],[116,23559,23561],{"className":23560},[746,747,748,749],[116,23562,3158],{"className":23563},[137,138,749],[116,23565,234],{"className":23566},[233],[116,23568,23570],{"className":23569},[173],[116,23571,23573],{"className":23572,"style":762},[177],[116,23574],{},", so the chain rule differentiates one term as\n",[116,23577,23579],{"className":23578},[119],[116,23580,23582,23769],{"className":23581,"ariaHidden":124},[123],[116,23583,23585,23589,23657,23701,23760,23763,23766],{"className":23584},[128],[116,23586],{"className":23587,"style":23588},[132],"height:1.1901em;vertical-align:-0.345em;",[116,23590,23592,23595,23654],{"className":23591},[137],[116,23593],{"className":23594},[561,4427],[116,23596,23598],{"className":23597},[4431],[116,23599,23601,23646],{"className":23600},[168,169],[116,23602,23604,23643],{"className":23603},[173],[116,23605,23607,23621,23629],{"className":23606,"style":19612},[177],[116,23608,23609,23612],{"style":8709},[116,23610],{"className":23611,"style":1119},[187],[116,23613,23615],{"className":23614},[746,747,748,749],[116,23616,23618],{"className":23617},[137,749],[116,23619,359],{"className":23620},[137,749],[116,23622,23623,23626],{"style":4597},[116,23624],{"className":23625,"style":1119},[187],[116,23627],{"className":23628,"style":4605},[4604],[116,23630,23631,23634],{"style":8732},[116,23632],{"className":23633,"style":1119},[187],[116,23635,23637],{"className":23636},[746,747,748,749],[116,23638,23640],{"className":23639},[137,749],[116,23641,345],{"className":23642},[137,749],[116,23644,234],{"className":23645},[233],[116,23647,23649],{"className":23648},[173],[116,23650,23652],{"className":23651,"style":8755},[177],[116,23653],{},[116,23655],{"className":23656},[651,4427],[116,23658,23660,23663],{"className":23659},[137],[116,23661,16070],{"className":23662,"style":16069},[137],[116,23664,23666],{"className":23665},[725],[116,23667,23669,23693],{"className":23668},[168,169],[116,23670,23672,23690],{"className":23671},[173],[116,23673,23675],{"className":23674,"style":8378},[177],[116,23676,23678,23681],{"style":23677},"top:-2.55em;margin-left:-0.0556em;margin-right:0.05em;",[116,23679],{"className":23680,"style":742},[187],[116,23682,23684],{"className":23683},[746,747,748,749],[116,23685,23687],{"className":23686},[137,749],[116,23688,6825],{"className":23689,"style":4969},[137,4026,749],[116,23691,234],{"className":23692},[233],[116,23694,23696],{"className":23695},[173],[116,23697,23699],{"className":23698,"style":762},[177],[116,23700],{},[116,23702,23704,23707],{"className":23703},[137],[116,23705,206],{"className":23706,"style":205},[137,138],[116,23708,23710],{"className":23709},[725],[116,23711,23713,23751],{"className":23712},[168,169],[116,23714,23716,23748],{"className":23715},[173],[116,23717,23719,23731],{"className":23718,"style":1152},[177],[116,23720,23722,23725],{"style":23721},"top:-2.4413em;margin-left:-0.0278em;margin-right:0.05em;",[116,23723],{"className":23724,"style":742},[187],[116,23726,23728],{"className":23727},[746,747,748,749],[116,23729,3158],{"className":23730},[137,138,749],[116,23732,23733,23736],{"style":1167},[116,23734],{"className":23735,"style":742},[187],[116,23737,23739],{"className":23738},[746,747,748,749],[116,23740,23742,23745],{"className":23741},[137,749],[116,23743],{"className":23744,"style":3325},[144,749],[116,23746,359],{"className":23747},[137,749],[116,23749,234],{"className":23750},[233],[116,23752,23754],{"className":23753},[173],[116,23755,23758],{"className":23756,"style":23757},[177],"height:0.2587em;",[116,23759],{},[116,23761],{"className":23762,"style":145},[144],[116,23764,150],{"className":23765},[149],[116,23767],{"className":23768,"style":145},[144],[116,23770,23772,23775,23815,23818],{"className":23771},[128],[116,23773],{"className":23774,"style":23534},[132],[116,23776,23778,23781],{"className":23777},[137],[116,23779,206],{"className":23780,"style":205},[137,138],[116,23782,23784],{"className":23783},[725],[116,23785,23787,23807],{"className":23786},[168,169],[116,23788,23790,23804],{"className":23789},[173],[116,23791,23793],{"className":23792,"style":3145},[177],[116,23794,23795,23798],{"style":23061},[116,23796],{"className":23797,"style":742},[187],[116,23799,23801],{"className":23800},[746,747,748,749],[116,23802,3158],{"className":23803},[137,138,749],[116,23805,234],{"className":23806},[233],[116,23808,23810],{"className":23809},[173],[116,23811,23813],{"className":23812,"style":762},[177],[116,23814],{},[116,23816],{"className":23817,"style":279},[144],[116,23819,23821,23824],{"className":23820},[137],[116,23822,566],{"className":23823},[137,4026],[116,23825,23827],{"className":23826},[725],[116,23828,23830,23850],{"className":23829},[168,169],[116,23831,23833,23847],{"className":23832},[173],[116,23834,23836],{"className":23835,"style":3145},[177],[116,23837,23838,23841],{"style":3584},[116,23839],{"className":23840,"style":742},[187],[116,23842,23844],{"className":23843},[746,747,748,749],[116,23845,3158],{"className":23846},[137,138,749],[116,23848,234],{"className":23849},[233],[116,23851,23853],{"className":23852},[173],[116,23854,23856],{"className":23855,"style":762},[177],[116,23857],{},".\nAveraging over the examples gives the gradient the update uses:",[116,23860,23862],{"className":23861},[702],[116,23863,23865],{"className":23864},[119],[116,23866,23868,23929,24088,24143],{"className":23867,"ariaHidden":124},[123],[116,23869,23871,23874,23917,23920,23923,23926],{"className":23870},[128],[116,23872],{"className":23873,"style":715},[132],[116,23875,23877,23880],{"className":23876},[137],[116,23878,8365],{"className":23879},[137],[116,23881,23883],{"className":23882},[725],[116,23884,23886,23909],{"className":23885},[168,169],[116,23887,23889,23906],{"className":23888},[173],[116,23890,23892],{"className":23891,"style":8378},[177],[116,23893,23894,23897],{"style":3584},[116,23895],{"className":23896,"style":742},[187],[116,23898,23900],{"className":23899},[746,747,748,749],[116,23901,23903],{"className":23902},[137,749],[116,23904,6825],{"className":23905,"style":4969},[137,4026,749],[116,23907,234],{"className":23908},[233],[116,23910,23912],{"className":23911},[173],[116,23913,23915],{"className":23914,"style":762},[177],[116,23916],{},[116,23918,21545],{"className":23919,"style":21544},[137,138],[116,23921],{"className":23922,"style":145},[144],[116,23924,150],{"className":23925},[149],[116,23927],{"className":23928,"style":145},[144],[116,23930,23932,23935,23997,24000,24067,24070,24076,24079,24082,24085],{"className":23931},[128],[116,23933],{"className":23934,"style":8979},[132],[116,23936,23938,23941,23994],{"className":23937},[137],[116,23939],{"className":23940},[561,4427],[116,23942,23944],{"className":23943},[4431],[116,23945,23947,23986],{"className":23946},[168,169],[116,23948,23950,23983],{"className":23949},[173],[116,23951,23953,23964,23972],{"className":23952,"style":7349},[177],[116,23954,23955,23958],{"style":5010},[116,23956],{"className":23957,"style":1119},[187],[116,23959,23961],{"className":23960},[137],[116,23962,10717],{"className":23963},[137,138],[116,23965,23966,23969],{"style":4597},[116,23967],{"className":23968,"style":1119},[187],[116,23970],{"className":23971,"style":4605},[4604],[116,23973,23974,23977],{"style":4608},[116,23975],{"className":23976,"style":1119},[187],[116,23978,23980],{"className":23979},[137],[116,23981,345],{"className":23982},[137],[116,23984,234],{"className":23985},[233],[116,23987,23989],{"className":23988},[173],[116,23990,23992],{"className":23991,"style":15935},[177],[116,23993],{},[116,23995],{"className":23996},[651,4427],[116,23998],{"className":23999,"style":279},[144],[116,24001,24003],{"className":24002},[1126,3245],[116,24004,24006,24059],{"className":24005},[168,169],[116,24007,24009,24056],{"className":24008},[173],[116,24010,24012,24032,24042],{"className":24011,"style":9073},[177],[116,24013,24014,24017],{"style":3420},[116,24015],{"className":24016,"style":3424},[187],[116,24018,24020],{"className":24019},[746,747,748,749],[116,24021,24023,24026,24029],{"className":24022},[137,749],[116,24024,3158],{"className":24025},[137,138,749],[116,24027,150],{"className":24028},[149,749],[116,24030,345],{"className":24031},[137,749],[116,24033,24034,24037],{"style":3445},[116,24035],{"className":24036,"style":3424},[187],[116,24038,24039],{},[116,24040,1130],{"className":24041},[1126,1127,3454],[116,24043,24044,24047],{"style":9107},[116,24045],{"className":24046,"style":3424},[187],[116,24048,24050],{"className":24049},[746,747,748,749],[116,24051,24053],{"className":24052},[137,749],[116,24054,10717],{"className":24055},[137,138,749],[116,24057,234],{"className":24058},[233],[116,24060,24062],{"className":24061},[173],[116,24063,24065],{"className":24064,"style":9130},[177],[116,24066],{},[116,24068],{"className":24069,"style":279},[144],[116,24071,24073],{"className":24072},[137],[116,24074,562],{"className":24075},[1091,1002],[116,24077,6825],{"className":24078,"style":4969},[137,4026],[116,24080],{"className":24081,"style":570},[144],[116,24083,5064],{"className":24084},[574],[116,24086],{"className":24087,"style":570},[144],[116,24089,24091,24094,24134,24137,24140],{"className":24090},[128],[116,24092],{"className":24093,"style":23115},[132],[116,24095,24097,24100],{"className":24096},[137],[116,24098,566],{"className":24099},[137,4026],[116,24101,24103],{"className":24102},[725],[116,24104,24106,24126],{"className":24105},[168,169],[116,24107,24109,24123],{"className":24108},[173],[116,24110,24112],{"className":24111,"style":3145},[177],[116,24113,24114,24117],{"style":3584},[116,24115],{"className":24116,"style":742},[187],[116,24118,24120],{"className":24119},[746,747,748,749],[116,24121,3158],{"className":24122},[137,138,749],[116,24124,234],{"className":24125},[233],[116,24127,24129],{"className":24128},[173],[116,24130,24132],{"className":24131,"style":762},[177],[116,24133],{},[116,24135],{"className":24136,"style":570},[144],[116,24138,1610],{"className":24139},[574],[116,24141],{"className":24142,"style":570},[144],[116,24144,24146,24149,24189,24195,24198,24238],{"className":24145},[128],[116,24147],{"className":24148,"style":7685},[132],[116,24150,24152,24155],{"className":24151},[137],[116,24153,601],{"className":24154,"style":139},[137,138],[116,24156,24158],{"className":24157},[725],[116,24159,24161,24181],{"className":24160},[168,169],[116,24162,24164,24178],{"className":24163},[173],[116,24165,24167],{"className":24166,"style":3145},[177],[116,24168,24169,24172],{"style":3490},[116,24170],{"className":24171,"style":742},[187],[116,24173,24175],{"className":24174},[746,747,748,749],[116,24176,3158],{"className":24177},[137,138,749],[116,24179,234],{"className":24180},[233],[116,24182,24184],{"className":24183},[173],[116,24185,24187],{"className":24186,"style":762},[177],[116,24188],{},[116,24190,24192],{"className":24191},[137],[116,24193,652],{"className":24194},[1091,1002],[116,24196],{"className":24197,"style":279},[144],[116,24199,24201,24204],{"className":24200},[137],[116,24202,566],{"className":24203},[137,4026],[116,24205,24207],{"className":24206},[725],[116,24208,24210,24230],{"className":24209},[168,169],[116,24211,24213,24227],{"className":24212},[173],[116,24214,24216],{"className":24215,"style":3145},[177],[116,24217,24218,24221],{"style":3584},[116,24219],{"className":24220,"style":742},[187],[116,24222,24224],{"className":24223},[746,747,748,749],[116,24225,3158],{"className":24226},[137,138,749],[116,24228,234],{"className":24229},[233],[116,24231,24233],{"className":24232},[173],[116,24234,24236],{"className":24235,"style":762},[177],[116,24237],{},[116,24239,1852],{"className":24240},[137],[73,24242,24243],{},"It is the average of each example's error scaled by its features, so the\nstep pushes weights toward reducing the largest residuals first.",[73,24245,24246,24247,24360],{},"How quickly descent converges depends on the shape of that bowl. The\nloss here is a quadratic bowl, and its contours are ellipses whose axes\nare the eigenvectors of the Hessian ",[116,24248,24250],{"className":24249},[119],[116,24251,24253],{"className":24252,"ariaHidden":124},[123],[116,24254,24256,24260,24328,24357],{"className":24255},[128],[116,24257],{"className":24258,"style":24259},[132],"height:1.1941em;vertical-align:-0.345em;",[116,24261,24263,24266,24325],{"className":24262},[137],[116,24264],{"className":24265},[561,4427],[116,24267,24269],{"className":24268},[4431],[116,24270,24272,24317],{"className":24271},[168,169],[116,24273,24275,24314],{"className":24274},[173],[116,24276,24278,24292,24300],{"className":24277,"style":19612},[177],[116,24279,24280,24283],{"style":8709},[116,24281],{"className":24282,"style":1119},[187],[116,24284,24286],{"className":24285},[746,747,748,749],[116,24287,24289],{"className":24288},[137,749],[116,24290,10717],{"className":24291},[137,138,749],[116,24293,24294,24297],{"style":4597},[116,24295],{"className":24296,"style":1119},[187],[116,24298],{"className":24299,"style":4605},[4604],[116,24301,24302,24305],{"style":8732},[116,24303],{"className":24304,"style":1119},[187],[116,24306,24308],{"className":24307},[746,747,748,749],[116,24309,24311],{"className":24310},[137,749],[116,24312,345],{"className":24313},[137,749],[116,24315,234],{"className":24316},[233],[116,24318,24320],{"className":24319},[173],[116,24321,24323],{"className":24322,"style":8755},[177],[116,24324],{},[116,24326],{"className":24327},[651,4427],[116,24329,24331,24334],{"className":24330},[137],[116,24332,2910],{"className":24333,"style":556},[137,138],[116,24335,24337],{"className":24336},[725],[116,24338,24340],{"className":24339},[168],[116,24341,24343],{"className":24342},[173],[116,24344,24346],{"className":24345,"style":1907},[177],[116,24347,24348,24351],{"style":1167},[116,24349],{"className":24350,"style":742},[187],[116,24352,24354],{"className":24353},[746,747,748,749],[116,24355,1006],{"className":24356},[137,749],[116,24358,2910],{"className":24359,"style":556},[137,138],". When the\nfeatures are on similar scales the bowl is round and descent heads almost\nstraight for the minimum. When one direction is much steeper than\nanother the bowl is a narrow valley, and the gradient, perpendicular to\neach contour, points mostly across the valley rather than down it, so the\npath zigzags.",[246,24362],{"hash":24363},"72f85e513f2b359103d90ca079f91f0b211cd586bb9919e86bb0e00d7ef1cb77",[73,24365,24366,24367,14497,24406,24421,24422,24463,24464,24479],{},"The step size interacts with that shape. Convergence on a quadratic needs\n",[116,24368,24370],{"className":24369},[119],[116,24371,24373,24393],{"className":24372,"ariaHidden":124},[123],[116,24374,24376,24380,24383,24386,24390],{"className":24375},[128],[116,24377],{"className":24378,"style":24379},[132],"height:0.7335em;vertical-align:-0.1944em;",[116,24381,8551],{"className":24382,"style":139},[137,138],[116,24384],{"className":24385,"style":145},[144],[116,24387,24389],{"className":24388},[149],"\u003C",[116,24391],{"className":24392,"style":145},[144],[116,24394,24396,24399,24403],{"className":24395},[128],[116,24397],{"className":24398,"style":552},[132],[116,24400,24402],{"className":24401},[137],"2\u002F",[116,24404,4716],{"className":24405},[137,138],[116,24407,24409],{"className":24408},[119],[116,24410,24412],{"className":24411,"ariaHidden":124},[123],[116,24413,24415,24418],{"className":24414},[128],[116,24416],{"className":24417,"style":272},[132],[116,24419,4716],{"className":24420},[137,138]," is the largest curvature; above it the iteration\novershoots and diverges. The number of steps to converge grows with the\ncondition number ",[116,24423,24425],{"className":24424},[119],[116,24426,24428,24447],{"className":24427,"ariaHidden":124},[123],[116,24429,24431,24434,24438,24441,24444],{"className":24430},[128],[116,24432],{"className":24433,"style":133},[132],[116,24435,24437],{"className":24436},[137,138],"κ",[116,24439],{"className":24440,"style":145},[144],[116,24442,150],{"className":24443},[149],[116,24445],{"className":24446,"style":145},[144],[116,24448,24450,24453,24456,24459],{"className":24449},[128],[116,24451],{"className":24452,"style":552},[132],[116,24454,4716],{"className":24455},[137,138],[116,24457,201],{"className":24458},[137],[116,24460,24462],{"className":24461},[137,138],"μ",", the ratio of the largest to the\nsmallest curvature, which is exactly how elongated the ellipses are. Too\nsmall an ",[116,24465,24467],{"className":24466},[119],[116,24468,24470],{"className":24469,"ariaHidden":124},[123],[116,24471,24473,24476],{"className":24472},[128],[116,24474],{"className":24475,"style":7009},[132],[116,24477,8551],{"className":24478,"style":139},[137,138]," is always safe but crawls.",[2107,24481,24483],{"className":2109,"code":24482,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Gradient-Descent}(X, y, \\eta)$ — batch parameter fit\ninput: features $X$, targets $y$, learning rate $\\eta$\ninitialize $\\mathbf{w}$ to zeros\nrepeat\n  $\\mathbf{g} \\gets \\nabla_{\\mathbf{w}} J(\\mathbf{w})$ over all examples\n  $\\mathbf{w} \\gets \\mathbf{w} - \\eta \\, \\mathbf{g}$\nuntil $J(\\mathbf{w})$ stops decreasing\nreturn $\\mathbf{w}$\n",[108,24484,24485,24490,24495,24500,24504,24509,24514,24519],{"__ignoreMap":478},[116,24486,24487],{"class":2116,"line":2117},[116,24488,24489],{},"caption: $\\textsc{Gradient-Descent}(X, y, \\eta)$ — batch parameter fit\n",[116,24491,24492],{"class":2116,"line":479},[116,24493,24494],{},"input: features $X$, targets $y$, learning rate $\\eta$\n",[116,24496,24497],{"class":2116,"line":2128},[116,24498,24499],{},"initialize $\\mathbf{w}$ to zeros\n",[116,24501,24502],{"class":2116,"line":2134},[116,24503,2131],{},[116,24505,24506],{"class":2116,"line":2140},[116,24507,24508],{},"  $\\mathbf{g} \\gets \\nabla_{\\mathbf{w}} J(\\mathbf{w})$ over all examples\n",[116,24510,24511],{"class":2116,"line":2146},[116,24512,24513],{},"  $\\mathbf{w} \\gets \\mathbf{w} - \\eta \\, \\mathbf{g}$\n",[116,24515,24516],{"class":2116,"line":2152},[116,24517,24518],{},"until $J(\\mathbf{w})$ stops decreasing\n",[116,24520,24521],{"class":2116,"line":2158},[116,24522,24523],{},"return $\\mathbf{w}$\n",[73,24525,24526,24527,24542,24543,24558],{},"Standardizing the features first shrinks ",[116,24528,24530],{"className":24529},[119],[116,24531,24533],{"className":24532,"ariaHidden":124},[123],[116,24534,24536,24539],{"className":24535},[128],[116,24537],{"className":24538,"style":133},[132],[116,24540,24437],{"className":24541},[137,138],"\ntoward ",[116,24544,24546],{"className":24545},[119],[116,24547,24549],{"className":24548,"ariaHidden":124},[123],[116,24550,24552,24555],{"className":24551},[128],[116,24553],{"className":24554,"style":1890},[132],[116,24556,345],{"className":24557},[137],", so no single dimension dominates the step and one learning\nrate suits them all. Stochastic and minibatch variants estimate the\ngradient from a subset each step, trading a noisier direction for far more\nupdates per pass over the data. Training stops when the loss flattens.",[2263,24560,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":24562},[],"2022-04-21","Regression models fit to a labeled dataset with no closed-form solver in\nplay: the parameters start arbitrary and\ngradient descent moves\nthem toward the values that minimize the loss. The point of the exercise\nis the optimizer itself — deriving the gradient of the loss and stepping\nagainst it.",{},"\u002Fprojects\u002Fml\u002Fml-gradient-descent",[8855,22809],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fmachine-learning\u002Fblob\u002Fmain\u002FHW1\u002FHW1_cosc74.ipynb",{"title":22820,"description":24564},"projects\u002Fml\u002Fml-gradient-descent","Fitting regression classifiers by gradient descent — deriving the update\nfrom the loss gradient, then stepping the parameters downhill and watching\nconditioning set the pace.",[2279,22816],"q_-LzZmm30Lf47q0HzPz9Wqse-QeS79rHO-M3zjQgdg",{"id":24575,"title":24576,"body":24577,"date":25728,"description":25729,"extension":483,"featured":2354,"meta":25730,"navigation":484,"path":25731,"references":25732,"repo":25733,"seo":25734,"stem":25735,"summary":25736,"tag":493,"tech":25737,"url":2282,"__hash__":25741},"projects\u002Fprojects\u002Fvisual\u002F89-position-based-dynamics.md","Position-Based Dynamics",{"type":70,"value":24578,"toc":25726},[24579,24588,24689,25204,25350,25353,25502,25505,25566,25569,25721,25724],[73,24580,24581,24582,24587],{},"A C++ body simulator built on position-based dynamics (PBD), following\n",[76,24583,24586],{"href":24584,"rel":24585},"https:\u002F\u002Fmatthias-research.github.io\u002Fpages\u002Fpublications\u002FposBasedDyn.pdf",[80],"Müller et al.","\nInstead of accumulating spring forces and integrating them into velocities, PBD\nworks directly on positions: it predicts where particles will move, then\nprojects those positions onto a set of constraints. The scheme is stabler than\nmass-spring at large timesteps, generalizes to many constraint types, and costs\nless per step.",[73,24589,24590,24591,24644,24645,24688],{},"Each step first moves every particle by its external forces alone,\nproducing a predicted position ",[116,24592,24594],{"className":24593},[119],[116,24595,24597],{"className":24596,"ariaHidden":124},[123],[116,24598,24600,24604],{"className":24599},[128],[116,24601],{"className":24602,"style":24603},[132],"height:0.6389em;vertical-align:-0.1944em;",[116,24605,24607,24610],{"className":24606},[137],[116,24608,73],{"className":24609},[137,4026],[116,24611,24613],{"className":24612},[725],[116,24614,24616,24636],{"className":24615},[168,169],[116,24617,24619,24633],{"className":24618},[173],[116,24620,24622],{"className":24621,"style":3145},[177],[116,24623,24624,24627],{"style":3584},[116,24625],{"className":24626,"style":742},[187],[116,24628,24630],{"className":24629},[746,747,748,749],[116,24631,3158],{"className":24632},[137,138,749],[116,24634,234],{"className":24635},[233],[116,24637,24639],{"className":24638},[173],[116,24640,24642],{"className":24641,"style":762},[177],[116,24643],{},". The predictions ignore\ninternal interactions and generally violate the constraints (a stretched\nedge, an overlapping pair), so the solver corrects them. Each constraint\n",[116,24646,24648],{"className":24647},[119],[116,24649,24651,24679],{"className":24650,"ariaHidden":124},[123],[116,24652,24654,24657,24661,24664,24667,24670,24673,24676],{"className":24653},[128],[116,24655],{"className":24656,"style":552},[132],[116,24658,24660],{"className":24659,"style":2666},[137,138],"C",[116,24662,562],{"className":24663},[561],[116,24665,73],{"className":24666},[137,4026],[116,24668,652],{"className":24669},[651],[116,24671],{"className":24672,"style":145},[144],[116,24674,150],{"className":24675},[149],[116,24677],{"className":24678,"style":145},[144],[116,24680,24682,24685],{"className":24681},[128],[116,24683],{"className":24684,"style":1890},[132],[116,24686,331],{"className":24687},[137]," is enforced by a position correction along its gradient,",[116,24690,24692],{"className":24691},[702],[116,24693,24695],{"className":24694},[119],[116,24696,24698,24756,24922],{"className":24697,"ariaHidden":124},[123],[116,24699,24701,24704,24707,24747,24750,24753],{"className":24700},[128],[116,24702],{"className":24703,"style":5448},[132],[116,24705,283],{"className":24706},[137],[116,24708,24710,24713],{"className":24709},[137],[116,24711,73],{"className":24712},[137,4026],[116,24714,24716],{"className":24715},[725],[116,24717,24719,24739],{"className":24718},[168,169],[116,24720,24722,24736],{"className":24721},[173],[116,24723,24725],{"className":24724,"style":3145},[177],[116,24726,24727,24730],{"style":3584},[116,24728],{"className":24729,"style":742},[187],[116,24731,24733],{"className":24732},[746,747,748,749],[116,24734,3158],{"className":24735},[137,138,749],[116,24737,234],{"className":24738},[233],[116,24740,24742],{"className":24741},[173],[116,24743,24745],{"className":24744,"style":762},[177],[116,24746],{},[116,24748],{"className":24749,"style":145},[144],[116,24751,150],{"className":24752},[149],[116,24754],{"className":24755,"style":145},[144],[116,24757,24759,24762,24765,24768,24771,24774,24814,24817,24898,24901,24904,24907,24910,24913,24916,24919],{"className":24758},[128],[116,24760],{"className":24761,"style":783},[132],[116,24763,1610],{"className":24764},[137],[116,24766],{"className":24767,"style":279},[144],[116,24769,16940],{"className":24770},[137,138],[116,24772],{"className":24773,"style":279},[144],[116,24775,24777,24780],{"className":24776},[137],[116,24778,6825],{"className":24779,"style":6824},[137,138],[116,24781,24783],{"className":24782},[725],[116,24784,24786,24806],{"className":24785},[168,169],[116,24787,24789,24803],{"className":24788},[173],[116,24790,24792],{"className":24791,"style":3145},[177],[116,24793,24794,24797],{"style":9162},[116,24795],{"className":24796,"style":742},[187],[116,24798,24800],{"className":24799},[746,747,748,749],[116,24801,3158],{"className":24802},[137,138,749],[116,24804,234],{"className":24805},[233],[116,24807,24809],{"className":24808},[173],[116,24810,24812],{"className":24811,"style":762},[177],[116,24813],{},[116,24815],{"className":24816,"style":279},[144],[116,24818,24820,24823],{"className":24819},[137],[116,24821,8365],{"className":24822},[137],[116,24824,24826],{"className":24825},[725],[116,24827,24829,24890],{"className":24828},[168,169],[116,24830,24832,24887],{"className":24831},[173],[116,24833,24835],{"className":24834,"style":8378},[177],[116,24836,24837,24840],{"style":3584},[116,24838],{"className":24839,"style":742},[187],[116,24841,24843],{"className":24842},[746,747,748,749],[116,24844,24846],{"className":24845},[137,749],[116,24847,24849,24852],{"className":24848},[137,749],[116,24850,73],{"className":24851},[137,4026,749],[116,24853,24855],{"className":24854},[725],[116,24856,24858,24879],{"className":24857},[168,169],[116,24859,24861,24876],{"className":24860},[173],[116,24862,24864],{"className":24863,"style":3290},[177],[116,24865,24867,24870],{"style":24866},"top:-2.357em;margin-left:0em;margin-right:0.0714em;",[116,24868],{"className":24869,"style":997},[187],[116,24871,24873],{"className":24872},[746,1001,1002,749],[116,24874,3158],{"className":24875},[137,138,749],[116,24877,234],{"className":24878},[233],[116,24880,24882],{"className":24881},[173],[116,24883,24885],{"className":24884,"style":3312},[177],[116,24886],{},[116,24888,234],{"className":24889},[233],[116,24891,24893],{"className":24892},[173],[116,24894,24896],{"className":24895,"style":822},[177],[116,24897],{},[116,24899,24660],{"className":24900,"style":2666},[137,138],[116,24902,594],{"className":24903},[593],[116,24905],{"className":24906,"style":4159},[144],[116,24908],{"className":24909,"style":279},[144],[116,24911,16940],{"className":24912},[137,138],[116,24914],{"className":24915,"style":145},[144],[116,24917,150],{"className":24918},[149],[116,24920],{"className":24921,"style":145},[144],[116,24923,24925,24929,25201],{"className":24924},[128],[116,24926],{"className":24927,"style":24928},[132],"height:2.5488em;vertical-align:-1.1218em;",[116,24930,24932,24935,25198],{"className":24931},[137],[116,24933],{"className":24934},[561,4427],[116,24936,24938],{"className":24937},[4431],[116,24939,24941,25189],{"className":24940},[168,169],[116,24942,24944,25186],{"className":24943},[173],[116,24945,24947,25158,25166],{"className":24946,"style":9926},[177],[116,24948,24949,24952],{"style":5010},[116,24950],{"className":24951,"style":1119},[187],[116,24953,24955,24995,24998,25038,25041,25044,25125,25128],{"className":24954},[137],[116,24956,24958,24961],{"className":24957},[1126],[116,24959,1130],{"className":24960,"style":1129},[1126,1127,1128],[116,24962,24964],{"className":24963},[725],[116,24965,24967,24987],{"className":24966},[168,169],[116,24968,24970,24984],{"className":24969},[173],[116,24971,24973],{"className":24972,"style":9464},[177],[116,24974,24975,24978],{"style":4472},[116,24976],{"className":24977,"style":742},[187],[116,24979,24981],{"className":24980},[746,747,748,749],[116,24982,3213],{"className":24983,"style":3212},[137,138,749],[116,24985,234],{"className":24986},[233],[116,24988,24990],{"className":24989},[173],[116,24991,24993],{"className":24992,"style":4515},[177],[116,24994],{},[116,24996],{"className":24997,"style":279},[144],[116,24999,25001,25004],{"className":25000},[137],[116,25002,6825],{"className":25003,"style":6824},[137,138],[116,25005,25007],{"className":25006},[725],[116,25008,25010,25030],{"className":25009},[168,169],[116,25011,25013,25027],{"className":25012},[173],[116,25014,25016],{"className":25015,"style":3145},[177],[116,25017,25018,25021],{"style":9162},[116,25019],{"className":25020,"style":742},[187],[116,25022,25024],{"className":25023},[746,747,748,749],[116,25025,3213],{"className":25026,"style":3212},[137,138,749],[116,25028,234],{"className":25029},[233],[116,25031,25033],{"className":25032},[173],[116,25034,25036],{"className":25035,"style":822},[177],[116,25037],{},[116,25039],{"className":25040,"style":279},[144],[116,25042,5020],{"className":25043},[561],[116,25045,25047,25050],{"className":25046},[137],[116,25048,8365],{"className":25049},[137],[116,25051,25053],{"className":25052},[725],[116,25054,25056,25116],{"className":25055},[168,169],[116,25057,25059,25113],{"className":25058},[173],[116,25060,25062],{"className":25061,"style":8378},[177],[116,25063,25064,25067],{"style":3584},[116,25065],{"className":25066,"style":742},[187],[116,25068,25070],{"className":25069},[746,747,748,749],[116,25071,25073],{"className":25072},[137,749],[116,25074,25076,25079],{"className":25075},[137,749],[116,25077,73],{"className":25078},[137,4026,749],[116,25080,25082],{"className":25081},[725],[116,25083,25085,25105],{"className":25084},[168,169],[116,25086,25088,25102],{"className":25087},[173],[116,25089,25091],{"className":25090,"style":3290},[177],[116,25092,25093,25096],{"style":24866},[116,25094],{"className":25095,"style":997},[187],[116,25097,25099],{"className":25098},[746,1001,1002,749],[116,25100,3213],{"className":25101,"style":3212},[137,138,749],[116,25103,234],{"className":25104},[233],[116,25106,25108],{"className":25107},[173],[116,25109,25111],{"className":25110,"style":3368},[177],[116,25112],{},[116,25114,234],{"className":25115},[233],[116,25117,25119],{"className":25118},[173],[116,25120,25123],{"className":25121,"style":25122},[177],"height:0.3473em;",[116,25124],{},[116,25126,24660],{"className":25127,"style":2666},[137,138],[116,25129,25131,25134],{"className":25130},[651],[116,25132,5020],{"className":25133},[651],[116,25135,25137],{"className":25136},[725],[116,25138,25140],{"className":25139},[168],[116,25141,25143],{"className":25142},[173],[116,25144,25147],{"className":25145,"style":25146},[177],"height:0.7401em;",[116,25148,25149,25152],{"style":7391},[116,25150],{"className":25151,"style":742},[187],[116,25153,25155],{"className":25154},[746,747,748,749],[116,25156,359],{"className":25157},[137,749],[116,25159,25160,25163],{"style":4597},[116,25161],{"className":25162,"style":1119},[187],[116,25164],{"className":25165,"style":4605},[4604],[116,25167,25168,25171],{"style":4608},[116,25169],{"className":25170,"style":1119},[187],[116,25172,25174,25177,25180,25183],{"className":25173},[137],[116,25175,24660],{"className":25176,"style":2666},[137,138],[116,25178,562],{"className":25179},[561],[116,25181,73],{"className":25182},[137,4026],[116,25184,652],{"className":25185},[651],[116,25187,234],{"className":25188},[233],[116,25190,25192],{"className":25191},[173],[116,25193,25196],{"className":25194,"style":25195},[177],"height:1.1218em;",[116,25197],{},[116,25199],{"className":25200},[651,4427],[116,25202,594],{"className":25203},[593],[73,25205,2532,25206,25317,25318,25333,25334,25349],{},[116,25207,25209],{"className":25208},[119],[116,25210,25212,25267],{"className":25211,"ariaHidden":124},[123],[116,25213,25215,25218,25258,25261,25264],{"className":25214},[128],[116,25216],{"className":25217,"style":9326},[132],[116,25219,25221,25224],{"className":25220},[137],[116,25222,6825],{"className":25223,"style":6824},[137,138],[116,25225,25227],{"className":25226},[725],[116,25228,25230,25250],{"className":25229},[168,169],[116,25231,25233,25247],{"className":25232},[173],[116,25234,25236],{"className":25235,"style":3145},[177],[116,25237,25238,25241],{"style":9162},[116,25239],{"className":25240,"style":742},[187],[116,25242,25244],{"className":25243},[746,747,748,749],[116,25245,3158],{"className":25246},[137,138,749],[116,25248,234],{"className":25249},[233],[116,25251,25253],{"className":25252},[173],[116,25254,25256],{"className":25255,"style":762},[177],[116,25257],{},[116,25259],{"className":25260,"style":145},[144],[116,25262,150],{"className":25263},[149],[116,25265],{"className":25266,"style":145},[144],[116,25268,25270,25273,25277],{"className":25269},[128],[116,25271],{"className":25272,"style":552},[132],[116,25274,25276],{"className":25275},[137],"1\u002F",[116,25278,25280,25283],{"className":25279},[137],[116,25281,10717],{"className":25282},[137,138],[116,25284,25286],{"className":25285},[725],[116,25287,25289,25309],{"className":25288},[168,169],[116,25290,25292,25306],{"className":25291},[173],[116,25293,25295],{"className":25294,"style":3145},[177],[116,25296,25297,25300],{"style":3584},[116,25298],{"className":25299,"style":742},[187],[116,25301,25303],{"className":25302},[746,747,748,749],[116,25304,3158],{"className":25305},[137,138,749],[116,25307,234],{"className":25308},[233],[116,25310,25312],{"className":25311},[173],[116,25313,25315],{"className":25314,"style":762},[177],[116,25316],{}," is the inverse mass, so heavier particles move less. The\nscaling ",[116,25319,25321],{"className":25320},[119],[116,25322,25324],{"className":25323,"ariaHidden":124},[123],[116,25325,25327,25330],{"className":25326},[128],[116,25328],{"className":25329,"style":133},[132],[116,25331,16940],{"className":25332},[137,138]," lands the correction exactly on the constraint for a linearized\n",[116,25335,25337],{"className":25336},[119],[116,25338,25340],{"className":25339,"ariaHidden":124},[123],[116,25341,25343,25346],{"className":25342},[128],[116,25344],{"className":25345,"style":272},[132],[116,25347,24660],{"className":25348,"style":2666},[137,138],", and weighting by inverse mass conserves linear and angular momentum.",[246,25351],{"hash":25352},"1948fd17ecd88d4507c68fd3d09c9b84f820d9e503385b8609560bacc34a5776",[73,25354,25355,25356,25451,25452,25467,25468,25501],{},"Geometrically, ",[116,25357,25359],{"className":25358},[119],[116,25360,25362],{"className":25361,"ariaHidden":124},[123],[116,25363,25365,25368,25448],{"className":25364},[128],[116,25366],{"className":25367,"style":783},[132],[116,25369,25371,25374],{"className":25370},[137],[116,25372,8365],{"className":25373},[137],[116,25375,25377],{"className":25376},[725],[116,25378,25380,25440],{"className":25379},[168,169],[116,25381,25383,25437],{"className":25382},[173],[116,25384,25386],{"className":25385,"style":8378},[177],[116,25387,25388,25391],{"style":3584},[116,25389],{"className":25390,"style":742},[187],[116,25392,25394],{"className":25393},[746,747,748,749],[116,25395,25397],{"className":25396},[137,749],[116,25398,25400,25403],{"className":25399},[137,749],[116,25401,73],{"className":25402},[137,4026,749],[116,25404,25406],{"className":25405},[725],[116,25407,25409,25429],{"className":25408},[168,169],[116,25410,25412,25426],{"className":25411},[173],[116,25413,25415],{"className":25414,"style":3290},[177],[116,25416,25417,25420],{"style":24866},[116,25418],{"className":25419,"style":997},[187],[116,25421,25423],{"className":25422},[746,1001,1002,749],[116,25424,3158],{"className":25425},[137,138,749],[116,25427,234],{"className":25428},[233],[116,25430,25432],{"className":25431},[173],[116,25433,25435],{"className":25434,"style":3312},[177],[116,25436],{},[116,25438,234],{"className":25439},[233],[116,25441,25443],{"className":25442},[173],[116,25444,25446],{"className":25445,"style":822},[177],[116,25447],{},[116,25449,24660],{"className":25450,"style":2666},[137,138]," points normal to the constraint\nsurface, so the correction moves each particle along that normal; the\nfactor ",[116,25453,25455],{"className":25454},[119],[116,25456,25458],{"className":25457,"ariaHidden":124},[123],[116,25459,25461,25464],{"className":25460},[128],[116,25462],{"className":25463,"style":133},[132],[116,25465,16940],{"className":25466},[137,138]," sets how far, chosen so a single step reaches ",[116,25469,25471],{"className":25470},[119],[116,25472,25474,25492],{"className":25473,"ariaHidden":124},[123],[116,25475,25477,25480,25483,25486,25489],{"className":25476},[128],[116,25478],{"className":25479,"style":272},[132],[116,25481,24660],{"className":25482,"style":2666},[137,138],[116,25484],{"className":25485,"style":145},[144],[116,25487,150],{"className":25488},[149],[116,25490],{"className":25491,"style":145},[144],[116,25493,25495,25498],{"className":25494},[128],[116,25496],{"className":25497,"style":1890},[132],[116,25499,331],{"className":25500},[137]," when the\nconstraint is locally linear and is re-solved when it is not.",[73,25503,25504],{},"Constraints are projected one after another in a Gauss-Seidel sweep, each\nseeing the corrections of the ones before it, and the whole set is swept a\nfew times per step, with more iterations stiffening the material toward\nrigid. Once the projections settle, velocities are read back from how far\neach particle actually moved:",[2107,25506,25508],{"className":2109,"code":25507,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Step}(h)$ — one position-based dynamics update\ninput: timestep $h$, positions $\\mathbf x_i$, velocities $\\mathbf v_i$, constraints $\\{C\\}$, solver iterations $n$\nfor each particle $i$ do\n  $\\mathbf v_i \\gets \\mathbf v_i + h\\,w_i\\,\\mathbf f_i^{\\text{ext}}$\n  $\\mathbf p_i \\gets \\mathbf x_i + h\\,\\mathbf v_i$\nfor $k \\gets 1$ to $n$ do\n  for each constraint $C$ do\n    project $\\mathbf p$ so that $C(\\mathbf p) = 0$\nfor each particle $i$ do\n  $\\mathbf v_i \\gets (\\mathbf p_i - \\mathbf x_i) \u002F h$\n  $\\mathbf x_i \\gets \\mathbf p_i$\n",[108,25509,25510,25515,25520,25525,25530,25535,25540,25545,25550,25554,25560],{"__ignoreMap":478},[116,25511,25512],{"class":2116,"line":2117},[116,25513,25514],{},"caption: $\\textsc{Step}(h)$ — one position-based dynamics update\n",[116,25516,25517],{"class":2116,"line":479},[116,25518,25519],{},"input: timestep $h$, positions $\\mathbf x_i$, velocities $\\mathbf v_i$, constraints $\\{C\\}$, solver iterations $n$\n",[116,25521,25522],{"class":2116,"line":2128},[116,25523,25524],{},"for each particle $i$ do\n",[116,25526,25527],{"class":2116,"line":2134},[116,25528,25529],{},"  $\\mathbf v_i \\gets \\mathbf v_i + h\\,w_i\\,\\mathbf f_i^{\\text{ext}}$\n",[116,25531,25532],{"class":2116,"line":2140},[116,25533,25534],{},"  $\\mathbf p_i \\gets \\mathbf x_i + h\\,\\mathbf v_i$\n",[116,25536,25537],{"class":2116,"line":2146},[116,25538,25539],{},"for $k \\gets 1$ to $n$ do\n",[116,25541,25542],{"class":2116,"line":2152},[116,25543,25544],{},"  for each constraint $C$ do\n",[116,25546,25547],{"class":2116,"line":2158},[116,25548,25549],{},"    project $\\mathbf p$ so that $C(\\mathbf p) = 0$\n",[116,25551,25552],{"class":2116,"line":2164},[116,25553,25524],{},[116,25555,25557],{"class":2116,"line":25556},10,[116,25558,25559],{},"  $\\mathbf v_i \\gets (\\mathbf p_i - \\mathbf x_i) \u002F h$\n",[116,25561,25563],{"class":2116,"line":25562},11,[116,25564,25565],{},"  $\\mathbf x_i \\gets \\mathbf p_i$\n",[25567,25568],"pbd-viz",{},[73,25570,25571,25572,25587,25588,25677,25678,25720],{},"Because a correction is a position projection rather than a force, there is no\nstiff spring constant to overshoot and blow up the integrator. A force-based\nsolver picks a stiffness ",[116,25573,25575],{"className":25574},[119],[116,25576,25578],{"className":25577,"ariaHidden":124},[123],[116,25579,25581,25584],{"className":25580},[128],[116,25582],{"className":25583,"style":4022},[132],[116,25585,4382],{"className":25586,"style":4381},[137,138]," and then must keep ",[116,25589,25591],{"className":25590},[119],[116,25592,25594,25618],{"className":25593,"ariaHidden":124},[123],[116,25595,25597,25601,25604,25607,25610,25615],{"className":25596},[128],[116,25598],{"className":25599,"style":25600},[132],"height:0.9592em;vertical-align:-0.2296em;",[116,25602,283],{"className":25603},[137],[116,25605,287],{"className":25606},[137,138],[116,25608],{"className":25609,"style":145},[144],[116,25611,25614],{"className":25612},[149,25613],"amsrm","≲",[116,25616],{"className":25617,"style":145},[144],[116,25619,25621,25624],{"className":25620},[128],[116,25622],{"className":25623,"style":160},[132],[116,25625,25627],{"className":25626},[137,164],[116,25628,25630,25669],{"className":25629},[168,169],[116,25631,25633,25666],{"className":25632},[173],[116,25634,25636,25654],{"className":25635,"style":178},[177],[116,25637,25639,25642],{"className":25638,"style":183},[182],[116,25640],{"className":25641,"style":188},[187],[116,25643,25645,25648,25651],{"className":25644,"style":192},[137],[116,25646,10717],{"className":25647},[137,138],[116,25649,201],{"className":25650},[137],[116,25652,4382],{"className":25653,"style":4381},[137,138],[116,25655,25656,25659],{"style":209},[116,25657],{"className":25658,"style":188},[187],[116,25660,25662],{"className":25661,"style":217},[216],[219,25663,25664],{"xmlns":221,"width":222,"height":223,"viewBox":224,"preserveAspectRatio":225},[227,25665],{"d":229},[116,25667,234],{"className":25668},[233],[116,25670,25672],{"className":25671},[173],[116,25673,25675],{"className":25674,"style":241},[177],[116,25676],{},",\nso a rigid material demands a tiny timestep; PBD instead moves the particle\nstraight onto the constraint, and stiffness becomes the number of solver\niterations — a quantity that can only converge, never diverge. That is why PBD\nholds together at the large, fixed timestep a game loop runs on, and why the\nsame solver handles distance, volume, and collision constraints without\nretuning: each is just another ",[116,25679,25681],{"className":25680},[119],[116,25682,25684,25711],{"className":25683,"ariaHidden":124},[123],[116,25685,25687,25690,25693,25696,25699,25702,25705,25708],{"className":25686},[128],[116,25688],{"className":25689,"style":552},[132],[116,25691,24660],{"className":25692,"style":2666},[137,138],[116,25694,562],{"className":25695},[561],[116,25697,73],{"className":25698},[137,4026],[116,25700,652],{"className":25701},[651],[116,25703],{"className":25704,"style":145},[144],[116,25706,150],{"className":25707},[149],[116,25709],{"className":25710,"style":145},[144],[116,25712,25714,25717],{"className":25713},[128],[116,25715],{"className":25716,"style":1890},[132],[116,25718,331],{"className":25719},[137]," to project onto.",[25722,25723],"pbd-cloth-viz",{},[2263,25725,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":25727},[],"2022-03-14","A C++ body simulator built on position-based dynamics (PBD), following\nMüller et al.\nInstead of accumulating spring forces and integrating them into velocities, PBD\nworks directly on positions: it predicts where particles will move, then\nprojects those positions onto a set of constraints. The scheme is stabler than\nmass-spring at large timesteps, generalizes to many constraint types, and costs\nless per step.",{},"\u002Fprojects\u002Fvisual\u002F89-position-based-dynamics",[488],"https:\u002F\u002Fgithub.com\u002Fsiavava\u002FPhysX\u002Ftree\u002Fcleaned-up-proj\u002Fproj\u002Fa1_mass_spring",{"title":24576,"description":25729},"projects\u002Fvisual\u002F89-position-based-dynamics","A C++ simulator built on position-based dynamics: rather than mass-spring\nforces, it projects predicted positions directly onto geometric constraints.",[25738,25739,25740],"C++","Visual Computing","Physical Simulation","QAYQ1HHukGkudr01d175slEaofj-EsMGdngodEJyZuE",{"id":25743,"title":25744,"body":25745,"date":25786,"description":25787,"extension":483,"featured":2354,"meta":25788,"navigation":484,"path":25789,"references":25790,"repo":25793,"seo":25794,"stem":25795,"summary":25796,"tag":25797,"tech":25798,"url":2282,"__hash__":25801},"projects\u002Fprojects\u002Ffunctional\u002Fwordle.md","Wordle, Grep",{"type":70,"value":25746,"toc":25784},[25747,25773,25781],[73,25748,25749,25750,25755,25760,25761,25766,25767,25772],{},"Two staples rebuilt in Haskell, a ",[76,25751,25754],{"href":25752,"rel":25753},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FPure_function",[80],"pure",[76,25756,25759],{"href":25757,"rel":25758},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFunctional_programming",[80],"functional","\nlanguage: ",[76,25762,25765],{"href":25763,"rel":25764},"https:\u002F\u002Fwww.nytimes.com\u002Fgames\u002Fwordle\u002Findex.html",[80],"Wordle",", the\nfive-letter guessing game, and ",[76,25768,25771],{"href":25769,"rel":25770},"https:\u002F\u002Fwww.gnu.org\u002Fsoftware\u002Fgrep\u002Fmanual\u002Fgrep.html",[80],"grep",",\nthe stream matcher.",[73,25774,25775,25776,1852],{},"Wordle picks a random five-letter word from a corpus and scores each\nguess per letter — right letter in the right place, right letter in the\nwrong place, or absent. The duplicate-letter case needs a two-pass scan:\nmark the exact matches first, then match the remaining guess letters\nagainst the pool of still-unmatched target letters, so a repeated letter\nis never credited twice. The round is won when the word is guessed,\nusually within five tries; an infinite mode keeps dealing new words. The\noriginal game was made by ",[76,25777,25780],{"href":25778,"rel":25779},"https:\u002F\u002Fyoutu.be\u002FX_e2IEaR4aA?si=6UD8xPwH4fsJJzO2&t=1016",[80],"Josh Wardle",[73,25782,25783],{},"Grep matches a pattern against a text stream line by line and prints\nthe lines that hit — search over local file contents. In Haskell the\nmatcher is a pure function over a lazy list of lines, so a file is\nconsumed as a stream and only as far as needed, rather than read into\nmemory whole.",{"title":478,"searchDepth":479,"depth":479,"links":25785},[],"2022-03-01","Two staples rebuilt in Haskell, a purefunctional\nlanguage: Wordle, the\nfive-letter guessing game, and grep,\nthe stream matcher.",{},"\u002Fprojects\u002Ffunctional\u002Fwordle",[25791,25792],"https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fsequences\u002Fstring-matching","https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fsequences\u002Fkmp-and-z-function","https:\u002F\u002Fgithub.com\u002Flostflux\u002Ftau",{"title":25744,"description":25787},"projects\u002Ffunctional\u002Fwordle","Wordle and grep rebuilt in Haskell, a pure functional language — a guessing\ngame and a stream matcher, both as pure functions over lazy lists.","functional programming",[13723,25799,25800],"Cabal","Functional Programming","KRquScLvSQQw3KtnPQyTWixtmDRLip1_6pgPGrQwbN8",{"id":25803,"title":25804,"body":25805,"date":27100,"description":27101,"extension":483,"featured":2354,"meta":27102,"navigation":484,"path":27103,"references":27104,"repo":27105,"seo":27106,"stem":27107,"summary":27108,"tag":493,"tech":27109,"url":2282,"__hash__":27110},"projects\u002Fprojects\u002Fvisual\u002F89-multicopter.md","Rigid Body Simulation",{"type":70,"value":25806,"toc":27098},[25807,25831,25922,26224,26281,26715,26718,26782,26832,26835,26854,26894,27096],[73,25808,5131,25809,25814,25819,25820,25825,25826,1852],{},[76,25810,25813],{"href":25811,"rel":25812},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRigid_body",[80],"rigid-body",[76,25815,25818],{"href":25816,"rel":25817},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMultirotor",[80],"helicopter"," simulated in C++ from\nits rotational dynamics. Rotor blades generate lift and thrust; the body's\nstate — position, orientation, and their velocities — advances by numerically\nintegrating the ",[76,25821,25824],{"href":25822,"rel":25823},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FNewton%E2%80%93Euler_equations",[80],"Newton-Euler equations","\nof motion with the ",[76,25827,25830],{"href":25828,"rel":25829},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEuler_method",[80],"Euler method",[73,25832,25833,25834,25849,25850,25865,25866,25881,25882,25906,25907,3225],{},"Unlike a point mass, a rigid body has orientation and spins, so its state\ncarries a position ",[116,25835,25837],{"className":25836},[119],[116,25838,25840],{"className":25839,"ariaHidden":124},[123],[116,25841,25843,25846],{"className":25842},[128],[116,25844],{"className":25845,"style":4318},[132],[116,25847,566],{"className":25848},[137,4026]," and linear velocity ",[116,25851,25853],{"className":25852},[119],[116,25854,25856],{"className":25855,"ariaHidden":124},[123],[116,25857,25859,25862],{"className":25858},[128],[116,25860],{"className":25861,"style":4318},[132],[116,25863,140],{"className":25864,"style":4969},[137,4026]," for the\ncenter of mass, plus an orientation (a rotation ",[116,25867,25869],{"className":25868},[119],[116,25870,25872],{"className":25871,"ariaHidden":124},[123],[116,25873,25875,25878],{"className":25874},[128],[116,25876],{"className":25877,"style":272},[132],[116,25879,2756],{"className":25880,"style":2755},[137,138],") and an angular velocity\n",[116,25883,25885],{"className":25884},[119],[116,25886,25888],{"className":25887,"ariaHidden":124},[123],[116,25889,25891,25894],{"className":25890},[128],[116,25892],{"className":25893,"style":4318},[132],[116,25895,25897],{"className":25896},[137],[116,25898,25900],{"className":25899},[137],[116,25901,25905],{"className":25902,"style":25904},[137,25903],"boldsymbol","margin-right:0.037em;","ω",". Linear motion follows Newton's second law; rotation follows\nEuler's equation, coupling angular acceleration to torque through the inertia\ntensor ",[116,25908,25910],{"className":25909},[119],[116,25911,25913],{"className":25912,"ariaHidden":124},[123],[116,25914,25916,25919],{"className":25915},[128],[116,25917],{"className":25918,"style":272},[132],[116,25920,557],{"className":25921,"style":556},[137,138],[116,25923,25925],{"className":25924},[702],[116,25926,25928],{"className":25927},[119],[116,25929,25931,25987,26144,26170,26194],{"className":25930,"ariaHidden":124},[123],[116,25932,25934,25938,25941,25944,25978,25981,25984],{"className":25933},[128],[116,25935],{"className":25936,"style":25937},[132],"height:0.6813em;",[116,25939,10717],{"className":25940},[137,138],[116,25942],{"className":25943,"style":279},[144],[116,25945,25947],{"className":25946},[137,7716],[116,25948,25950],{"className":25949},[168],[116,25951,25953],{"className":25952},[173],[116,25954,25956,25964],{"className":25955,"style":25937},[177],[116,25957,25958,25961],{"style":3376},[116,25959],{"className":25960,"style":1119},[187],[116,25962,140],{"className":25963,"style":4969},[137,4026],[116,25965,25967,25970],{"style":25966},"top:-3.0134em;",[116,25968],{"className":25969,"style":1119},[187],[116,25971,25974],{"className":25972,"style":25973},[7742],"left:-0.1389em;",[116,25975,25977],{"className":25976},[137],"˙",[116,25979],{"className":25980,"style":145},[144],[116,25982,150],{"className":25983},[149],[116,25985],{"className":25986,"style":145},[144],[116,25988,25990,25994,26038,26041,26083,26086,26089,26092,26095,26098,26135,26138,26141],{"className":25989},[128],[116,25991],{"className":25992,"style":25993},[132],"height:2.3521em;vertical-align:-1.3021em;",[116,25995,25997],{"className":25996},[1126,3245],[116,25998,26000,26030],{"className":25999},[168,169],[116,26001,26003,26027],{"className":26002},[173],[116,26004,26006,26017],{"className":26005,"style":3417},[177],[116,26007,26008,26011],{"style":11827},[116,26009],{"className":26010,"style":3424},[187],[116,26012,26014],{"className":26013},[746,747,748,749],[116,26015,4382],{"className":26016,"style":4381},[137,138,749],[116,26018,26019,26022],{"style":3445},[116,26020],{"className":26021,"style":3424},[187],[116,26023,26024],{},[116,26025,1130],{"className":26026},[1126,1127,3454],[116,26028,234],{"className":26029},[233],[116,26031,26033],{"className":26032},[173],[116,26034,26036],{"className":26035,"style":11863},[177],[116,26037],{},[116,26039],{"className":26040,"style":279},[144],[116,26042,26044,26048],{"className":26043},[137],[116,26045,26047],{"className":26046,"style":196},[137,4026],"f",[116,26049,26051],{"className":26050},[725],[116,26052,26054,26075],{"className":26053},[168,169],[116,26055,26057,26072],{"className":26056},[173],[116,26058,26060],{"className":26059,"style":5301},[177],[116,26061,26063,26066],{"style":26062},"top:-2.55em;margin-left:-0.109em;margin-right:0.05em;",[116,26064],{"className":26065,"style":742},[187],[116,26067,26069],{"className":26068},[746,747,748,749],[116,26070,4382],{"className":26071,"style":4381},[137,138,749],[116,26073,234],{"className":26074},[233],[116,26076,26078],{"className":26077},[173],[116,26079,26081],{"className":26080,"style":762},[177],[116,26082],{},[116,26084,594],{"className":26085},[593],[116,26087],{"className":26088,"style":4159},[144],[116,26090],{"className":26091,"style":279},[144],[116,26093,557],{"className":26094,"style":556},[137,138],[116,26096],{"className":26097,"style":279},[144],[116,26099,26101],{"className":26100},[137,7716],[116,26102,26104],{"className":26103},[168],[116,26105,26107],{"className":26106},[173],[116,26108,26110,26124],{"className":26109,"style":25937},[177],[116,26111,26112,26115],{"style":3376},[116,26113],{"className":26114,"style":1119},[187],[116,26116,26118],{"className":26117},[137],[116,26119,26121],{"className":26120},[137],[116,26122,25905],{"className":26123,"style":25904},[137,25903],[116,26125,26126,26129],{"style":25966},[116,26127],{"className":26128,"style":1119},[187],[116,26130,26132],{"className":26131,"style":25973},[7742],[116,26133,25977],{"className":26134},[137],[116,26136],{"className":26137,"style":145},[144],[116,26139,150],{"className":26140},[149],[116,26142],{"className":26143,"style":145},[144],[116,26145,26147,26150,26161,26164,26167],{"className":26146},[128],[116,26148],{"className":26149,"style":2930},[132],[116,26151,26153],{"className":26152},[137],[116,26154,26156],{"className":26155},[137],[116,26157,26160],{"className":26158,"style":26159},[137,25903],"margin-right:0.1347em;","τ",[116,26162],{"className":26163,"style":570},[144],[116,26165,1610],{"className":26166},[574],[116,26168],{"className":26169,"style":570},[144],[116,26171,26173,26176,26185,26188,26191],{"className":26172},[128],[116,26174],{"className":26175,"style":2930},[132],[116,26177,26179],{"className":26178},[137],[116,26180,26182],{"className":26181},[137],[116,26183,25905],{"className":26184,"style":25904},[137,25903],[116,26186],{"className":26187,"style":570},[144],[116,26189,439],{"className":26190},[574],[116,26192],{"className":26193,"style":570},[144],[116,26195,26197,26200,26203,26206,26209,26218,26221],{"className":26196},[128],[116,26198],{"className":26199,"style":552},[132],[116,26201,562],{"className":26202},[561],[116,26204,557],{"className":26205,"style":556},[137,138],[116,26207],{"className":26208,"style":279},[144],[116,26210,26212],{"className":26211},[137],[116,26213,26215],{"className":26214},[137],[116,26216,25905],{"className":26217,"style":25904},[137,25903],[116,26219,652],{"className":26220},[651],[116,26222,1852],{"className":26223},[137],[73,26225,11365,26226,26280],{},[116,26227,26229],{"className":26228},[119],[116,26230,26232,26256],{"className":26231,"ariaHidden":124},[123],[116,26233,26235,26238,26247,26250,26253],{"className":26234},[128],[116,26236],{"className":26237,"style":2930},[132],[116,26239,26241],{"className":26240},[137],[116,26242,26244],{"className":26243},[137],[116,26245,25905],{"className":26246,"style":25904},[137,25903],[116,26248],{"className":26249,"style":570},[144],[116,26251,439],{"className":26252},[574],[116,26254],{"className":26255,"style":570},[144],[116,26257,26259,26262,26265,26268,26277],{"className":26258},[128],[116,26260],{"className":26261,"style":552},[132],[116,26263,562],{"className":26264},[561],[116,26266,557],{"className":26267,"style":556},[137,138],[116,26269,26271],{"className":26270},[137],[116,26272,26274],{"className":26273},[137],[116,26275,25905],{"className":26276,"style":25904},[137,25903],[116,26278,652],{"className":26279},[651]," term is the gyroscopic\ncoupling; without it a tumbling body would not precess.",[73,26282,26283,26284,26337,26338,26538,26539,26714],{},"A rotor spinning at angular speed ",[116,26285,26287],{"className":26286},[119],[116,26288,26290],{"className":26289,"ariaHidden":124},[123],[116,26291,26293,26296],{"className":26292},[128],[116,26294],{"className":26295,"style":715},[132],[116,26297,26299,26303],{"className":26298},[137],[116,26300,26302],{"className":26301},[137],"Ω",[116,26304,26306],{"className":26305},[725],[116,26307,26309,26329],{"className":26308},[168,169],[116,26310,26312,26326],{"className":26311},[173],[116,26313,26315],{"className":26314,"style":5301},[177],[116,26316,26317,26320],{"style":3584},[116,26318],{"className":26319,"style":742},[187],[116,26321,26323],{"className":26322},[746,747,748,749],[116,26324,4382],{"className":26325,"style":4381},[137,138,749],[116,26327,234],{"className":26328},[233],[116,26330,26332],{"className":26331},[173],[116,26333,26335],{"className":26334,"style":762},[177],[116,26336],{}," generates a thrust along its\naxis roughly proportional to the square of its speed,\n",[116,26339,26341],{"className":26340},[119],[116,26342,26344,26399],{"className":26343,"ariaHidden":124},[123],[116,26345,26347,26350,26390,26393,26396],{"className":26346},[128],[116,26348],{"className":26349,"style":4182},[132],[116,26351,26353,26356],{"className":26352},[137],[116,26354,26047],{"className":26355,"style":196},[137,4026],[116,26357,26359],{"className":26358},[725],[116,26360,26362,26382],{"className":26361},[168,169],[116,26363,26365,26379],{"className":26364},[173],[116,26366,26368],{"className":26367,"style":5301},[177],[116,26369,26370,26373],{"style":26062},[116,26371],{"className":26372,"style":742},[187],[116,26374,26376],{"className":26375},[746,747,748,749],[116,26377,4382],{"className":26378,"style":4381},[137,138,749],[116,26380,234],{"className":26381},[233],[116,26383,26385],{"className":26384},[173],[116,26386,26388],{"className":26387,"style":762},[177],[116,26389],{},[116,26391],{"className":26392,"style":145},[144],[116,26394,413],{"className":26395},[149],[116,26397],{"className":26398,"style":145},[144],[116,26400,26402,26406,26409,26412,26465,26468],{"className":26401},[128],[116,26403],{"className":26404,"style":26405},[132],"height:1.0972em;vertical-align:-0.2831em;",[116,26407,24437],{"className":26408},[137,138],[116,26410],{"className":26411,"style":279},[144],[116,26413,26415,26418],{"className":26414},[137],[116,26416,26302],{"className":26417},[137],[116,26419,26421],{"className":26420},[725],[116,26422,26424,26456],{"className":26423},[168,169],[116,26425,26427,26453],{"className":26426},[173],[116,26428,26430,26442],{"className":26429,"style":1152},[177],[116,26431,26433,26436],{"style":26432},"top:-2.4169em;margin-left:0em;margin-right:0.05em;",[116,26434],{"className":26435,"style":742},[187],[116,26437,26439],{"className":26438},[746,747,748,749],[116,26440,4382],{"className":26441,"style":4381},[137,138,749],[116,26443,26444,26447],{"style":1167},[116,26445],{"className":26446,"style":742},[187],[116,26448,26450],{"className":26449},[746,747,748,749],[116,26451,359],{"className":26452},[137,749],[116,26454,234],{"className":26455},[233],[116,26457,26459],{"className":26458},[173],[116,26460,26463],{"className":26461,"style":26462},[177],"height:0.2831em;",[116,26464],{},[116,26466],{"className":26467,"style":279},[144],[116,26469,26471,26504],{"className":26470},[137],[116,26472,26474],{"className":26473},[137,7716],[116,26475,26477],{"className":26476},[168],[116,26478,26480],{"className":26479},[173],[116,26481,26484,26492],{"className":26482,"style":26483},[177],"height:0.7079em;",[116,26485,26486,26489],{"style":3376},[116,26487],{"className":26488,"style":1119},[187],[116,26490,9120],{"className":26491},[137,4026],[116,26493,26494,26497],{"style":25966},[116,26495],{"className":26496,"style":1119},[187],[116,26498,26501],{"className":26499,"style":26500},[7742],"left:-0.25em;",[116,26502,7747],{"className":26503},[137],[116,26505,26507],{"className":26506},[725],[116,26508,26510,26530],{"className":26509},[168,169],[116,26511,26513,26527],{"className":26512},[173],[116,26514,26516],{"className":26515,"style":5301},[177],[116,26517,26518,26521],{"style":3584},[116,26519],{"className":26520,"style":742},[187],[116,26522,26524],{"className":26523},[746,747,748,749],[116,26525,4382],{"className":26526,"style":4381},[137,138,749],[116,26528,234],{"className":26529},[233],[116,26531,26533],{"className":26532},[173],[116,26534,26536],{"className":26535,"style":762},[177],[116,26537],{},". Summed, the\nthrusts lift the craft; differences between them produce a net torque\n",[116,26540,26542],{"className":26541},[119],[116,26543,26545,26569,26668],{"className":26544,"ariaHidden":124},[123],[116,26546,26548,26551,26560,26563,26566],{"className":26547},[128],[116,26549],{"className":26550,"style":4318},[132],[116,26552,26554],{"className":26553},[137],[116,26555,26557],{"className":26556},[137],[116,26558,26160],{"className":26559,"style":26159},[137,25903],[116,26561],{"className":26562,"style":145},[144],[116,26564,150],{"className":26565},[149],[116,26567],{"className":26568,"style":145},[144],[116,26570,26572,26575,26616,26619,26659,26662,26665],{"className":26571},[128],[116,26573],{"className":26574,"style":9445},[132],[116,26576,26578,26581],{"className":26577},[1126],[116,26579,1130],{"className":26580,"style":1129},[1126,1127,1128],[116,26582,26584],{"className":26583},[725],[116,26585,26587,26608],{"className":26586},[168,169],[116,26588,26590,26605],{"className":26589},[173],[116,26591,26594],{"className":26592,"style":26593},[177],"height:0.1864em;",[116,26595,26596,26599],{"style":4472},[116,26597],{"className":26598,"style":742},[187],[116,26600,26602],{"className":26601},[746,747,748,749],[116,26603,4382],{"className":26604,"style":4381},[137,138,749],[116,26606,234],{"className":26607},[233],[116,26609,26611],{"className":26610},[173],[116,26612,26614],{"className":26613,"style":9485},[177],[116,26615],{},[116,26617],{"className":26618,"style":279},[144],[116,26620,26622,26625],{"className":26621},[137],[116,26623,206],{"className":26624},[137,4026],[116,26626,26628],{"className":26627},[725],[116,26629,26631,26651],{"className":26630},[168,169],[116,26632,26634,26648],{"className":26633},[173],[116,26635,26637],{"className":26636,"style":5301},[177],[116,26638,26639,26642],{"style":3584},[116,26640],{"className":26641,"style":742},[187],[116,26643,26645],{"className":26644},[746,747,748,749],[116,26646,4382],{"className":26647,"style":4381},[137,138,749],[116,26649,234],{"className":26650},[233],[116,26652,26654],{"className":26653},[173],[116,26655,26657],{"className":26656,"style":762},[177],[116,26658],{},[116,26660],{"className":26661,"style":570},[144],[116,26663,439],{"className":26664},[574],[116,26666],{"className":26667,"style":570},[144],[116,26669,26671,26674],{"className":26670},[128],[116,26672],{"className":26673,"style":4182},[132],[116,26675,26677,26680],{"className":26676},[137],[116,26678,26047],{"className":26679,"style":196},[137,4026],[116,26681,26683],{"className":26682},[725],[116,26684,26686,26706],{"className":26685},[168,169],[116,26687,26689,26703],{"className":26688},[173],[116,26690,26692],{"className":26691,"style":5301},[177],[116,26693,26694,26697],{"style":26062},[116,26695],{"className":26696,"style":742},[187],[116,26698,26700],{"className":26699},[746,747,748,749],[116,26701,4382],{"className":26702,"style":4381},[137,138,749],[116,26704,234],{"className":26705},[233],[116,26707,26709],{"className":26708},[173],[116,26710,26712],{"className":26711,"style":762},[177],[116,26713],{}," about the center of\nmass, which is what tilts and yaws it. Both feed the equations above.",[246,26716],{"hash":26717},"e799f9ced469983a72f13903e8c2f86b4e113ffca9ada6acf5cecadeec759b7d",[73,26719,26720,26721,26724,26725,2911,26728,26731,26732,26781],{},"Steering comes from differential thrust. With the rotors laid out around\nthe body, the three attitude moments come from spinning them unequally.\nSpeeding up the\nrotors on one side and slowing the other tilts the thrust asymmetry into a\n",[505,26722,26723],{},"roll"," about the forward axis; doing the same front-to-back produces\n",[505,26726,26727],{},"pitch",[505,26729,26730],{},"Yaw"," is subtler: each rotor also drags against the air with a\nreaction torque opposite its spin, so running the clockwise rotors faster than\nthe counter-clockwise ones leaves a net twist about the vertical axis without\nchanging total lift. A controller therefore never commands torque directly — it\nsolves for the four rotor speeds whose combined thrust and reaction torque hit a\ndesired total lift and ",[116,26733,26735],{"className":26734},[119],[116,26736,26738],{"className":26737,"ariaHidden":124},[123],[116,26739,26741,26744,26747,26753,26756,26759,26765,26768,26771,26778],{"className":26740},[128],[116,26742],{"className":26743,"style":552},[132],[116,26745,562],{"className":26746},[561],[116,26748,26750],{"className":26749},[137,431],[116,26751,26723],{"className":26752},[137],[116,26754,594],{"className":26755},[593],[116,26757],{"className":26758,"style":279},[144],[116,26760,26762],{"className":26761},[137,431],[116,26763,26727],{"className":26764},[137],[116,26766,594],{"className":26767},[593],[116,26769],{"className":26770,"style":279},[144],[116,26772,26774],{"className":26773},[137,431],[116,26775,26777],{"className":26776},[137],"yaw",[116,26779,652],{"className":26780},[651],", the inverse of\nthe map above. The simulation stub closes that loop each frame: read the current\nstate, compare it to the target attitude, set rotor speeds, integrate, repeat.",[2107,26783,26785],{"className":2109,"code":26784,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Simulate}()$ — the per-frame loop that drives the update\nstate: position $\\mathbf x$, velocity $\\mathbf v$, rotation $R$, angular velocity $\\boldsymbol\\omega$\nrepeat each frame\n  read the target attitude from input\n  set each rotor speed from the controller (differential thrust)\n  $\\mathbf f_k \\gets$ thrust of rotor $k$ at body offset $\\mathbf r_k$\n  $\\textsc{Step}(h)$\n  draw the craft from $\\mathbf x, R$\nuntil the window closes\n",[108,26786,26787,26792,26797,26802,26807,26812,26817,26822,26827],{"__ignoreMap":478},[116,26788,26789],{"class":2116,"line":2117},[116,26790,26791],{},"caption: $\\textsc{Simulate}()$ — the per-frame loop that drives the update\n",[116,26793,26794],{"class":2116,"line":479},[116,26795,26796],{},"state: position $\\mathbf x$, velocity $\\mathbf v$, rotation $R$, angular velocity $\\boldsymbol\\omega$\n",[116,26798,26799],{"class":2116,"line":2128},[116,26800,26801],{},"repeat each frame\n",[116,26803,26804],{"class":2116,"line":2134},[116,26805,26806],{},"  read the target attitude from input\n",[116,26808,26809],{"class":2116,"line":2140},[116,26810,26811],{},"  set each rotor speed from the controller (differential thrust)\n",[116,26813,26814],{"class":2116,"line":2146},[116,26815,26816],{},"  $\\mathbf f_k \\gets$ thrust of rotor $k$ at body offset $\\mathbf r_k$\n",[116,26818,26819],{"class":2116,"line":2152},[116,26820,26821],{},"  $\\textsc{Step}(h)$\n",[116,26823,26824],{"class":2116,"line":2158},[116,26825,26826],{},"  draw the craft from $\\mathbf x, R$\n",[116,26828,26829],{"class":2116,"line":2164},[116,26830,26831],{},"until the window closes\n",[26833,26834],"multicopter-viz",{},[73,26836,26837,26838,26853],{},"The coupled nonlinear system has no closed form, so the simulator steps it\nforward with semi-implicit Euler at a fixed timestep ",[116,26839,26841],{"className":26840},[119],[116,26842,26844],{"className":26843,"ariaHidden":124},[123],[116,26845,26847,26850],{"className":26846},[128],[116,26848],{"className":26849,"style":4022},[132],[116,26851,4027],{"className":26852},[137,138],", taking velocities\nfirst and then positions from the new velocities:",[2107,26855,26857],{"className":2109,"code":26856,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Step}(h)$ — one semi-implicit Euler update of the rigid body\ninput: timestep $h$, rotor forces $\\mathbf f_k$ at offsets $\\mathbf r_k$\n$\\boldsymbol\\tau \\gets \\sum_k \\mathbf r_k \\times \\mathbf f_k$; $\\ \\mathbf f \\gets \\sum_k \\mathbf f_k$\n$\\mathbf v \\gets \\mathbf v + h\\,\\mathbf f \u002F m$\n$\\boldsymbol\\omega \\gets \\boldsymbol\\omega + h\\,I^{-1}\\!\\left(\\boldsymbol\\tau - \\boldsymbol\\omega \\times I\\,\\boldsymbol\\omega\\right)$\n$\\mathbf x \\gets \\mathbf x + h\\,\\mathbf v$\n$R \\gets \\operatorname{orthonormalize}\\!\\left(R + h\\,[\\boldsymbol\\omega]_\\times R\\right)$\n",[108,26858,26859,26864,26869,26874,26879,26884,26889],{"__ignoreMap":478},[116,26860,26861],{"class":2116,"line":2117},[116,26862,26863],{},"caption: $\\textsc{Step}(h)$ — one semi-implicit Euler update of the rigid body\n",[116,26865,26866],{"class":2116,"line":479},[116,26867,26868],{},"input: timestep $h$, rotor forces $\\mathbf f_k$ at offsets $\\mathbf r_k$\n",[116,26870,26871],{"class":2116,"line":2128},[116,26872,26873],{},"$\\boldsymbol\\tau \\gets \\sum_k \\mathbf r_k \\times \\mathbf f_k$; $\\ \\mathbf f \\gets \\sum_k \\mathbf f_k$\n",[116,26875,26876],{"class":2116,"line":2134},[116,26877,26878],{},"$\\mathbf v \\gets \\mathbf v + h\\,\\mathbf f \u002F m$\n",[116,26880,26881],{"class":2116,"line":2140},[116,26882,26883],{},"$\\boldsymbol\\omega \\gets \\boldsymbol\\omega + h\\,I^{-1}\\!\\left(\\boldsymbol\\tau - \\boldsymbol\\omega \\times I\\,\\boldsymbol\\omega\\right)$\n",[116,26885,26886],{"class":2116,"line":2146},[116,26887,26888],{},"$\\mathbf x \\gets \\mathbf x + h\\,\\mathbf v$\n",[116,26890,26891],{"class":2116,"line":2152},[116,26892,26893],{},"$R \\gets \\operatorname{orthonormalize}\\!\\left(R + h\\,[\\boldsymbol\\omega]_\\times R\\right)$\n",[73,26895,26896,26897,27014,27015,27079,27080,27095],{},"The orientation update comes from ",[116,26898,26900],{"className":26899},[119],[116,26901,26903,26952],{"className":26902,"ariaHidden":124},[123],[116,26904,26906,26910,26943,26946,26949],{"className":26905},[128],[116,26907],{"className":26908,"style":26909},[132],"height:0.9202em;",[116,26911,26913],{"className":26912},[137,7716],[116,26914,26916],{"className":26915},[168],[116,26917,26919],{"className":26918},[173],[116,26920,26922,26930],{"className":26921,"style":26909},[177],[116,26923,26924,26927],{"style":3376},[116,26925],{"className":26926,"style":1119},[187],[116,26928,2756],{"className":26929,"style":2755},[137,138],[116,26931,26933,26936],{"style":26932},"top:-3.2523em;",[116,26934],{"className":26935,"style":1119},[187],[116,26937,26940],{"className":26938,"style":26939},[7742],"left:-0.0556em;",[116,26941,25977],{"className":26942},[137],[116,26944],{"className":26945,"style":145},[144],[116,26947,150],{"className":26948},[149],[116,26950],{"className":26951,"style":145},[144],[116,26953,26955,26958,26961,26970,27011],{"className":26954},[128],[116,26956],{"className":26957,"style":552},[132],[116,26959,1092],{"className":26960},[561],[116,26962,26964],{"className":26963},[137],[116,26965,26967],{"className":26966},[137],[116,26968,25905],{"className":26969,"style":25904},[137,25903],[116,26971,26973,26976],{"className":26972},[651],[116,26974,1493],{"className":26975},[651],[116,26977,26979],{"className":26978},[725],[116,26980,26982,27003],{"className":26981},[168,169],[116,26983,26985,27000],{"className":26984},[173],[116,26986,26989],{"className":26987,"style":26988},[177],"height:0.2583em;",[116,26990,26991,26994],{"style":3584},[116,26992],{"className":26993,"style":742},[187],[116,26995,26997],{"className":26996},[746,747,748,749],[116,26998,439],{"className":26999},[574,749],[116,27001,234],{"className":27002},[233],[116,27004,27006],{"className":27005},[173],[116,27007,27009],{"className":27008,"style":10931},[177],[116,27010],{},[116,27012,2756],{"className":27013,"style":2755},[137,138],", where\n",[116,27016,27018],{"className":27017},[119],[116,27019,27021],{"className":27020,"ariaHidden":124},[123],[116,27022,27024,27027,27030,27039],{"className":27023},[128],[116,27025],{"className":27026,"style":552},[132],[116,27028,1092],{"className":27029},[561],[116,27031,27033],{"className":27032},[137],[116,27034,27036],{"className":27035},[137],[116,27037,25905],{"className":27038,"style":25904},[137,25903],[116,27040,27042,27045],{"className":27041},[651],[116,27043,1493],{"className":27044},[651],[116,27046,27048],{"className":27047},[725],[116,27049,27051,27071],{"className":27050},[168,169],[116,27052,27054,27068],{"className":27053},[173],[116,27055,27057],{"className":27056,"style":26988},[177],[116,27058,27059,27062],{"style":3584},[116,27060],{"className":27061,"style":742},[187],[116,27063,27065],{"className":27064},[746,747,748,749],[116,27066,439],{"className":27067},[574,749],[116,27069,234],{"className":27070},[233],[116,27072,27074],{"className":27073},[173],[116,27075,27077],{"className":27076,"style":10931},[177],[116,27078],{}," is the skew-symmetric cross-product matrix; a Euler\nstep drifts ",[116,27081,27083],{"className":27082},[119],[116,27084,27086],{"className":27085,"ariaHidden":124},[123],[116,27087,27089,27092],{"className":27088},[128],[116,27090],{"className":27091,"style":272},[132],[116,27093,2756],{"className":27094,"style":2755},[137,138]," off the rotation group, so it is re-orthonormalized each frame.\nUpdating velocity before position, rather than after, keeps the integrator\nstable at the timesteps a real-time simulation can afford, whereas explicit\nEuler gains energy and diverges.",[2263,27097,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":27099},[],"2022-02-14","A rigid-bodyhelicopter simulated in C++ from\nits rotational dynamics. Rotor blades generate lift and thrust; the body's\nstate — position, orientation, and their velocities — advances by numerically\nintegrating the Newton-Euler equations\nof motion with the Euler method.",{},"\u002Fprojects\u002Fvisual\u002F89-multicopter",[488],"https:\u002F\u002Fgithub.com\u002Fsiavava\u002FPhysX\u002Fblob\u002Fmain\u002Fproj\u002Fa4_multi_copter",{"title":25804,"description":27101},"projects\u002Fvisual\u002F89-multicopter","A rigid-body helicopter simulated from Newton-Euler dynamics, its rotors\ngenerating lift and torque, integrated forward with the Euler method.",[25738,25739,25740],"idDjqI7xd8QSEs0fbaYFZm15bKzOojJwvnbX8LIq0gg",{"id":27112,"title":27113,"body":27114,"date":27948,"description":27949,"extension":483,"featured":2354,"meta":27950,"navigation":484,"path":27951,"references":2282,"repo":27952,"seo":27953,"stem":27954,"summary":27955,"tag":493,"tech":27956,"url":2282,"__hash__":27957},"projects\u002Fprojects\u002Fvisual\u002F89-fluid-mechanics.md","Smoke Simulation",{"type":70,"value":27115,"toc":27946},[27116,27166,27185,27528,27531,27534,27579,27582,27591,27737,27944],[73,27117,27118,27119,27124,27125,27159,27160,27165],{},"A physics-based smoke simulation in C++. The fluid lives on a fixed 2D\n",[76,27120,27123],{"href":27121,"rel":27122},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRegular_grid",[80],"Eulerian grid"," (the solver\nruns on a ",[116,27126,27128],{"className":27127},[119],[116,27129,27131,27150],{"className":27130,"ariaHidden":124},[123],[116,27132,27134,27137,27141,27144,27147],{"className":27133},[128],[116,27135],{"className":27136,"style":1871},[132],[116,27138,27140],{"className":27139},[137],"128",[116,27142],{"className":27143,"style":570},[144],[116,27145,439],{"className":27146},[574],[116,27148],{"className":27149,"style":570},[144],[116,27151,27153,27156],{"className":27152},[128],[116,27154],{"className":27155,"style":1890},[132],[116,27157,14479],{"className":27158},[137]," lattice of cells) with velocity, pressure,\nvorticity, and smoke density stored per grid node, advanced by the\n",[76,27161,27164],{"href":27162,"rel":27163},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FNavier%E2%80%93Stokes_equations",[80],"Navier–Stokes equations","\nand rendered as drifting smoke.",[73,27167,27168,27169,27184],{},"Smoke behaves as an incompressible fluid, so its velocity field\n",[116,27170,27172],{"className":27171},[119],[116,27173,27175],{"className":27174,"ariaHidden":124},[123],[116,27176,27178,27181],{"className":27177},[128],[116,27179],{"className":27180,"style":4318},[132],[116,27182,589],{"className":27183},[137,4026]," obeys momentum balance under pressure, viscosity, and external\nforces, together with a divergence-free constraint:",[116,27186,27188],{"className":27187},[702],[116,27189,27191],{"className":27190},[119],[116,27192,27194,27278,27302,27329,27414,27470,27500,27518],{"className":27193,"ariaHidden":124},[123],[116,27195,27197,27201,27269,27272,27275],{"className":27196},[128],[116,27198],{"className":27199,"style":27200},[132],"height:2.0574em;vertical-align:-0.686em;",[116,27202,27204,27207,27266],{"className":27203},[137],[116,27205],{"className":27206},[561,4427],[116,27208,27210],{"className":27209},[4431],[116,27211,27213,27258],{"className":27212},[168,169],[116,27214,27216,27255],{"className":27215},[173],[116,27217,27219,27233,27241],{"className":27218,"style":16056},[177],[116,27220,27221,27224],{"style":5010},[116,27222],{"className":27223,"style":1119},[187],[116,27225,27227,27230],{"className":27226},[137],[116,27228,16070],{"className":27229,"style":16069},[137],[116,27231,287],{"className":27232},[137,138],[116,27234,27235,27238],{"style":4597},[116,27236],{"className":27237,"style":1119},[187],[116,27239],{"className":27240,"style":4605},[4604],[116,27242,27243,27246],{"style":4608},[116,27244],{"className":27245,"style":1119},[187],[116,27247,27249,27252],{"className":27248},[137],[116,27250,16070],{"className":27251,"style":16069},[137],[116,27253,589],{"className":27254},[137,4026],[116,27256,234],{"className":27257},[233],[116,27259,27261],{"className":27260},[173],[116,27262,27264],{"className":27263,"style":15935},[177],[116,27265],{},[116,27267],{"className":27268},[651,4427],[116,27270],{"className":27271,"style":145},[144],[116,27273,150],{"className":27274},[149],[116,27276],{"className":27277,"style":145},[144],[116,27279,27281,27284,27287,27290,27293,27296,27299],{"className":27280},[128],[116,27282],{"className":27283,"style":552},[132],[116,27285,1610],{"className":27286},[137],[116,27288,562],{"className":27289},[561],[116,27291,589],{"className":27292},[137,4026],[116,27294],{"className":27295,"style":570},[144],[116,27297,5064],{"className":27298},[574],[116,27300],{"className":27301,"style":570},[144],[116,27303,27305,27308,27311,27314,27317,27320,27323,27326],{"className":27304},[128],[116,27306],{"className":27307,"style":552},[132],[116,27309,8365],{"className":27310},[137],[116,27312,652],{"className":27313},[651],[116,27315],{"className":27316,"style":279},[144],[116,27318,589],{"className":27319},[137,4026],[116,27321],{"className":27322,"style":570},[144],[116,27324,1610],{"className":27325},[574],[116,27327],{"className":27328,"style":570},[144],[116,27330,27332,27336,27399,27402,27405,27408,27411],{"className":27331},[128],[116,27333],{"className":27334,"style":27335},[132],"height:2.2019em;vertical-align:-0.8804em;",[116,27337,27339,27342,27396],{"className":27338},[137],[116,27340],{"className":27341},[561,4427],[116,27343,27345],{"className":27344},[4431],[116,27346,27348,27387],{"className":27347},[168,169],[116,27349,27351,27384],{"className":27350},[173],[116,27352,27354,27365,27373],{"className":27353,"style":7349},[177],[116,27355,27356,27359],{"style":5010},[116,27357],{"className":27358,"style":1119},[187],[116,27360,27362],{"className":27361},[137],[116,27363,11390],{"className":27364},[137,138],[116,27366,27367,27370],{"style":4597},[116,27368],{"className":27369,"style":1119},[187],[116,27371],{"className":27372,"style":4605},[4604],[116,27374,27375,27378],{"style":4608},[116,27376],{"className":27377,"style":1119},[187],[116,27379,27381],{"className":27380},[137],[116,27382,345],{"className":27383},[137],[116,27385,234],{"className":27386},[233],[116,27388,27390],{"className":27389},[173],[116,27391,27394],{"className":27392,"style":27393},[177],"height:0.8804em;",[116,27395],{},[116,27397],{"className":27398},[651,4427],[116,27400,8365],{"className":27401},[137],[116,27403,73],{"className":27404},[137,138],[116,27406],{"className":27407,"style":570},[144],[116,27409,575],{"className":27410},[574],[116,27412],{"className":27413,"style":570},[144],[116,27415,27417,27421,27426,27429,27458,27461,27464,27467],{"className":27416},[128],[116,27418],{"className":27419,"style":27420},[132],"height:0.9474em;vertical-align:-0.0833em;",[116,27422,27425],{"className":27423,"style":27424},[137,138],"margin-right:0.0637em;","ν",[116,27427],{"className":27428,"style":279},[144],[116,27430,27432,27435],{"className":27431},[137],[116,27433,8365],{"className":27434},[137],[116,27436,27438],{"className":27437},[725],[116,27439,27441],{"className":27440},[168],[116,27442,27444],{"className":27443},[173],[116,27445,27447],{"className":27446,"style":21657},[177],[116,27448,27449,27452],{"style":2488},[116,27450],{"className":27451,"style":742},[187],[116,27453,27455],{"className":27454},[746,747,748,749],[116,27456,359],{"className":27457},[137,749],[116,27459,589],{"className":27460},[137,4026],[116,27462],{"className":27463,"style":570},[144],[116,27465,575],{"className":27466},[574],[116,27468],{"className":27469,"style":570},[144],[116,27471,27473,27476,27479,27482,27485,27488,27491,27494,27497],{"className":27472},[128],[116,27474],{"className":27475,"style":4241},[132],[116,27477,26047],{"className":27478,"style":196},[137,4026],[116,27480,594],{"className":27481},[593],[116,27483],{"className":27484,"style":4159},[144],[116,27486],{"className":27487,"style":279},[144],[116,27489,8365],{"className":27490},[137],[116,27492],{"className":27493,"style":570},[144],[116,27495,5064],{"className":27496},[574],[116,27498],{"className":27499,"style":570},[144],[116,27501,27503,27506,27509,27512,27515],{"className":27502},[128],[116,27504],{"className":27505,"style":4318},[132],[116,27507,589],{"className":27508},[137,4026],[116,27510],{"className":27511,"style":145},[144],[116,27513,150],{"className":27514},[149],[116,27516],{"className":27517,"style":145},[144],[116,27519,27521,27524],{"className":27520},[128],[116,27522],{"className":27523,"style":1890},[132],[116,27525,27527],{"className":27526},[137],"0.",[73,27529,27530],{},"Each timestep runs the same four-step sequence: inject smoke and velocity\nat the sources, advect the fields, apply vorticity confinement, and project\nthe velocity back to a divergence-free state.",[246,27532],{"hash":27533},"5bbd8561cd8315245d597f97f31172994963b910d09377bb750897c86b1d6453",[2107,27535,27537],{"className":2109,"code":27536,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Advance}(\\Delta t)$ — one timestep of the grid solver\nstate: velocity $u$, pressure $p$, smoke density $d$ on the $128 \\times 64$ grid\ninject sources: add inflow velocity and density at the emitters\n$u \\gets$ advect $u$ through itself (semi-Lagrangian, RK2 backtrace)\n$d \\gets$ advect $d$ through $u$\n$u \\gets u + \\Delta t \\, f_{\\text{conf}}$ (vorticity confinement, $\\varepsilon = 4$)\nsolve $\\nabla^2 p = \\nabla \\cdot u$ by Gauss-Seidel, 40 sweeps\n$u \\gets u - \\nabla p$ (project back to divergence-free)\n",[108,27538,27539,27544,27549,27554,27559,27564,27569,27574],{"__ignoreMap":478},[116,27540,27541],{"class":2116,"line":2117},[116,27542,27543],{},"caption: $\\textsc{Advance}(\\Delta t)$ — one timestep of the grid solver\n",[116,27545,27546],{"class":2116,"line":479},[116,27547,27548],{},"state: velocity $u$, pressure $p$, smoke density $d$ on the $128 \\times 64$ grid\n",[116,27550,27551],{"class":2116,"line":2128},[116,27552,27553],{},"inject sources: add inflow velocity and density at the emitters\n",[116,27555,27556],{"class":2116,"line":2134},[116,27557,27558],{},"$u \\gets$ advect $u$ through itself (semi-Lagrangian, RK2 backtrace)\n",[116,27560,27561],{"class":2116,"line":2140},[116,27562,27563],{},"$d \\gets$ advect $d$ through $u$\n",[116,27565,27566],{"class":2116,"line":2146},[116,27567,27568],{},"$u \\gets u + \\Delta t \\, f_{\\text{conf}}$ (vorticity confinement, $\\varepsilon = 4$)\n",[116,27570,27571],{"class":2116,"line":2152},[116,27572,27573],{},"solve $\\nabla^2 p = \\nabla \\cdot u$ by Gauss-Seidel, 40 sweeps\n",[116,27575,27576],{"class":2116,"line":2158},[116,27577,27578],{},"$u \\gets u - \\nabla p$ (project back to divergence-free)\n",[27580,27581],"smoke-viz",{},[73,27583,27584,27585,27590],{},"A handful of inflow emitters seed the motion: grid nodes within a small\nradius of an emitter take its velocity, with radial, tangential, and mixed\nemitters set around the domain. The fields then move by\n",[76,27586,27589],{"href":27587,"rel":27588},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSemi-Lagrangian_scheme",[80],"semi-Lagrangian"," advection, which updates a node by\ntracing the velocity field backward (a midpoint half-step, then a full\nstep) and bilinearly interpolating the old field at the departure point.\nTracing backward and interpolating this way is unconditionally stable,\nwhich is what lets the smoke take large steps without blowing up.",[73,27592,27593,27594,27645,27646,27730,27731,27736],{},"Advection leaves the velocity field with nonzero divergence, so a\nprojection step restores ",[116,27595,27597],{"className":27596},[119],[116,27598,27600,27618,27636],{"className":27599,"ariaHidden":124},[123],[116,27601,27603,27606,27609,27612,27615],{"className":27602},[128],[116,27604],{"className":27605,"style":272},[132],[116,27607,8365],{"className":27608},[137],[116,27610],{"className":27611,"style":570},[144],[116,27613,5064],{"className":27614},[574],[116,27616],{"className":27617,"style":570},[144],[116,27619,27621,27624,27627,27630,27633],{"className":27620},[128],[116,27622],{"className":27623,"style":4318},[132],[116,27625,589],{"className":27626},[137,4026],[116,27628],{"className":27629,"style":145},[144],[116,27631,150],{"className":27632},[149],[116,27634],{"className":27635,"style":145},[144],[116,27637,27639,27642],{"className":27638},[128],[116,27640],{"className":27641,"style":1890},[132],[116,27643,331],{"className":27644},[137],". The solver takes the\ndivergence by central differences, solves the Poisson equation\n",[116,27647,27649],{"className":27648},[119],[116,27650,27652,27703,27721],{"className":27651,"ariaHidden":124},[123],[116,27653,27655,27659,27662,27691,27694,27697,27700],{"className":27654},[128],[116,27656],{"className":27657,"style":27658},[132],"height:1.0085em;vertical-align:-0.1944em;",[116,27660,1610],{"className":27661},[137],[116,27663,27665,27668],{"className":27664},[137],[116,27666,8365],{"className":27667},[137],[116,27669,27671],{"className":27670},[725],[116,27672,27674],{"className":27673},[168],[116,27675,27677],{"className":27676},[173],[116,27678,27680],{"className":27679,"style":1152},[177],[116,27681,27682,27685],{"style":1167},[116,27683],{"className":27684,"style":742},[187],[116,27686,27688],{"className":27687},[746,747,748,749],[116,27689,359],{"className":27690},[137,749],[116,27692,73],{"className":27693},[137,138],[116,27695],{"className":27696,"style":145},[144],[116,27698,150],{"className":27699},[149],[116,27701],{"className":27702,"style":145},[144],[116,27704,27706,27709,27712,27715,27718],{"className":27705},[128],[116,27707],{"className":27708,"style":272},[132],[116,27710,8365],{"className":27711},[137],[116,27713],{"className":27714,"style":570},[144],[116,27716,5064],{"className":27717},[574],[116,27719],{"className":27720,"style":570},[144],[116,27722,27724,27727],{"className":27723},[128],[116,27725],{"className":27726,"style":4318},[132],[116,27728,589],{"className":27729},[137,4026]," with forty\n",[76,27732,27735],{"href":27733,"rel":27734},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGauss%E2%80%93Seidel_method",[80],"Gauss–Seidel"," sweeps, and subtracts the pressure gradient\nfrom the velocity.",[73,27738,27739,27740,27745,27746,27803,27804,27819,27820,27847,27848,27909,27910,27943],{},"Discretizing the fluid numerically damps small-scale rotation, so the smoke\nloses its curl and goes limp.\n",[76,27741,27744],{"href":27742,"rel":27743},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FVorticity_(fluid_dynamics)",[80],"Vorticity confinement","\nmeasures the local vorticity ",[116,27747,27749],{"className":27748},[119],[116,27750,27752,27776,27794],{"className":27751,"ariaHidden":124},[123],[116,27753,27755,27758,27767,27770,27773],{"className":27754},[128],[116,27756],{"className":27757,"style":4318},[132],[116,27759,27761],{"className":27760},[137],[116,27762,27764],{"className":27763},[137],[116,27765,25905],{"className":27766,"style":25904},[137,25903],[116,27768],{"className":27769,"style":145},[144],[116,27771,150],{"className":27772},[149],[116,27774],{"className":27775,"style":145},[144],[116,27777,27779,27782,27785,27788,27791],{"className":27778},[128],[116,27780],{"className":27781,"style":423},[132],[116,27783,8365],{"className":27784},[137],[116,27786],{"className":27787,"style":570},[144],[116,27789,439],{"className":27790},[574],[116,27792],{"className":27793,"style":570},[144],[116,27795,27797,27800],{"className":27796},[128],[116,27798],{"className":27799,"style":4318},[132],[116,27801,589],{"className":27802},[137,4026],",\nbuilds unit vectors ",[116,27805,27807],{"className":27806},[119],[116,27808,27810],{"className":27809,"ariaHidden":124},[123],[116,27811,27813,27816],{"className":27812},[128],[116,27814],{"className":27815,"style":272},[132],[116,27817,6484],{"className":27818,"style":196},[137,138]," pointing up the gradient of ",[116,27821,27823],{"className":27822},[119],[116,27824,27826],{"className":27825,"ariaHidden":124},[123],[116,27827,27829,27832,27835,27844],{"className":27828},[128],[116,27830],{"className":27831,"style":552},[132],[116,27833,5020],{"className":27834},[561],[116,27836,27838],{"className":27837},[137],[116,27839,27841],{"className":27840},[137],[116,27842,25905],{"className":27843,"style":25904},[137,25903],[116,27845,5020],{"className":27846},[651],"\ntoward its concentrations, and adds the force\n",[116,27849,27851],{"className":27850},[119],[116,27852,27854,27891],{"className":27853,"ariaHidden":124},[123],[116,27855,27857,27860,27864,27867,27870,27873,27876,27879,27882,27885,27888],{"className":27856},[128],[116,27858],{"className":27859,"style":552},[132],[116,27861,27863],{"className":27862},[137,138],"ε",[116,27865],{"className":27866,"style":279},[144],[116,27868,283],{"className":27869},[137],[116,27871,566],{"className":27872},[137,138],[116,27874],{"className":27875,"style":279},[144],[116,27877,562],{"className":27878},[561],[116,27880,6484],{"className":27881,"style":196},[137,138],[116,27883],{"className":27884,"style":570},[144],[116,27886,439],{"className":27887},[574],[116,27889],{"className":27890,"style":570},[144],[116,27892,27894,27897,27906],{"className":27893},[128],[116,27895],{"className":27896,"style":552},[132],[116,27898,27900],{"className":27899},[137],[116,27901,27903],{"className":27902},[137],[116,27904,25905],{"className":27905,"style":25904},[137,25903],[116,27907,652],{"className":27908},[651]," — with confinement\nstrength ",[116,27911,27913],{"className":27912},[119],[116,27914,27916,27934],{"className":27915,"ariaHidden":124},[123],[116,27917,27919,27922,27925,27928,27931],{"className":27918},[128],[116,27920],{"className":27921,"style":133},[132],[116,27923,27863],{"className":27924},[137,138],[116,27926],{"className":27927,"style":145},[144],[116,27929,150],{"className":27930},[149],[116,27932],{"className":27933,"style":145},[144],[116,27935,27937,27940],{"className":27936},[128],[116,27938],{"className":27939,"style":1890},[132],[116,27941,5993],{"className":27942},[137]," in the code — back into the velocity,\nrestoring the swirling detail that makes rising smoke read as smoke.",[2263,27945,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":27947},[],"2022-02-13","A physics-based smoke simulation in C++. The fluid lives on a fixed 2D\nEulerian grid (the solver\nruns on a 128×64 lattice of cells) with velocity, pressure,\nvorticity, and smoke density stored per grid node, advanced by the\nNavier–Stokes equations\nand rendered as drifting smoke.",{},"\u002Fprojects\u002Fvisual\u002F89-fluid-mechanics","https:\u002F\u002Fgithub.com\u002Fsiavava\u002FPhysX\u002Fblob\u002Fmain\u002Fproj\u002Fa3_grid_fluid",{"title":27113,"description":27949},"projects\u002Fvisual\u002F89-fluid-mechanics","A grid-based smoke simulation in C++ that solves the incompressible\nNavier–Stokes equations on a Eulerian grid — semi-Lagrangian advection, a\nGauss–Seidel pressure projection, and vorticity confinement to keep the\nswirl alive.",[25738,25739,25740],"aS0uVrqDx59TSnBkhmi0Md4l_lJJMKnFpTWwV9v2Yzs",{"id":27959,"title":27960,"body":27961,"date":29271,"description":29272,"extension":483,"featured":2354,"meta":29273,"navigation":484,"path":29274,"references":29275,"repo":29277,"seo":29278,"stem":29279,"summary":29280,"tag":493,"tech":29281,"url":2282,"__hash__":29282},"projects\u002Fprojects\u002Fvisual\u002F89-particle-physics.md","Particle Simulation",{"type":70,"value":27962,"toc":29269},[27963,27977,27996,28349,28734,28737,28934,29035,29122,29125,29165,29168,29202,29267],[73,27964,27965,27966,27970,27971,27976],{},"A C++ simulator for fluids and particle systems. Fluids follow the\n",[76,27967,27969],{"href":27162,"rel":27968},[80],"Navier-Stokes equations",",\ndiscretized with ",[76,27972,27975],{"href":27973,"rel":27974},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSmoothed-particle_hydrodynamics",[80],"smoothed-particle hydrodynamics","\n(SPH); a uniform spatial hash keeps neighbor search and collision detection\nnear-linear as particle counts grow.",[73,27978,27979,27980,27995],{},"SPH represents a fluid as particles that each carry mass and sample the\nfield around them. Any field quantity ",[116,27981,27983],{"className":27982},[119],[116,27984,27986],{"className":27985,"ariaHidden":124},[123],[116,27987,27989,27992],{"className":27988},[128],[116,27990],{"className":27991,"style":272},[132],[116,27993,977],{"className":27994},[137,138]," at a point is a kernel-weighted\nsum over nearby particles,",[116,27997,27999],{"className":27998},[702],[116,28000,28002],{"className":28001},[119],[116,28003,28005,28032,28288],{"className":28004,"ariaHidden":124},[123],[116,28006,28008,28011,28014,28017,28020,28023,28026,28029],{"className":28007},[128],[116,28009],{"className":28010,"style":552},[132],[116,28012,977],{"className":28013},[137,138],[116,28015,562],{"className":28016},[561],[116,28018,206],{"className":28019},[137,4026],[116,28021,652],{"className":28022},[651],[116,28024],{"className":28025,"style":145},[144],[116,28027,150],{"className":28028},[149],[116,28030],{"className":28031,"style":145},[144],[116,28033,28035,28039,28083,28086,28126,28129,28267,28270,28273,28276,28279,28282,28285],{"className":28034},[128],[116,28036],{"className":28037,"style":28038},[132],"height:2.7741em;vertical-align:-1.4138em;",[116,28040,28042],{"className":28041},[1126,3245],[116,28043,28045,28075],{"className":28044},[168,169],[116,28046,28048,28072],{"className":28047},[173],[116,28049,28051,28062],{"className":28050,"style":3417},[177],[116,28052,28053,28056],{"style":3420},[116,28054],{"className":28055,"style":3424},[187],[116,28057,28059],{"className":28058},[746,747,748,749],[116,28060,3213],{"className":28061,"style":3212},[137,138,749],[116,28063,28064,28067],{"style":3445},[116,28065],{"className":28066,"style":3424},[187],[116,28068,28069],{},[116,28070,1130],{"className":28071},[1126,1127,3454],[116,28073,234],{"className":28074},[233],[116,28076,28078],{"className":28077},[173],[116,28079,28081],{"className":28080,"style":3464},[177],[116,28082],{},[116,28084],{"className":28085,"style":279},[144],[116,28087,28089,28092],{"className":28088},[137],[116,28090,10717],{"className":28091},[137,138],[116,28093,28095],{"className":28094},[725],[116,28096,28098,28118],{"className":28097},[168,169],[116,28099,28101,28115],{"className":28100},[173],[116,28102,28104],{"className":28103,"style":3145},[177],[116,28105,28106,28109],{"style":3584},[116,28107],{"className":28108,"style":742},[187],[116,28110,28112],{"className":28111},[746,747,748,749],[116,28113,3213],{"className":28114,"style":3212},[137,138,749],[116,28116,234],{"className":28117},[233],[116,28119,28121],{"className":28120},[173],[116,28122,28124],{"className":28123,"style":822},[177],[116,28125],{},[116,28127],{"className":28128,"style":279},[144],[116,28130,28132,28135,28264],{"className":28131},[137],[116,28133],{"className":28134},[561,4427],[116,28136,28138],{"className":28137},[4431],[116,28139,28141,28255],{"className":28140},[168,169],[116,28142,28144,28252],{"className":28143},[173],[116,28145,28148,28196,28204],{"className":28146,"style":28147},[177],"height:1.3603em;",[116,28149,28150,28153],{"style":5010},[116,28151],{"className":28152,"style":1119},[187],[116,28154,28156],{"className":28155},[137],[116,28157,28159,28162],{"className":28158},[137],[116,28160,11390],{"className":28161},[137,138],[116,28163,28165],{"className":28164},[725],[116,28166,28168,28188],{"className":28167},[168,169],[116,28169,28171,28185],{"className":28170},[173],[116,28172,28174],{"className":28173,"style":3145},[177],[116,28175,28176,28179],{"style":3584},[116,28177],{"className":28178,"style":742},[187],[116,28180,28182],{"className":28181},[746,747,748,749],[116,28183,3213],{"className":28184,"style":3212},[137,138,749],[116,28186,234],{"className":28187},[233],[116,28189,28191],{"className":28190},[173],[116,28192,28194],{"className":28193,"style":822},[177],[116,28195],{},[116,28197,28198,28201],{"style":4597},[116,28199],{"className":28200,"style":1119},[187],[116,28202],{"className":28203,"style":4605},[4604],[116,28205,28206,28209],{"style":4608},[116,28207],{"className":28208,"style":1119},[187],[116,28210,28212],{"className":28211},[137],[116,28213,28215,28218],{"className":28214},[137],[116,28216,977],{"className":28217},[137,138],[116,28219,28221],{"className":28220},[725],[116,28222,28224,28244],{"className":28223},[168,169],[116,28225,28227,28241],{"className":28226},[173],[116,28228,28230],{"className":28229,"style":3145},[177],[116,28231,28232,28235],{"style":3584},[116,28233],{"className":28234,"style":742},[187],[116,28236,28238],{"className":28237},[746,747,748,749],[116,28239,3213],{"className":28240,"style":3212},[137,138,749],[116,28242,234],{"className":28243},[233],[116,28245,28247],{"className":28246},[173],[116,28248,28250],{"className":28249,"style":822},[177],[116,28251],{},[116,28253,234],{"className":28254},[233],[116,28256,28258],{"className":28257},[173],[116,28259,28262],{"className":28260,"style":28261},[177],"height:0.9721em;",[116,28263],{},[116,28265],{"className":28266},[651,4427],[116,28268],{"className":28269,"style":279},[144],[116,28271,925],{"className":28272,"style":924},[137,138],[116,28274,562],{"className":28275},[561],[116,28277,206],{"className":28278},[137,4026],[116,28280],{"className":28281,"style":570},[144],[116,28283,1610],{"className":28284},[574],[116,28286],{"className":28287,"style":570},[144],[116,28289,28291,28294,28334,28337,28340,28343,28346],{"className":28290},[128],[116,28292],{"className":28293,"style":11131},[132],[116,28295,28297,28300],{"className":28296},[137],[116,28298,206],{"className":28299},[137,4026],[116,28301,28303],{"className":28302},[725],[116,28304,28306,28326],{"className":28305},[168,169],[116,28307,28309,28323],{"className":28308},[173],[116,28310,28312],{"className":28311,"style":3145},[177],[116,28313,28314,28317],{"style":3584},[116,28315],{"className":28316,"style":742},[187],[116,28318,28320],{"className":28319},[746,747,748,749],[116,28321,3213],{"className":28322,"style":3212},[137,138,749],[116,28324,234],{"className":28325},[233],[116,28327,28329],{"className":28328},[173],[116,28330,28332],{"className":28331,"style":822},[177],[116,28333],{},[116,28335,594],{"className":28336},[593],[116,28338],{"className":28339,"style":279},[144],[116,28341,4027],{"className":28342},[137,138],[116,28344,652],{"className":28345},[651],[116,28347,594],{"className":28348},[593],[73,28350,2532,28351,28366,28367,12861,28382,28434,28435,28450,28451,28718,28719,1852],{},[116,28352,28354],{"className":28353},[119],[116,28355,28357],{"className":28356,"ariaHidden":124},[123],[116,28358,28360,28363],{"className":28359},[128],[116,28361],{"className":28362,"style":272},[132],[116,28364,925],{"className":28365,"style":924},[137,138]," is a smoothing kernel of support radius ",[116,28368,28370],{"className":28369},[119],[116,28371,28373],{"className":28372,"ariaHidden":124},[123],[116,28374,28376,28379],{"className":28375},[128],[116,28377],{"className":28378,"style":4022},[132],[116,28380,4027],{"className":28381},[137,138],[116,28383,28385],{"className":28384},[119],[116,28386,28388],{"className":28387,"ariaHidden":124},[123],[116,28389,28391,28394],{"className":28390},[128],[116,28392],{"className":28393,"style":3818},[132],[116,28395,28397,28400],{"className":28396},[137],[116,28398,11390],{"className":28399},[137,138],[116,28401,28403],{"className":28402},[725],[116,28404,28406,28426],{"className":28405},[168,169],[116,28407,28409,28423],{"className":28408},[173],[116,28410,28412],{"className":28411,"style":3145},[177],[116,28413,28414,28417],{"style":3584},[116,28415],{"className":28416,"style":742},[187],[116,28418,28420],{"className":28419},[746,747,748,749],[116,28421,3213],{"className":28422,"style":3212},[137,138,749],[116,28424,234],{"className":28425},[233],[116,28427,28429],{"className":28428},[173],[116,28430,28432],{"className":28431,"style":822},[177],[116,28433],{}," the density\nat particle ",[116,28436,28438],{"className":28437},[119],[116,28439,28441],{"className":28440,"ariaHidden":124},[123],[116,28442,28444,28447],{"className":28443},[128],[116,28445],{"className":28446,"style":3931},[132],[116,28448,3213],{"className":28449,"style":3212},[137,138],". Density is the same sum applied to mass,\n",[116,28452,28454],{"className":28453},[119],[116,28455,28457,28512,28660],{"className":28456,"ariaHidden":124},[123],[116,28458,28460,28463,28503,28506,28509],{"className":28459},[128],[116,28461],{"className":28462,"style":7009},[132],[116,28464,28466,28469],{"className":28465},[137],[116,28467,11390],{"className":28468},[137,138],[116,28470,28472],{"className":28471},[725],[116,28473,28475,28495],{"className":28474},[168,169],[116,28476,28478,28492],{"className":28477},[173],[116,28479,28481],{"className":28480,"style":3145},[177],[116,28482,28483,28486],{"style":3584},[116,28484],{"className":28485,"style":742},[187],[116,28487,28489],{"className":28488},[746,747,748,749],[116,28490,3158],{"className":28491},[137,138,749],[116,28493,234],{"className":28494},[233],[116,28496,28498],{"className":28497},[173],[116,28499,28501],{"className":28500,"style":762},[177],[116,28502],{},[116,28504],{"className":28505,"style":145},[144],[116,28507,150],{"className":28508},[149],[116,28510],{"className":28511,"style":145},[144],[116,28513,28515,28519,28559,28562,28602,28605,28608,28611,28651,28654,28657],{"className":28514},[128],[116,28516],{"className":28517,"style":28518},[132],"height:1.1858em;vertical-align:-0.4358em;",[116,28520,28522,28525],{"className":28521},[1126],[116,28523,1130],{"className":28524,"style":1129},[1126,1127,1128],[116,28526,28528],{"className":28527},[725],[116,28529,28531,28551],{"className":28530},[168,169],[116,28532,28534,28548],{"className":28533},[173],[116,28535,28537],{"className":28536,"style":9464},[177],[116,28538,28539,28542],{"style":4472},[116,28540],{"className":28541,"style":742},[187],[116,28543,28545],{"className":28544},[746,747,748,749],[116,28546,3213],{"className":28547,"style":3212},[137,138,749],[116,28549,234],{"className":28550},[233],[116,28552,28554],{"className":28553},[173],[116,28555,28557],{"className":28556,"style":4515},[177],[116,28558],{},[116,28560],{"className":28561,"style":279},[144],[116,28563,28565,28568],{"className":28564},[137],[116,28566,10717],{"className":28567},[137,138],[116,28569,28571],{"className":28570},[725],[116,28572,28574,28594],{"className":28573},[168,169],[116,28575,28577,28591],{"className":28576},[173],[116,28578,28580],{"className":28579,"style":3145},[177],[116,28581,28582,28585],{"style":3584},[116,28583],{"className":28584,"style":742},[187],[116,28586,28588],{"className":28587},[746,747,748,749],[116,28589,3213],{"className":28590,"style":3212},[137,138,749],[116,28592,234],{"className":28593},[233],[116,28595,28597],{"className":28596},[173],[116,28598,28600],{"className":28599,"style":822},[177],[116,28601],{},[116,28603],{"className":28604,"style":279},[144],[116,28606,925],{"className":28607,"style":924},[137,138],[116,28609,562],{"className":28610},[561],[116,28612,28614,28617],{"className":28613},[137],[116,28615,206],{"className":28616},[137,4026],[116,28618,28620],{"className":28619},[725],[116,28621,28623,28643],{"className":28622},[168,169],[116,28624,28626,28640],{"className":28625},[173],[116,28627,28629],{"className":28628,"style":3145},[177],[116,28630,28631,28634],{"style":3584},[116,28632],{"className":28633,"style":742},[187],[116,28635,28637],{"className":28636},[746,747,748,749],[116,28638,3158],{"className":28639},[137,138,749],[116,28641,234],{"className":28642},[233],[116,28644,28646],{"className":28645},[173],[116,28647,28649],{"className":28648,"style":762},[177],[116,28650],{},[116,28652],{"className":28653,"style":570},[144],[116,28655,1610],{"className":28656},[574],[116,28658],{"className":28659,"style":570},[144],[116,28661,28663,28666,28706,28709,28712,28715],{"className":28662},[128],[116,28664],{"className":28665,"style":11131},[132],[116,28667,28669,28672],{"className":28668},[137],[116,28670,206],{"className":28671},[137,4026],[116,28673,28675],{"className":28674},[725],[116,28676,28678,28698],{"className":28677},[168,169],[116,28679,28681,28695],{"className":28680},[173],[116,28682,28684],{"className":28683,"style":3145},[177],[116,28685,28686,28689],{"style":3584},[116,28687],{"className":28688,"style":742},[187],[116,28690,28692],{"className":28691},[746,747,748,749],[116,28693,3213],{"className":28694,"style":3212},[137,138,749],[116,28696,234],{"className":28697},[233],[116,28699,28701],{"className":28700},[173],[116,28702,28704],{"className":28703,"style":822},[177],[116,28705],{},[116,28707,594],{"className":28708},[593],[116,28710],{"className":28711,"style":279},[144],[116,28713,4027],{"className":28714},[137,138],[116,28716,652],{"className":28717},[651],"; pressure and viscosity\nforces come from the gradient and Laplacian of ",[116,28720,28722],{"className":28721},[119],[116,28723,28725],{"className":28724,"ariaHidden":124},[123],[116,28726,28728,28731],{"className":28727},[128],[116,28729],{"className":28730,"style":272},[132],[116,28732,925],{"className":28733,"style":924},[137,138],[73,28735,28736],{},"Each particle obeys the momentum form of Navier-Stokes,",[116,28738,28740],{"className":28739},[702],[116,28741,28743],{"className":28742},[119],[116,28744,28746,28837,28861,28915],{"className":28745,"ariaHidden":124},[123],[116,28747,28749,28753,28756,28759,28828,28831,28834],{"className":28748},[128],[116,28750],{"className":28751,"style":28752},[132],"height:2.0463em;vertical-align:-0.686em;",[116,28754,11390],{"className":28755},[137,138],[116,28757],{"className":28758,"style":279},[144],[116,28760,28762,28765,28825],{"className":28761},[137],[116,28763],{"className":28764},[561,4427],[116,28766,28768],{"className":28767},[4431],[116,28769,28771,28817],{"className":28770},[168,169],[116,28772,28774,28814],{"className":28773},[173],[116,28775,28777,28792,28800],{"className":28776,"style":28147},[177],[116,28778,28779,28782],{"style":5010},[116,28780],{"className":28781,"style":1119},[187],[116,28783,28785,28789],{"className":28784},[137],[116,28786,28788],{"className":28787,"style":205},[137,138],"D",[116,28790,287],{"className":28791},[137,138],[116,28793,28794,28797],{"style":4597},[116,28795],{"className":28796,"style":1119},[187],[116,28798],{"className":28799,"style":4605},[4604],[116,28801,28802,28805],{"style":4608},[116,28803],{"className":28804,"style":1119},[187],[116,28806,28808,28811],{"className":28807},[137],[116,28809,28788],{"className":28810,"style":205},[137,138],[116,28812,140],{"className":28813,"style":4969},[137,4026],[116,28815,234],{"className":28816},[233],[116,28818,28820],{"className":28819},[173],[116,28821,28823],{"className":28822,"style":15935},[177],[116,28824],{},[116,28826],{"className":28827},[651,4427],[116,28829],{"className":28830,"style":145},[144],[116,28832,150],{"className":28833},[149],[116,28835],{"className":28836,"style":145},[144],[116,28838,28840,28843,28846,28849,28852,28855,28858],{"className":28839},[128],[116,28841],{"className":28842,"style":5448},[132],[116,28844,1610],{"className":28845},[137],[116,28847,8365],{"className":28848},[137],[116,28850,73],{"className":28851},[137,138],[116,28853],{"className":28854,"style":570},[144],[116,28856,575],{"className":28857},[574],[116,28859],{"className":28860,"style":570},[144],[116,28862,28864,28868,28871,28874,28903,28906,28909,28912],{"className":28863},[128],[116,28865],{"className":28866,"style":28867},[132],"height:1.0585em;vertical-align:-0.1944em;",[116,28869,24462],{"className":28870},[137,138],[116,28872],{"className":28873,"style":279},[144],[116,28875,28877,28880],{"className":28876},[137],[116,28878,8365],{"className":28879},[137],[116,28881,28883],{"className":28882},[725],[116,28884,28886],{"className":28885},[168],[116,28887,28889],{"className":28888},[173],[116,28890,28892],{"className":28891,"style":21657},[177],[116,28893,28894,28897],{"style":2488},[116,28895],{"className":28896,"style":742},[187],[116,28898,28900],{"className":28899},[746,747,748,749],[116,28901,359],{"className":28902},[137,749],[116,28904,140],{"className":28905,"style":4969},[137,4026],[116,28907],{"className":28908,"style":570},[144],[116,28910,575],{"className":28911},[574],[116,28913],{"className":28914,"style":570},[144],[116,28916,28918,28921,28924,28927,28931],{"className":28917},[128],[116,28919],{"className":28920,"style":24603},[132],[116,28922,11390],{"className":28923},[137,138],[116,28925],{"className":28926,"style":279},[144],[116,28928,28930],{"className":28929,"style":4969},[137,4026],"g",[116,28932,594],{"className":28933},[593],[73,28935,28936,28937,29034],{},"a balance of pressure, viscosity, and gravity. Pressure follows an equation of\nstate from density, ",[116,28938,28940],{"className":28939},[119],[116,28941,28943,28961,28985],{"className":28942,"ariaHidden":124},[123],[116,28944,28946,28949,28952,28955,28958],{"className":28945},[128],[116,28947],{"className":28948,"style":7009},[132],[116,28950,73],{"className":28951},[137,138],[116,28953],{"className":28954,"style":145},[144],[116,28956,150],{"className":28957},[149],[116,28959],{"className":28960,"style":145},[144],[116,28962,28964,28967,28970,28973,28976,28979,28982],{"className":28963},[128],[116,28965],{"className":28966,"style":552},[132],[116,28968,4382],{"className":28969,"style":4381},[137,138],[116,28971,562],{"className":28972},[561],[116,28974,11390],{"className":28975},[137,138],[116,28977],{"className":28978,"style":570},[144],[116,28980,1610],{"className":28981},[574],[116,28983],{"className":28984,"style":570},[144],[116,28986,28988,28991,29031],{"className":28987},[128],[116,28989],{"className":28990,"style":552},[132],[116,28992,28994,28997],{"className":28993},[137],[116,28995,11390],{"className":28996},[137,138],[116,28998,29000],{"className":28999},[725],[116,29001,29003,29023],{"className":29002},[168,169],[116,29004,29006,29020],{"className":29005},[173],[116,29007,29009],{"className":29008,"style":4068},[177],[116,29010,29011,29014],{"style":3584},[116,29012],{"className":29013,"style":742},[187],[116,29015,29017],{"className":29016},[746,747,748,749],[116,29018,331],{"className":29019},[137,749],[116,29021,234],{"className":29022},[233],[116,29024,29026],{"className":29025},[173],[116,29027,29029],{"className":29028,"style":762},[177],[116,29030],{},[116,29032,652],{"className":29033},[651],", which resists compression and keeps\nthe fluid roughly incompressible.",[73,29036,29037,29038,29053,29054,29105,29106,29121],{},"Every kernel sum ranges only over particles within ",[116,29039,29041],{"className":29040},[119],[116,29042,29044],{"className":29043,"ariaHidden":124},[123],[116,29045,29047,29050],{"className":29046},[128],[116,29048],{"className":29049,"style":4022},[132],[116,29051,4027],{"className":29052},[137,138],", but finding them\nnaively is ",[116,29055,29057],{"className":29056},[119],[116,29058,29060],{"className":29059,"ariaHidden":124},[123],[116,29061,29063,29066,29070,29073,29102],{"className":29062},[128],[116,29064],{"className":29065,"style":2205},[132],[116,29067,29069],{"className":29068,"style":205},[137,138],"O",[116,29071,562],{"className":29072},[561],[116,29074,29076,29079],{"className":29075},[137],[116,29077,9120],{"className":29078},[137,138],[116,29080,29082],{"className":29081},[725],[116,29083,29085],{"className":29084},[168],[116,29086,29088],{"className":29087},[173],[116,29089,29091],{"className":29090,"style":1152},[177],[116,29092,29093,29096],{"style":1167},[116,29094],{"className":29095,"style":742},[187],[116,29097,29099],{"className":29098},[746,747,748,749],[116,29100,359],{"className":29101},[137,749],[116,29103,652],{"className":29104},[651],", and that search dominates the cost. Positional indexing\nhashes each particle into a grid of cell size ",[116,29107,29109],{"className":29108},[119],[116,29110,29112],{"className":29111,"ariaHidden":124},[123],[116,29113,29115,29118],{"className":29114},[128],[116,29116],{"className":29117,"style":4022},[132],[116,29119,4027],{"className":29120},[137,138],"; then only the particle's\nown cell and the cells bordering it can hold interactions, so each query\ntouches a constant number of cells:",[246,29123],{"hash":29124},"ae3b11913070dfc2bc221b48658b5835e761b55c271c98cfa8ebe870a1d03ef6",[2107,29126,29128],{"className":2109,"code":29127,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Neighbors}(i)$ — spatial-hash query for particles within $h$ of $i$\ninput: particle $i$, cell size $h$, table $G$ mapping cell $\\to$ particles\n$c \\gets \\lfloor \\mathbf r_i \u002F h \\rfloor$; $\\ $ result $\\gets \\varnothing$\nfor each cell $c'$ bordering $c$, and $c$ itself, do\n  for each particle $j \\in G[c']$ do\n    if $\\lVert \\mathbf r_i - \\mathbf r_j \\rVert \u003C h$ then add $j$ to result\nreturn result\n",[108,29129,29130,29135,29140,29145,29150,29155,29160],{"__ignoreMap":478},[116,29131,29132],{"class":2116,"line":2117},[116,29133,29134],{},"caption: $\\textsc{Neighbors}(i)$ — spatial-hash query for particles within $h$ of $i$\n",[116,29136,29137],{"class":2116,"line":479},[116,29138,29139],{},"input: particle $i$, cell size $h$, table $G$ mapping cell $\\to$ particles\n",[116,29141,29142],{"class":2116,"line":2128},[116,29143,29144],{},"$c \\gets \\lfloor \\mathbf r_i \u002F h \\rfloor$; $\\ $ result $\\gets \\varnothing$\n",[116,29146,29147],{"class":2116,"line":2134},[116,29148,29149],{},"for each cell $c'$ bordering $c$, and $c$ itself, do\n",[116,29151,29152],{"class":2116,"line":2140},[116,29153,29154],{},"  for each particle $j \\in G[c']$ do\n",[116,29156,29157],{"class":2116,"line":2146},[116,29158,29159],{},"    if $\\lVert \\mathbf r_i - \\mathbf r_j \\rVert \u003C h$ then add $j$ to result\n",[116,29161,29162],{"class":2116,"line":2152},[116,29163,29164],{},"return result\n",[29166,29167],"particle-hash-viz",{},[73,29169,29170,29171,29186,29187,3225],{},"The same grid detects particle collisions and propagates contact forces:\nparticles that share or border a cell are the only ones close enough to touch,\nso contact resolution never compares far-apart pairs. A contact between two\nparticles of radius ",[116,29172,29174],{"className":29173},[119],[116,29175,29177],{"className":29176,"ariaHidden":124},[123],[116,29178,29180,29183],{"className":29179},[128],[116,29181],{"className":29182,"style":133},[132],[116,29184,206],{"className":29185,"style":205},[137,138]," is an overlap; resolution separates the pair and, if\nthey are still approaching, reflects the normal component of their relative\nvelocity with restitution ",[116,29188,29190],{"className":29189},[119],[116,29191,29193],{"className":29192,"ariaHidden":124},[123],[116,29194,29196,29199],{"className":29195},[128],[116,29197],{"className":29198,"style":133},[132],[116,29200,4527],{"className":29201},[137,138],[2107,29203,29205],{"className":2109,"code":29204,"language":2111,"meta":478,"style":478},"caption: $\\textsc{ResolveContacts}()$ — collisions through the same hash\ninput: particles with radius $r$, restitution $e$, cell table $G$\nrebuild $G$: insert every particle into its cell\nfor each particle $i$ do\n  for each $j \\in \\textsc{Neighbors}(i)$ with $j > i$ do\n    $d \\gets \\lVert \\mathbf r_i - \\mathbf r_j \\rVert$\n    if $d \u003C 2r$ then\n      $\\mathbf n \\gets (\\mathbf r_i - \\mathbf r_j) \u002F d$\n      move $i$ and $j$ apart by $(2r - d)\u002F2$ along $\\pm\\mathbf n$\n      $v_n \\gets (\\mathbf v_i - \\mathbf v_j) \\cdot \\mathbf n$\n      if $v_n \u003C 0$ then\n        apply impulse $-(1 + e)\\,v_n \u002F 2$ along $\\pm\\mathbf n$ to $i$ and $j$\n",[108,29206,29207,29212,29217,29222,29226,29231,29236,29241,29246,29251,29256,29261],{"__ignoreMap":478},[116,29208,29209],{"class":2116,"line":2117},[116,29210,29211],{},"caption: $\\textsc{ResolveContacts}()$ — collisions through the same hash\n",[116,29213,29214],{"class":2116,"line":479},[116,29215,29216],{},"input: particles with radius $r$, restitution $e$, cell table $G$\n",[116,29218,29219],{"class":2116,"line":2128},[116,29220,29221],{},"rebuild $G$: insert every particle into its cell\n",[116,29223,29224],{"class":2116,"line":2134},[116,29225,25524],{},[116,29227,29228],{"class":2116,"line":2140},[116,29229,29230],{},"  for each $j \\in \\textsc{Neighbors}(i)$ with $j > i$ do\n",[116,29232,29233],{"class":2116,"line":2146},[116,29234,29235],{},"    $d \\gets \\lVert \\mathbf r_i - \\mathbf r_j \\rVert$\n",[116,29237,29238],{"class":2116,"line":2152},[116,29239,29240],{},"    if $d \u003C 2r$ then\n",[116,29242,29243],{"class":2116,"line":2158},[116,29244,29245],{},"      $\\mathbf n \\gets (\\mathbf r_i - \\mathbf r_j) \u002F d$\n",[116,29247,29248],{"class":2116,"line":2164},[116,29249,29250],{},"      move $i$ and $j$ apart by $(2r - d)\u002F2$ along $\\pm\\mathbf n$\n",[116,29252,29253],{"class":2116,"line":25556},[116,29254,29255],{},"      $v_n \\gets (\\mathbf v_i - \\mathbf v_j) \\cdot \\mathbf n$\n",[116,29257,29258],{"class":2116,"line":25562},[116,29259,29260],{},"      if $v_n \u003C 0$ then\n",[116,29262,29264],{"class":2116,"line":29263},12,[116,29265,29266],{},"        apply impulse $-(1 + e)\\,v_n \u002F 2$ along $\\pm\\mathbf n$ to $i$ and $j$\n",[2263,29268,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":29270},[],"2022-01-27","A C++ simulator for fluids and particle systems. Fluids follow the\nNavier-Stokes equations,\ndiscretized with smoothed-particle hydrodynamics\n(SPH); a uniform spatial hash keeps neighbor search and collision detection\nnear-linear as particle counts grow.",{},"\u002Fprojects\u002Fvisual\u002F89-particle-physics",[29276,13717],"https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fdata-structures\u002Fspatial-data-structures","https:\u002F\u002Fgithub.com\u002Fsiavava\u002FPhysX\u002Ftree\u002Fmain\u002Fproj\u002Fa1_mass_spring",{"title":27960,"description":29272},"projects\u002Fvisual\u002F89-particle-physics","A fluid and particle simulator in C++: smoothed-particle hydrodynamics for\nthe Navier-Stokes equations, with a spatial hash for neighbor search and\ncollisions.",[25738,25739,25740],"zXW_q9gRXKH7myQGlJmSeyJjhjc2Yb3lpa3wfNskZlY",{"id":29284,"title":29285,"body":29286,"date":31005,"description":31006,"extension":483,"featured":2354,"meta":31007,"navigation":484,"path":31008,"references":31009,"repo":29277,"seo":31011,"stem":31012,"summary":31013,"tag":493,"tech":31014,"url":2282,"__hash__":31015},"projects\u002Fprojects\u002Fvisual\u002F89-mass-spring.md","Hair Strand Simulation",{"type":70,"value":29287,"toc":31003},[29288,29297,29300,29303,29453,30083,30344,30347,30354,30797,31000],[73,29289,29290,29291,29296],{},"A single hair strand animated as a mass-spring system in C++, drawn with\n",[76,29292,29295],{"href":29293,"rel":29294},"https:\u002F\u002Fwww.opengl.org\u002F",[80],"OpenGL",". The strand is discretized into a chain\nof point masses, and springs between them supply the forces that move it.",[246,29298],{"hash":29299},"80ef6b71ded4f6a46aefc8260a97d76d1efbc9105ef814d483e47bd83e9c1af6",[29301,29302],"mass-spring-viz",{},[73,29304,29305,29306,29311,29312,29367,29368,29452],{},"Adjacent masses are linked by springs that resist stretching. Each exerts a\n",[76,29307,29310],{"href":29308,"rel":29309},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHooke%27s_law",[80],"Hooke's-law"," force pulling the pair back toward the rest\nlength ",[116,29313,29315],{"className":29314},[119],[116,29316,29318],{"className":29317,"ariaHidden":124},[123],[116,29319,29321,29324],{"className":29320},[128],[116,29322],{"className":29323,"style":783},[132],[116,29325,29327,29330],{"className":29326},[137],[116,29328,4716],{"className":29329},[137,138],[116,29331,29333],{"className":29332},[725],[116,29334,29336,29359],{"className":29335},[168,169],[116,29337,29339,29356],{"className":29338},[173],[116,29340,29342],{"className":29341,"style":3145},[177],[116,29343,29344,29347],{"style":3584},[116,29345],{"className":29346,"style":742},[187],[116,29348,29350],{"className":29349},[746,747,748,749],[116,29351,29353],{"className":29352},[137,749],[116,29354,3503],{"className":29355,"style":3212},[137,138,749],[116,29357,234],{"className":29358},[233],[116,29360,29362],{"className":29361},[173],[116,29363,29365],{"className":29364,"style":822},[177],[116,29366],{},", plus a damping term along the same direction\n",[116,29369,29371],{"className":29370},[119],[116,29372,29374],{"className":29373,"ariaHidden":124},[123],[116,29375,29377,29381],{"className":29376},[128],[116,29378],{"className":29379,"style":29380},[132],"height:0.994em;vertical-align:-0.2861em;",[116,29382,29384,29415],{"className":29383},[137],[116,29385,29387],{"className":29386},[137,7716],[116,29388,29390],{"className":29389},[168],[116,29391,29393],{"className":29392},[173],[116,29394,29396,29404],{"className":29395,"style":26483},[177],[116,29397,29398,29401],{"style":3376},[116,29399],{"className":29400,"style":1119},[187],[116,29402,566],{"className":29403},[137,4026],[116,29405,29406,29409],{"style":25966},[116,29407],{"className":29408,"style":1119},[187],[116,29410,29412],{"className":29411,"style":26500},[7742],[116,29413,7747],{"className":29414},[137],[116,29416,29418],{"className":29417},[725],[116,29419,29421,29444],{"className":29420},[168,169],[116,29422,29424,29441],{"className":29423},[173],[116,29425,29427],{"className":29426,"style":3145},[177],[116,29428,29429,29432],{"style":3584},[116,29430],{"className":29431,"style":742},[187],[116,29433,29435],{"className":29434},[746,747,748,749],[116,29436,29438],{"className":29437},[137,749],[116,29439,3503],{"className":29440,"style":3212},[137,138,749],[116,29442,234],{"className":29443},[233],[116,29445,29447],{"className":29446},[173],[116,29448,29450],{"className":29449,"style":822},[177],[116,29451],{}," that bleeds off oscillation:",[116,29454,29456],{"className":29455},[702],[116,29457,29459],{"className":29458},[119],[116,29460,29462,29521,29638,29696,29760,29862,29920],{"className":29461,"ariaHidden":124},[123],[116,29463,29465,29469,29512,29515,29518],{"className":29464},[128],[116,29466],{"className":29467,"style":29468},[132],"height:0.9805em;vertical-align:-0.2861em;",[116,29470,29472,29475],{"className":29471},[137],[116,29473,26047],{"className":29474,"style":196},[137,4026],[116,29476,29478],{"className":29477},[725],[116,29479,29481,29504],{"className":29480},[168,169],[116,29482,29484,29501],{"className":29483},[173],[116,29485,29487],{"className":29486,"style":3145},[177],[116,29488,29489,29492],{"style":26062},[116,29490],{"className":29491,"style":742},[187],[116,29493,29495],{"className":29494},[746,747,748,749],[116,29496,29498],{"className":29497},[137,749],[116,29499,3503],{"className":29500,"style":3212},[137,138,749],[116,29502,234],{"className":29503},[233],[116,29505,29507],{"className":29506},[173],[116,29508,29510],{"className":29509,"style":822},[177],[116,29511],{},[116,29513],{"className":29514,"style":145},[144],[116,29516,150],{"className":29517},[149],[116,29519],{"className":29520,"style":145},[144],[116,29522,29524,29527,29530,29536,29539,29580,29586,29589,29629,29632,29635],{"className":29523},[128],[116,29525],{"className":29526,"style":16823},[132],[116,29528,1610],{"className":29529},[137],[116,29531,29533],{"className":29532},[137],[116,29534,1092],{"className":29535},[1091,16264],[116,29537],{"className":29538,"style":279},[144],[116,29540,29542,29545],{"className":29541},[137],[116,29543,4382],{"className":29544,"style":4381},[137,138],[116,29546,29548],{"className":29547},[725],[116,29549,29551,29572],{"className":29550},[168,169],[116,29552,29554,29569],{"className":29553},[173],[116,29555,29557],{"className":29556,"style":735},[177],[116,29558,29560,29563],{"style":29559},"top:-2.55em;margin-left:-0.0315em;margin-right:0.05em;",[116,29561],{"className":29562,"style":742},[187],[116,29564,29566],{"className":29565},[746,747,748,749],[116,29567,16940],{"className":29568},[137,138,749],[116,29570,234],{"className":29571},[233],[116,29573,29575],{"className":29574},[173],[116,29576,29578],{"className":29577,"style":762},[177],[116,29579],{},[116,29581,29583],{"className":29582},[137],[116,29584,562],{"className":29585},[1091,1002],[116,29587,5020],{"className":29588},[561],[116,29590,29592,29595],{"className":29591},[137],[116,29593,566],{"className":29594},[137,4026],[116,29596,29598],{"className":29597},[725],[116,29599,29601,29621],{"className":29600},[168,169],[116,29602,29604,29618],{"className":29603},[173],[116,29605,29607],{"className":29606,"style":3145},[177],[116,29608,29609,29612],{"style":3584},[116,29610],{"className":29611,"style":742},[187],[116,29613,29615],{"className":29614},[746,747,748,749],[116,29616,3158],{"className":29617},[137,138,749],[116,29619,234],{"className":29620},[233],[116,29622,29624],{"className":29623},[173],[116,29625,29627],{"className":29626,"style":762},[177],[116,29628],{},[116,29630],{"className":29631,"style":570},[144],[116,29633,1610],{"className":29634},[574],[116,29636],{"className":29637,"style":570},[144],[116,29639,29641,29644,29684,29687,29690,29693],{"className":29640},[128],[116,29642],{"className":29643,"style":11131},[132],[116,29645,29647,29650],{"className":29646},[137],[116,29648,566],{"className":29649},[137,4026],[116,29651,29653],{"className":29652},[725],[116,29654,29656,29676],{"className":29655},[168,169],[116,29657,29659,29673],{"className":29658},[173],[116,29660,29662],{"className":29661,"style":3145},[177],[116,29663,29664,29667],{"style":3584},[116,29665],{"className":29666,"style":742},[187],[116,29668,29670],{"className":29669},[746,747,748,749],[116,29671,3213],{"className":29672,"style":3212},[137,138,749],[116,29674,234],{"className":29675},[233],[116,29677,29679],{"className":29678},[173],[116,29680,29682],{"className":29681,"style":822},[177],[116,29683],{},[116,29685,5020],{"className":29686},[651],[116,29688],{"className":29689,"style":570},[144],[116,29691,1610],{"className":29692},[574],[116,29694],{"className":29695,"style":570},[144],[116,29697,29699,29702,29745,29751,29754,29757],{"className":29698},[128],[116,29700],{"className":29701,"style":7685},[132],[116,29703,29705,29708],{"className":29704},[137],[116,29706,4716],{"className":29707},[137,138],[116,29709,29711],{"className":29710},[725],[116,29712,29714,29737],{"className":29713},[168,169],[116,29715,29717,29734],{"className":29716},[173],[116,29718,29720],{"className":29719,"style":3145},[177],[116,29721,29722,29725],{"style":3584},[116,29723],{"className":29724,"style":742},[187],[116,29726,29728],{"className":29727},[746,747,748,749],[116,29729,29731],{"className":29730},[137,749],[116,29732,3503],{"className":29733,"style":3212},[137,138,749],[116,29735,234],{"className":29736},[233],[116,29738,29740],{"className":29739},[173],[116,29741,29743],{"className":29742,"style":822},[177],[116,29744],{},[116,29746,29748],{"className":29747},[137],[116,29749,652],{"className":29750},[1091,1002],[116,29752],{"className":29753,"style":570},[144],[116,29755,575],{"className":29756},[574],[116,29758],{"className":29759,"style":570},[144],[116,29761,29763,29766,29806,29809,29812,29853,29856,29859],{"className":29762},[128],[116,29764],{"className":29765,"style":552},[132],[116,29767,29769,29772],{"className":29768},[137],[116,29770,4382],{"className":29771,"style":4381},[137,138],[116,29773,29775],{"className":29774},[725],[116,29776,29778,29798],{"className":29777},[168,169],[116,29779,29781,29795],{"className":29780},[173],[116,29782,29784],{"className":29783,"style":5301},[177],[116,29785,29786,29789],{"style":29559},[116,29787],{"className":29788,"style":742},[187],[116,29790,29792],{"className":29791},[746,747,748,749],[116,29793,5288],{"className":29794},[137,138,749],[116,29796,234],{"className":29797},[233],[116,29799,29801],{"className":29800},[173],[116,29802,29804],{"className":29803,"style":762},[177],[116,29805],{},[116,29807],{"className":29808,"style":279},[144],[116,29810,562],{"className":29811},[561],[116,29813,29815,29818],{"className":29814},[137],[116,29816,140],{"className":29817,"style":4969},[137,4026],[116,29819,29821],{"className":29820},[725],[116,29822,29824,29845],{"className":29823},[168,169],[116,29825,29827,29842],{"className":29826},[173],[116,29828,29830],{"className":29829,"style":3145},[177],[116,29831,29833,29836],{"style":29832},"top:-2.55em;margin-left:-0.016em;margin-right:0.05em;",[116,29834],{"className":29835,"style":742},[187],[116,29837,29839],{"className":29838},[746,747,748,749],[116,29840,3158],{"className":29841},[137,138,749],[116,29843,234],{"className":29844},[233],[116,29846,29848],{"className":29847},[173],[116,29849,29851],{"className":29850,"style":762},[177],[116,29852],{},[116,29854],{"className":29855,"style":570},[144],[116,29857,1610],{"className":29858},[574],[116,29860],{"className":29861,"style":570},[144],[116,29863,29865,29868,29908,29911,29914,29917],{"className":29864},[128],[116,29866],{"className":29867,"style":11131},[132],[116,29869,29871,29874],{"className":29870},[137],[116,29872,140],{"className":29873,"style":4969},[137,4026],[116,29875,29877],{"className":29876},[725],[116,29878,29880,29900],{"className":29879},[168,169],[116,29881,29883,29897],{"className":29882},[173],[116,29884,29886],{"className":29885,"style":3145},[177],[116,29887,29888,29891],{"style":29832},[116,29889],{"className":29890,"style":742},[187],[116,29892,29894],{"className":29893},[746,747,748,749],[116,29895,3213],{"className":29896,"style":3212},[137,138,749],[116,29898,234],{"className":29899},[233],[116,29901,29903],{"className":29902},[173],[116,29904,29906],{"className":29905,"style":822},[177],[116,29907],{},[116,29909,652],{"className":29910},[651],[116,29912],{"className":29913,"style":570},[144],[116,29915,5064],{"className":29916},[574],[116,29918],{"className":29919,"style":570},[144],[116,29921,29923,29926,29997,30000,30006,30009,30080],{"className":29922},[128],[116,29924],{"className":29925,"style":16823},[132],[116,29927,29929,29960],{"className":29928},[137],[116,29930,29932],{"className":29931},[137,7716],[116,29933,29935],{"className":29934},[168],[116,29936,29938],{"className":29937},[173],[116,29939,29941,29949],{"className":29940,"style":26483},[177],[116,29942,29943,29946],{"style":3376},[116,29944],{"className":29945,"style":1119},[187],[116,29947,566],{"className":29948},[137,4026],[116,29950,29951,29954],{"style":25966},[116,29952],{"className":29953,"style":1119},[187],[116,29955,29957],{"className":29956,"style":26500},[7742],[116,29958,7747],{"className":29959},[137],[116,29961,29963],{"className":29962},[725],[116,29964,29966,29989],{"className":29965},[168,169],[116,29967,29969,29986],{"className":29968},[173],[116,29970,29972],{"className":29971,"style":3145},[177],[116,29973,29974,29977],{"style":3584},[116,29975],{"className":29976,"style":742},[187],[116,29978,29980],{"className":29979},[746,747,748,749],[116,29981,29983],{"className":29982},[137,749],[116,29984,3503],{"className":29985,"style":3212},[137,138,749],[116,29987,234],{"className":29988},[233],[116,29990,29992],{"className":29991},[173],[116,29993,29995],{"className":29994,"style":822},[177],[116,29996],{},[116,29998],{"className":29999,"style":279},[144],[116,30001,30003],{"className":30002},[137],[116,30004,1493],{"className":30005},[1091,16264],[116,30007],{"className":30008,"style":279},[144],[116,30010,30012,30043],{"className":30011},[137],[116,30013,30015],{"className":30014},[137,7716],[116,30016,30018],{"className":30017},[168],[116,30019,30021],{"className":30020},[173],[116,30022,30024,30032],{"className":30023,"style":26483},[177],[116,30025,30026,30029],{"style":3376},[116,30027],{"className":30028,"style":1119},[187],[116,30030,566],{"className":30031},[137,4026],[116,30033,30034,30037],{"style":25966},[116,30035],{"className":30036,"style":1119},[187],[116,30038,30040],{"className":30039,"style":26500},[7742],[116,30041,7747],{"className":30042},[137],[116,30044,30046],{"className":30045},[725],[116,30047,30049,30072],{"className":30048},[168,169],[116,30050,30052,30069],{"className":30051},[173],[116,30053,30055],{"className":30054,"style":3145},[177],[116,30056,30057,30060],{"style":3584},[116,30058],{"className":30059,"style":742},[187],[116,30061,30063],{"className":30062},[746,747,748,749],[116,30064,30066],{"className":30065},[137,749],[116,30067,3503],{"className":30068,"style":3212},[137,138,749],[116,30070,234],{"className":30071},[233],[116,30073,30075],{"className":30074},[173],[116,30076,30078],{"className":30077,"style":822},[177],[116,30079],{},[116,30081,1852],{"className":30082},[137],[73,30084,30085,30086,30199,30200,30255,30256,30259,30260,30343],{},"The first bracketed term is the spring: its magnitude grows with how far\nthe current separation ",[116,30087,30089],{"className":30088},[119],[116,30090,30092,30150],{"className":30091,"ariaHidden":124},[123],[116,30093,30095,30098,30101,30141,30144,30147],{"className":30094},[128],[116,30096],{"className":30097,"style":552},[132],[116,30099,5020],{"className":30100},[561],[116,30102,30104,30107],{"className":30103},[137],[116,30105,566],{"className":30106},[137,4026],[116,30108,30110],{"className":30109},[725],[116,30111,30113,30133],{"className":30112},[168,169],[116,30114,30116,30130],{"className":30115},[173],[116,30117,30119],{"className":30118,"style":3145},[177],[116,30120,30121,30124],{"style":3584},[116,30122],{"className":30123,"style":742},[187],[116,30125,30127],{"className":30126},[746,747,748,749],[116,30128,3158],{"className":30129},[137,138,749],[116,30131,234],{"className":30132},[233],[116,30134,30136],{"className":30135},[173],[116,30137,30139],{"className":30138,"style":762},[177],[116,30140],{},[116,30142],{"className":30143,"style":570},[144],[116,30145,1610],{"className":30146},[574],[116,30148],{"className":30149,"style":570},[144],[116,30151,30153,30156,30196],{"className":30152},[128],[116,30154],{"className":30155,"style":11131},[132],[116,30157,30159,30162],{"className":30158},[137],[116,30160,566],{"className":30161},[137,4026],[116,30163,30165],{"className":30164},[725],[116,30166,30168,30188],{"className":30167},[168,169],[116,30169,30171,30185],{"className":30170},[173],[116,30172,30174],{"className":30173,"style":3145},[177],[116,30175,30176,30179],{"style":3584},[116,30177],{"className":30178,"style":742},[187],[116,30180,30182],{"className":30181},[746,747,748,749],[116,30183,3213],{"className":30184,"style":3212},[137,138,749],[116,30186,234],{"className":30187},[233],[116,30189,30191],{"className":30190},[173],[116,30192,30194],{"className":30193,"style":822},[177],[116,30195],{},[116,30197,5020],{"className":30198},[651]," has\nstrayed from ",[116,30201,30203],{"className":30202},[119],[116,30204,30206],{"className":30205,"ariaHidden":124},[123],[116,30207,30209,30212],{"className":30208},[128],[116,30210],{"className":30211,"style":783},[132],[116,30213,30215,30218],{"className":30214},[137],[116,30216,4716],{"className":30217},[137,138],[116,30219,30221],{"className":30220},[725],[116,30222,30224,30247],{"className":30223},[168,169],[116,30225,30227,30244],{"className":30226},[173],[116,30228,30230],{"className":30229,"style":3145},[177],[116,30231,30232,30235],{"style":3584},[116,30233],{"className":30234,"style":742},[187],[116,30236,30238],{"className":30237},[746,747,748,749],[116,30239,30241],{"className":30240},[137,749],[116,30242,3503],{"className":30243,"style":3212},[137,138,749],[116,30245,234],{"className":30246},[233],[116,30248,30250],{"className":30249},[173],[116,30251,30253],{"className":30252,"style":822},[177],[116,30254],{},", and its sign restores toward rest — stretched\nsprings pull in, compressed springs push out. The second term damps only\nthe component of relative velocity ",[442,30257,30258],{},"along"," the spring, projected out by\nthe dot product with ",[116,30261,30263],{"className":30262},[119],[116,30264,30266],{"className":30265,"ariaHidden":124},[123],[116,30267,30269,30272],{"className":30268},[128],[116,30270],{"className":30271,"style":29380},[132],[116,30273,30275,30306],{"className":30274},[137],[116,30276,30278],{"className":30277},[137,7716],[116,30279,30281],{"className":30280},[168],[116,30282,30284],{"className":30283},[173],[116,30285,30287,30295],{"className":30286,"style":26483},[177],[116,30288,30289,30292],{"style":3376},[116,30290],{"className":30291,"style":1119},[187],[116,30293,566],{"className":30294},[137,4026],[116,30296,30297,30300],{"style":25966},[116,30298],{"className":30299,"style":1119},[187],[116,30301,30303],{"className":30302,"style":26500},[7742],[116,30304,7747],{"className":30305},[137],[116,30307,30309],{"className":30308},[725],[116,30310,30312,30335],{"className":30311},[168,169],[116,30313,30315,30332],{"className":30314},[173],[116,30316,30318],{"className":30317,"style":3145},[177],[116,30319,30320,30323],{"style":3584},[116,30321],{"className":30322,"style":742},[187],[116,30324,30326],{"className":30325},[746,747,748,749],[116,30327,30329],{"className":30328},[137,749],[116,30330,3503],{"className":30331,"style":3212},[137,138,749],[116,30333,234],{"className":30334},[233],[116,30336,30338],{"className":30337},[173],[116,30339,30341],{"className":30340,"style":822},[177],[116,30342],{},", so it removes energy from\nstretching oscillation without fighting the strand's overall motion. The\npair force is applied equal and opposite to the two masses, so momentum\nis conserved.",[73,30345,30346],{},"Structural springs alone would let the strand fold flat, so a second set of\nstiffer springs spans every other mass, resisting curvature so the strand\nkeeps a smooth bend and springs back toward straight when disturbed.",[73,30348,30349,30350,30353],{},"Summing forces on each mass gives its acceleration, and the state advances\nby semi-implicit (symplectic) Euler, which updates velocity first and then\nposition from the ",[442,30351,30352],{},"updated"," velocity:",[116,30355,30357],{"className":30356},[702],[116,30358,30360],{"className":30359},[119],[116,30361,30363,30418,30473,30684,30739],{"className":30362,"ariaHidden":124},[123],[116,30364,30366,30369,30409,30412,30415],{"className":30365},[128],[116,30367],{"className":30368,"style":23534},[132],[116,30370,30372,30375],{"className":30371},[137],[116,30373,140],{"className":30374,"style":4969},[137,4026],[116,30376,30378],{"className":30377},[725],[116,30379,30381,30401],{"className":30380},[168,169],[116,30382,30384,30398],{"className":30383},[173],[116,30385,30387],{"className":30386,"style":3145},[177],[116,30388,30389,30392],{"style":29832},[116,30390],{"className":30391,"style":742},[187],[116,30393,30395],{"className":30394},[746,747,748,749],[116,30396,3158],{"className":30397},[137,138,749],[116,30399,234],{"className":30400},[233],[116,30402,30404],{"className":30403},[173],[116,30405,30407],{"className":30406,"style":762},[177],[116,30408],{},[116,30410],{"className":30411,"style":145},[144],[116,30413,2195],{"className":30414},[149],[116,30416],{"className":30417,"style":145},[144],[116,30419,30421,30424,30464,30467,30470],{"className":30420},[128],[116,30422],{"className":30423,"style":23115},[132],[116,30425,30427,30430],{"className":30426},[137],[116,30428,140],{"className":30429,"style":4969},[137,4026],[116,30431,30433],{"className":30432},[725],[116,30434,30436,30456],{"className":30435},[168,169],[116,30437,30439,30453],{"className":30438},[173],[116,30440,30442],{"className":30441,"style":3145},[177],[116,30443,30444,30447],{"style":29832},[116,30445],{"className":30446,"style":742},[187],[116,30448,30450],{"className":30449},[746,747,748,749],[116,30451,3158],{"className":30452},[137,138,749],[116,30454,234],{"className":30455},[233],[116,30457,30459],{"className":30458},[173],[116,30460,30462],{"className":30461,"style":762},[177],[116,30463],{},[116,30465],{"className":30466,"style":570},[144],[116,30468,575],{"className":30469},[574],[116,30471],{"className":30472,"style":570},[144],[116,30474,30476,30480,30483,30486,30489,30626,30629,30632,30635,30675,30678,30681],{"className":30475},[128],[116,30477],{"className":30478,"style":30479},[132],"height:2.2074em;vertical-align:-0.836em;",[116,30481,283],{"className":30482},[137],[116,30484,287],{"className":30485},[137,138],[116,30487],{"className":30488,"style":279},[144],[116,30490,30492,30495,30623],{"className":30491},[137],[116,30493],{"className":30494},[561,4427],[116,30496,30498],{"className":30497},[4431],[116,30499,30501,30614],{"className":30500},[168,169],[116,30502,30504,30611],{"className":30503},[173],[116,30505,30507,30555,30563],{"className":30506,"style":16056},[177],[116,30508,30509,30512],{"style":5010},[116,30510],{"className":30511,"style":1119},[187],[116,30513,30515],{"className":30514},[137],[116,30516,30518,30521],{"className":30517},[137],[116,30519,10717],{"className":30520},[137,138],[116,30522,30524],{"className":30523},[725],[116,30525,30527,30547],{"className":30526},[168,169],[116,30528,30530,30544],{"className":30529},[173],[116,30531,30533],{"className":30532,"style":3145},[177],[116,30534,30535,30538],{"style":3584},[116,30536],{"className":30537,"style":742},[187],[116,30539,30541],{"className":30540},[746,747,748,749],[116,30542,3158],{"className":30543},[137,138,749],[116,30545,234],{"className":30546},[233],[116,30548,30550],{"className":30549},[173],[116,30551,30553],{"className":30552,"style":762},[177],[116,30554],{},[116,30556,30557,30560],{"style":4597},[116,30558],{"className":30559,"style":1119},[187],[116,30561],{"className":30562,"style":4605},[4604],[116,30564,30565,30568],{"style":4608},[116,30566],{"className":30567,"style":1119},[187],[116,30569,30571],{"className":30570},[137],[116,30572,30574,30577],{"className":30573},[137],[116,30575,26047],{"className":30576,"style":196},[137,4026],[116,30578,30580],{"className":30579},[725],[116,30581,30583,30603],{"className":30582},[168,169],[116,30584,30586,30600],{"className":30585},[173],[116,30587,30589],{"className":30588,"style":3145},[177],[116,30590,30591,30594],{"style":26062},[116,30592],{"className":30593,"style":742},[187],[116,30595,30597],{"className":30596},[746,747,748,749],[116,30598,3158],{"className":30599},[137,138,749],[116,30601,234],{"className":30602},[233],[116,30604,30606],{"className":30605},[173],[116,30607,30609],{"className":30608,"style":762},[177],[116,30610],{},[116,30612,234],{"className":30613},[233],[116,30615,30617],{"className":30616},[173],[116,30618,30621],{"className":30619,"style":30620},[177],"height:0.836em;",[116,30622],{},[116,30624],{"className":30625},[651,4427],[116,30627,594],{"className":30628},[593],[116,30630],{"className":30631,"style":4159},[144],[116,30633],{"className":30634,"style":279},[144],[116,30636,30638,30641],{"className":30637},[137],[116,30639,566],{"className":30640},[137,4026],[116,30642,30644],{"className":30643},[725],[116,30645,30647,30667],{"className":30646},[168,169],[116,30648,30650,30664],{"className":30649},[173],[116,30651,30653],{"className":30652,"style":3145},[177],[116,30654,30655,30658],{"style":3584},[116,30656],{"className":30657,"style":742},[187],[116,30659,30661],{"className":30660},[746,747,748,749],[116,30662,3158],{"className":30663},[137,138,749],[116,30665,234],{"className":30666},[233],[116,30668,30670],{"className":30669},[173],[116,30671,30673],{"className":30672,"style":762},[177],[116,30674],{},[116,30676],{"className":30677,"style":145},[144],[116,30679,2195],{"className":30680},[149],[116,30682],{"className":30683,"style":145},[144],[116,30685,30687,30690,30730,30733,30736],{"className":30686},[128],[116,30688],{"className":30689,"style":23115},[132],[116,30691,30693,30696],{"className":30692},[137],[116,30694,566],{"className":30695},[137,4026],[116,30697,30699],{"className":30698},[725],[116,30700,30702,30722],{"className":30701},[168,169],[116,30703,30705,30719],{"className":30704},[173],[116,30706,30708],{"className":30707,"style":3145},[177],[116,30709,30710,30713],{"style":3584},[116,30711],{"className":30712,"style":742},[187],[116,30714,30716],{"className":30715},[746,747,748,749],[116,30717,3158],{"className":30718},[137,138,749],[116,30720,234],{"className":30721},[233],[116,30723,30725],{"className":30724},[173],[116,30726,30728],{"className":30727,"style":762},[177],[116,30729],{},[116,30731],{"className":30732,"style":570},[144],[116,30734,575],{"className":30735},[574],[116,30737],{"className":30738,"style":570},[144],[116,30740,30742,30745,30748,30751,30754,30794],{"className":30741},[128],[116,30743],{"className":30744,"style":715},[132],[116,30746,283],{"className":30747},[137],[116,30749,287],{"className":30750},[137,138],[116,30752],{"className":30753,"style":279},[144],[116,30755,30757,30760],{"className":30756},[137],[116,30758,140],{"className":30759,"style":4969},[137,4026],[116,30761,30763],{"className":30762},[725],[116,30764,30766,30786],{"className":30765},[168,169],[116,30767,30769,30783],{"className":30768},[173],[116,30770,30772],{"className":30771,"style":3145},[177],[116,30773,30774,30777],{"style":29832},[116,30775],{"className":30776,"style":742},[187],[116,30778,30780],{"className":30779},[746,747,748,749],[116,30781,3158],{"className":30782},[137,138,749],[116,30784,234],{"className":30785},[233],[116,30787,30789],{"className":30788},[173],[116,30790,30792],{"className":30791,"style":762},[177],[116,30793],{},[116,30795,1852],{"className":30796},[137],[73,30798,30799,30800,30803,30804,30927,30928,30980,30981,30999],{},"The order matters because explicit Euler updates position from the ",[442,30801,30802],{},"old","\nvelocity. On a spring, where the force always opposes displacement, each\nsuch step lags the true trajectory and adds a little energy, and over many\nsteps that error compounds: the oscillation grows instead of decaying, and\nthe strand shakes itself apart. Semi-implicit Euler steps the velocity\nfirst, then advances position with the new velocity, which folds a\nhalf-step of implicitness into the position update and keeps the per-step\nenergy bounded rather than growing. Stability still has a limit\nset by the stiffest spring: the step must satisfy roughly\n",[116,30805,30807],{"className":30806},[119],[116,30808,30810,30831],{"className":30809,"ariaHidden":124},[123],[116,30811,30813,30816,30819,30822,30825,30828],{"className":30812},[128],[116,30814],{"className":30815,"style":25600},[132],[116,30817,283],{"className":30818},[137],[116,30820,287],{"className":30821},[137,138],[116,30823],{"className":30824,"style":145},[144],[116,30826,25614],{"className":30827},[149,25613],[116,30829],{"className":30830,"style":145},[144],[116,30832,30834,30837],{"className":30833},[128],[116,30835],{"className":30836,"style":160},[132],[116,30838,30840],{"className":30839},[137,164],[116,30841,30843,30919],{"className":30842},[168,169],[116,30844,30846,30916],{"className":30845},[173],[116,30847,30849,30904],{"className":30848,"style":178},[177],[116,30850,30852,30855],{"className":30851,"style":183},[182],[116,30853],{"className":30854,"style":188},[187],[116,30856,30858,30861,30864],{"className":30857,"style":192},[137],[116,30859,10717],{"className":30860},[137,138],[116,30862,201],{"className":30863},[137],[116,30865,30867,30870],{"className":30866},[137],[116,30868,4382],{"className":30869,"style":4381},[137,138],[116,30871,30873],{"className":30872},[725],[116,30874,30876,30896],{"className":30875},[168,169],[116,30877,30879,30893],{"className":30878},[173],[116,30880,30882],{"className":30881,"style":735},[177],[116,30883,30884,30887],{"style":29559},[116,30885],{"className":30886,"style":742},[187],[116,30888,30890],{"className":30889},[746,747,748,749],[116,30891,16940],{"className":30892},[137,138,749],[116,30894,234],{"className":30895},[233],[116,30897,30899],{"className":30898},[173],[116,30900,30902],{"className":30901,"style":762},[177],[116,30903],{},[116,30905,30906,30909],{"style":209},[116,30907],{"className":30908,"style":188},[187],[116,30910,30912],{"className":30911,"style":217},[216],[219,30913,30914],{"xmlns":221,"width":222,"height":223,"viewBox":224,"preserveAspectRatio":225},[227,30915],{"d":229},[116,30917,234],{"className":30918},[233],[116,30920,30922],{"className":30921},[173],[116,30923,30925],{"className":30924,"style":241},[177],[116,30926],{},", so raising ",[116,30929,30931],{"className":30930},[119],[116,30932,30934],{"className":30933,"ariaHidden":124},[123],[116,30935,30937,30940],{"className":30936},[128],[116,30938],{"className":30939,"style":4182},[132],[116,30941,30943,30946],{"className":30942},[137],[116,30944,4382],{"className":30945,"style":4381},[137,138],[116,30947,30949],{"className":30948},[725],[116,30950,30952,30972],{"className":30951},[168,169],[116,30953,30955,30969],{"className":30954},[173],[116,30956,30958],{"className":30957,"style":735},[177],[116,30959,30960,30963],{"style":29559},[116,30961],{"className":30962,"style":742},[187],[116,30964,30966],{"className":30965},[746,747,748,749],[116,30967,16940],{"className":30968},[137,138,749],[116,30970,234],{"className":30971},[233],[116,30973,30975],{"className":30974},[173],[116,30976,30978],{"className":30977,"style":762},[177],[116,30979],{}," to make the strand\nfirmer forces a smaller ",[116,30982,30984],{"className":30983},[119],[116,30985,30987],{"className":30986,"ariaHidden":124},[123],[116,30988,30990,30993,30996],{"className":30989},[128],[116,30991],{"className":30992,"style":272},[132],[116,30994,283],{"className":30995},[137],[116,30997,287],{"className":30998},[137,138],". The bending springs are the stiffest\nin the model and set that ceiling, which is the practical reason a\nmass-spring strand is delicate to tune.",[73,31001,31002],{},"The stability limit and the tangent-following error are properties of\nthe numerical ODE integration, not of the hair model.",{"title":478,"searchDepth":479,"depth":479,"links":31004},[],"2022-01-20","A single hair strand animated as a mass-spring system in C++, drawn with\nOpenGL. The strand is discretized into a chain\nof point masses, and springs between them supply the forces that move it.",{},"\u002Fprojects\u002Fvisual\u002F89-mass-spring",[31010],"https:\u002F\u002Fnotes.amittai.studio\u002Fdifferential-equations\u002Fnumerical\u002Feuler-and-runge-kutta",{"title":29285,"description":31006},"projects\u002Fvisual\u002F89-mass-spring","A hair strand animated in C++\u002FOpenGL as a mass-spring chain, held in shape\nby structural and bending constraints.",[25738,25739,25740],"CQ0Zp2MJN1GdbfFPos9Ltq4DhknyiHG4dWq5rp--5yo",{"id":31017,"title":31018,"body":31019,"date":31141,"description":31142,"extension":483,"featured":484,"meta":31143,"navigation":484,"path":31144,"references":31145,"repo":31149,"seo":31150,"stem":31151,"summary":31152,"tag":21246,"tech":31153,"url":2282,"__hash__":31156},"projects\u002Fprojects\u002Fsystems\u002F51-logisim-cpu.md","Logisim Processor",{"type":70,"value":31020,"toc":31139},[31021,31072,31075,31136],[73,31022,31023,31024,31029,31030,31035,31036,31041,31042,31047,31048,31053,31054,31059,31060,31065,31066,31071],{},"A fully functional 16-bit ",[76,31025,31028],{"href":31026,"rel":31027},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FCentral_processing_unit",[80],"CPU","\nimplemented in ",[76,31031,31034],{"href":31032,"rel":31033},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLogisim",[80],"Logisim",", built\nup from bare gates: the\n",[76,31037,31040],{"href":31038,"rel":31039},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FArithmetic_logic_unit",[80],"ALU",", the register\nfile, the ",[76,31043,31046],{"href":31044,"rel":31045},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FControl_unit",[80],"control unit",",\nthe ",[76,31049,31052],{"href":31050,"rel":31051},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FProgram_counter",[80],"program counter",",\nRAM, a ",[76,31055,31058],{"href":31056,"rel":31057},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMicrosequencer",[80],"micro-sequencer","\ndriven by a ",[76,31061,31064],{"href":31062,"rel":31063},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFinite-state_machine",[80],"finite-state machine",",\nand memory-mapped ",[76,31067,31070],{"href":31068,"rel":31069},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInput\u002Foutput",[80],"IO",". It\nruns real programs, hand-assembled into its own 16-bit instruction\nencoding.",[246,31073],{"hash":31074},"f367364211556192494ff400be3246a28d0195b5783c75869df20d22c9088582",[73,31076,31077,31078,31093,31094,31135],{},"Every part of the machine reduces to gates. The ALU's adder is a chain of\nfull adders; subtraction is addition of the two's complement; comparisons\nfall out of the subtractor's sign and zero flags. Multiplexers built\nfrom AND\u002FOR trees steer every bus, and each register is a rank of\nD flip-flops behind a write-enable. With ",[116,31079,31081],{"className":31080},[119],[116,31082,31084],{"className":31083,"ariaHidden":124},[123],[116,31085,31087,31090],{"className":31086},[128],[116,31088],{"className":31089,"style":133},[132],[116,31091,9120],{"className":31092},[137,138]," select lines a multiplexer\nchooses among ",[116,31095,31097],{"className":31096},[119],[116,31098,31100],{"className":31099,"ariaHidden":124},[123],[116,31101,31103,31106],{"className":31102},[128],[116,31104],{"className":31105,"style":4633},[132],[116,31107,31109,31112],{"className":31108},[137],[116,31110,359],{"className":31111},[137],[116,31113,31115],{"className":31114},[725],[116,31116,31118],{"className":31117},[168],[116,31119,31121],{"className":31120},[173],[116,31122,31124],{"className":31123,"style":4633},[177],[116,31125,31126,31129],{"style":1167},[116,31127],{"className":31128,"style":742},[187],[116,31130,31132],{"className":31131},[746,747,748,749],[116,31133,9120],{"className":31134},[137,138,749]," inputs; the machine is built by applying that\nidentity at every scale.",[73,31137,31138],{},"The control unit is a finite-state machine that sequences each\ninstruction over several clock cycles: fetch the word at the PC, decode\nits opcode, execute its micro-operations. The micro-sequencer walks a ROM\nof control words, one per state, asserting the right write-enables, bus\nselects, and ALU function bits, then jumps back to fetch. Adding an\ninstruction means adding rows to that ROM, not rewiring the machine.",{"title":478,"searchDepth":479,"depth":479,"links":31140},[],"2021-11-05","A fully functional 16-bit CPU\nimplemented in Logisim, built\nup from bare gates: the\nALU, the register\nfile, the control unit,\nthe program counter,\nRAM, a micro-sequencer\ndriven by a finite-state machine,\nand memory-mapped IO. It\nruns real programs, hand-assembled into its own 16-bit instruction\nencoding.",{},"\u002Fprojects\u002Fsystems\u002F51-logisim-cpu",[31146,31147,31148],"https:\u002F\u002Fnotes.amittai.studio\u002Fcomputer-architecture\u002Fprocessor-design\u002Fthe-fetch-decode-execute-cycle","https:\u002F\u002Fnotes.amittai.studio\u002Fcomputer-architecture\u002Fdigital-logic\u002Fmultiplexers-decoders-and-the-alu","https:\u002F\u002Fnotes.amittai.studio\u002Fcomputer-architecture\u002Fdigital-logic\u002Fmemory-elements-latches-flip-flops-and-clocking","https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fassembly\u002Ftree\u002Fmain\u002Fcs51\u002Fpractice\u002Fhw8",{"title":31018,"description":31142},"projects\u002Fsystems\u002F51-logisim-cpu","A fully functional 16-bit CPU built in Logisim from bare gates — ALU,\nregister file, micro-sequenced control, and memory-mapped IO, running real\nprograms.",[31154,31155],"Assembly","Computer Architecture","ryRNgePtWzmrnPfmMlFiF6-a8-3AKc2Sg3S3bzE8fCM",{"id":31158,"title":31159,"body":31160,"date":32388,"description":32389,"extension":483,"featured":2354,"meta":32390,"navigation":484,"path":32391,"references":32392,"repo":32395,"seo":32396,"stem":32397,"summary":32398,"tag":32399,"tech":32400,"url":2282,"__hash__":32404},"projects\u002Fprojects\u002Fai\u002F76-markov-maze.md","Robot Colocation",{"type":70,"value":31161,"toc":32386},[31162,31175,31178,31181,31411,31571,31952,32080,32125,32384],[73,31163,31164,31165,31170,31171,31174],{},"Localization asks where a robot is, given only a stream of noisy sensor readings\nand a map. A ",[76,31166,31169],{"href":31167,"rel":31168},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHidden_Markov_model",[80],"hidden Markov model","\nfits the setting: the hidden state is the robot's cell in the maze, transitions\nencode how it moves between adjacent cells, and each cell emits a sensor reading\n— a color, here — corrupted by a known error rate. From a sequence of readings\nthe model recovers a probability distribution over the robot's position, a\n",[442,31172,31173],{},"belief"," that spreads across the grid and then tightens as evidence arrives.",[246,31176],{"hash":31177},"aaf52db82a79e228ed7b7848960ca840d64b86722026c7ba45f669accd8b04ef",[73,31179,31180],{},"The HMM factors the problem into a transition model and a sensor model, and the\nmap fixes both:",[10278,31182,31183,31309],{},[10281,31184,31185,106,31188,31259,31260,31304,31305,31308],{},[505,31186,31187],{},"Transition model",[116,31189,31191],{"className":31190},[119],[116,31192,31194,31218],{"className":31193,"ariaHidden":124},[123],[116,31195,31197,31200,31203,31206,31209,31212,31215],{"className":31196},[128],[116,31198],{"className":31199,"style":552},[132],[116,31201,2794],{"className":31202,"style":924},[137,138],[116,31204,562],{"className":31205},[561],[116,31207,16940],{"className":31208},[137,138],[116,31210],{"className":31211,"style":145},[144],[116,31213,4389],{"className":31214},[149],[116,31216],{"className":31217,"style":145},[144],[116,31219,31221,31224,31256],{"className":31220},[128],[116,31222],{"className":31223,"style":2846},[132],[116,31225,31227,31230],{"className":31226},[137],[116,31228,16940],{"className":31229},[137,138],[116,31231,31233],{"className":31232},[725],[116,31234,31236],{"className":31235},[168],[116,31237,31239],{"className":31238},[173],[116,31240,31242],{"className":31241,"style":2412},[177],[116,31243,31244,31247],{"style":1167},[116,31245],{"className":31246,"style":742},[187],[116,31248,31250],{"className":31249},[746,747,748,749],[116,31251,31253],{"className":31252},[137,749],[116,31254,2445],{"className":31255},[137,749],[116,31257,652],{"className":31258},[651],". From cell ",[116,31261,31263],{"className":31262},[119],[116,31264,31266],{"className":31265,"ariaHidden":124},[123],[116,31267,31269,31272],{"className":31268},[128],[116,31270],{"className":31271,"style":2412},[132],[116,31273,31275,31278],{"className":31274},[137],[116,31276,16940],{"className":31277},[137,138],[116,31279,31281],{"className":31280},[725],[116,31282,31284],{"className":31283},[168],[116,31285,31287],{"className":31286},[173],[116,31288,31290],{"className":31289,"style":2412},[177],[116,31291,31292,31295],{"style":1167},[116,31293],{"className":31294,"style":742},[187],[116,31296,31298],{"className":31297},[746,747,748,749],[116,31299,31301],{"className":31300},[137,749],[116,31302,2445],{"className":31303},[137,749]," the robot steps to an\nadjacent cell; walls and the grid boundary zero out the illegal moves, and the\nlegal neighbors split the remaining probability. Applied to a belief, this model\n",[442,31306,31307],{},"diffuses"," mass outward — uncertainty grows with every step taken blind.",[10281,31310,31311,106,31314,31356,31357,31390,31391,31406,31407,31410],{},[505,31312,31313],{},"Sensor model",[116,31315,31317],{"className":31316},[119],[116,31318,31320,31344],{"className":31319,"ariaHidden":124},[123],[116,31321,31323,31326,31329,31332,31335,31338,31341],{"className":31322},[128],[116,31324],{"className":31325,"style":552},[132],[116,31327,2794],{"className":31328,"style":924},[137,138],[116,31330,562],{"className":31331},[561],[116,31333,4527],{"className":31334},[137,138],[116,31336],{"className":31337,"style":145},[144],[116,31339,4389],{"className":31340},[149],[116,31342],{"className":31343,"style":145},[144],[116,31345,31347,31350,31353],{"className":31346},[128],[116,31348],{"className":31349,"style":552},[132],[116,31351,16940],{"className":31352},[137,138],[116,31354,652],{"className":31355},[651],". Each cell carries a color. A reading equals the\ncell's true color with probability ",[116,31358,31360],{"className":31359},[119],[116,31361,31363,31381],{"className":31362,"ariaHidden":124},[123],[116,31364,31366,31369,31372,31375,31378],{"className":31365},[128],[116,31367],{"className":31368,"style":1871},[132],[116,31370,345],{"className":31371},[137],[116,31373],{"className":31374,"style":570},[144],[116,31376,1610],{"className":31377},[574],[116,31379],{"className":31380,"style":570},[144],[116,31382,31384,31387],{"className":31383},[128],[116,31385],{"className":31386,"style":133},[132],[116,31388,17825],{"className":31389},[137,138]," and, with the leftover\n",[116,31392,31394],{"className":31393},[119],[116,31395,31397],{"className":31396,"ariaHidden":124},[123],[116,31398,31400,31403],{"className":31399},[128],[116,31401],{"className":31402,"style":133},[132],[116,31404,17825],{"className":31405},[137,138],", reports one of the other colors. Applied to a belief, this model\n",[442,31408,31409],{},"sharpens"," it — mass is pulled toward cells whose color matches the reading.",[73,31412,31413,31414,31476,31477,31492,31493,31508,31509,31570],{},"Filtering tracks a belief ",[116,31415,31417],{"className":31416},[119],[116,31418,31420],{"className":31419,"ariaHidden":124},[123],[116,31421,31423,31426,31467,31470,31473],{"className":31422},[128],[116,31424],{"className":31425,"style":552},[132],[116,31427,31429,31432],{"className":31428},[137],[116,31430,15813],{"className":31431,"style":15812},[137,138],[116,31433,31435],{"className":31434},[725],[116,31436,31438,31459],{"className":31437},[168,169],[116,31439,31441,31456],{"className":31440},[173],[116,31442,31444],{"className":31443,"style":861},[177],[116,31445,31447,31450],{"style":31446},"top:-2.55em;margin-left:-0.0037em;margin-right:0.05em;",[116,31448],{"className":31449,"style":742},[187],[116,31451,31453],{"className":31452},[746,747,748,749],[116,31454,287],{"className":31455},[137,138,749],[116,31457,234],{"className":31458},[233],[116,31460,31462],{"className":31461},[173],[116,31463,31465],{"className":31464,"style":762},[177],[116,31466],{},[116,31468,562],{"className":31469},[561],[116,31471,16940],{"className":31472},[137,138],[116,31474,652],{"className":31475},[651],", the probability the robot sits in\ncell ",[116,31478,31480],{"className":31479},[119],[116,31481,31483],{"className":31482,"ariaHidden":124},[123],[116,31484,31486,31489],{"className":31485},[128],[116,31487],{"className":31488,"style":133},[132],[116,31490,16940],{"className":31491},[137,138]," at time ",[116,31494,31496],{"className":31495},[119],[116,31497,31499],{"className":31498,"ariaHidden":124},[123],[116,31500,31502,31505],{"className":31501},[128],[116,31503],{"className":31504,"style":2770},[132],[116,31506,287],{"className":31507},[137,138]," given the readings ",[116,31510,31512],{"className":31511},[119],[116,31513,31515],{"className":31514,"ariaHidden":124},[123],[116,31516,31518,31521],{"className":31517},[128],[116,31519],{"className":31520,"style":9326},[132],[116,31522,31524,31527],{"className":31523},[137],[116,31525,4527],{"className":31526},[137,138],[116,31528,31530],{"className":31529},[725],[116,31531,31533,31562],{"className":31532},[168,169],[116,31534,31536,31559],{"className":31535},[173],[116,31537,31539],{"className":31538,"style":4068},[177],[116,31540,31541,31544],{"style":3584},[116,31542],{"className":31543,"style":742},[187],[116,31545,31547],{"className":31546},[746,747,748,749],[116,31548,31550,31553,31556],{"className":31549},[137,749],[116,31551,345],{"className":31552},[137,749],[116,31554,3225],{"className":31555},[149,749],[116,31557,287],{"className":31558},[137,138,749],[116,31560,234],{"className":31561},[233],[116,31563,31565],{"className":31564},[173],[116,31566,31568],{"className":31567,"style":762},[177],[116,31569],{},". It updates in two steps:\npredict through the motion model, then weight by the new reading's emission\nprobability,",[116,31572,31574],{"className":31573},[702],[116,31575,31577],{"className":31576},[119],[116,31578,31580,31644,31705,31817],{"className":31579,"ariaHidden":124},[123],[116,31581,31583,31586,31626,31629,31632,31635,31638,31641],{"className":31582},[128],[116,31584],{"className":31585,"style":552},[132],[116,31587,31589,31592],{"className":31588},[137],[116,31590,15813],{"className":31591,"style":15812},[137,138],[116,31593,31595],{"className":31594},[725],[116,31596,31598,31618],{"className":31597},[168,169],[116,31599,31601,31615],{"className":31600},[173],[116,31602,31604],{"className":31603,"style":861},[177],[116,31605,31606,31609],{"style":31446},[116,31607],{"className":31608,"style":742},[187],[116,31610,31612],{"className":31611},[746,747,748,749],[116,31613,287],{"className":31614},[137,138,749],[116,31616,234],{"className":31617},[233],[116,31619,31621],{"className":31620},[173],[116,31622,31624],{"className":31623,"style":762},[177],[116,31625],{},[116,31627,562],{"className":31628},[561],[116,31630,16940],{"className":31631},[137,138],[116,31633,652],{"className":31634},[651],[116,31636],{"className":31637,"style":145},[144],[116,31639,150],{"className":31640},[149],[116,31642],{"className":31643,"style":145},[144],[116,31645,31647,31650,31653,31656,31696,31699,31702],{"className":31646},[128],[116,31648],{"className":31649,"style":552},[132],[116,31651,2794],{"className":31652,"style":924},[137,138],[116,31654,562],{"className":31655},[561],[116,31657,31659,31662],{"className":31658},[137],[116,31660,4527],{"className":31661},[137,138],[116,31663,31665],{"className":31664},[725],[116,31666,31668,31688],{"className":31667},[168,169],[116,31669,31671,31685],{"className":31670},[173],[116,31672,31674],{"className":31673,"style":861},[177],[116,31675,31676,31679],{"style":3584},[116,31677],{"className":31678,"style":742},[187],[116,31680,31682],{"className":31681},[746,747,748,749],[116,31683,287],{"className":31684},[137,138,749],[116,31686,234],{"className":31687},[233],[116,31689,31691],{"className":31690},[173],[116,31692,31694],{"className":31693,"style":762},[177],[116,31695],{},[116,31697],{"className":31698,"style":145},[144],[116,31700,4389],{"className":31701},[149],[116,31703],{"className":31704,"style":145},[144],[116,31706,31708,31711,31714,31717,31720,31796,31799,31802,31805,31808,31811,31814],{"className":31707},[128],[116,31709],{"className":31710,"style":17004},[132],[116,31712,16940],{"className":31713},[137,138],[116,31715,652],{"className":31716},[651],[116,31718],{"className":31719,"style":279},[144],[116,31721,31723],{"className":31722},[1126,3245],[116,31724,31726,31788],{"className":31725},[168,169],[116,31727,31729,31785],{"className":31728},[173],[116,31730,31732,31775],{"className":31731,"style":3417},[177],[116,31733,31734,31737],{"style":17026},[116,31735],{"className":31736,"style":3424},[187],[116,31738,31740],{"className":31739},[746,747,748,749],[116,31741,31743],{"className":31742},[137,749],[116,31744,31746,31749],{"className":31745},[137,749],[116,31747,16940],{"className":31748},[137,138,749],[116,31750,31752],{"className":31751},[725],[116,31753,31755],{"className":31754},[168],[116,31756,31758],{"className":31757},[173],[116,31759,31761],{"className":31760,"style":9983},[177],[116,31762,31763,31766],{"style":993},[116,31764],{"className":31765,"style":997},[187],[116,31767,31769],{"className":31768},[746,1001,1002,749],[116,31770,31772],{"className":31771},[137,749],[116,31773,2445],{"className":31774},[137,749],[116,31776,31777,31780],{"style":3445},[116,31778],{"className":31779,"style":3424},[187],[116,31781,31782],{},[116,31783,1130],{"className":31784},[1126,1127,3454],[116,31786,234],{"className":31787},[233],[116,31789,31791],{"className":31790},[173],[116,31792,31794],{"className":31793,"style":17087},[177],[116,31795],{},[116,31797],{"className":31798,"style":279},[144],[116,31800,2794],{"className":31801,"style":924},[137,138],[116,31803,562],{"className":31804},[561],[116,31806,16940],{"className":31807},[137,138],[116,31809],{"className":31810,"style":145},[144],[116,31812,4389],{"className":31813},[149],[116,31815],{"className":31816,"style":145},[144],[116,31818,31820,31824,31856,31859,31862,31911,31914,31946,31949],{"className":31819},[128],[116,31821],{"className":31822,"style":31823},[132],"height:1.0519em;vertical-align:-0.25em;",[116,31825,31827,31830],{"className":31826},[137],[116,31828,16940],{"className":31829},[137,138],[116,31831,31833],{"className":31832},[725],[116,31834,31836],{"className":31835},[168],[116,31837,31839],{"className":31838},[173],[116,31840,31842],{"className":31841,"style":5751},[177],[116,31843,31844,31847],{"style":2488},[116,31845],{"className":31846,"style":742},[187],[116,31848,31850],{"className":31849},[746,747,748,749],[116,31851,31853],{"className":31852},[137,749],[116,31854,2445],{"className":31855},[137,749],[116,31857,652],{"className":31858},[651],[116,31860],{"className":31861,"style":279},[144],[116,31863,31865,31868],{"className":31864},[137],[116,31866,15813],{"className":31867,"style":15812},[137,138],[116,31869,31871],{"className":31870},[725],[116,31872,31874,31903],{"className":31873},[168,169],[116,31875,31877,31900],{"className":31876},[173],[116,31878,31880],{"className":31879,"style":4068},[177],[116,31881,31882,31885],{"style":31446},[116,31883],{"className":31884,"style":742},[187],[116,31886,31888],{"className":31887},[746,747,748,749],[116,31889,31891,31894,31897],{"className":31890},[137,749],[116,31892,287],{"className":31893},[137,138,749],[116,31895,1610],{"className":31896},[574,749],[116,31898,345],{"className":31899},[137,749],[116,31901,234],{"className":31902},[233],[116,31904,31906],{"className":31905},[173],[116,31907,31909],{"className":31908,"style":10931},[177],[116,31910],{},[116,31912,562],{"className":31913},[561],[116,31915,31917,31920],{"className":31916},[137],[116,31918,16940],{"className":31919},[137,138],[116,31921,31923],{"className":31922},[725],[116,31924,31926],{"className":31925},[168],[116,31927,31929],{"className":31928},[173],[116,31930,31932],{"className":31931,"style":5751},[177],[116,31933,31934,31937],{"style":2488},[116,31935],{"className":31936,"style":742},[187],[116,31938,31940],{"className":31939},[746,747,748,749],[116,31941,31943],{"className":31942},[137,749],[116,31944,2445],{"className":31945},[137,749],[116,31947,652],{"className":31948},[651],[116,31950,594],{"className":31951},[593],[73,31953,31954,31955,31999,32000,32079],{},"renormalized to sum to one. The two models pull in opposite directions each step:\nthe sum over ",[116,31956,31958],{"className":31957},[119],[116,31959,31961],{"className":31960,"ariaHidden":124},[123],[116,31962,31964,31967],{"className":31963},[128],[116,31965],{"className":31966,"style":2412},[132],[116,31968,31970,31973],{"className":31969},[137],[116,31971,16940],{"className":31972},[137,138],[116,31974,31976],{"className":31975},[725],[116,31977,31979],{"className":31978},[168],[116,31980,31982],{"className":31981},[173],[116,31983,31985],{"className":31984,"style":2412},[177],[116,31986,31987,31990],{"style":1167},[116,31988],{"className":31989,"style":742},[187],[116,31991,31993],{"className":31992},[746,747,748,749],[116,31994,31996],{"className":31995},[137,749],[116,31997,2445],{"className":31998},[137,749]," is the predict step, diffusing the previous belief through the\ntransition model, and the leading ",[116,32001,32003],{"className":32002},[119],[116,32004,32006,32067],{"className":32005,"ariaHidden":124},[123],[116,32007,32009,32012,32015,32018,32058,32061,32064],{"className":32008},[128],[116,32010],{"className":32011,"style":552},[132],[116,32013,2794],{"className":32014,"style":924},[137,138],[116,32016,562],{"className":32017},[561],[116,32019,32021,32024],{"className":32020},[137],[116,32022,4527],{"className":32023},[137,138],[116,32025,32027],{"className":32026},[725],[116,32028,32030,32050],{"className":32029},[168,169],[116,32031,32033,32047],{"className":32032},[173],[116,32034,32036],{"className":32035,"style":861},[177],[116,32037,32038,32041],{"style":3584},[116,32039],{"className":32040,"style":742},[187],[116,32042,32044],{"className":32043},[746,747,748,749],[116,32045,287],{"className":32046},[137,138,749],[116,32048,234],{"className":32049},[233],[116,32051,32053],{"className":32052},[173],[116,32054,32056],{"className":32055,"style":762},[177],[116,32057],{},[116,32059],{"className":32060,"style":145},[144],[116,32062,4389],{"className":32063},[149],[116,32065],{"className":32066,"style":145},[144],[116,32068,32070,32073,32076],{"className":32069},[128],[116,32071],{"className":32072,"style":552},[132],[116,32074,16940],{"className":32075},[137,138],[116,32077,652],{"className":32078},[651]," is the update step, sharpening\nit against the new reading. Evidence compounds. A cell keeps its mass only while\nit stays consistent with every emission seen, so a belief that starts near-uniform\ncollapses toward a few cells, or one, as readings accumulate. Where the map repeats\na color pattern the belief can stay multimodal — split across the matching regions\n— until a distinguishing reading breaks the tie.",[2107,32081,32083],{"className":2109,"code":32082,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Forward}(e_{1:T})$ — filter the position distribution over time\ninput: readings $e_1 \\ldots e_T$, motion model $P(s \\mid s')$, sensor model $P(e \\mid s)$\nfor each cell $s$ do $\\alpha_0(s) \\gets$ prior belief\nfor $t \\gets 1$ to $T$ do\n  for each cell $s$ do\n    $\\alpha_t(s) \\gets P(e_t \\mid s) \\sum_{s'} P(s \\mid s')\\, \\alpha_{t-1}(s')$\n  normalize $\\alpha_t$ so that $\\sum_s \\alpha_t(s) = 1$\nreturn $\\alpha_1 \\ldots \\alpha_T$\n",[108,32084,32085,32090,32095,32100,32105,32110,32115,32120],{"__ignoreMap":478},[116,32086,32087],{"class":2116,"line":2117},[116,32088,32089],{},"caption: $\\textsc{Forward}(e_{1:T})$ — filter the position distribution over time\n",[116,32091,32092],{"class":2116,"line":479},[116,32093,32094],{},"input: readings $e_1 \\ldots e_T$, motion model $P(s \\mid s')$, sensor model $P(e \\mid s)$\n",[116,32096,32097],{"class":2116,"line":2128},[116,32098,32099],{},"for each cell $s$ do $\\alpha_0(s) \\gets$ prior belief\n",[116,32101,32102],{"class":2116,"line":2134},[116,32103,32104],{},"for $t \\gets 1$ to $T$ do\n",[116,32106,32107],{"class":2116,"line":2140},[116,32108,32109],{},"  for each cell $s$ do\n",[116,32111,32112],{"class":2116,"line":2146},[116,32113,32114],{},"    $\\alpha_t(s) \\gets P(e_t \\mid s) \\sum_{s'} P(s \\mid s')\\, \\alpha_{t-1}(s')$\n",[116,32116,32117],{"class":2116,"line":2152},[116,32118,32119],{},"  normalize $\\alpha_t$ so that $\\sum_s \\alpha_t(s) = 1$\n",[116,32121,32122],{"class":2116,"line":2158},[116,32123,32124],{},"return $\\alpha_1 \\ldots \\alpha_T$\n",[73,32126,32127,32128,32133,32134,32198,32199,32377,32378,32383],{},"Filtering conditions only on past readings. The\n",[76,32129,32132],{"href":32130,"rel":32131},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FForward%E2%80%93backward_algorithm",[80],"forward-backward algorithm","\nadds a backward pass ",[116,32135,32137],{"className":32136},[119],[116,32138,32140],{"className":32139,"ariaHidden":124},[123],[116,32141,32143,32146,32189,32192,32195],{"className":32142},[128],[116,32144],{"className":32145,"style":552},[132],[116,32147,32149,32154],{"className":32148},[137],[116,32150,32153],{"className":32151,"style":32152},[137,138],"margin-right:0.0528em;","β",[116,32155,32157],{"className":32156},[725],[116,32158,32160,32181],{"className":32159},[168,169],[116,32161,32163,32178],{"className":32162},[173],[116,32164,32166],{"className":32165,"style":861},[177],[116,32167,32169,32172],{"style":32168},"top:-2.55em;margin-left:-0.0528em;margin-right:0.05em;",[116,32170],{"className":32171,"style":742},[187],[116,32173,32175],{"className":32174},[746,747,748,749],[116,32176,287],{"className":32177},[137,138,749],[116,32179,234],{"className":32180},[233],[116,32182,32184],{"className":32183},[173],[116,32185,32187],{"className":32186,"style":762},[177],[116,32188],{},[116,32190,562],{"className":32191},[561],[116,32193,16940],{"className":32194},[137,138],[116,32196,652],{"className":32197},[651]," carrying the influence of future readings, then\nmultiplies the two, ",[116,32200,32202],{"className":32201},[119],[116,32203,32205,32270],{"className":32204,"ariaHidden":124},[123],[116,32206,32208,32211,32251,32254,32257,32260,32263,32267],{"className":32207},[128],[116,32209],{"className":32210,"style":552},[132],[116,32212,32214,32217],{"className":32213},[137],[116,32215,17008],{"className":32216,"style":16069},[137,138],[116,32218,32220],{"className":32219},[725],[116,32221,32223,32243],{"className":32222},[168,169],[116,32224,32226,32240],{"className":32225},[173],[116,32227,32229],{"className":32228,"style":861},[177],[116,32230,32231,32234],{"style":23677},[116,32232],{"className":32233,"style":742},[187],[116,32235,32237],{"className":32236},[746,747,748,749],[116,32238,287],{"className":32239},[137,138,749],[116,32241,234],{"className":32242},[233],[116,32244,32246],{"className":32245},[173],[116,32247,32249],{"className":32248,"style":762},[177],[116,32250],{},[116,32252,562],{"className":32253},[561],[116,32255,16940],{"className":32256},[137,138],[116,32258,652],{"className":32259},[651],[116,32261],{"className":32262,"style":145},[144],[116,32264,32266],{"className":32265},[149],"∝",[116,32268],{"className":32269,"style":145},[144],[116,32271,32273,32276,32316,32319,32322,32325,32328,32368,32371,32374],{"className":32272},[128],[116,32274],{"className":32275,"style":552},[132],[116,32277,32279,32282],{"className":32278},[137],[116,32280,15813],{"className":32281,"style":15812},[137,138],[116,32283,32285],{"className":32284},[725],[116,32286,32288,32308],{"className":32287},[168,169],[116,32289,32291,32305],{"className":32290},[173],[116,32292,32294],{"className":32293,"style":861},[177],[116,32295,32296,32299],{"style":31446},[116,32297],{"className":32298,"style":742},[187],[116,32300,32302],{"className":32301},[746,747,748,749],[116,32303,287],{"className":32304},[137,138,749],[116,32306,234],{"className":32307},[233],[116,32309,32311],{"className":32310},[173],[116,32312,32314],{"className":32313,"style":762},[177],[116,32315],{},[116,32317,562],{"className":32318},[561],[116,32320,16940],{"className":32321},[137,138],[116,32323,652],{"className":32324},[651],[116,32326],{"className":32327,"style":279},[144],[116,32329,32331,32334],{"className":32330},[137],[116,32332,32153],{"className":32333,"style":32152},[137,138],[116,32335,32337],{"className":32336},[725],[116,32338,32340,32360],{"className":32339},[168,169],[116,32341,32343,32357],{"className":32342},[173],[116,32344,32346],{"className":32345,"style":861},[177],[116,32347,32348,32351],{"style":32168},[116,32349],{"className":32350,"style":742},[187],[116,32352,32354],{"className":32353},[746,747,748,749],[116,32355,287],{"className":32356},[137,138,749],[116,32358,234],{"className":32359},[233],[116,32361,32363],{"className":32362},[173],[116,32364,32366],{"className":32365,"style":762},[177],[116,32367],{},[116,32369,562],{"className":32370},[561],[116,32372,16940],{"className":32373},[137,138],[116,32375,652],{"className":32376},[651],", to refine every\npast estimate with the full sequence. When the goal is the single most likely\ntrajectory rather than per-step marginals, the\n",[76,32379,32382],{"href":32380,"rel":32381},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FViterbi_algorithm",[80],"Viterbi algorithm"," replaces the\nsums with maxima and reads the best path off back-pointers.",[2263,32385,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":32387},[],"2021-11-02","Localization asks where a robot is, given only a stream of noisy sensor readings\nand a map. A hidden Markov model\nfits the setting: the hidden state is the robot's cell in the maze, transitions\nencode how it moves between adjacent cells, and each cell emits a sensor reading\n— a color, here — corrupted by a known error rate. From a sequence of readings\nthe model recovers a probability distribution over the robot's position, a\nbelief that spreads across the grid and then tightens as evidence arrives.",{},"\u002Fprojects\u002Fai\u002F76-markov-maze",[32393,32394],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Funcertainty\u002Freasoning-over-time","https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Funcertainty\u002Ftracking-and-data-association","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fartificial-intelligence\u002Ftree\u002Fmain\u002F06-HiddenMarkovModels",{"title":31159,"description":32389},"projects\u002Fai\u002F76-markov-maze","Localizing a robot in a grid from noisy sensor readings with a hidden Markov\nmodel — filtering, forward-backward smoothing, and Viterbi decoding.","artificial intelligence",[2279,32401,32402,32403],"MDP","Robotics","AI","LazPrmYZs1EjhlM0_r9Y043scND8n-y5i4xY7sG0680",{"id":32406,"title":32407,"body":32408,"date":33065,"description":33066,"extension":483,"featured":2354,"meta":33067,"navigation":484,"path":33068,"references":33069,"repo":33073,"seo":33074,"stem":33075,"summary":33076,"tag":32399,"tech":33077,"url":2282,"__hash__":33079},"projects\u002Fprojects\u002Fai\u002F76-logic.md","Logic Algorithms",{"type":70,"value":32409,"toc":33063},[32410,32436,32439,32632,32867,32977,32998,33058,33061],[73,32411,32412,32417,32418,32423,32424,32429,32430,32435],{},[76,32413,32416],{"href":32414,"rel":32415},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBoolean_satisfiability_problem",[80],"Boolean satisfiability","\n(SAT) asks whether a propositional formula can be made true by some assignment\nof its variables. It is\n",[76,32419,32422],{"href":32420,"rel":32421},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FNP-completeness",[80],"NP-complete",", so no known\nalgorithm decides it in polynomial time; a polynomial solution would settle\n",[76,32425,32428],{"href":32426,"rel":32427},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FP_versus_NP_problem",[80],"P versus NP",". This project\nsidesteps the worst case with local search, trading completeness for speed, and\nuses it to solve ",[76,32431,32434],{"href":32432,"rel":32433},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSudoku",[80],"Sudoku"," puzzles.",[73,32437,32438],{},"SAT solvers take conjunctive normal form,",[116,32440,32442],{"className":32441},[702],[116,32443,32445],{"className":32444},[119],[116,32446,32448,32467],{"className":32447,"ariaHidden":124},[123],[116,32449,32451,32454,32458,32461,32464],{"className":32450},[128],[116,32452],{"className":32453,"style":272},[132],[116,32455,32457],{"className":32456},[137],"Φ",[116,32459],{"className":32460,"style":145},[144],[116,32462,150],{"className":32463},[149],[116,32465],{"className":32466,"style":145},[144],[116,32468,32470,32474,32522,32528,32576,32579,32623,32629],{"className":32469},[128],[116,32471],{"className":32472,"style":32473},[132],"height:2.5638em;vertical-align:-1.4138em;",[116,32475,32477],{"className":32476},[1126,3245],[116,32478,32480,32514],{"className":32479},[168,169],[116,32481,32483,32511],{"className":32482},[173],[116,32484,32486,32500],{"className":32485,"style":3417},[177],[116,32487,32488,32491],{"style":3420},[116,32489],{"className":32490,"style":3424},[187],[116,32492,32494],{"className":32493},[746,747,748,749],[116,32495,32497],{"className":32496},[137,749],[116,32498,3158],{"className":32499},[137,138,749],[116,32501,32502,32505],{"style":3445},[116,32503],{"className":32504,"style":3424},[187],[116,32506,32507],{},[116,32508,32510],{"className":32509},[1126,1127,3454],"⋀",[116,32512,234],{"className":32513},[233],[116,32515,32517],{"className":32516},[173],[116,32518,32520],{"className":32519,"style":9130},[177],[116,32521],{},[116,32523,32525],{"className":32524},[561],[116,32526,562],{"className":32527},[1091,16264],[116,32529,32531],{"className":32530},[1126,3245],[116,32532,32534,32568],{"className":32533},[168,169],[116,32535,32537,32565],{"className":32536},[173],[116,32538,32540,32554],{"className":32539,"style":3417},[177],[116,32541,32542,32545],{"style":3420},[116,32543],{"className":32544,"style":3424},[187],[116,32546,32548],{"className":32547},[746,747,748,749],[116,32549,32551],{"className":32550},[137,749],[116,32552,3213],{"className":32553,"style":3212},[137,138,749],[116,32555,32556,32559],{"style":3445},[116,32557],{"className":32558,"style":3424},[187],[116,32560,32561],{},[116,32562,32564],{"className":32563},[1126,1127,3454],"⋁",[116,32566,234],{"className":32567},[233],[116,32569,32571],{"className":32570},[173],[116,32572,32574],{"className":32573,"style":3464},[177],[116,32575],{},[116,32577],{"className":32578,"style":279},[144],[116,32580,32582,32586],{"className":32581},[137],[116,32583,32585],{"className":32584},[137],"ℓ",[116,32587,32589],{"className":32588},[725],[116,32590,32592,32615],{"className":32591},[168,169],[116,32593,32595,32612],{"className":32594},[173],[116,32596,32598],{"className":32597,"style":3145},[177],[116,32599,32600,32603],{"style":3584},[116,32601],{"className":32602,"style":742},[187],[116,32604,32606],{"className":32605},[746,747,748,749],[116,32607,32609],{"className":32608},[137,749],[116,32610,3503],{"className":32611,"style":3212},[137,138,749],[116,32613,234],{"className":32614},[233],[116,32616,32618],{"className":32617},[173],[116,32619,32621],{"className":32620,"style":822},[177],[116,32622],{},[116,32624,32626],{"className":32625},[651],[116,32627,652],{"className":32628},[1091,16264],[116,32630,594],{"className":32631},[593],[73,32633,32634,32635,32690,32691,32758,32759,32789,32790,32805,32806,32809,32810,19950,32813,32815,32816,32819,32820,32853,32854,5452,32857,5452,32860,5452,32863,32866],{},"a conjunction of clauses, each clause a disjunction of literals ",[116,32636,32638],{"className":32637},[119],[116,32639,32641],{"className":32640,"ariaHidden":124},[123],[116,32642,32644,32647],{"className":32643},[128],[116,32645],{"className":32646,"style":29468},[132],[116,32648,32650,32653],{"className":32649},[137],[116,32651,32585],{"className":32652},[137],[116,32654,32656],{"className":32655},[725],[116,32657,32659,32682],{"className":32658},[168,169],[116,32660,32662,32679],{"className":32661},[173],[116,32663,32665],{"className":32664,"style":3145},[177],[116,32666,32667,32670],{"style":3584},[116,32668],{"className":32669,"style":742},[187],[116,32671,32673],{"className":32672},[746,747,748,749],[116,32674,32676],{"className":32675},[137,749],[116,32677,3503],{"className":32678,"style":3212},[137,138,749],[116,32680,234],{"className":32681},[233],[116,32683,32685],{"className":32684},[173],[116,32686,32688],{"className":32687,"style":822},[177],[116,32689],{},". A\nSudoku board encodes as one Boolean variable ",[116,32692,32694],{"className":32693},[119],[116,32695,32697],{"className":32696,"ariaHidden":124},[123],[116,32698,32700,32703],{"className":32699},[128],[116,32701],{"className":32702,"style":3818},[132],[116,32704,32706,32709],{"className":32705},[137],[116,32707,566],{"className":32708},[137,138],[116,32710,32712],{"className":32711},[725],[116,32713,32715,32750],{"className":32714},[168,169],[116,32716,32718,32747],{"className":32717},[173],[116,32719,32721],{"className":32720,"style":5301},[177],[116,32722,32723,32726],{"style":3584},[116,32724],{"className":32725,"style":742},[187],[116,32727,32729],{"className":32728},[746,747,748,749],[116,32730,32732,32735,32738,32741,32744],{"className":32731},[137,749],[116,32733,206],{"className":32734,"style":205},[137,138,749],[116,32736,594],{"className":32737},[593,749],[116,32739,8916],{"className":32740},[137,138,749],[116,32742,594],{"className":32743},[593,749],[116,32745,5288],{"className":32746},[137,138,749],[116,32748,234],{"className":32749},[233],[116,32751,32753],{"className":32752},[173],[116,32754,32756],{"className":32755,"style":822},[177],[116,32757],{}," per (row, column,\ndigit) triple, true when cell ",[116,32760,32762],{"className":32761},[119],[116,32763,32765],{"className":32764,"ariaHidden":124},[123],[116,32766,32768,32771,32774,32777,32780,32783,32786],{"className":32767},[128],[116,32769],{"className":32770,"style":552},[132],[116,32772,562],{"className":32773},[561],[116,32775,206],{"className":32776,"style":205},[137,138],[116,32778,594],{"className":32779},[593],[116,32781],{"className":32782,"style":279},[144],[116,32784,8916],{"className":32785},[137,138],[116,32787,652],{"className":32788},[651]," holds digit ",[116,32791,32793],{"className":32792},[119],[116,32794,32796],{"className":32795,"ariaHidden":124},[123],[116,32797,32799,32802],{"className":32798},[128],[116,32800],{"className":32801,"style":4022},[132],[116,32803,5288],{"className":32804},[137,138],"; the code names each\nvariable by the three-digit string ",[108,32807,32808],{},"rcd"," and negates with a leading ",[108,32811,32812],{},"-",[108,32814,32434],{}," class writes the rules out as clauses to a ",[108,32817,32818],{},".cnf"," file — each cell\ngets an at-least-one disjunction over its nine digits plus pairwise at-most-one\nclauses, each row, column, and ",[116,32821,32823],{"className":32822},[119],[116,32824,32826,32844],{"className":32825,"ariaHidden":124},[123],[116,32827,32829,32832,32835,32838,32841],{"className":32828},[128],[116,32830],{"className":32831,"style":1871},[132],[116,32833,2564],{"className":32834},[137],[116,32836],{"className":32837,"style":570},[144],[116,32839,439],{"className":32840},[574],[116,32842],{"className":32843,"style":570},[144],[116,32845,32847,32850],{"className":32846},[128],[116,32848],{"className":32849,"style":1890},[132],[116,32851,2564],{"className":32852},[137]," block gets a clause per digit\nforcing it to appear, and every given cell contributes a unit clause. Smaller\nstaged files (",[108,32855,32856],{},"one_cell",[108,32858,32859],{},"rows",[108,32861,32862],{},"rows_and_cols",[108,32864,32865],{},"rules",") build the encoding\nup piece by piece for testing. A completed board is a satisfying assignment.",[73,32868,11365,32869,32872,32873,2344,32878,32883,32884,106,32887,32916,32917,106,32920,32957,32958,32973,32974,32976],{},[108,32870,32871],{},"SAT"," solver is generic: it reads any CNF file, maps each variable to an\nindex with a two-way dictionary, and starts from a random full assignment,\nflipping one variable at a time.\n",[76,32874,32877],{"href":32875,"rel":32876},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGSAT",[80],"GSAT",[76,32879,32882],{"href":32880,"rel":32881},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FWalkSAT",[80],"WalkSAT"," share a noise parameter\n(",[108,32885,32886],{},"threshold",[116,32888,32890],{"className":32889},[119],[116,32891,32893,32906],{"className":32892,"ariaHidden":124},[123],[116,32894,32896,32900,32903],{"className":32895},[128],[116,32897],{"className":32898,"style":32899},[132],"height:0.3669em;",[116,32901,150],{"className":32902},[149],[116,32904],{"className":32905,"style":145},[144],[116,32907,32909,32912],{"className":32908},[128],[116,32910],{"className":32911,"style":1890},[132],[116,32913,32915],{"className":32914},[137],"0.3",") and a flip budget (",[108,32918,32919],{},"max_iterations",[116,32921,32923],{"className":32922},[119],[116,32924,32926,32938],{"className":32925,"ariaHidden":124},[123],[116,32927,32929,32932,32935],{"className":32928},[128],[116,32930],{"className":32931,"style":32899},[132],[116,32933,150],{"className":32934},[149],[116,32936],{"className":32937,"style":145},[144],[116,32939,32941,32944,32947,32953],{"className":32940},[128],[116,32942],{"className":32943,"style":899},[132],[116,32945,6772],{"className":32946},[137],[116,32948,32950],{"className":32949},[137],[116,32951,594],{"className":32952},[593],[116,32954,32956],{"className":32955},[137],"000","). On\neach step GSAT, with probability ",[116,32959,32961],{"className":32960},[119],[116,32962,32964],{"className":32963,"ariaHidden":124},[123],[116,32965,32967,32970],{"className":32966},[128],[116,32968],{"className":32969,"style":7009},[132],[116,32971,73],{"className":32972},[137,138],", flips a random variable, and otherwise\nscans ",[442,32975,5643],{}," variables and flips the one whose flip leaves the most clauses\nsatisfied — hill climbing that stalls on local optima where no single flip\nhelps.",[73,32978,32979,32981,32982,32997],{},[505,32980,32882],{}," narrows the search. It first collects the currently unsatisfied\nclauses, picks one at random and, with probability ",[116,32983,32985],{"className":32984},[119],[116,32986,32988],{"className":32987,"ariaHidden":124},[123],[116,32989,32991,32994],{"className":32990},[128],[116,32992],{"className":32993,"style":7009},[132],[116,32995,73],{"className":32996},[137,138],", flips a random\nvariable in it; otherwise it considers only that clause's variables and flips\nthe one that leaves the most clauses satisfied. Restricting the greedy scan to\na single broken clause is what makes each step cheap.",[2107,32999,33001],{"className":2109,"code":33000,"language":2111,"meta":478,"style":478},"caption: $\\textsc{WalkSAT}(\\Phi, p, n)$ — noisy local search for SAT\ninput: a CNF formula $\\Phi$, noise probability $p$, a flip budget $n$\nassign each variable a random truth value\nrepeat $n$ times\n  if the assignment satisfies every clause then return it\n  $C \\gets$ a randomly chosen unsatisfied clause\n  with probability $p$ do\n    flip a random variable in $C$\n  otherwise\n    flip the variable in $C$ that leaves the most clauses satisfied\nreturn failure\n",[108,33002,33003,33008,33013,33018,33023,33028,33033,33038,33043,33048,33053],{"__ignoreMap":478},[116,33004,33005],{"class":2116,"line":2117},[116,33006,33007],{},"caption: $\\textsc{WalkSAT}(\\Phi, p, n)$ — noisy local search for SAT\n",[116,33009,33010],{"class":2116,"line":479},[116,33011,33012],{},"input: a CNF formula $\\Phi$, noise probability $p$, a flip budget $n$\n",[116,33014,33015],{"class":2116,"line":2128},[116,33016,33017],{},"assign each variable a random truth value\n",[116,33019,33020],{"class":2116,"line":2134},[116,33021,33022],{},"repeat $n$ times\n",[116,33024,33025],{"class":2116,"line":2140},[116,33026,33027],{},"  if the assignment satisfies every clause then return it\n",[116,33029,33030],{"class":2116,"line":2146},[116,33031,33032],{},"  $C \\gets$ a randomly chosen unsatisfied clause\n",[116,33034,33035],{"class":2116,"line":2152},[116,33036,33037],{},"  with probability $p$ do\n",[116,33039,33040],{"class":2116,"line":2158},[116,33041,33042],{},"    flip a random variable in $C$\n",[116,33044,33045],{"class":2116,"line":2164},[116,33046,33047],{},"  otherwise\n",[116,33049,33050],{"class":2116,"line":25556},[116,33051,33052],{},"    flip the variable in $C$ that leaves the most clauses satisfied\n",[116,33054,33055],{"class":2116,"line":25562},[116,33056,33057],{},"return failure\n",[73,33059,33060],{},"Neither algorithm is complete: on an unsatisfiable formula they simply exhaust\nthe flip budget without reporting that no assignment exists. On satisfiable\ninstances like a valid Sudoku they find an assignment quickly, which is the\nregime this project targets.",[2263,33062,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":33064},[],"2021-10-21","Boolean satisfiability\n(SAT) asks whether a propositional formula can be made true by some assignment\nof its variables. It is\nNP-complete, so no known\nalgorithm decides it in polynomial time; a polynomial solution would settle\nP versus NP. This project\nsidesteps the worst case with local search, trading completeness for speed, and\nuses it to solve Sudoku puzzles.",{},"\u002Fprojects\u002Fai\u002F76-logic",[33070,33071,33072],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Flogic-and-planning\u002Fpropositional-logic","https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Flogic-and-planning\u002Fpropositional-inference","https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fintractability\u002Fnp-completeness","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fartificial-intelligence\u002Ftree\u002Fmain\u002F05-Logic",{"title":32407,"description":33066},"projects\u002Fai\u002F76-logic","Solving Boolean satisfiability with the GSAT and WalkSAT local-search\nalgorithms, applied to Sudoku puzzles encoded as propositional clauses.",[2279,33078,32403],"First Order Logic","Vsui7qe6tU7i-yEaimCTPyS03usJzQgVVSpU1OH0iok",{"id":33081,"title":33082,"body":33083,"date":33206,"description":33207,"extension":483,"featured":2354,"meta":33208,"navigation":484,"path":33209,"references":33210,"repo":33214,"seo":33215,"stem":33216,"summary":33217,"tag":32399,"tech":33218,"url":2282,"__hash__":33220},"projects\u002Fprojects\u002Fai\u002F76-constraint-satisfaction.md","Constraint Satisfaction",{"type":70,"value":33084,"toc":33204},[33085,33100,33103,33106,33170,33173,33193,33199,33202],[73,33086,33087,33088,33093,33094,33099],{},"A constraint satisfaction problem (CSP) is a triple: variables, a domain of\nvalues for each, and constraints that forbid certain combinations. Map coloring\nand circuit-board layout both take this form — assign a color to each region, or\na position to each component, so that no constraint is violated. This project\nsolves them with ",[76,33089,33092],{"href":33090,"rel":33091},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBacktracking",[80],"backtracking","\nsearch, sharpened by\n",[76,33095,33098],{"href":33096,"rel":33097},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FForward_checking",[80],"forward checking"," and variable-\nand value-ordering heuristics.",[246,33101],{"hash":33102},"111dba58513302069fd9c0dc53608f6232daad533a235c5cc9a54717c9f49762",[73,33104,33105],{},"Backtracking assigns variables one at a time, checks the constraints touching\neach new assignment, and on a dead end undoes the last assignment to try the next\nvalue. It walks the same tree as naive generate-and-test but prunes a branch the\nmoment it turns inconsistent, rather than only at a complete assignment.",[2107,33107,33109],{"className":2109,"code":33108,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Backtrack}(A, csp)$ — depth-first search over partial assignments\ninput: a partial assignment $A$, a CSP\nif $A$ is complete then return $A$\n$X \\gets$ unassigned variable chosen by MRV, then degree\nfor each value $v$ of $X$, ordered by LCV, do\n  if $v$ is consistent with $A$ then\n    add $X = v$ to $A$; propagate by forward checking\n    if no neighbor's domain is empty then\n      $r \\gets \\textsc{Backtrack}(A, csp)$\n      if $r \\ne \\textsf{failure}$ then return $r$\n    remove $X = v$ from $A$; restore pruned domains\nreturn failure\n",[108,33110,33111,33116,33121,33126,33131,33136,33141,33146,33151,33156,33161,33166],{"__ignoreMap":478},[116,33112,33113],{"class":2116,"line":2117},[116,33114,33115],{},"caption: $\\textsc{Backtrack}(A, csp)$ — depth-first search over partial assignments\n",[116,33117,33118],{"class":2116,"line":479},[116,33119,33120],{},"input: a partial assignment $A$, a CSP\n",[116,33122,33123],{"class":2116,"line":2128},[116,33124,33125],{},"if $A$ is complete then return $A$\n",[116,33127,33128],{"class":2116,"line":2134},[116,33129,33130],{},"$X \\gets$ unassigned variable chosen by MRV, then degree\n",[116,33132,33133],{"class":2116,"line":2140},[116,33134,33135],{},"for each value $v$ of $X$, ordered by LCV, do\n",[116,33137,33138],{"class":2116,"line":2146},[116,33139,33140],{},"  if $v$ is consistent with $A$ then\n",[116,33142,33143],{"class":2116,"line":2152},[116,33144,33145],{},"    add $X = v$ to $A$; propagate by forward checking\n",[116,33147,33148],{"class":2116,"line":2158},[116,33149,33150],{},"    if no neighbor's domain is empty then\n",[116,33152,33153],{"class":2116,"line":2164},[116,33154,33155],{},"      $r \\gets \\textsc{Backtrack}(A, csp)$\n",[116,33157,33158],{"class":2116,"line":25556},[116,33159,33160],{},"      if $r \\ne \\textsf{failure}$ then return $r$\n",[116,33162,33163],{"class":2116,"line":25562},[116,33164,33165],{},"    remove $X = v$ from $A$; restore pruned domains\n",[116,33167,33168],{"class":2116,"line":29263},[116,33169,33057],{},[73,33171,33172],{},"Three ordering heuristics decide which branch to try first:",[10278,33174,33175,33181,33187],{},[10281,33176,33177,33180],{},[505,33178,33179],{},"Minimum remaining values (MRV)"," picks the variable with the fewest legal\nvalues left, failing fast on the tightest variable.",[10281,33182,33183,33186],{},[505,33184,33185],{},"Degree"," breaks MRV ties by choosing the variable tied to the most\nconstraints with still-unassigned neighbors.",[10281,33188,33189,33192],{},[505,33190,33191],{},"Least-constraining value (LCV)"," orders the chosen variable's values by how\nfew options they remove from neighbors, keeping the rest of the search open.",[73,33194,33195,33198],{},[505,33196,33197],{},"Forward checking"," propagates each assignment into neighbors' domains,\ndeleting values it has just made illegal; when a domain empties, the current\npath is abandoned before it is extended further. This catches conflicts one step\nearlier than testing constraints only at assignment time.",[246,33200],{"hash":33201},"cc2bc83dca77c034c34145c1b9c2c87cddbec9b452e4fdd0646cba4c6b8b3973",[2263,33203,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":33205},[],"2021-10-13","A constraint satisfaction problem (CSP) is a triple: variables, a domain of\nvalues for each, and constraints that forbid certain combinations. Map coloring\nand circuit-board layout both take this form — assign a color to each region, or\na position to each component, so that no constraint is violated. This project\nsolves them with backtracking\nsearch, sharpened by\nforward checking and variable-\nand value-ordering heuristics.",{},"\u002Fprojects\u002Fai\u002F76-constraint-satisfaction",[33211,33212,33213],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Fconstraint-satisfaction","https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Fcsp-search-and-structure","https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fbacktracking\u002Fconstraint-search","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fartificial-intelligence\u002Ftree\u002Fmain\u002F04-ConstraintSatisfaction",{"title":33082,"description":33207},"projects\u002Fai\u002F76-constraint-satisfaction","Backtracking search with forward checking and the MRV, degree, and\nleast-constraining-value heuristics, applied to map coloring and circuit\nlayout.",[2279,33219,32403],"Graph Search","wrh5Eeo6lSa9n2XK3z-ma16oeRg4sgQE0QLTmVw3rOM",{"id":33222,"title":33223,"body":33224,"date":35664,"description":35665,"extension":483,"featured":2354,"meta":35666,"navigation":484,"path":35667,"references":35668,"repo":35671,"seo":35672,"stem":35673,"summary":35674,"tag":32399,"tech":35675,"url":2282,"__hash__":35676},"projects\u002Fprojects\u002Fai\u002F76-informed-search.md","Informed Search",{"type":70,"value":33225,"toc":35662},[33226,33240,33259,33344,33475,33478,33486,33745,34065,34068,34365,34586,34923,35085,35534,35604,35657,35660],[73,33227,33228,33229,33234,33235,1852],{},"Informed search uses a heuristic estimate of the cost remaining to the goal to\ndecide which state to expand next, reaching the goal after touching far fewer\nstates than blind search. This project drives a robot across a grid maze of\nobstacles to a target cell, comparing\n",[76,33230,33233],{"href":33231,"rel":33232},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FA*_search_algorithm",[80],"A* search"," against\n",[76,33236,33239],{"href":33237,"rel":33238},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGreedy_algorithm",[80],"greedy best-first search",[73,33241,33242,33243,33258],{},"Each frontier state ",[116,33244,33246],{"className":33245},[119],[116,33247,33249],{"className":33248,"ariaHidden":124},[123],[116,33250,33252,33255],{"className":33251},[128],[116,33253],{"className":33254,"style":133},[132],[116,33256,9120],{"className":33257},[137,138]," is scored by",[116,33260,33262],{"className":33261},[702],[116,33263,33265],{"className":33264},[119],[116,33266,33268,33296,33323],{"className":33267,"ariaHidden":124},[123],[116,33269,33271,33274,33278,33281,33284,33287,33290,33293],{"className":33270},[128],[116,33272],{"className":33273,"style":552},[132],[116,33275,26047],{"className":33276,"style":33277},[137,138],"margin-right:0.1076em;",[116,33279,562],{"className":33280},[561],[116,33282,9120],{"className":33283},[137,138],[116,33285,652],{"className":33286},[651],[116,33288],{"className":33289,"style":145},[144],[116,33291,150],{"className":33292},[149],[116,33294],{"className":33295,"style":145},[144],[116,33297,33299,33302,33305,33308,33311,33314,33317,33320],{"className":33298},[128],[116,33300],{"className":33301,"style":552},[132],[116,33303,28930],{"className":33304,"style":139},[137,138],[116,33306,562],{"className":33307},[561],[116,33309,9120],{"className":33310},[137,138],[116,33312,652],{"className":33313},[651],[116,33315],{"className":33316,"style":570},[144],[116,33318,575],{"className":33319},[574],[116,33321],{"className":33322,"style":570},[144],[116,33324,33326,33329,33332,33335,33338,33341],{"className":33325},[128],[116,33327],{"className":33328,"style":552},[132],[116,33330,4027],{"className":33331},[137,138],[116,33333,562],{"className":33334},[561],[116,33336,9120],{"className":33337},[137,138],[116,33339,652],{"className":33340},[651],[116,33342,594],{"className":33343},[593],[73,33345,2532,33346,33370,33371,12861,33386,33410,33411,33426,33427,33442,33443,33458,33459,33474],{},[116,33347,33349],{"className":33348},[119],[116,33350,33352],{"className":33351,"ariaHidden":124},[123],[116,33353,33355,33358,33361,33364,33367],{"className":33354},[128],[116,33356],{"className":33357,"style":552},[132],[116,33359,28930],{"className":33360,"style":139},[137,138],[116,33362,562],{"className":33363},[561],[116,33365,9120],{"className":33366},[137,138],[116,33368,652],{"className":33369},[651]," is the cost already paid to reach ",[116,33372,33374],{"className":33373},[119],[116,33375,33377],{"className":33376,"ariaHidden":124},[123],[116,33378,33380,33383],{"className":33379},[128],[116,33381],{"className":33382,"style":133},[132],[116,33384,9120],{"className":33385},[137,138],[116,33387,33389],{"className":33388},[119],[116,33390,33392],{"className":33391,"ariaHidden":124},[123],[116,33393,33395,33398,33401,33404,33407],{"className":33394},[128],[116,33396],{"className":33397,"style":552},[132],[116,33399,4027],{"className":33400},[137,138],[116,33402,562],{"className":33403},[561],[116,33405,9120],{"className":33406},[137,138],[116,33408,652],{"className":33409},[651]," estimates the cost\nfrom ",[116,33412,33414],{"className":33413},[119],[116,33415,33417],{"className":33416,"ariaHidden":124},[123],[116,33418,33420,33423],{"className":33419},[128],[116,33421],{"className":33422,"style":133},[132],[116,33424,9120],{"className":33425},[137,138]," to the goal. A-star always expands the state of lowest ",[116,33428,33430],{"className":33429},[119],[116,33431,33433],{"className":33432,"ariaHidden":124},[123],[116,33434,33436,33439],{"className":33435},[128],[116,33437],{"className":33438,"style":4241},[132],[116,33440,26047],{"className":33441,"style":33277},[137,138],". Greedy search\ndrops the ",[116,33444,33446],{"className":33445},[119],[116,33447,33449],{"className":33448,"ariaHidden":124},[123],[116,33450,33452,33455],{"className":33451},[128],[116,33453],{"className":33454,"style":7009},[132],[116,33456,28930],{"className":33457,"style":139},[137,138]," term and expands by ",[116,33460,33462],{"className":33461},[119],[116,33463,33465],{"className":33464,"ariaHidden":124},[123],[116,33466,33468,33471],{"className":33467},[128],[116,33469],{"className":33470,"style":4022},[132],[116,33472,4027],{"className":33473},[137,138]," alone — quicker to commit, but with no\naccount of the path so far it can settle for an expensive route.",[246,33476],{"hash":33477},"f3d9e25ebc2c52f3b9647891c80877465dcbea02a84ed723f53b032374e468ec",[73,33479,33480,33481],{},"On a grid the estimate is a distance to the goal cell. For four-connected\nmovement,\n",[76,33482,33485],{"href":33483,"rel":33484},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTaxicab_geometry",[80],"Manhattan distance",[116,33487,33489],{"className":33488},[702],[116,33490,33492],{"className":33491},[119],[116,33493,33495,33522,33580,33638,33696],{"className":33494,"ariaHidden":124},[123],[116,33496,33498,33501,33504,33507,33510,33513,33516,33519],{"className":33497},[128],[116,33499],{"className":33500,"style":552},[132],[116,33502,4027],{"className":33503},[137,138],[116,33505,562],{"className":33506},[561],[116,33508,9120],{"className":33509},[137,138],[116,33511,652],{"className":33512},[651],[116,33514],{"className":33515,"style":145},[144],[116,33517,150],{"className":33518},[149],[116,33520],{"className":33521,"style":145},[144],[116,33523,33525,33528,33531,33571,33574,33577],{"className":33524},[128],[116,33526],{"className":33527,"style":552},[132],[116,33529,4389],{"className":33530},[137],[116,33532,33534,33537],{"className":33533},[137],[116,33535,566],{"className":33536},[137,138],[116,33538,33540],{"className":33539},[725],[116,33541,33543,33563],{"className":33542},[168,169],[116,33544,33546,33560],{"className":33545},[173],[116,33547,33549],{"className":33548,"style":735},[177],[116,33550,33551,33554],{"style":3584},[116,33552],{"className":33553,"style":742},[187],[116,33555,33557],{"className":33556},[746,747,748,749],[116,33558,9120],{"className":33559},[137,138,749],[116,33561,234],{"className":33562},[233],[116,33564,33566],{"className":33565},[173],[116,33567,33569],{"className":33568,"style":762},[177],[116,33570],{},[116,33572],{"className":33573,"style":570},[144],[116,33575,1610],{"className":33576},[574],[116,33578],{"className":33579,"style":570},[144],[116,33581,33583,33586,33626,33629,33632,33635],{"className":33582},[128],[116,33584],{"className":33585,"style":11131},[132],[116,33587,33589,33592],{"className":33588},[137],[116,33590,566],{"className":33591},[137,138],[116,33593,33595],{"className":33594},[725],[116,33596,33598,33618],{"className":33597},[168,169],[116,33599,33601,33615],{"className":33600},[173],[116,33602,33604],{"className":33603,"style":735},[177],[116,33605,33606,33609],{"style":3584},[116,33607],{"className":33608,"style":742},[187],[116,33610,33612],{"className":33611},[746,747,748,749],[116,33613,28930],{"className":33614,"style":139},[137,138,749],[116,33616,234],{"className":33617},[233],[116,33619,33621],{"className":33620},[173],[116,33622,33624],{"className":33623,"style":822},[177],[116,33625],{},[116,33627,4389],{"className":33628},[137],[116,33630],{"className":33631,"style":570},[144],[116,33633,575],{"className":33634},[574],[116,33636],{"className":33637,"style":570},[144],[116,33639,33641,33644,33647,33687,33690,33693],{"className":33640},[128],[116,33642],{"className":33643,"style":552},[132],[116,33645,4389],{"className":33646},[137],[116,33648,33650,33653],{"className":33649},[137],[116,33651,601],{"className":33652,"style":139},[137,138],[116,33654,33656],{"className":33655},[725],[116,33657,33659,33679],{"className":33658},[168,169],[116,33660,33662,33676],{"className":33661},[173],[116,33663,33665],{"className":33664,"style":735},[177],[116,33666,33667,33670],{"style":3490},[116,33668],{"className":33669,"style":742},[187],[116,33671,33673],{"className":33672},[746,747,748,749],[116,33674,9120],{"className":33675},[137,138,749],[116,33677,234],{"className":33678},[233],[116,33680,33682],{"className":33681},[173],[116,33683,33685],{"className":33684,"style":762},[177],[116,33686],{},[116,33688],{"className":33689,"style":570},[144],[116,33691,1610],{"className":33692},[574],[116,33694],{"className":33695,"style":570},[144],[116,33697,33699,33702,33742],{"className":33698},[128],[116,33700],{"className":33701,"style":11131},[132],[116,33703,33705,33708],{"className":33704},[137],[116,33706,601],{"className":33707,"style":139},[137,138],[116,33709,33711],{"className":33710},[725],[116,33712,33714,33734],{"className":33713},[168,169],[116,33715,33717,33731],{"className":33716},[173],[116,33718,33720],{"className":33719,"style":735},[177],[116,33721,33722,33725],{"style":3490},[116,33723],{"className":33724,"style":742},[187],[116,33726,33728],{"className":33727},[746,747,748,749],[116,33729,28930],{"className":33730,"style":139},[137,138,749],[116,33732,234],{"className":33733},[233],[116,33735,33737],{"className":33736},[173],[116,33738,33740],{"className":33739,"style":822},[177],[116,33741],{},[116,33743,4389],{"className":33744},[137],[73,33746,33747,33748,33753,34064],{},"counts axis-aligned steps; when diagonal moves are allowed,\n",[76,33749,33752],{"href":33750,"rel":33751},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEuclidean_distance",[80],"Euclidean distance",[116,33754,33756],{"className":33755},[119],[116,33757,33759],{"className":33758,"ariaHidden":124},[123],[116,33760,33762,33766],{"className":33761},[128],[116,33763],{"className":33764,"style":33765},[132],"height:1.24em;vertical-align:-0.3231em;",[116,33767,33769],{"className":33768},[137,164],[116,33770,33772,34055],{"className":33771},[168,169],[116,33773,33775,34052],{"className":33774},[173],[116,33776,33779,34039],{"className":33777,"style":33778},[177],"height:0.9169em;",[116,33780,33782,33785],{"className":33781,"style":183},[182],[116,33783],{"className":33784,"style":188},[187],[116,33786,33788,33791,33831,33834,33837,33840,33880,33909,33912,33915,33918,33921,33961,33964,33967,33970,34010],{"className":33787,"style":192},[137],[116,33789,562],{"className":33790},[561],[116,33792,33794,33797],{"className":33793},[137],[116,33795,566],{"className":33796},[137,138],[116,33798,33800],{"className":33799},[725],[116,33801,33803,33823],{"className":33802},[168,169],[116,33804,33806,33820],{"className":33805},[173],[116,33807,33809],{"className":33808,"style":735},[177],[116,33810,33811,33814],{"style":3584},[116,33812],{"className":33813,"style":742},[187],[116,33815,33817],{"className":33816},[746,747,748,749],[116,33818,9120],{"className":33819},[137,138,749],[116,33821,234],{"className":33822},[233],[116,33824,33826],{"className":33825},[173],[116,33827,33829],{"className":33828,"style":762},[177],[116,33830],{},[116,33832],{"className":33833,"style":570},[144],[116,33835,1610],{"className":33836},[574],[116,33838],{"className":33839,"style":570},[144],[116,33841,33843,33846],{"className":33842},[137],[116,33844,566],{"className":33845},[137,138],[116,33847,33849],{"className":33848},[725],[116,33850,33852,33872],{"className":33851},[168,169],[116,33853,33855,33869],{"className":33854},[173],[116,33856,33858],{"className":33857,"style":735},[177],[116,33859,33860,33863],{"style":3584},[116,33861],{"className":33862,"style":742},[187],[116,33864,33866],{"className":33865},[746,747,748,749],[116,33867,28930],{"className":33868,"style":139},[137,138,749],[116,33870,234],{"className":33871},[233],[116,33873,33875],{"className":33874},[173],[116,33876,33878],{"className":33877,"style":822},[177],[116,33879],{},[116,33881,33883,33886],{"className":33882},[651],[116,33884,652],{"className":33885},[651],[116,33887,33889],{"className":33888},[725],[116,33890,33892],{"className":33891},[168],[116,33893,33895],{"className":33894},[173],[116,33896,33898],{"className":33897,"style":25146},[177],[116,33899,33900,33903],{"style":7391},[116,33901],{"className":33902,"style":742},[187],[116,33904,33906],{"className":33905},[746,747,748,749],[116,33907,359],{"className":33908},[137,749],[116,33910],{"className":33911,"style":570},[144],[116,33913,575],{"className":33914},[574],[116,33916],{"className":33917,"style":570},[144],[116,33919,562],{"className":33920},[561],[116,33922,33924,33927],{"className":33923},[137],[116,33925,601],{"className":33926,"style":139},[137,138],[116,33928,33930],{"className":33929},[725],[116,33931,33933,33953],{"className":33932},[168,169],[116,33934,33936,33950],{"className":33935},[173],[116,33937,33939],{"className":33938,"style":735},[177],[116,33940,33941,33944],{"style":3490},[116,33942],{"className":33943,"style":742},[187],[116,33945,33947],{"className":33946},[746,747,748,749],[116,33948,9120],{"className":33949},[137,138,749],[116,33951,234],{"className":33952},[233],[116,33954,33956],{"className":33955},[173],[116,33957,33959],{"className":33958,"style":762},[177],[116,33960],{},[116,33962],{"className":33963,"style":570},[144],[116,33965,1610],{"className":33966},[574],[116,33968],{"className":33969,"style":570},[144],[116,33971,33973,33976],{"className":33972},[137],[116,33974,601],{"className":33975,"style":139},[137,138],[116,33977,33979],{"className":33978},[725],[116,33980,33982,34002],{"className":33981},[168,169],[116,33983,33985,33999],{"className":33984},[173],[116,33986,33988],{"className":33987,"style":735},[177],[116,33989,33990,33993],{"style":3490},[116,33991],{"className":33992,"style":742},[187],[116,33994,33996],{"className":33995},[746,747,748,749],[116,33997,28930],{"className":33998,"style":139},[137,138,749],[116,34000,234],{"className":34001},[233],[116,34003,34005],{"className":34004},[173],[116,34006,34008],{"className":34007,"style":822},[177],[116,34009],{},[116,34011,34013,34016],{"className":34012},[651],[116,34014,652],{"className":34015},[651],[116,34017,34019],{"className":34018},[725],[116,34020,34022],{"className":34021},[168],[116,34023,34025],{"className":34024},[173],[116,34026,34028],{"className":34027,"style":25146},[177],[116,34029,34030,34033],{"style":7391},[116,34031],{"className":34032,"style":742},[187],[116,34034,34036],{"className":34035},[746,747,748,749],[116,34037,359],{"className":34038},[137,749],[116,34040,34042,34045],{"style":34041},"top:-2.8769em;",[116,34043],{"className":34044,"style":188},[187],[116,34046,34048],{"className":34047,"style":217},[216],[219,34049,34050],{"xmlns":221,"width":222,"height":223,"viewBox":224,"preserveAspectRatio":225},[227,34051],{"d":229},[116,34053,234],{"className":34054},[233],[116,34056,34058],{"className":34057},[173],[116,34059,34062],{"className":34060,"style":34061},[177],"height:0.3231em;",[116,34063],{}," fits the true geometry. Both are\nadmissible — never overestimating the real remaining cost — which is exactly the\ncondition under which A-star returns an optimal path.",[73,34066,34067],{},"Two properties of a heuristic control what A* guarantees:",[10278,34069,34070,34205],{},[10281,34071,34072,106,34075,34153,34154,34204],{},[505,34073,34074],{},"Admissible.",[116,34076,34078],{"className":34077},[119],[116,34079,34081,34108],{"className":34080,"ariaHidden":124},[123],[116,34082,34084,34087,34090,34093,34096,34099,34102,34105],{"className":34083},[128],[116,34085],{"className":34086,"style":552},[132],[116,34088,4027],{"className":34089},[137,138],[116,34091,562],{"className":34092},[561],[116,34094,9120],{"className":34095},[137,138],[116,34097,652],{"className":34098},[651],[116,34100],{"className":34101,"style":145},[144],[116,34103,14886],{"className":34104},[149],[116,34106],{"className":34107,"style":145},[144],[116,34109,34111,34114,34144,34147,34150],{"className":34110},[128],[116,34112],{"className":34113,"style":552},[132],[116,34115,34117,34120],{"className":34116},[137],[116,34118,4027],{"className":34119},[137,138],[116,34121,34123],{"className":34122},[725],[116,34124,34126],{"className":34125},[168],[116,34127,34129],{"className":34128},[173],[116,34130,34133],{"className":34131,"style":34132},[177],"height:0.6887em;",[116,34134,34135,34138],{"style":1167},[116,34136],{"className":34137,"style":742},[187],[116,34139,34141],{"className":34140},[746,747,748,749],[116,34142,4806],{"className":34143},[574,749],[116,34145,562],{"className":34146},[561],[116,34148,9120],{"className":34149},[137,138],[116,34151,652],{"className":34152},[651]," at every node, where ",[116,34155,34157],{"className":34156},[119],[116,34158,34160],{"className":34159,"ariaHidden":124},[123],[116,34161,34163,34166,34195,34198,34201],{"className":34162},[128],[116,34164],{"className":34165,"style":552},[132],[116,34167,34169,34172],{"className":34168},[137],[116,34170,4027],{"className":34171},[137,138],[116,34173,34175],{"className":34174},[725],[116,34176,34178],{"className":34177},[168],[116,34179,34181],{"className":34180},[173],[116,34182,34184],{"className":34183,"style":34132},[177],[116,34185,34186,34189],{"style":1167},[116,34187],{"className":34188,"style":742},[187],[116,34190,34192],{"className":34191},[746,747,748,749],[116,34193,4806],{"className":34194},[574,749],[116,34196,562],{"className":34197},[561],[116,34199,9120],{"className":34200},[137,138],[116,34202,652],{"className":34203},[651]," is the\ntrue remaining cost. The estimate never overshoots.",[10281,34206,34207,106,34210,34301,34302,34332,34333,34348,34349,34364],{},[505,34208,34209],{},"Consistent.",[116,34211,34213],{"className":34212},[119],[116,34214,34216,34243,34283],{"className":34215,"ariaHidden":124},[123],[116,34217,34219,34222,34225,34228,34231,34234,34237,34240],{"className":34218},[128],[116,34220],{"className":34221,"style":552},[132],[116,34223,4027],{"className":34224},[137,138],[116,34226,562],{"className":34227},[561],[116,34229,9120],{"className":34230},[137,138],[116,34232,652],{"className":34233},[651],[116,34235],{"className":34236,"style":145},[144],[116,34238,14886],{"className":34239},[149],[116,34241],{"className":34242,"style":145},[144],[116,34244,34246,34249,34256,34259,34262,34265,34268,34271,34274,34277,34280],{"className":34245},[128],[116,34247],{"className":34248,"style":552},[132],[116,34250,34252],{"className":34251},[1126],[116,34253,34255],{"className":34254},[137,3388],"cost",[116,34257,562],{"className":34258},[561],[116,34260,9120],{"className":34261},[137,138],[116,34263,594],{"className":34264},[593],[116,34266],{"className":34267,"style":279},[144],[116,34269,10717],{"className":34270},[137,138],[116,34272,652],{"className":34273},[651],[116,34275],{"className":34276,"style":570},[144],[116,34278,575],{"className":34279},[574],[116,34281],{"className":34282,"style":570},[144],[116,34284,34286,34289,34292,34295,34298],{"className":34285},[128],[116,34287],{"className":34288,"style":552},[132],[116,34290,4027],{"className":34291},[137,138],[116,34293,562],{"className":34294},[561],[116,34296,10717],{"className":34297},[137,138],[116,34299,652],{"className":34300},[651]," across every edge\n",[116,34303,34305],{"className":34304},[119],[116,34306,34308],{"className":34307,"ariaHidden":124},[123],[116,34309,34311,34314,34317,34320,34323,34326,34329],{"className":34310},[128],[116,34312],{"className":34313,"style":552},[132],[116,34315,562],{"className":34316},[561],[116,34318,9120],{"className":34319},[137,138],[116,34321,594],{"className":34322},[593],[116,34324],{"className":34325,"style":279},[144],[116,34327,10717],{"className":34328},[137,138],[116,34330,652],{"className":34331},[651]," — a triangle inequality on the estimate. Consistency implies\nadmissibility, and it makes ",[116,34334,34336],{"className":34335},[119],[116,34337,34339],{"className":34338,"ariaHidden":124},[123],[116,34340,34342,34345],{"className":34341},[128],[116,34343],{"className":34344,"style":4241},[132],[116,34346,26047],{"className":34347,"style":33277},[137,138]," nondecreasing along any path, so A* settles each\nnode's optimal ",[116,34350,34352],{"className":34351},[119],[116,34353,34355],{"className":34354,"ariaHidden":124},[123],[116,34356,34358,34361],{"className":34357},[128],[116,34359],{"className":34360,"style":7009},[132],[116,34362,28930],{"className":34363,"style":139},[137,138]," the first time it expands it and never reopens one.",[73,34366,34367,34368,34409,34410,13647,34463,34569,34570,34585],{},"Admissibility is enough for optimality, and the argument is short. Let ",[116,34369,34371],{"className":34370},[119],[116,34372,34374],{"className":34373,"ariaHidden":124},[123],[116,34375,34377,34380],{"className":34376},[128],[116,34378],{"className":34379,"style":34132},[132],[116,34381,34383,34386],{"className":34382},[137],[116,34384,24660],{"className":34385,"style":2666},[137,138],[116,34387,34389],{"className":34388},[725],[116,34390,34392],{"className":34391},[168],[116,34393,34395],{"className":34394},[173],[116,34396,34398],{"className":34397,"style":34132},[177],[116,34399,34400,34403],{"style":1167},[116,34401],{"className":34402,"style":742},[187],[116,34404,34406],{"className":34405},[746,747,748,749],[116,34407,4806],{"className":34408},[574,749]," be\nthe optimal cost and suppose a suboptimal goal ",[116,34411,34413],{"className":34412},[119],[116,34414,34416],{"className":34415,"ariaHidden":124},[123],[116,34417,34419,34422],{"className":34418},[128],[116,34420],{"className":34421,"style":715},[132],[116,34423,34425,34429],{"className":34424},[137],[116,34426,34428],{"className":34427},[137,138],"G",[116,34430,34432],{"className":34431},[725],[116,34433,34435,34455],{"className":34434},[168,169],[116,34436,34438,34452],{"className":34437},[173],[116,34439,34441],{"className":34440,"style":4068},[177],[116,34442,34443,34446],{"style":3584},[116,34444],{"className":34445,"style":742},[187],[116,34447,34449],{"className":34448},[746,747,748,749],[116,34450,359],{"className":34451},[137,749],[116,34453,234],{"className":34454},[233],[116,34456,34458],{"className":34457},[173],[116,34459,34461],{"className":34460,"style":762},[177],[116,34462],{},[116,34464,34466],{"className":34465},[119],[116,34467,34469,34534],{"className":34468,"ariaHidden":124},[123],[116,34470,34472,34475,34478,34481,34521,34524,34527,34531],{"className":34471},[128],[116,34473],{"className":34474,"style":552},[132],[116,34476,28930],{"className":34477,"style":139},[137,138],[116,34479,562],{"className":34480},[561],[116,34482,34484,34487],{"className":34483},[137],[116,34485,34428],{"className":34486},[137,138],[116,34488,34490],{"className":34489},[725],[116,34491,34493,34513],{"className":34492},[168,169],[116,34494,34496,34510],{"className":34495},[173],[116,34497,34499],{"className":34498,"style":4068},[177],[116,34500,34501,34504],{"style":3584},[116,34502],{"className":34503,"style":742},[187],[116,34505,34507],{"className":34506},[746,747,748,749],[116,34508,359],{"className":34509},[137,749],[116,34511,234],{"className":34512},[233],[116,34514,34516],{"className":34515},[173],[116,34517,34519],{"className":34518,"style":762},[177],[116,34520],{},[116,34522,652],{"className":34523},[651],[116,34525],{"className":34526,"style":145},[144],[116,34528,34530],{"className":34529},[149],">",[116,34532],{"className":34533,"style":145},[144],[116,34535,34537,34540],{"className":34536},[128],[116,34538],{"className":34539,"style":34132},[132],[116,34541,34543,34546],{"className":34542},[137],[116,34544,24660],{"className":34545,"style":2666},[137,138],[116,34547,34549],{"className":34548},[725],[116,34550,34552],{"className":34551},[168],[116,34553,34555],{"className":34554},[173],[116,34556,34558],{"className":34557,"style":34132},[177],[116,34559,34560,34563],{"style":1167},[116,34561],{"className":34562,"style":742},[187],[116,34564,34566],{"className":34565},[746,747,748,749],[116,34567,4806],{"className":34568},[574,749]," sits on\nthe frontier. Some node ",[116,34571,34573],{"className":34572},[119],[116,34574,34576],{"className":34575,"ariaHidden":124},[123],[116,34577,34579,34582],{"className":34578},[128],[116,34580],{"className":34581,"style":133},[132],[116,34583,9120],{"className":34584},[137,138]," on an optimal path is on the frontier too, and there",[116,34587,34589],{"className":34588},[702],[116,34590,34592],{"className":34591},[119],[116,34593,34595,34622,34649,34676,34703,34756,34801,34865],{"className":34594,"ariaHidden":124},[123],[116,34596,34598,34601,34604,34607,34610,34613,34616,34619],{"className":34597},[128],[116,34599],{"className":34600,"style":552},[132],[116,34602,26047],{"className":34603,"style":33277},[137,138],[116,34605,562],{"className":34606},[561],[116,34608,9120],{"className":34609},[137,138],[116,34611,652],{"className":34612},[651],[116,34614],{"className":34615,"style":145},[144],[116,34617,150],{"className":34618},[149],[116,34620],{"className":34621,"style":145},[144],[116,34623,34625,34628,34631,34634,34637,34640,34643,34646],{"className":34624},[128],[116,34626],{"className":34627,"style":552},[132],[116,34629,28930],{"className":34630,"style":139},[137,138],[116,34632,562],{"className":34633},[561],[116,34635,9120],{"className":34636},[137,138],[116,34638,652],{"className":34639},[651],[116,34641],{"className":34642,"style":570},[144],[116,34644,575],{"className":34645},[574],[116,34647],{"className":34648,"style":570},[144],[116,34650,34652,34655,34658,34661,34664,34667,34670,34673],{"className":34651},[128],[116,34653],{"className":34654,"style":552},[132],[116,34656,4027],{"className":34657},[137,138],[116,34659,562],{"className":34660},[561],[116,34662,9120],{"className":34663},[137,138],[116,34665,652],{"className":34666},[651],[116,34668],{"className":34669,"style":145},[144],[116,34671,14886],{"className":34672},[149],[116,34674],{"className":34675,"style":145},[144],[116,34677,34679,34682,34685,34688,34691,34694,34697,34700],{"className":34678},[128],[116,34680],{"className":34681,"style":552},[132],[116,34683,28930],{"className":34684,"style":139},[137,138],[116,34686,562],{"className":34687},[561],[116,34689,9120],{"className":34690},[137,138],[116,34692,652],{"className":34693},[651],[116,34695],{"className":34696,"style":570},[144],[116,34698,575],{"className":34699},[574],[116,34701],{"className":34702,"style":570},[144],[116,34704,34706,34709,34738,34741,34744,34747,34750,34753],{"className":34705},[128],[116,34707],{"className":34708,"style":552},[132],[116,34710,34712,34715],{"className":34711},[137],[116,34713,4027],{"className":34714},[137,138],[116,34716,34718],{"className":34717},[725],[116,34719,34721],{"className":34720},[168],[116,34722,34724],{"className":34723},[173],[116,34725,34727],{"className":34726,"style":4791},[177],[116,34728,34729,34732],{"style":2488},[116,34730],{"className":34731,"style":742},[187],[116,34733,34735],{"className":34734},[746,747,748,749],[116,34736,4806],{"className":34737},[574,749],[116,34739,562],{"className":34740},[561],[116,34742,9120],{"className":34743},[137,138],[116,34745,652],{"className":34746},[651],[116,34748],{"className":34749,"style":145},[144],[116,34751,150],{"className":34752},[149],[116,34754],{"className":34755,"style":145},[144],[116,34757,34759,34763,34792,34795,34798],{"className":34758},[128],[116,34760],{"className":34761,"style":34762},[132],"height:0.7778em;vertical-align:-0.0391em;",[116,34764,34766,34769],{"className":34765},[137],[116,34767,24660],{"className":34768,"style":2666},[137,138],[116,34770,34772],{"className":34771},[725],[116,34773,34775],{"className":34774},[168],[116,34776,34778],{"className":34777},[173],[116,34779,34781],{"className":34780,"style":4791},[177],[116,34782,34783,34786],{"style":2488},[116,34784],{"className":34785,"style":742},[187],[116,34787,34789],{"className":34788},[746,747,748,749],[116,34790,4806],{"className":34791},[574,749],[116,34793],{"className":34794,"style":145},[144],[116,34796,24389],{"className":34797},[149],[116,34799],{"className":34800,"style":145},[144],[116,34802,34804,34807,34810,34813,34853,34856,34859,34862],{"className":34803},[128],[116,34805],{"className":34806,"style":552},[132],[116,34808,28930],{"className":34809,"style":139},[137,138],[116,34811,562],{"className":34812},[561],[116,34814,34816,34819],{"className":34815},[137],[116,34817,34428],{"className":34818},[137,138],[116,34820,34822],{"className":34821},[725],[116,34823,34825,34845],{"className":34824},[168,169],[116,34826,34828,34842],{"className":34827},[173],[116,34829,34831],{"className":34830,"style":4068},[177],[116,34832,34833,34836],{"style":3584},[116,34834],{"className":34835,"style":742},[187],[116,34837,34839],{"className":34838},[746,747,748,749],[116,34840,359],{"className":34841},[137,749],[116,34843,234],{"className":34844},[233],[116,34846,34848],{"className":34847},[173],[116,34849,34851],{"className":34850,"style":762},[177],[116,34852],{},[116,34854,652],{"className":34855},[651],[116,34857],{"className":34858,"style":145},[144],[116,34860,150],{"className":34861},[149],[116,34863],{"className":34864,"style":145},[144],[116,34866,34868,34871,34874,34877,34917,34920],{"className":34867},[128],[116,34869],{"className":34870,"style":552},[132],[116,34872,26047],{"className":34873,"style":33277},[137,138],[116,34875,562],{"className":34876},[561],[116,34878,34880,34883],{"className":34879},[137],[116,34881,34428],{"className":34882},[137,138],[116,34884,34886],{"className":34885},[725],[116,34887,34889,34909],{"className":34888},[168,169],[116,34890,34892,34906],{"className":34891},[173],[116,34893,34895],{"className":34894,"style":4068},[177],[116,34896,34897,34900],{"style":3584},[116,34898],{"className":34899,"style":742},[187],[116,34901,34903],{"className":34902},[746,747,748,749],[116,34904,359],{"className":34905},[137,749],[116,34907,234],{"className":34908},[233],[116,34910,34912],{"className":34911},[173],[116,34913,34915],{"className":34914,"style":762},[177],[116,34916],{},[116,34918,652],{"className":34919},[651],[116,34921,1852],{"className":34922},[137],[73,34924,34925,34926,34941,34942,34957,34958,35010,35011,35026,35027,35068,35069,35084],{},"A* expands the smaller ",[116,34927,34929],{"className":34928},[119],[116,34930,34932],{"className":34931,"ariaHidden":124},[123],[116,34933,34935,34938],{"className":34934},[128],[116,34936],{"className":34937,"style":4241},[132],[116,34939,26047],{"className":34940,"style":33277},[137,138]," first, so it reaches ",[116,34943,34945],{"className":34944},[119],[116,34946,34948],{"className":34947,"ariaHidden":124},[123],[116,34949,34951,34954],{"className":34950},[128],[116,34952],{"className":34953,"style":133},[132],[116,34955,9120],{"className":34956},[137,138]," — and eventually the true goal\n— before it would ever remove ",[116,34959,34961],{"className":34960},[119],[116,34962,34964],{"className":34963,"ariaHidden":124},[123],[116,34965,34967,34970],{"className":34966},[128],[116,34968],{"className":34969,"style":715},[132],[116,34971,34973,34976],{"className":34972},[137],[116,34974,34428],{"className":34975},[137,138],[116,34977,34979],{"className":34978},[725],[116,34980,34982,35002],{"className":34981},[168,169],[116,34983,34985,34999],{"className":34984},[173],[116,34986,34988],{"className":34987,"style":4068},[177],[116,34989,34990,34993],{"style":3584},[116,34991],{"className":34992,"style":742},[187],[116,34994,34996],{"className":34995},[746,747,748,749],[116,34997,359],{"className":34998},[137,749],[116,35000,234],{"className":35001},[233],[116,35003,35005],{"className":35004},[173],[116,35006,35008],{"className":35007,"style":762},[177],[116,35009],{},". Overestimating breaks this: an ",[116,35012,35014],{"className":35013},[119],[116,35015,35017],{"className":35016,"ariaHidden":124},[123],[116,35018,35020,35023],{"className":35019},[128],[116,35021],{"className":35022,"style":4022},[132],[116,35024,4027],{"className":35025},[137,138]," larger than\n",[116,35028,35030],{"className":35029},[119],[116,35031,35033],{"className":35032,"ariaHidden":124},[123],[116,35034,35036,35039],{"className":35035},[128],[116,35037],{"className":35038,"style":4022},[132],[116,35040,35042,35045],{"className":35041},[137],[116,35043,4027],{"className":35044},[137,138],[116,35046,35048],{"className":35047},[725],[116,35049,35051],{"className":35050},[168],[116,35052,35054],{"className":35053},[173],[116,35055,35057],{"className":35056,"style":34132},[177],[116,35058,35059,35062],{"style":1167},[116,35060],{"className":35061,"style":742},[187],[116,35063,35065],{"className":35064},[746,747,748,749],[116,35066,4806],{"className":35067},[574,749]," can inflate a good node's ",[116,35070,35072],{"className":35071},[119],[116,35073,35075],{"className":35074,"ariaHidden":124},[123],[116,35076,35078,35081],{"className":35077},[128],[116,35079],{"className":35080,"style":4241},[132],[116,35082,26047],{"className":35083,"style":33277},[137,138]," past a bad goal's and let the bad goal out\nfirst.",[73,35086,35087,35088,35213,35214,106,35266,106,35269,35321,35322,35374,35375,35427,35428,35480,35481,35533],{},"Among admissible heuristics, larger is better. If ",[116,35089,35091],{"className":35090},[119],[116,35092,35094,35158],{"className":35093,"ariaHidden":124},[123],[116,35095,35097,35100,35140,35143,35146,35149,35152,35155],{"className":35096},[128],[116,35098],{"className":35099,"style":552},[132],[116,35101,35103,35106],{"className":35102},[137],[116,35104,4027],{"className":35105},[137,138],[116,35107,35109],{"className":35108},[725],[116,35110,35112,35132],{"className":35111},[168,169],[116,35113,35115,35129],{"className":35114},[173],[116,35116,35118],{"className":35117,"style":4068},[177],[116,35119,35120,35123],{"style":3584},[116,35121],{"className":35122,"style":742},[187],[116,35124,35126],{"className":35125},[746,747,748,749],[116,35127,359],{"className":35128},[137,749],[116,35130,234],{"className":35131},[233],[116,35133,35135],{"className":35134},[173],[116,35136,35138],{"className":35137,"style":762},[177],[116,35139],{},[116,35141,562],{"className":35142},[561],[116,35144,9120],{"className":35145},[137,138],[116,35147,652],{"className":35148},[651],[116,35150],{"className":35151,"style":145},[144],[116,35153,6888],{"className":35154},[149],[116,35156],{"className":35157,"style":145},[144],[116,35159,35161,35164,35204,35207,35210],{"className":35160},[128],[116,35162],{"className":35163,"style":552},[132],[116,35165,35167,35170],{"className":35166},[137],[116,35168,4027],{"className":35169},[137,138],[116,35171,35173],{"className":35172},[725],[116,35174,35176,35196],{"className":35175},[168,169],[116,35177,35179,35193],{"className":35178},[173],[116,35180,35182],{"className":35181,"style":4068},[177],[116,35183,35184,35187],{"style":3584},[116,35185],{"className":35186,"style":742},[187],[116,35188,35190],{"className":35189},[746,747,748,749],[116,35191,345],{"className":35192},[137,749],[116,35194,234],{"className":35195},[233],[116,35197,35199],{"className":35198},[173],[116,35200,35202],{"className":35201,"style":762},[177],[116,35203],{},[116,35205,562],{"className":35206},[561],[116,35208,9120],{"className":35209},[137,138],[116,35211,652],{"className":35212},[651],"\neverywhere, ",[116,35215,35217],{"className":35216},[119],[116,35218,35220],{"className":35219,"ariaHidden":124},[123],[116,35221,35223,35226],{"className":35222},[128],[116,35224],{"className":35225,"style":4182},[132],[116,35227,35229,35232],{"className":35228},[137],[116,35230,4027],{"className":35231},[137,138],[116,35233,35235],{"className":35234},[725],[116,35236,35238,35258],{"className":35237},[168,169],[116,35239,35241,35255],{"className":35240},[173],[116,35242,35244],{"className":35243,"style":4068},[177],[116,35245,35246,35249],{"style":3584},[116,35247],{"className":35248,"style":742},[187],[116,35250,35252],{"className":35251},[746,747,748,749],[116,35253,359],{"className":35254},[137,749],[116,35256,234],{"className":35257},[233],[116,35259,35261],{"className":35260},[173],[116,35262,35264],{"className":35263,"style":762},[177],[116,35265],{},[505,35267,35268],{},"dominates",[116,35270,35272],{"className":35271},[119],[116,35273,35275],{"className":35274,"ariaHidden":124},[123],[116,35276,35278,35281],{"className":35277},[128],[116,35279],{"className":35280,"style":4182},[132],[116,35282,35284,35287],{"className":35283},[137],[116,35285,4027],{"className":35286},[137,138],[116,35288,35290],{"className":35289},[725],[116,35291,35293,35313],{"className":35292},[168,169],[116,35294,35296,35310],{"className":35295},[173],[116,35297,35299],{"className":35298,"style":4068},[177],[116,35300,35301,35304],{"style":3584},[116,35302],{"className":35303,"style":742},[187],[116,35305,35307],{"className":35306},[746,747,748,749],[116,35308,345],{"className":35309},[137,749],[116,35311,234],{"className":35312},[233],[116,35314,35316],{"className":35315},[173],[116,35317,35319],{"className":35318,"style":762},[177],[116,35320],{},", and A* with ",[116,35323,35325],{"className":35324},[119],[116,35326,35328],{"className":35327,"ariaHidden":124},[123],[116,35329,35331,35334],{"className":35330},[128],[116,35332],{"className":35333,"style":4182},[132],[116,35335,35337,35340],{"className":35336},[137],[116,35338,4027],{"className":35339},[137,138],[116,35341,35343],{"className":35342},[725],[116,35344,35346,35366],{"className":35345},[168,169],[116,35347,35349,35363],{"className":35348},[173],[116,35350,35352],{"className":35351,"style":4068},[177],[116,35353,35354,35357],{"style":3584},[116,35355],{"className":35356,"style":742},[187],[116,35358,35360],{"className":35359},[746,747,748,749],[116,35361,359],{"className":35362},[137,749],[116,35364,234],{"className":35365},[233],[116,35367,35369],{"className":35368},[173],[116,35370,35372],{"className":35371,"style":762},[177],[116,35373],{}," expands no more nodes than\nwith ",[116,35376,35378],{"className":35377},[119],[116,35379,35381],{"className":35380,"ariaHidden":124},[123],[116,35382,35384,35387],{"className":35383},[128],[116,35385],{"className":35386,"style":4182},[132],[116,35388,35390,35393],{"className":35389},[137],[116,35391,4027],{"className":35392},[137,138],[116,35394,35396],{"className":35395},[725],[116,35397,35399,35419],{"className":35398},[168,169],[116,35400,35402,35416],{"className":35401},[173],[116,35403,35405],{"className":35404,"style":4068},[177],[116,35406,35407,35410],{"style":3584},[116,35408],{"className":35409,"style":742},[187],[116,35411,35413],{"className":35412},[746,747,748,749],[116,35414,345],{"className":35415},[137,749],[116,35417,234],{"className":35418},[233],[116,35420,35422],{"className":35421},[173],[116,35423,35425],{"className":35424,"style":762},[177],[116,35426],{},": every node A* can safely skip under ",[116,35429,35431],{"className":35430},[119],[116,35432,35434],{"className":35433,"ariaHidden":124},[123],[116,35435,35437,35440],{"className":35436},[128],[116,35438],{"className":35439,"style":4182},[132],[116,35441,35443,35446],{"className":35442},[137],[116,35444,4027],{"className":35445},[137,138],[116,35447,35449],{"className":35448},[725],[116,35450,35452,35472],{"className":35451},[168,169],[116,35453,35455,35469],{"className":35454},[173],[116,35456,35458],{"className":35457,"style":4068},[177],[116,35459,35460,35463],{"style":3584},[116,35461],{"className":35462,"style":742},[187],[116,35464,35466],{"className":35465},[746,747,748,749],[116,35467,345],{"className":35468},[137,749],[116,35470,234],{"className":35471},[233],[116,35473,35475],{"className":35474},[173],[116,35476,35478],{"className":35477,"style":762},[177],[116,35479],{}," it also skips under ",[116,35482,35484],{"className":35483},[119],[116,35485,35487],{"className":35486,"ariaHidden":124},[123],[116,35488,35490,35493],{"className":35489},[128],[116,35491],{"className":35492,"style":4182},[132],[116,35494,35496,35499],{"className":35495},[137],[116,35497,4027],{"className":35498},[137,138],[116,35500,35502],{"className":35501},[725],[116,35503,35505,35525],{"className":35504},[168,169],[116,35506,35508,35522],{"className":35507},[173],[116,35509,35511],{"className":35510,"style":4068},[177],[116,35512,35513,35516],{"style":3584},[116,35514],{"className":35515,"style":742},[187],[116,35517,35519],{"className":35518},[746,747,748,749],[116,35520,359],{"className":35521},[137,749],[116,35523,234],{"className":35524},[233],[116,35526,35528],{"className":35527},[173],[116,35529,35531],{"className":35530,"style":762},[177],[116,35532],{},".\nThe pointwise maximum of two admissible heuristics is itself admissible and\ndominates both, which is why heuristics are often combined by taking their max.",[2107,35535,35537],{"className":2109,"code":35536,"language":2111,"meta":478,"style":478},"caption: $\\textsc{A-Star}(start, goal)$ — least-cost-first search on $f = g + h$\ninput: a start cell, a goal cell, a heuristic $h$\nfrontier $\\gets$ priority queue holding $start$ with key $h(start)$\n$g[start] \\gets 0$\nwhile frontier is not empty do\n  $n \\gets$ remove the state of least key from frontier\n  if $n = goal$ then return the path traced back to $start$\n  for each neighbor $m$ of $n$ do\n    $c \\gets g[n] + \\operatorname{cost}(n, m)$\n    if $m$ is unseen or $c \u003C g[m]$ then\n      $g[m] \\gets c$; set $m$'s parent to $n$\n      insert $m$ into frontier with key $c + h(m)$\nreturn failure\n",[108,35538,35539,35544,35549,35554,35559,35564,35569,35574,35579,35584,35589,35594,35599],{"__ignoreMap":478},[116,35540,35541],{"class":2116,"line":2117},[116,35542,35543],{},"caption: $\\textsc{A-Star}(start, goal)$ — least-cost-first search on $f = g + h$\n",[116,35545,35546],{"class":2116,"line":479},[116,35547,35548],{},"input: a start cell, a goal cell, a heuristic $h$\n",[116,35550,35551],{"class":2116,"line":2128},[116,35552,35553],{},"frontier $\\gets$ priority queue holding $start$ with key $h(start)$\n",[116,35555,35556],{"class":2116,"line":2134},[116,35557,35558],{},"$g[start] \\gets 0$\n",[116,35560,35561],{"class":2116,"line":2140},[116,35562,35563],{},"while frontier is not empty do\n",[116,35565,35566],{"class":2116,"line":2146},[116,35567,35568],{},"  $n \\gets$ remove the state of least key from frontier\n",[116,35570,35571],{"class":2116,"line":2152},[116,35572,35573],{},"  if $n = goal$ then return the path traced back to $start$\n",[116,35575,35576],{"class":2116,"line":2158},[116,35577,35578],{},"  for each neighbor $m$ of $n$ do\n",[116,35580,35581],{"class":2116,"line":2164},[116,35582,35583],{},"    $c \\gets g[n] + \\operatorname{cost}(n, m)$\n",[116,35585,35586],{"class":2116,"line":25556},[116,35587,35588],{},"    if $m$ is unseen or $c \u003C g[m]$ then\n",[116,35590,35591],{"class":2116,"line":25562},[116,35592,35593],{},"      $g[m] \\gets c$; set $m$'s parent to $n$\n",[116,35595,35596],{"class":2116,"line":29263},[116,35597,35598],{},"      insert $m$ into frontier with key $c + h(m)$\n",[116,35600,35602],{"class":2116,"line":35601},13,[116,35603,33057],{},[73,35605,35606,35607,35640,35641,35656],{},"Greedy search often expands fewer states, since it heads straight at the goal,\nbut it gives up optimality: a heuristic that points\ntoward a dead end walks the robot into it. A-star pays for more expansions with a\nguarantee — under an admissible heuristic the first goal it removes from the\nfrontier sits on a shortest path. Setting ",[116,35608,35610],{"className":35609},[119],[116,35611,35613,35631],{"className":35612,"ariaHidden":124},[123],[116,35614,35616,35619,35622,35625,35628],{"className":35615},[128],[116,35617],{"className":35618,"style":4022},[132],[116,35620,4027],{"className":35621},[137,138],[116,35623],{"className":35624,"style":145},[144],[116,35626,150],{"className":35627},[149],[116,35629],{"className":35630,"style":145},[144],[116,35632,35634,35637],{"className":35633},[128],[116,35635],{"className":35636,"style":1890},[132],[116,35638,331],{"className":35639},[137]," collapses A-star to uniform-cost\nsearch, and a sharper ",[116,35642,35644],{"className":35643},[119],[116,35645,35647],{"className":35646,"ariaHidden":124},[123],[116,35648,35650,35653],{"className":35649},[128],[116,35651],{"className":35652,"style":4022},[132],[116,35654,4027],{"className":35655},[137,138]," narrows the search toward the goal without breaking\nthat guarantee.",[35658,35659],"a-star-viz",{},[2263,35661,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":35663},[],"2021-10-03","Informed search uses a heuristic estimate of the cost remaining to the goal to\ndecide which state to expand next, reaching the goal after touching far fewer\nstates than blind search. This project drives a robot across a grid maze of\nobstacles to a target cell, comparing\nA* search against\ngreedy best-first search.",{},"\u002Fprojects\u002Fai\u002F76-informed-search",[35669,35670],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Finformed-search","https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Fheuristic-functions","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fartificial-intelligence\u002Ftree\u002Fmain\u002F02-Mazeworld",{"title":33223,"description":35665},"projects\u002Fai\u002F76-informed-search","Navigating a robot through a grid maze with A-star and greedy best-first\nsearch, using Manhattan and Euclidean distance as admissible heuristics.",[2279,33219,32403],"8s_QOayGZ0axr_EoZlqOU8YG-lbeFRRcUA_pkVtBiUU",{"id":35678,"title":35679,"body":35680,"date":36649,"description":36650,"extension":483,"featured":484,"meta":36651,"navigation":484,"path":36652,"references":36653,"repo":36656,"seo":36657,"stem":36658,"summary":36659,"tag":32399,"tech":36660,"url":2282,"__hash__":36662},"projects\u002Fprojects\u002Fai\u002F76-chess.md","Intelligent Chess bot",{"type":70,"value":35681,"toc":36647},[35682,35696,35699,36174,36263,36300,36392,36395,36458,36461,36642,36645],[73,35683,35684,35685,7034,35690,35695],{},"A chess engine built on classical adversarial search:\n",[76,35686,35689],{"href":35687,"rel":35688},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMinimax",[80],"minimax",[76,35691,35694],{"href":35692,"rel":35693},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAlpha%E2%80%93beta_pruning",[80],"alpha-beta pruning","\nat its base, then a stack of refinements — iterative deepening,\ntransposition tables, move ordering, null-move pruning, aspiration\nwindows, and quiescence search — that make the textbook algorithm\nplay well under a real clock.",[73,35697,35698],{},"Chess is a zero-sum game, so one number scores every position: the\nengine (MAX) picks the child of highest value, assuming the opponent\n(MIN) always answers with the lowest.\nMinimax computes that value by recursing to the leaves,",[116,35700,35702],{"className":35701},[702],[116,35703,35705],{"className":35704},[119],[116,35706,35708,35738],{"className":35707,"ariaHidden":124},[123],[116,35709,35711,35714,35720,35723,35726,35729,35732,35735],{"className":35710},[128],[116,35712],{"className":35713,"style":552},[132],[116,35715,35717],{"className":35716},[1126],[116,35718,35689],{"className":35719},[137,3388],[116,35721,562],{"className":35722},[561],[116,35724,9120],{"className":35725},[137,138],[116,35727,652],{"className":35728},[651],[116,35730],{"className":35731,"style":145},[144],[116,35733,150],{"className":35734},[149],[116,35736],{"className":35737,"style":145},[144],[116,35739,35741,35745],{"className":35740},[128],[116,35742],{"className":35743,"style":35744},[132],"height:4.8em;vertical-align:-2.15em;",[116,35746,35748,35846,36171],{"className":35747},[946],[116,35749,35751],{"className":35750},[561],[116,35752,35754],{"className":35753},[1091,3524],[116,35755,35757,35837],{"className":35756},[168,169],[116,35758,35760,35834],{"className":35759},[173],[116,35761,35764,35779,35798,35810,35822],{"className":35762,"style":35763},[177],"height:2.65em;",[116,35765,35767,35771],{"style":35766},"top:-1.9em;",[116,35768],{"className":35769,"style":35770},[187],"height:3.15em;",[116,35772,35776],{"className":35773},[35774,35775],"delimsizinginner","delim-size4",[116,35777,35778],{},"⎩",[116,35780,35782,35785],{"style":35781},"top:-1.892em;",[116,35783],{"className":35784,"style":35770},[187],[116,35786,35788],{"style":35787},"height:0.616em;width:0.8889em;",[219,35789,35795],{"xmlns":221,"width":35790,"height":35791,"style":35792,"viewBox":35793,"preserveAspectRatio":35794},"0.8889em","0.616em","width:0.8889em","0 0 888.89 616","xMinYMin",[227,35796],{"d":35797},"M384 0 H504 V616 H384z M384 0 H504 V616 H384z",[116,35799,35801,35804],{"style":35800},"top:-3.15em;",[116,35802],{"className":35803,"style":35770},[187],[116,35805,35807],{"className":35806},[35774,35775],[116,35808,35809],{},"⎨",[116,35811,35813,35816],{"style":35812},"top:-4.292em;",[116,35814],{"className":35815,"style":35770},[187],[116,35817,35818],{"style":35787},[219,35819,35820],{"xmlns":221,"width":35790,"height":35791,"style":35792,"viewBox":35793,"preserveAspectRatio":35794},[227,35821],{"d":35797},[116,35823,35825,35828],{"style":35824},"top:-4.9em;",[116,35826],{"className":35827,"style":35770},[187],[116,35829,35831],{"className":35830},[35774,35775],[116,35832,35833],{},"⎧",[116,35835,234],{"className":35836},[233],[116,35838,35840],{"className":35839},[173],[116,35841,35844],{"className":35842,"style":35843},[177],"height:2.15em;",[116,35845],{},[116,35847,35849],{"className":35848},[137],[116,35850,35852,36090,36094],{"className":35851},[1099],[116,35853,35856],{"className":35854},[35855],"col-align-l",[116,35857,35859,36081],{"className":35858},[168,169],[116,35860,35862,36078],{"className":35861},[173],[116,35863,35866,35892,35987],{"className":35864,"style":35865},[177],"height:2.61em;",[116,35867,35869,35873],{"style":35868},"top:-4.61em;",[116,35870],{"className":35871,"style":35872},[187],"height:3.008em;",[116,35874,35876,35883,35886,35889],{"className":35875},[137],[116,35877,35879],{"className":35878},[1126],[116,35880,35882],{"className":35881},[137,3388],"eval",[116,35884,562],{"className":35885},[561],[116,35887,9120],{"className":35888},[137,138],[116,35890,652],{"className":35891},[651],[116,35893,35895,35898],{"style":35894},"top:-2.97em;",[116,35896],{"className":35897,"style":35872},[187],[116,35899,35901,35969,35972,35978,35981,35984],{"className":35900},[137],[116,35902,35904,35910],{"className":35903},[1126],[116,35905,35907],{"className":35906},[1126],[116,35908,9027],{"className":35909},[137,3388],[116,35911,35913],{"className":35912},[725],[116,35914,35916,35960],{"className":35915},[168,169],[116,35917,35919,35957],{"className":35918},[173],[116,35920,35922],{"className":35921,"style":4663},[177],[116,35923,35925,35928],{"style":35924},"top:-2.5198em;margin-right:0.05em;",[116,35926],{"className":35927,"style":742},[187],[116,35929,35931],{"className":35930},[746,747,748,749],[116,35932,35934,35937,35941,35948,35951,35954],{"className":35933},[137,749],[116,35935,8916],{"className":35936},[137,138,749],[116,35938,35940],{"className":35939},[149,749],"∈",[116,35942,35944],{"className":35943},[1126,749],[116,35945,35947],{"className":35946},[137,3388,749],"succ",[116,35949,562],{"className":35950},[561,749],[116,35952,9120],{"className":35953},[137,138,749],[116,35955,652],{"className":35956},[651,749],[116,35958,234],{"className":35959},[233],[116,35961,35963],{"className":35962},[173],[116,35964,35967],{"className":35965,"style":35966},[177],"height:0.3552em;",[116,35968],{},[116,35970],{"className":35971,"style":279},[144],[116,35973,35975],{"className":35974},[1126],[116,35976,35689],{"className":35977},[137,3388],[116,35979,562],{"className":35980},[561],[116,35982,8916],{"className":35983},[137,138],[116,35985,652],{"className":35986},[651],[116,35988,35990,35993],{"style":35989},"top:-1.33em;",[116,35991],{"className":35992,"style":35872},[187],[116,35994,35996,36060,36063,36069,36072,36075],{"className":35995},[137],[116,35997,35999,36005],{"className":35998},[1126],[116,36000,36002],{"className":36001},[1126],[116,36003,3389],{"className":36004},[137,3388],[116,36006,36008],{"className":36007},[725],[116,36009,36011,36052],{"className":36010},[168,169],[116,36012,36014,36049],{"className":36013},[173],[116,36015,36017],{"className":36016,"style":4663},[177],[116,36018,36019,36022],{"style":35924},[116,36020],{"className":36021,"style":742},[187],[116,36023,36025],{"className":36024},[746,747,748,749],[116,36026,36028,36031,36034,36040,36043,36046],{"className":36027},[137,749],[116,36029,8916],{"className":36030},[137,138,749],[116,36032,35940],{"className":36033},[149,749],[116,36035,36037],{"className":36036},[1126,749],[116,36038,35947],{"className":36039},[137,3388,749],[116,36041,562],{"className":36042},[561,749],[116,36044,9120],{"className":36045},[137,138,749],[116,36047,652],{"className":36048},[651,749],[116,36050,234],{"className":36051},[233],[116,36053,36055],{"className":36054},[173],[116,36056,36058],{"className":36057,"style":35966},[177],[116,36059],{},[116,36061],{"className":36062,"style":279},[144],[116,36064,36066],{"className":36065},[1126],[116,36067,35689],{"className":36068},[137,3388],[116,36070,562],{"className":36071},[561],[116,36073,8916],{"className":36074},[137,138],[116,36076,652],{"className":36077},[651],[116,36079,234],{"className":36080},[233],[116,36082,36084],{"className":36083},[173],[116,36085,36088],{"className":36086,"style":36087},[177],"height:2.11em;",[116,36089],{},[116,36091],{"className":36092,"style":36093},[1299],"width:1em;",[116,36095,36097],{"className":36096},[35855],[116,36098,36100,36163],{"className":36099},[168,169],[116,36101,36103,36160],{"className":36102},[173],[116,36104,36106,36124,36142],{"className":36105,"style":35865},[177],[116,36107,36108,36111],{"style":35868},[116,36109],{"className":36110,"style":35872},[187],[116,36112,36114,36117],{"className":36113},[137],[116,36115,9120],{"className":36116},[137,138],[116,36118,36120],{"className":36119},[137,431],[116,36121,36123],{"className":36122},[137]," is a leaf,",[116,36125,36126,36129],{"style":35894},[116,36127],{"className":36128,"style":35872},[187],[116,36130,36132,36135],{"className":36131},[137],[116,36133,9120],{"className":36134},[137,138],[116,36136,36138],{"className":36137},[137,431],[116,36139,36141],{"className":36140},[137]," is a MAX node,",[116,36143,36144,36147],{"style":35989},[116,36145],{"className":36146,"style":35872},[187],[116,36148,36150,36153],{"className":36149},[137],[116,36151,9120],{"className":36152},[137,138],[116,36154,36156],{"className":36155},[137,431],[116,36157,36159],{"className":36158},[137]," is a MIN node,",[116,36161,234],{"className":36162},[233],[116,36164,36166],{"className":36165},[173],[116,36167,36169],{"className":36168,"style":36087},[177],[116,36170],{},[116,36172],{"className":36173},[651,4427],[73,36175,36176,36177,36227,36228,36262],{},"but the full tree is ",[116,36178,36180],{"className":36179},[119],[116,36181,36183],{"className":36182,"ariaHidden":124},[123],[116,36184,36186,36189,36192,36195,36224],{"className":36185},[128],[116,36187],{"className":36188,"style":552},[132],[116,36190,29069],{"className":36191,"style":205},[137,138],[116,36193,562],{"className":36194},[561],[116,36196,36198,36201],{"className":36197},[137],[116,36199,4115],{"className":36200},[137,138],[116,36202,36204],{"className":36203},[725],[116,36205,36207],{"className":36206},[168],[116,36208,36210],{"className":36209},[173],[116,36211,36213],{"className":36212,"style":4633},[177],[116,36214,36215,36218],{"style":1167},[116,36216],{"className":36217,"style":742},[187],[116,36219,36221],{"className":36220},[746,747,748,749],[116,36222,10717],{"className":36223},[137,138,749],[116,36225,652],{"className":36226},[651]," — and chess branches at ",[116,36229,36231],{"className":36230},[119],[116,36232,36234,36252],{"className":36233,"ariaHidden":124},[123],[116,36235,36237,36240,36243,36246,36249],{"className":36236},[128],[116,36238],{"className":36239,"style":4022},[132],[116,36241,4115],{"className":36242},[137,138],[116,36244],{"className":36245,"style":145},[144],[116,36247,413],{"className":36248},[149],[116,36250],{"className":36251,"style":145},[144],[116,36253,36255,36258],{"className":36254},[128],[116,36256],{"className":36257,"style":1890},[132],[116,36259,36261],{"className":36260},[137],"35",".\nSearching it outright is hopeless; every refinement below reduces how\nmuch of it is searched.",[73,36264,36265,36268,36269,36299],{},[505,36266,36267],{},"Alpha-beta pruning"," keeps minimax's answer while skipping subtrees\nthat cannot matter. The search carries a window ",[116,36270,36272],{"className":36271},[119],[116,36273,36275],{"className":36274,"ariaHidden":124},[123],[116,36276,36278,36281,36284,36287,36290,36293,36296],{"className":36277},[128],[116,36279],{"className":36280,"style":552},[132],[116,36282,1092],{"className":36283},[561],[116,36285,15813],{"className":36286,"style":15812},[137,138],[116,36288,594],{"className":36289},[593],[116,36291],{"className":36292,"style":279},[144],[116,36294,32153],{"className":36295,"style":32152},[137,138],[116,36297,1493],{"className":36298},[651]," — the\nbest score each side can already force — and cuts off the moment a\nnode's value falls outside it:",[2107,36301,36303],{"className":2109,"code":36302,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Alpha-Beta}(n, \\alpha, \\beta, d)$ — minimax with a cutoff window\ninput: position $n$, window $[\\alpha, \\beta]$, remaining depth $d$\nif $d = 0$ or $n$ is terminal then return $\\textsc{Quiescence}(n, \\alpha, \\beta)$\nif MAX to move then\n  $v \\gets -\\infty$\n  for each move $a$ of $n$, best first, do\n    $v \\gets \\max(v, \\textsc{Alpha-Beta}(\\textsc{Result}(n, a), \\alpha, \\beta, d - 1))$\n    $\\alpha \\gets \\max(\\alpha, v)$\n    if $\\alpha \\ge \\beta$ then return $v$\n  return $v$\nelse\n  $v \\gets +\\infty$\n  for each move $a$ of $n$, best first, do\n    $v \\gets \\min(v, \\textsc{Alpha-Beta}(\\textsc{Result}(n, a), \\alpha, \\beta, d - 1))$\n    $\\beta \\gets \\min(\\beta, v)$\n    if $\\beta \\le \\alpha$ then return $v$\n  return $v$\n",[108,36304,36305,36310,36315,36320,36325,36330,36335,36340,36345,36350,36355,36360,36365,36369,36375,36381,36387],{"__ignoreMap":478},[116,36306,36307],{"class":2116,"line":2117},[116,36308,36309],{},"caption: $\\textsc{Alpha-Beta}(n, \\alpha, \\beta, d)$ — minimax with a cutoff window\n",[116,36311,36312],{"class":2116,"line":479},[116,36313,36314],{},"input: position $n$, window $[\\alpha, \\beta]$, remaining depth $d$\n",[116,36316,36317],{"class":2116,"line":2128},[116,36318,36319],{},"if $d = 0$ or $n$ is terminal then return $\\textsc{Quiescence}(n, \\alpha, \\beta)$\n",[116,36321,36322],{"class":2116,"line":2134},[116,36323,36324],{},"if MAX to move then\n",[116,36326,36327],{"class":2116,"line":2140},[116,36328,36329],{},"  $v \\gets -\\infty$\n",[116,36331,36332],{"class":2116,"line":2146},[116,36333,36334],{},"  for each move $a$ of $n$, best first, do\n",[116,36336,36337],{"class":2116,"line":2152},[116,36338,36339],{},"    $v \\gets \\max(v, \\textsc{Alpha-Beta}(\\textsc{Result}(n, a), \\alpha, \\beta, d - 1))$\n",[116,36341,36342],{"class":2116,"line":2158},[116,36343,36344],{},"    $\\alpha \\gets \\max(\\alpha, v)$\n",[116,36346,36347],{"class":2116,"line":2164},[116,36348,36349],{},"    if $\\alpha \\ge \\beta$ then return $v$\n",[116,36351,36352],{"class":2116,"line":25556},[116,36353,36354],{},"  return $v$\n",[116,36356,36357],{"class":2116,"line":25562},[116,36358,36359],{},"else\n",[116,36361,36362],{"class":2116,"line":29263},[116,36363,36364],{},"  $v \\gets +\\infty$\n",[116,36366,36367],{"class":2116,"line":35601},[116,36368,36334],{},[116,36370,36372],{"class":2116,"line":36371},14,[116,36373,36374],{},"    $v \\gets \\min(v, \\textsc{Alpha-Beta}(\\textsc{Result}(n, a), \\alpha, \\beta, d - 1))$\n",[116,36376,36378],{"class":2116,"line":36377},15,[116,36379,36380],{},"    $\\beta \\gets \\min(\\beta, v)$\n",[116,36382,36384],{"class":2116,"line":36383},16,[116,36385,36386],{},"    if $\\beta \\le \\alpha$ then return $v$\n",[116,36388,36390],{"class":2116,"line":36389},17,[116,36391,36354],{},[246,36393],{"hash":36394},"b72623aff6c2c6efbd912ec641a33cca6e23453518ac5eb283f916895b3eef65",[73,36396,36397,36398,36457],{},"With perfect move ordering, alpha-beta examines only ",[116,36399,36401],{"className":36400},[119],[116,36402,36404],{"className":36403,"ariaHidden":124},[123],[116,36405,36407,36411,36414,36417,36454],{"className":36406},[128],[116,36408],{"className":36409,"style":36410},[132],"height:1.138em;vertical-align:-0.25em;",[116,36412,29069],{"className":36413,"style":205},[137,138],[116,36415,562],{"className":36416},[561],[116,36418,36420,36423],{"className":36419},[137],[116,36421,4115],{"className":36422},[137,138],[116,36424,36426],{"className":36425},[725],[116,36427,36429],{"className":36428},[168],[116,36430,36432],{"className":36431},[173],[116,36433,36436],{"className":36434,"style":36435},[177],"height:0.888em;",[116,36437,36438,36441],{"style":1167},[116,36439],{"className":36440,"style":742},[187],[116,36442,36444],{"className":36443},[746,747,748,749],[116,36445,36447,36450],{"className":36446},[137,749],[116,36448,10717],{"className":36449},[137,138,749],[116,36451,36453],{"className":36452},[137,749],"\u002F2",[116,36455,652],{"className":36456},[651]," nodes\n— the same horizon for half the exponent, which in practice doubles the\nreachable search depth.",[73,36459,36460],{},"Each refinement past alpha-beta strengthens either the pruning or the\nevaluation:",[10278,36462,36463,36514,36522,36587,36595,36634],{},[10281,36464,36465,36470,36471,36513],{},[76,36466,36469],{"href":36467,"rel":36468},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FIterative_deepening_depth-first_search",[80],"Iterative deepening","\nsearches depth ",[116,36472,36474],{"className":36473},[119],[116,36475,36477],{"className":36476,"ariaHidden":124},[123],[116,36478,36480,36483,36486,36489,36492,36495,36498,36501,36504,36507,36510],{"className":36479},[128],[116,36481],{"className":36482,"style":899},[132],[116,36484,345],{"className":36485},[137],[116,36487,594],{"className":36488},[593],[116,36490],{"className":36491,"style":279},[144],[116,36493,359],{"className":36494},[137],[116,36496,594],{"className":36497},[593],[116,36499],{"className":36500,"style":279},[144],[116,36502,2564],{"className":36503},[137],[116,36505,594],{"className":36506},[593],[116,36508],{"className":36509,"style":279},[144],[116,36511,10684],{"className":36512},[946]," until time runs out — and each pass's\nbest line seeds the next pass's move ordering.",[10281,36515,36516,36521],{},[76,36517,36520],{"href":36518,"rel":36519},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTransposition_table",[80],"Transposition tables","\nmemoize positions reached by different move orders, so a position is\nsearched once, not once per path.",[10281,36523,36524,36529,36530,36586],{},[76,36525,36528],{"href":36526,"rel":36527},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMove_ordering",[80],"Move ordering"," tries\ncaptures and killer moves first, pushing real play toward that\n",[116,36531,36533],{"className":36532},[119],[116,36534,36536],{"className":36535,"ariaHidden":124},[123],[116,36537,36539,36542,36545,36548,36583],{"className":36538},[128],[116,36540],{"className":36541,"style":36410},[132],[116,36543,29069],{"className":36544,"style":205},[137,138],[116,36546,562],{"className":36547},[561],[116,36549,36551,36554],{"className":36550},[137],[116,36552,4115],{"className":36553},[137,138],[116,36555,36557],{"className":36556},[725],[116,36558,36560],{"className":36559},[168],[116,36561,36563],{"className":36562},[173],[116,36564,36566],{"className":36565,"style":36435},[177],[116,36567,36568,36571],{"style":1167},[116,36569],{"className":36570,"style":742},[187],[116,36572,36574],{"className":36573},[746,747,748,749],[116,36575,36577,36580],{"className":36576},[137,749],[116,36578,10717],{"className":36579},[137,138,749],[116,36581,36453],{"className":36582},[137,749],[116,36584,652],{"className":36585},[651]," best case.",[10281,36588,36589,36594],{},[76,36590,36593],{"href":36591,"rel":36592},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FNull-move_heuristic",[80],"Null-move pruning","\ngives the opponent a free move; if the position is still winning, the\nsubtree is cut without a full search.",[10281,36596,36597,36602,36603,36633],{},[76,36598,36601],{"href":36599,"rel":36600},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAspiration_window",[80],"Aspiration windows","\nstart each iteration with a narrow ",[116,36604,36606],{"className":36605},[119],[116,36607,36609],{"className":36608,"ariaHidden":124},[123],[116,36610,36612,36615,36618,36621,36624,36627,36630],{"className":36611},[128],[116,36613],{"className":36614,"style":552},[132],[116,36616,1092],{"className":36617},[561],[116,36619,15813],{"className":36620,"style":15812},[137,138],[116,36622,594],{"className":36623},[593],[116,36625],{"className":36626,"style":279},[144],[116,36628,32153],{"className":36629,"style":32152},[137,138],[116,36631,1493],{"className":36632},[651]," guessed from the\nlast one, re-searching only when the score lands outside it.",[10281,36635,36636,36641],{},[76,36637,36640],{"href":36638,"rel":36639},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FQuiescence_search",[80],"Quiescence search","\nextends the search at the horizon until the position is quiet, so the\nevaluation never scores a board mid-capture.",[246,36643],{"hash":36644},"e15002c31491229fa41d1faaf02fd3cc8f9daa5d7baa269bd9a9485551ffcf0e",[2263,36646,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":36648},[],"2021-10-01","A chess engine built on classical adversarial search:\nminimax with\nalpha-beta pruning\nat its base, then a stack of refinements — iterative deepening,\ntransposition tables, move ordering, null-move pruning, aspiration\nwindows, and quiescence search — that make the textbook algorithm\nplay well under a real clock.",{},"\u002Fprojects\u002Fai\u002F76-chess",[36654,36655,35669],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Fadversarial-search","https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Fgames-of-chance-and-imperfect-information","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fartificial-intelligence\u002Ftree\u002Fmain\u002F03-ChessAI",{"title":35679,"description":36650},"projects\u002Fai\u002F76-chess","A chess engine built on adversarial search — minimax with alpha-beta\npruning, sharpened by iterative deepening, transposition tables, move\nordering, and quiescence search.",[2279,36661,32403],"adversarial search","Ukg-abpFpJWGos2CYyxm3YwtCUsIrJCijFEeU3Ey9fY",{"id":36664,"title":36665,"body":36666,"date":37034,"description":37035,"extension":483,"featured":2354,"meta":37036,"navigation":484,"path":37037,"references":37038,"repo":37040,"seo":37041,"stem":37042,"summary":37043,"tag":32399,"tech":37044,"url":2282,"__hash__":37045},"projects\u002Fprojects\u002Fai\u002F76-uninformed-search.md","Uninformed Search",{"type":70,"value":36667,"toc":37032},[36668,36682,36685,36691,36694,36747,36750,36903,37030],[73,36669,36670,36671,2344,36676,36681],{},"Many puzzles are search problems in disguise: a set of states, a start, a goal,\nand moves between states. Solving one means finding a path through the implicit\ngraph of states without ever building it in full. This project applies\n",[76,36672,36675],{"href":36673,"rel":36674},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBreadth-first_search",[80],"breadth-first search",[76,36677,36680],{"href":36678,"rel":36679},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDepth-first_search",[80],"depth-first search"," to the\nchickens-and-foxes river crossing.",[73,36683,36684],{},"A state records how many chickens and foxes sit on each bank and which side the\nboat is on. A move ferries one or two animals across,\nand a state is legal only when foxes never outnumber chickens on a bank that\nstill has chickens. The start has everyone on one side; the goal has everyone on\nthe other. Nothing enumerates the graph ahead of time — successors are generated\non demand from each state.",[73,36686,36687,36690],{},[505,36688,36689],{},"BFS and DFS"," differ only in which frontier state they expand next: BFS uses a\nqueue, DFS a stack, and that single choice sets their behavior. BFS explores by\ndistance from the start, so the first time it reaches the goal it has found a\npath with the fewest crossings; DFS dives down one branch before backtracking,\nusing less memory but returning whatever path it reaches first. A visited set\nkeeps both from re-expanding a state and looping on the graph's cycles.",[36692,36693],"graph-traversal-viz",{},[2107,36695,36697],{"className":2109,"code":36696,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Search}(start, goal)$ — graph search parameterized by the frontier\ninput: a start state, a goal test\nfrontier $\\gets$ container holding $start$; seen $\\gets \\{start\\}$\nwhile frontier is not empty do\n  $s \\gets$ remove a state from frontier\n  if $s$ is the goal then return the path traced back to $start$\n  for each legal successor $s'$ of $s$ do\n    if $s' \\notin$ seen then\n      add $s'$ to seen; set $s'$'s parent to $s$; add $s'$ to frontier\nreturn failure\n",[108,36698,36699,36704,36709,36714,36718,36723,36728,36733,36738,36743],{"__ignoreMap":478},[116,36700,36701],{"class":2116,"line":2117},[116,36702,36703],{},"caption: $\\textsc{Search}(start, goal)$ — graph search parameterized by the frontier\n",[116,36705,36706],{"class":2116,"line":479},[116,36707,36708],{},"input: a start state, a goal test\n",[116,36710,36711],{"class":2116,"line":2128},[116,36712,36713],{},"frontier $\\gets$ container holding $start$; seen $\\gets \\{start\\}$\n",[116,36715,36716],{"class":2116,"line":2134},[116,36717,35563],{},[116,36719,36720],{"class":2116,"line":2140},[116,36721,36722],{},"  $s \\gets$ remove a state from frontier\n",[116,36724,36725],{"class":2116,"line":2146},[116,36726,36727],{},"  if $s$ is the goal then return the path traced back to $start$\n",[116,36729,36730],{"class":2116,"line":2152},[116,36731,36732],{},"  for each legal successor $s'$ of $s$ do\n",[116,36734,36735],{"class":2116,"line":2158},[116,36736,36737],{},"    if $s' \\notin$ seen then\n",[116,36739,36740],{"class":2116,"line":2164},[116,36741,36742],{},"      add $s'$ to seen; set $s'$'s parent to $s$; add $s'$ to frontier\n",[116,36744,36745],{"class":2116,"line":25556},[116,36746,33057],{},[73,36748,36749],{},"A queue for the frontier gives BFS, a stack gives DFS — the rest of the\nprocedure is identical.",[73,36751,36752,36753,36768,36769,36784,36785,36800,36801,36804,36805,36820,36821,36824,36825,36876,36877,36902],{},"The two diverge in what they guarantee. Let ",[116,36754,36756],{"className":36755},[119],[116,36757,36759],{"className":36758,"ariaHidden":124},[123],[116,36760,36762,36765],{"className":36761},[128],[116,36763],{"className":36764,"style":4022},[132],[116,36766,4115],{"className":36767},[137,138]," be the branching factor, ",[116,36770,36772],{"className":36771},[119],[116,36773,36775],{"className":36774,"ariaHidden":124},[123],[116,36776,36778,36781],{"className":36777},[128],[116,36779],{"className":36780,"style":4022},[132],[116,36782,5288],{"className":36783},[137,138]," the\ndepth of the shallowest goal, and ",[116,36786,36788],{"className":36787},[119],[116,36789,36791],{"className":36790,"ariaHidden":124},[123],[116,36792,36794,36797],{"className":36793},[128],[116,36795],{"className":36796,"style":133},[132],[116,36798,10717],{"className":36799},[137,138]," the depth of the deepest state. BFS is ",[505,36802,36803],{},"complete"," (with\nfinite ",[116,36806,36808],{"className":36807},[119],[116,36809,36811],{"className":36810,"ariaHidden":124},[123],[116,36812,36814,36817],{"className":36813},[128],[116,36815],{"className":36816,"style":4022},[132],[116,36818,4115],{"className":36819},[137,138]," it always finds a goal when one exists) and ",[505,36822,36823],{},"optimal"," when every move\ncosts the same, since it reaches goals in order of depth. Its price is memory: it\nholds an entire frontier level at once, so time and space are both ",[116,36826,36828],{"className":36827},[119],[116,36829,36831],{"className":36830,"ariaHidden":124},[123],[116,36832,36834,36838,36841,36844,36873],{"className":36833},[128],[116,36835],{"className":36836,"style":36837},[132],"height:1.0991em;vertical-align:-0.25em;",[116,36839,29069],{"className":36840,"style":205},[137,138],[116,36842,562],{"className":36843},[561],[116,36845,36847,36850],{"className":36846},[137],[116,36848,4115],{"className":36849},[137,138],[116,36851,36853],{"className":36852},[725],[116,36854,36856],{"className":36855},[168],[116,36857,36859],{"className":36858},[173],[116,36860,36862],{"className":36861,"style":1907},[177],[116,36863,36864,36867],{"style":1167},[116,36865],{"className":36866,"style":742},[187],[116,36868,36870],{"className":36869},[746,747,748,749],[116,36871,5288],{"className":36872},[137,138,749],[116,36874,652],{"className":36875},[651],", and\nthe space bound is what breaks it first on a wide graph. DFS keeps only the current\npath and its unexpanded siblings, ",[116,36878,36880],{"className":36879},[119],[116,36881,36883],{"className":36882,"ariaHidden":124},[123],[116,36884,36886,36889,36892,36895,36899],{"className":36885},[128],[116,36887],{"className":36888,"style":552},[132],[116,36890,29069],{"className":36891,"style":205},[137,138],[116,36893,562],{"className":36894},[561],[116,36896,36898],{"className":36897},[137,138],"bm",[116,36900,652],{"className":36901},[651]," space, but it is not optimal — it returns\nthe first path it stumbles onto — and without the visited set it would not even be\ncomplete on a cyclic graph, looping forever down one branch.",[73,36904,36905,36907,36908,36950,36951,36978,36979,37029],{},[505,36906,36469],{}," is the compromise. Run depth-limited DFS with limits\n",[116,36909,36911],{"className":36910},[119],[116,36912,36914],{"className":36913,"ariaHidden":124},[123],[116,36915,36917,36920,36923,36926,36929,36932,36935,36938,36941,36944,36947],{"className":36916},[128],[116,36918],{"className":36919,"style":899},[132],[116,36921,345],{"className":36922},[137],[116,36924,594],{"className":36925},[593],[116,36927],{"className":36928,"style":279},[144],[116,36930,359],{"className":36931},[137],[116,36933,594],{"className":36934},[593],[116,36936],{"className":36937,"style":279},[144],[116,36939,2564],{"className":36940},[137],[116,36942,594],{"className":36943},[593],[116,36945],{"className":36946,"style":279},[144],[116,36948,10684],{"className":36949},[946],", restarting from scratch each time, until a goal appears. It\ninherits DFS's ",[116,36952,36954],{"className":36953},[119],[116,36955,36957],{"className":36956,"ariaHidden":124},[123],[116,36958,36960,36963,36966,36969,36972,36975],{"className":36959},[128],[116,36961],{"className":36962,"style":552},[132],[116,36964,29069],{"className":36965,"style":205},[137,138],[116,36967,562],{"className":36968},[561],[116,36970,4115],{"className":36971},[137,138],[116,36973,5288],{"className":36974},[137,138],[116,36976,652],{"className":36977},[651]," memory and BFS's completeness and optimality. Re-searching\nthe shallow levels sounds wasteful, but the bottom level of a branching tree\ndwarfs everything above it, so the repeated work is a constant factor and the total\nstays ",[116,36980,36982],{"className":36981},[119],[116,36983,36985],{"className":36984,"ariaHidden":124},[123],[116,36986,36988,36991,36994,36997,37026],{"className":36987},[128],[116,36989],{"className":36990,"style":36837},[132],[116,36992,29069],{"className":36993,"style":205},[137,138],[116,36995,562],{"className":36996},[561],[116,36998,37000,37003],{"className":36999},[137],[116,37001,4115],{"className":37002},[137,138],[116,37004,37006],{"className":37005},[725],[116,37007,37009],{"className":37008},[168],[116,37010,37012],{"className":37011},[173],[116,37013,37015],{"className":37014,"style":1907},[177],[116,37016,37017,37020],{"style":1167},[116,37018],{"className":37019,"style":742},[187],[116,37021,37023],{"className":37022},[746,747,748,749],[116,37024,5288],{"className":37025},[137,138,749],[116,37027,652],{"className":37028},[651]," — BFS's guarantees at DFS's footprint.",[2263,37031,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":37033},[],"2021-09-25","Many puzzles are search problems in disguise: a set of states, a start, a goal,\nand moves between states. Solving one means finding a path through the implicit\ngraph of states without ever building it in full. This project applies\nbreadth-first search and\ndepth-first search to the\nchickens-and-foxes river crossing.",{},"\u002Fprojects\u002Fai\u002F76-uninformed-search",[37039,13716],"https:\u002F\u002Fnotes.amittai.studio\u002Fartificial-intelligence\u002Fsearch\u002Funinformed-search","https:\u002F\u002Fgithub.com\u002Flostflux\u002Fartificial-intelligence\u002Ftree\u002Fmain\u002F01-SearchProblems",{"title":36665,"description":37035},"projects\u002Fai\u002F76-uninformed-search","Breadth-first and depth-first search over a state graph, applied to the\nchickens-and-foxes river-crossing puzzle.",[2279,33219,32403],"J-yswZYbemSV7a3vsEguJmiW1cYKEEkt9yaIOD-2Peg",{"id":37047,"title":37048,"body":37049,"date":37634,"description":37635,"extension":483,"featured":2354,"meta":37636,"navigation":484,"path":37637,"references":37638,"repo":37640,"seo":37641,"stem":37642,"summary":37643,"tag":21246,"tech":37644,"url":2282,"__hash__":37648},"projects\u002Fprojects\u002Fsystems\u002F50-nuggets.md","Nuggets Game",{"type":70,"value":37050,"toc":37632},[37051,37066,37069,37140,37535,37554,37609,37612,37615,37618,37630],[73,37052,37053,37054,37059,37060,37065],{},"A multiplayer command-line game of ",[76,37055,37058],{"href":37056,"rel":37057},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FNuggets_(game)",[80],"nuggets",".\nA single server holds the maze, the gold piles, and every player's\nposition; clients connect over ",[76,37061,37064],{"href":37062,"rel":37063},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FWebSocket",[80],"sockets",",\nsend keystrokes, and receive the slice of the map their character can\ncurrently see. The game ends when the last pile is collected, and the\nplayer with the most gold wins.",[73,37067,37068],{},"The server is authoritative: it owns the grid, the set of gold piles and\ntheir values, and each connected player's location and purse. A client is\na thin terminal that captures movement keystrokes, ships them to the\nserver as short messages over a socket, and redraws whatever display\nstring the server sends back. The two speak a small line-based protocol:\na join message and per-keystroke moves upstream, a grid string and a\nstatus banner downstream. Every state change, whether a move, a pickup,\nor a join, happens on the server and fans out to the clients, so no two\nclients can disagree about where the gold is or who holds it. The client\nkeeps no authoritative state of its own; if its socket drops, the server\ncan drop that player without the rest of the game noticing.",[73,37070,37071,37072,37087,37088,37104,37105,37123,37124,37139],{},"Visibility comes down to a line-of-sight test. Each player sees only what\ntheir position reveals, and the maze uncovers gradually as they walk; a\nwall,\nonce seen, stays drawn, but gold and other players show only while in\nview. A cell ",[116,37073,37075],{"className":37074},[119],[116,37076,37078],{"className":37077,"ariaHidden":124},[123],[116,37079,37081,37084],{"className":37080},[128],[116,37082],{"className":37083,"style":7009},[132],[116,37085,73],{"className":37086},[137,138]," is visible from the player at ",[116,37089,37091],{"className":37090},[119],[116,37092,37094],{"className":37093,"ariaHidden":124},[123],[116,37095,37097,37100],{"className":37096},[128],[116,37098],{"className":37099,"style":7009},[132],[116,37101,37103],{"className":37102,"style":139},[137,138],"q"," when the straight\nsegment ",[116,37106,37108],{"className":37107},[119],[116,37109,37111],{"className":37110,"ariaHidden":124},[123],[116,37112,37114,37117,37120],{"className":37113},[128],[116,37115],{"className":37116,"style":7009},[132],[116,37118,37103],{"className":37119,"style":139},[137,138],[116,37121,73],{"className":37122},[137,138]," is not interrupted by a wall. Walking the segment column by\ncolumn, the row where it crosses column ",[116,37125,37127],{"className":37126},[119],[116,37128,37130],{"className":37129,"ariaHidden":124},[123],[116,37131,37133,37136],{"className":37132},[128],[116,37134],{"className":37135,"style":133},[132],[116,37137,566],{"className":37138},[137,138]," is",[116,37141,37143],{"className":37142},[702],[116,37144,37146],{"className":37145},[119],[116,37147,37149,37167,37223,37281],{"className":37148,"ariaHidden":124},[123],[116,37150,37152,37155,37158,37161,37164],{"className":37151},[128],[116,37153],{"className":37154,"style":7009},[132],[116,37156,601],{"className":37157,"style":139},[137,138],[116,37159],{"className":37160,"style":145},[144],[116,37162,150],{"className":37163},[149],[116,37165],{"className":37166,"style":145},[144],[116,37168,37170,37174,37214,37217,37220],{"className":37169},[128],[116,37171],{"className":37172,"style":37173},[132],"height:0.8694em;vertical-align:-0.2861em;",[116,37175,37177,37180],{"className":37176},[137],[116,37178,37103],{"className":37179,"style":139},[137,138],[116,37181,37183],{"className":37182},[725],[116,37184,37186,37206],{"className":37185},[168,169],[116,37187,37189,37203],{"className":37188},[173],[116,37190,37192],{"className":37191,"style":735},[177],[116,37193,37194,37197],{"style":3490},[116,37195],{"className":37196,"style":742},[187],[116,37198,37200],{"className":37199},[746,747,748,749],[116,37201,601],{"className":37202,"style":139},[137,138,749],[116,37204,234],{"className":37205},[233],[116,37207,37209],{"className":37208},[173],[116,37210,37212],{"className":37211,"style":822},[177],[116,37213],{},[116,37215],{"className":37216,"style":570},[144],[116,37218,575],{"className":37219},[574],[116,37221],{"className":37222,"style":570},[144],[116,37224,37226,37229,37232,37272,37275,37278],{"className":37225},[128],[116,37227],{"className":37228,"style":11131},[132],[116,37230,562],{"className":37231},[561],[116,37233,37235,37238],{"className":37234},[137],[116,37236,73],{"className":37237},[137,138],[116,37239,37241],{"className":37240},[725],[116,37242,37244,37264],{"className":37243},[168,169],[116,37245,37247,37261],{"className":37246},[173],[116,37248,37250],{"className":37249,"style":735},[177],[116,37251,37252,37255],{"style":3584},[116,37253],{"className":37254,"style":742},[187],[116,37256,37258],{"className":37257},[746,747,748,749],[116,37259,601],{"className":37260,"style":139},[137,138,749],[116,37262,234],{"className":37263},[233],[116,37265,37267],{"className":37266},[173],[116,37268,37270],{"className":37269,"style":822},[177],[116,37271],{},[116,37273],{"className":37274,"style":570},[144],[116,37276,1610],{"className":37277},[574],[116,37279],{"className":37280,"style":570},[144],[116,37282,37284,37288,37328,37331,37334,37532],{"className":37283},[128],[116,37285],{"className":37286,"style":37287},[132],"height:2.1408em;vertical-align:-0.8804em;",[116,37289,37291,37294],{"className":37290},[137],[116,37292,37103],{"className":37293,"style":139},[137,138],[116,37295,37297],{"className":37296},[725],[116,37298,37300,37320],{"className":37299},[168,169],[116,37301,37303,37317],{"className":37302},[173],[116,37304,37306],{"className":37305,"style":735},[177],[116,37307,37308,37311],{"style":3490},[116,37309],{"className":37310,"style":742},[187],[116,37312,37314],{"className":37313},[746,747,748,749],[116,37315,601],{"className":37316,"style":139},[137,138,749],[116,37318,234],{"className":37319},[233],[116,37321,37323],{"className":37322},[173],[116,37324,37326],{"className":37325,"style":822},[177],[116,37327],{},[116,37329,652],{"className":37330},[651],[116,37332],{"className":37333,"style":279},[144],[116,37335,37337,37340,37529],{"className":37336},[137],[116,37338],{"className":37339},[561,4427],[116,37341,37343],{"className":37342},[4431],[116,37344,37346,37521],{"className":37345},[168,169],[116,37347,37349,37518],{"className":37348},[173],[116,37350,37353,37450,37458],{"className":37351,"style":37352},[177],"height:1.2603em;",[116,37354,37355,37358],{"style":5010},[116,37356],{"className":37357,"style":1119},[187],[116,37359,37361,37401,37404,37407,37410],{"className":37360},[137],[116,37362,37364,37367],{"className":37363},[137],[116,37365,73],{"className":37366},[137,138],[116,37368,37370],{"className":37369},[725],[116,37371,37373,37393],{"className":37372},[168,169],[116,37374,37376,37390],{"className":37375},[173],[116,37377,37379],{"className":37378,"style":735},[177],[116,37380,37381,37384],{"style":3584},[116,37382],{"className":37383,"style":742},[187],[116,37385,37387],{"className":37386},[746,747,748,749],[116,37388,566],{"className":37389},[137,138,749],[116,37391,234],{"className":37392},[233],[116,37394,37396],{"className":37395},[173],[116,37397,37399],{"className":37398,"style":762},[177],[116,37400],{},[116,37402],{"className":37403,"style":570},[144],[116,37405,1610],{"className":37406},[574],[116,37408],{"className":37409,"style":570},[144],[116,37411,37413,37416],{"className":37412},[137],[116,37414,37103],{"className":37415,"style":139},[137,138],[116,37417,37419],{"className":37418},[725],[116,37420,37422,37442],{"className":37421},[168,169],[116,37423,37425,37439],{"className":37424},[173],[116,37426,37428],{"className":37427,"style":735},[177],[116,37429,37430,37433],{"style":3490},[116,37431],{"className":37432,"style":742},[187],[116,37434,37436],{"className":37435},[746,747,748,749],[116,37437,566],{"className":37438},[137,138,749],[116,37440,234],{"className":37441},[233],[116,37443,37445],{"className":37444},[173],[116,37446,37448],{"className":37447,"style":762},[177],[116,37449],{},[116,37451,37452,37455],{"style":4597},[116,37453],{"className":37454,"style":1119},[187],[116,37456],{"className":37457,"style":4605},[4604],[116,37459,37460,37463],{"style":4608},[116,37461],{"className":37462,"style":1119},[187],[116,37464,37466,37469,37472,37475,37478],{"className":37465},[137],[116,37467,566],{"className":37468},[137,138],[116,37470],{"className":37471,"style":570},[144],[116,37473,1610],{"className":37474},[574],[116,37476],{"className":37477,"style":570},[144],[116,37479,37481,37484],{"className":37480},[137],[116,37482,37103],{"className":37483,"style":139},[137,138],[116,37485,37487],{"className":37486},[725],[116,37488,37490,37510],{"className":37489},[168,169],[116,37491,37493,37507],{"className":37492},[173],[116,37494,37496],{"className":37495,"style":735},[177],[116,37497,37498,37501],{"style":3490},[116,37499],{"className":37500,"style":742},[187],[116,37502,37504],{"className":37503},[746,747,748,749],[116,37505,566],{"className":37506},[137,138,749],[116,37508,234],{"className":37509},[233],[116,37511,37513],{"className":37512},[173],[116,37514,37516],{"className":37515,"style":762},[177],[116,37517],{},[116,37519,234],{"className":37520},[233],[116,37522,37524],{"className":37523},[173],[116,37525,37527],{"className":37526,"style":27393},[177],[116,37528],{},[116,37530],{"className":37531},[651,4427],[116,37533,594],{"className":37534},[593],[73,37536,37537,37538,37553],{},"and the cell there — or, when ",[116,37539,37541],{"className":37540},[119],[116,37542,37544],{"className":37543,"ariaHidden":124},[123],[116,37545,37547,37550],{"className":37546},[128],[116,37548],{"className":37549,"style":7009},[132],[116,37551,601],{"className":37552,"style":139},[137,138]," is fractional, the pair of cells it\nfalls between — must be open for the sightline to survive:",[2107,37555,37557],{"className":2109,"code":37556,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Visible}(q, p, grid)$ — can the player at $q$ see cell $p$?\ninput: player cell $q$, target cell $p$, the maze $grid$\nfor each column $x$ strictly between $q_x$ and $p_x$ do\n  $y \\gets q_y + (p_y - q_y)\\,(x - q_x)\u002F(p_x - q_x)$\n  if $y$ is an integer then\n    if $grid[x][y]$ is a wall then return false\n  else if $grid[x][\\lfloor y \\rfloor]$ and $grid[x][\\lceil y \\rceil]$ are both walls then return false\nfor each row $y$ strictly between $q_y$ and $p_y$, symmetric in $x$, do\n  if the crossing cell, or the pair it falls between, is wall then return false\nreturn true\n",[108,37558,37559,37564,37569,37574,37579,37584,37589,37594,37599,37604],{"__ignoreMap":478},[116,37560,37561],{"class":2116,"line":2117},[116,37562,37563],{},"caption: $\\textsc{Visible}(q, p, grid)$ — can the player at $q$ see cell $p$?\n",[116,37565,37566],{"class":2116,"line":479},[116,37567,37568],{},"input: player cell $q$, target cell $p$, the maze $grid$\n",[116,37570,37571],{"class":2116,"line":2128},[116,37572,37573],{},"for each column $x$ strictly between $q_x$ and $p_x$ do\n",[116,37575,37576],{"class":2116,"line":2134},[116,37577,37578],{},"  $y \\gets q_y + (p_y - q_y)\\,(x - q_x)\u002F(p_x - q_x)$\n",[116,37580,37581],{"class":2116,"line":2140},[116,37582,37583],{},"  if $y$ is an integer then\n",[116,37585,37586],{"class":2116,"line":2146},[116,37587,37588],{},"    if $grid[x][y]$ is a wall then return false\n",[116,37590,37591],{"class":2116,"line":2152},[116,37592,37593],{},"  else if $grid[x][\\lfloor y \\rfloor]$ and $grid[x][\\lceil y \\rceil]$ are both walls then return false\n",[116,37595,37596],{"class":2116,"line":2158},[116,37597,37598],{},"for each row $y$ strictly between $q_y$ and $p_y$, symmetric in $x$, do\n",[116,37600,37601],{"class":2116,"line":2164},[116,37602,37603],{},"  if the crossing cell, or the pair it falls between, is wall then return false\n",[116,37605,37606],{"class":2116,"line":25556},[116,37607,37608],{},"return true\n",[246,37610],{"hash":37611},"e1503e83de729ccd3d8d06757e8f42d60f4d5844693a5405d0746ae87da2dc1b",[73,37613,37614],{},"The server runs this test from every player against every cell it might\nreveal, then sends each client the visible region merged with the walls\nthat player has already discovered. Because the visible set is a\nfunction of position, it is recomputed the moment a player moves: the\nold vantage's sightlines no longer hold, gold that was occluded may come\ninto view, and cells that were open may fall behind a corner. Recomputing\nper move, rather than caching a fixed field of view, is what lets the\nmap unfold as the player explores and keeps every client's picture of\nthe world honest.",[73,37616,37617],{},"The sightline reduces to a segment-versus-grid intersection — a\ngeometric primitive doing the work of a game mechanic.",[73,37619,2338,37620,19366,37625,1852],{},[76,37621,37624],{"href":37622,"rel":37623},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Falphonso-bradham",[80],"Alphonso Bradham",[76,37626,37629],{"href":37627,"rel":37628},"https:\u002F\u002Fin.linkedin.com\u002Fin\u002Fzimehr-abbasi-aa8865154",[80],"Zimehr Abbasi",[2263,37631,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":37633},[],"2021-06-02","A multiplayer command-line game of nuggets.\nA single server holds the maze, the gold piles, and every player's\nposition; clients connect over sockets,\nsend keystrokes, and receive the slice of the map their character can\ncurrently see. The game ends when the last pile is collected, and the\nplayer with the most gold wins.",{},"\u002Fprojects\u002Fsystems\u002F50-nuggets",[37639],"https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fcomputational-geometry\u002Fgeometric-primitives","https:\u002F\u002Fgithub.com\u002Flostflux\u002Ftse",{"title":37048,"description":37635},"projects\u002Fsystems\u002F50-nuggets","A multiplayer terminal game in C: one server owns the maze and the gold, and\nstreams each player only the sectors their line of sight reveals.",[24660,37645,37646,37647],"Bash","Make","Web Sockets","DpwkJZ74HEYm-d0POsofpmAtK3jLq072Ha2RfFw1OLs",{"id":37650,"title":37651,"body":37652,"date":38382,"description":38383,"extension":483,"featured":484,"meta":38384,"navigation":484,"path":38385,"references":38386,"repo":37640,"seo":38387,"stem":38388,"summary":38389,"tag":21246,"tech":38390,"url":2282,"__hash__":38392},"projects\u002Fprojects\u002Fsystems\u002F50-tse.md","Tiny Search Engine",{"type":70,"value":37653,"toc":38380},[37654,37697,37700,37711,37766,37784,37885,37899,38253,38378],[73,37655,5131,37656,37661,37662,37665,37666,12917,37669,5452,37672,37675,37676,37679,37680,20050,37683,20050,37686,20050,37689,37692,37693,37696],{},[76,37657,37660],{"href":37658,"rel":37659},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FWeb_search_engine",[80],"search engine","\nwritten in plain C: three small programs — a crawler, an indexer, and a\nquerier — connected by nothing but files on disk. Each one does a single\njob, validates its inputs defensively, and writes an artifact the next\nstage reads. They share two libraries: a ",[108,37663,37664],{},"common"," module (",[108,37667,37668],{},"index",[108,37670,37671],{},"pagedir",[108,37673,37674],{},"word",") and ",[108,37677,37678],{},"libcs50",", which supplies the generic containers\nthe pipeline is built on: a ",[108,37681,37682],{},"bag",[108,37684,37685],{},"hashtable",[108,37687,37688],{},"set",[108,37690,37691],{},"counters","\nset, and a ",[108,37694,37695],{},"webpage"," fetcher.",[246,37698],{"hash":37699},"953fed679b0babf5419751e905d32a4169275c2898a6d9b06b0bc3fd6d3a9c3d",[73,37701,37702,37703,37706,37707,37710],{},"Crawling the web is graph traversal: the web is a directed graph whose\nvertices are pages and whose edges are links, and the crawler runs\nbreadth-first search over it from a seed URL, bounded by a maximum depth\nand restricted to a configurable domain, so the crawl stays inside its\nassigned subset of the web. The frontier is a ",[108,37704,37705],{},"bag_t"," of pages still to\nvisit and the seen-set a ",[108,37708,37709],{},"hashtable_t"," of URLs already queued:",[2107,37712,37714],{"className":2109,"code":37713,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Crawl}(s, k)$ — BFS over the web graph\ninput: a seed URL $s$, a depth bound $k$\nbag $\\gets$ queue containing $(seed, 0)$; seen $\\gets$ hashtable containing seed\nwhile bag is not empty do\n  $(url, d) \\gets$ remove from bag\n  fetch $url$; save the page to disk\n  if $d \u003C k$ then\n    for each link $u$ on the page, normalized, do\n      if $u$ is internal and $u \\notin$ seen then\n        insert $u$ into seen; add $(u, d + 1)$ to bag\n",[108,37715,37716,37721,37726,37731,37736,37741,37746,37751,37756,37761],{"__ignoreMap":478},[116,37717,37718],{"class":2116,"line":2117},[116,37719,37720],{},"caption: $\\textsc{Crawl}(s, k)$ — BFS over the web graph\n",[116,37722,37723],{"class":2116,"line":479},[116,37724,37725],{},"input: a seed URL $s$, a depth bound $k$\n",[116,37727,37728],{"class":2116,"line":2128},[116,37729,37730],{},"bag $\\gets$ queue containing $(seed, 0)$; seen $\\gets$ hashtable containing seed\n",[116,37732,37733],{"class":2116,"line":2134},[116,37734,37735],{},"while bag is not empty do\n",[116,37737,37738],{"class":2116,"line":2140},[116,37739,37740],{},"  $(url, d) \\gets$ remove from bag\n",[116,37742,37743],{"class":2116,"line":2146},[116,37744,37745],{},"  fetch $url$; save the page to disk\n",[116,37747,37748],{"class":2116,"line":2152},[116,37749,37750],{},"  if $d \u003C k$ then\n",[116,37752,37753],{"class":2116,"line":2158},[116,37754,37755],{},"    for each link $u$ on the page, normalized, do\n",[116,37757,37758],{"class":2116,"line":2164},[116,37759,37760],{},"      if $u$ is internal and $u \\notin$ seen then\n",[116,37762,37763],{"class":2116,"line":25556},[116,37764,37765],{},"        insert $u$ into seen; add $(u, d + 1)$ to bag\n",[73,37767,37768,37771,37772,37775,37776,37779,37780,37783],{},[108,37769,37770],{},"pageScan"," pulls the links off each fetched page, normalizes them, and\nadds the internal, unseen ones to the bag. ",[108,37773,37774],{},"pagedir_save"," writes every\nfetched page to a file named by an integer document ID (URL on the first\nline, crawl depth on the second, raw HTML below) inside a directory\n",[108,37777,37778],{},"pagedir_init"," stamps with a ",[108,37781,37782],{},".crawler"," sentinel so the later stages can\nconfirm they were handed a real crawl.",[73,37785,37786,37787,37790,37791,20050,37794,37796,37797,37800,37801,2911,37848,37851,37852,37855,37856,37859,37860,37884],{},"The indexer inverts those pages into a map. It walks that directory and,\nfor each word ",[108,37788,37789],{},"normalizeWord"," lowercases out of a page, updates an\n",[108,37792,37793],{},"index_t",[108,37795,37709],{}," mapping each word to a ",[108,37798,37799],{},"counters_t"," that\ntallies ",[116,37802,37804],{"className":37803},[119],[116,37805,37807,37833],{"className":37806,"ariaHidden":124},[123],[116,37808,37810,37813,37816,37824,37827,37830],{"className":37809},[128],[116,37811],{"className":37812,"style":552},[132],[116,37814,562],{"className":37815},[561],[116,37817,37819],{"className":37818},[137],[116,37820,37823],{"className":37821},[137,37822],"mathit","docID",[116,37825],{"className":37826,"style":145},[144],[116,37828,13552],{"className":37829},[149],[116,37831],{"className":37832,"style":145},[144],[116,37834,37836,37839,37845],{"className":37835},[128],[116,37837],{"className":37838,"style":552},[132],[116,37840,37842],{"className":37841},[137],[116,37843,10018],{"className":37844},[137,37822],[116,37846,652],{"className":37847},[651],[108,37849,37850],{},"index_print"," serializes it\nto a plain text file, one word per line followed by its ",[108,37853,37854],{},"docID count","\npairs; ",[108,37857,37858],{},"index_load"," reconstructs the same structure, so the querier reads\nback exactly what the indexer wrote. Looking up a query term is ",[116,37861,37863],{"className":37862},[119],[116,37864,37866],{"className":37865,"ariaHidden":124},[123],[116,37867,37869,37872,37875,37878,37881],{"className":37868},[128],[116,37870],{"className":37871,"style":552},[132],[116,37873,29069],{"className":37874,"style":205},[137,138],[116,37876,562],{"className":37877},[561],[116,37879,345],{"className":37880},[137],[116,37882,652],{"className":37883},[651]," per\nword rather than a scan over every document.",[73,37886,37887,37888,37891,37892,37895,37896,37898],{},"The querier answers ranked boolean queries. It parses them with implicit\n",[108,37889,37890],{},"and"," conjunctions and explicit ",[108,37893,37894],{},"or"," disjunctions, honoring precedence\n(",[108,37897,37890],{}," binds tighter). Scores follow the operators: a conjunction takes\nthe minimum over its terms, a disjunction the sum,",[116,37900,37902],{"className":37901},[702],[116,37903,37905],{"className":37904},[119],[116,37906,37908,37957,38131,38195],{"className":37907,"ariaHidden":124},[123],[116,37909,37911,37914,37920,37923,37926,37933,37936,37939,37942,37945,37948,37951,37954],{"className":37910},[128],[116,37912],{"className":37913,"style":552},[132],[116,37915,37917],{"className":37916},[1126],[116,37918,19557],{"className":37919},[137,3388],[116,37921,562],{"className":37922},[561],[116,37924,977],{"className":37925},[137,138],[116,37927,37929],{"className":37928},[137,431],[116,37930,37932],{"className":37931},[137]," and ",[116,37934,13228],{"className":37935,"style":13227},[137,138],[116,37937,594],{"className":37938},[593],[116,37940],{"className":37941,"style":279},[144],[116,37943,5288],{"className":37944},[137,138],[116,37946,652],{"className":37947},[651],[116,37949],{"className":37950,"style":145},[144],[116,37952,150],{"className":37953},[149],[116,37955],{"className":37956,"style":145},[144],[116,37958,37960,37963,37969,37972,38012,38015,38018,38021,38024,38027,38030,38070,38073,38076,38079,38082,38085,38088,38094,38097,38100,38107,38110,38113,38116,38119,38122,38125,38128],{"className":37959},[128],[116,37961],{"className":37962,"style":552},[132],[116,37964,37966],{"className":37965},[1126],[116,37967,3389],{"className":37968},[137,3388],[116,37970,562],{"className":37971},[561],[116,37973,37975,37978],{"className":37974},[137],[116,37976,8916],{"className":37977},[137,138],[116,37979,37981],{"className":37980},[725],[116,37982,37984,38004],{"className":37983},[168,169],[116,37985,37987,38001],{"className":37986},[173],[116,37988,37990],{"className":37989,"style":13247},[177],[116,37991,37992,37995],{"style":3584},[116,37993],{"className":37994,"style":742},[187],[116,37996,37998],{"className":37997},[746,747,748,749],[116,37999,977],{"className":38000},[137,138,749],[116,38002,234],{"className":38003},[233],[116,38005,38007],{"className":38006},[173],[116,38008,38010],{"className":38009,"style":762},[177],[116,38011],{},[116,38013,562],{"className":38014},[561],[116,38016,5288],{"className":38017},[137,138],[116,38019,652],{"className":38020},[651],[116,38022,594],{"className":38023},[593],[116,38025],{"className":38026,"style":279},[144],[116,38028],{"className":38029,"style":279},[144],[116,38031,38033,38036],{"className":38032},[137],[116,38034,8916],{"className":38035},[137,138],[116,38037,38039],{"className":38038},[725],[116,38040,38042,38062],{"className":38041},[168,169],[116,38043,38045,38059],{"className":38044},[173],[116,38046,38048],{"className":38047,"style":13247},[177],[116,38049,38050,38053],{"style":3584},[116,38051],{"className":38052,"style":742},[187],[116,38054,38056],{"className":38055},[746,747,748,749],[116,38057,13228],{"className":38058,"style":13227},[137,138,749],[116,38060,234],{"className":38061},[233],[116,38063,38065],{"className":38064},[173],[116,38066,38068],{"className":38067,"style":762},[177],[116,38069],{},[116,38071,562],{"className":38072},[561],[116,38074,5288],{"className":38075},[137,138],[116,38077,8262],{"className":38078},[651],[116,38080,594],{"className":38081},[593],[116,38083],{"className":38084,"style":4159},[144],[116,38086],{"className":38087,"style":279},[144],[116,38089,38091],{"className":38090},[1126],[116,38092,19557],{"className":38093},[137,3388],[116,38095,562],{"className":38096},[561],[116,38098,977],{"className":38099},[137,138],[116,38101,38103],{"className":38102},[137,431],[116,38104,38106],{"className":38105},[137]," or ",[116,38108,13228],{"className":38109,"style":13227},[137,138],[116,38111,594],{"className":38112},[593],[116,38114],{"className":38115,"style":279},[144],[116,38117,5288],{"className":38118},[137,138],[116,38120,652],{"className":38121},[651],[116,38123],{"className":38124,"style":145},[144],[116,38126,150],{"className":38127},[149],[116,38129],{"className":38130,"style":145},[144],[116,38132,38134,38137,38177,38180,38183,38186,38189,38192],{"className":38133},[128],[116,38135],{"className":38136,"style":552},[132],[116,38138,38140,38143],{"className":38139},[137],[116,38141,8916],{"className":38142},[137,138],[116,38144,38146],{"className":38145},[725],[116,38147,38149,38169],{"className":38148},[168,169],[116,38150,38152,38166],{"className":38151},[173],[116,38153,38155],{"className":38154,"style":13247},[177],[116,38156,38157,38160],{"style":3584},[116,38158],{"className":38159,"style":742},[187],[116,38161,38163],{"className":38162},[746,747,748,749],[116,38164,977],{"className":38165},[137,138,749],[116,38167,234],{"className":38168},[233],[116,38170,38172],{"className":38171},[173],[116,38173,38175],{"className":38174,"style":762},[177],[116,38176],{},[116,38178,562],{"className":38179},[561],[116,38181,5288],{"className":38182},[137,138],[116,38184,652],{"className":38185},[651],[116,38187],{"className":38188,"style":570},[144],[116,38190,575],{"className":38191},[574],[116,38193],{"className":38194,"style":570},[144],[116,38196,38198,38201,38241,38244,38247,38250],{"className":38197},[128],[116,38199],{"className":38200,"style":552},[132],[116,38202,38204,38207],{"className":38203},[137],[116,38205,8916],{"className":38206},[137,138],[116,38208,38210],{"className":38209},[725],[116,38211,38213,38233],{"className":38212},[168,169],[116,38214,38216,38230],{"className":38215},[173],[116,38217,38219],{"className":38218,"style":13247},[177],[116,38220,38221,38224],{"style":3584},[116,38222],{"className":38223,"style":742},[187],[116,38225,38227],{"className":38226},[746,747,748,749],[116,38228,13228],{"className":38229,"style":13227},[137,138,749],[116,38231,234],{"className":38232},[233],[116,38234,38236],{"className":38235},[173],[116,38237,38239],{"className":38238,"style":762},[177],[116,38240],{},[116,38242,562],{"className":38243},[561],[116,38245,5288],{"className":38246},[137,138],[116,38248,652],{"className":38249},[651],[116,38251,594],{"className":38252},[593],[73,38254,2532,38255,38316,38317,38332,38333,38348,38349,38351,38352,38355,38356,38359,38360,38363,38364,38367,38368,12861,38371,38374,38375,38377],{},[116,38256,38258],{"className":38257},[119],[116,38259,38261],{"className":38260,"ariaHidden":124},[123],[116,38262,38264,38267,38307,38310,38313],{"className":38263},[128],[116,38265],{"className":38266,"style":552},[132],[116,38268,38270,38273],{"className":38269},[137],[116,38271,8916],{"className":38272},[137,138],[116,38274,38276],{"className":38275},[725],[116,38277,38279,38299],{"className":38278},[168,169],[116,38280,38282,38296],{"className":38281},[173],[116,38283,38285],{"className":38284,"style":735},[177],[116,38286,38287,38290],{"style":3584},[116,38288],{"className":38289,"style":742},[187],[116,38291,38293],{"className":38292},[746,747,748,749],[116,38294,6825],{"className":38295,"style":6824},[137,138,749],[116,38297,234],{"className":38298},[233],[116,38300,38302],{"className":38301},[173],[116,38303,38305],{"className":38304,"style":762},[177],[116,38306],{},[116,38308,562],{"className":38309},[561],[116,38311,5288],{"className":38312},[137,138],[116,38314,652],{"className":38315},[651]," counts occurrences of ",[116,38318,38320],{"className":38319},[119],[116,38321,38323],{"className":38322,"ariaHidden":124},[123],[116,38324,38326,38329],{"className":38325},[128],[116,38327],{"className":38328,"style":133},[132],[116,38330,6825],{"className":38331,"style":6824},[137,138]," in document ",[116,38334,38336],{"className":38335},[119],[116,38337,38339],{"className":38338,"ariaHidden":124},[123],[116,38340,38342,38345],{"className":38341},[128],[116,38343],{"className":38344,"style":4022},[132],[116,38346,5288],{"className":38347},[137,138],". Those two rules\nfall straight out of the ",[108,38350,37691],{}," module: ",[108,38353,38354],{},"query_build"," looks each word\nup in the index, ",[108,38357,38358],{},"query_intersection"," walks two counter sets keeping the\nminimum shared count, and ",[108,38361,38362],{},"query_union"," sums them. ",[108,38365,38366],{},"query_print"," then\nsorts the surviving documents by score before printing. Everything is\nvalgrind-clean C, checked against the ",[108,38369,38370],{},"memcheck",[108,38372,38373],{},"indextest"," harnesses\nin each module, with every container hand-rolled on the shared ",[108,38376,37678],{},"\nprimitives.",[2263,38379,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":38381},[],"2021-05-22","A search engine\nwritten in plain C: three small programs — a crawler, an indexer, and a\nquerier — connected by nothing but files on disk. Each one does a single\njob, validates its inputs defensively, and writes an artifact the next\nstage reads. They share two libraries: a common module (index,\npagedir, word) and libcs50, which supplies the generic containers\nthe pipeline is built on: a bag, a hashtable, a set, a counters\nset, and a webpage fetcher.",{},"\u002Fprojects\u002Fsystems\u002F50-tse",[13716,13717],{"title":37651,"description":38383},"projects\u002Fsystems\u002F50-tse","A search engine in plain C — a crawler, an indexer, and a querier connected\nby files on disk, with ranked results and boolean query operators.",[24660,37645,37646,38391],"Web Crawling","AYJLpV8_HLPjh0ZN2ZwTPVQTHNxyomfqjVIPyWq3d8c",{"id":38394,"title":38395,"body":38396,"date":38485,"description":38400,"extension":483,"featured":2354,"meta":38486,"navigation":484,"path":38487,"references":38488,"repo":38489,"seo":38490,"stem":38491,"summary":38492,"tag":38493,"tech":38494,"url":2282,"__hash__":38496},"projects\u002Fprojects\u002Ftrivial\u002F50-modules.md","Data Structures",{"type":70,"value":38397,"toc":38483},[38398,38401,38428],[73,38399,38400],{},"Four reusable container modules in C, each an opaque type behind a small\nallocate \u002F insert \u002F find \u002F iterate \u002F free interface.",[73,38402,5131,38403,38407,38408,38411,38412,38415,38416,38419,38420,38423,38424,38427],{},[76,38404,37682],{"href":38405,"rel":38406},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSet_(abstract_data_type)",[80]," is an unordered collection of ",[108,38409,38410],{},"void*"," items,\nimplemented as a singly linked list used as a stack: ",[108,38413,38414],{},"bag_insert"," pushes\nonto the head and ",[108,38417,38418],{},"bag_extract"," pops any item back off. A counter set\ntrades items for tallies, so ",[108,38421,38422],{},"counters_add",", keyed on an ",[108,38425,38426],{},"int",", either\nstarts a new count at one or increments an existing one over the same\nlinked-list backing.",[73,38429,5131,38430,38433,38434,38437,38438,38441,38442,38446,38447,38450,38451,12861,38454,38457,38458,38482],{},[76,38431,37688],{"href":38405,"rel":38432},[80]," stores ",[108,38435,38436],{},"(char* key, void* item)"," pairs in a linked\nlist, copying each key string and rejecting duplicates, with ",[108,38439,38440],{},"set_find","\nreturning an item by key. A ",[76,38443,37685],{"href":38444,"rel":38445},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHash_table",[80]," presents that same\ninterface but scales it, holding an array of ",[108,38448,38449],{},"num_slots"," sets and routing\neach key through Bob Jenkins' one-at-a-time hash to a slot, so\n",[108,38452,38453],{},"hashtable_insert",[108,38455,38456],{},"hashtable_find"," delegate to a short per-slot set.\nChaining collisions inside those sets turns the set's linear scan into an\nexpected ",[116,38459,38461],{"className":38460},[119],[116,38462,38464],{"className":38463,"ariaHidden":124},[123],[116,38465,38467,38470,38473,38476,38479],{"className":38466},[128],[116,38468],{"className":38469,"style":552},[132],[116,38471,29069],{"className":38472,"style":205},[137,138],[116,38474,562],{"className":38475},[561],[116,38477,345],{"className":38478},[137],[116,38480,652],{"className":38481},[651]," lookup.",{"title":478,"searchDepth":479,"depth":479,"links":38484},[],"2021-05-13",{},"\u002Fprojects\u002Ftrivial\u002F50-modules",[13717],"https:\u002F\u002Fgithub.com\u002Fsiavava\u002FCS50.3",{"title":38395,"description":38400},"projects\u002Ftrivial\u002F50-modules","Four reusable C modules — a bag, a counter set, a set, and a hashtable —\nwhere the hashtable is an array of sets that chains collisions for expected\nconstant-time lookup.","data structures and algorithms",[37645,24660,38495,38395],"Linux","8r11t4tO19pKwmRSiYRu-XdoydwNv-CZ5bN_tTJpk0E",{"id":38498,"title":38499,"body":38500,"date":38865,"description":38504,"extension":483,"featured":2354,"meta":38866,"navigation":484,"path":38867,"references":2282,"repo":38868,"seo":38869,"stem":38870,"summary":38871,"tag":21246,"tech":38872,"url":2282,"__hash__":38873},"projects\u002Fprojects\u002Ftrivial\u002F50-chill.md","Command-Line Utilities",{"type":70,"value":38501,"toc":38863},[38502,38505,38549,38772,38849],[73,38503,38504],{},"Three small command-line utilities written in C, each reading input and\nwriting to standard output in the Unix filter style.",[73,38506,38507,38510,38511,38516,38517,38532,38533,38548],{},[108,38508,38509],{},"chill"," computes the ",[76,38512,38515],{"href":38513,"rel":38514},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FWind_chill",[80],"wind chill"," from an air temperature ",[116,38518,38520],{"className":38519},[119],[116,38521,38523],{"className":38522,"ariaHidden":124},[123],[116,38524,38526,38529],{"className":38525},[128],[116,38527],{"className":38528,"style":272},[132],[116,38530,17096],{"className":38531,"style":924},[137,138],"\n(°F) and a wind speed ",[116,38534,38536],{"className":38535},[119],[116,38537,38539],{"className":38538,"ariaHidden":124},[123],[116,38540,38542,38545],{"className":38541},[128],[116,38543],{"className":38544,"style":133},[132],[116,38546,140],{"className":38547,"style":139},[137,138]," (mph), using the US National Weather Service\nformula:",[116,38550,38552],{"className":38551},[702],[116,38553,38555],{"className":38554},[119],[116,38556,38558,38619,38638,38663,38718],{"className":38557,"ariaHidden":124},[123],[116,38559,38561,38564,38610,38613,38616],{"className":38560},[128],[116,38562],{"className":38563,"style":715},[132],[116,38565,38567,38570],{"className":38566},[137],[116,38568,17096],{"className":38569,"style":924},[137,138],[116,38571,38573],{"className":38572},[725],[116,38574,38576,38602],{"className":38575},[168,169],[116,38577,38579,38599],{"className":38578},[173],[116,38580,38582],{"className":38581,"style":735},[177],[116,38583,38584,38587],{"style":3148},[116,38585],{"className":38586,"style":742},[187],[116,38588,38590],{"className":38589},[746,747,748,749],[116,38591,38593,38596],{"className":38592},[137,749],[116,38594,6825],{"className":38595,"style":6824},[137,138,749],[116,38597,8916],{"className":38598},[137,138,749],[116,38600,234],{"className":38601},[233],[116,38603,38605],{"className":38604},[173],[116,38606,38608],{"className":38607,"style":762},[177],[116,38609],{},[116,38611],{"className":38612,"style":145},[144],[116,38614,150],{"className":38615},[149],[116,38617],{"className":38618,"style":145},[144],[116,38620,38622,38625,38629,38632,38635],{"className":38621},[128],[116,38623],{"className":38624,"style":1871},[132],[116,38626,38628],{"className":38627},[137],"35.74",[116,38630],{"className":38631,"style":570},[144],[116,38633,575],{"className":38634},[574],[116,38636],{"className":38637,"style":570},[144],[116,38639,38641,38644,38648,38651,38654,38657,38660],{"className":38640},[128],[116,38642],{"className":38643,"style":423},[132],[116,38645,38647],{"className":38646},[137],"0.6215",[116,38649],{"className":38650,"style":279},[144],[116,38652,17096],{"className":38653,"style":924},[137,138],[116,38655],{"className":38656,"style":570},[144],[116,38658,1610],{"className":38659},[574],[116,38661],{"className":38662,"style":570},[144],[116,38664,38666,38669,38673,38676,38709,38712,38715],{"className":38665},[128],[116,38667],{"className":38668,"style":27420},[132],[116,38670,38672],{"className":38671},[137],"35.75",[116,38674],{"className":38675,"style":279},[144],[116,38677,38679,38682],{"className":38678},[137],[116,38680,140],{"className":38681,"style":139},[137,138],[116,38683,38685],{"className":38684},[725],[116,38686,38688],{"className":38687},[168],[116,38689,38691],{"className":38690},[173],[116,38692,38694],{"className":38693,"style":21657},[177],[116,38695,38696,38699],{"style":2488},[116,38697],{"className":38698,"style":742},[187],[116,38700,38702],{"className":38701},[746,747,748,749],[116,38703,38705],{"className":38704},[137,749],[116,38706,38708],{"className":38707},[137,749],"0.16",[116,38710],{"className":38711,"style":570},[144],[116,38713,575],{"className":38714},[574],[116,38716],{"className":38717,"style":570},[144],[116,38719,38721,38724,38728,38731,38734,38737,38769],{"className":38720},[128],[116,38722],{"className":38723,"style":21657},[132],[116,38725,38727],{"className":38726},[137],"0.4275",[116,38729],{"className":38730,"style":279},[144],[116,38732,17096],{"className":38733,"style":924},[137,138],[116,38735],{"className":38736,"style":279},[144],[116,38738,38740,38743],{"className":38739},[137],[116,38741,140],{"className":38742,"style":139},[137,138],[116,38744,38746],{"className":38745},[725],[116,38747,38749],{"className":38748},[168],[116,38750,38752],{"className":38751},[173],[116,38753,38755],{"className":38754,"style":21657},[177],[116,38756,38757,38760],{"style":2488},[116,38758],{"className":38759,"style":742},[187],[116,38761,38763],{"className":38762},[746,747,748,749],[116,38764,38766],{"className":38765},[137,749],[116,38767,38708],{"className":38768},[137,749],[116,38770,1852],{"className":38771},[137],[73,38773,38774,38777,38778,38781,38782,15209,38800,38816,38817,15209,38832,38848],{},[108,38775,38776],{},"computeChill"," returns the value and ",[108,38779,38780],{},"printTable"," formats the output:\nwith no arguments the program sweeps a table over temperatures from\n",[116,38783,38785],{"className":38784},[119],[116,38786,38788],{"className":38787,"ariaHidden":124},[123],[116,38789,38791,38794,38797],{"className":38790},[128],[116,38792],{"className":38793,"style":1871},[132],[116,38795,1610],{"className":38796},[137],[116,38798,20846],{"className":38799},[137],[116,38801,38803],{"className":38802},[119],[116,38804,38806],{"className":38805,"ariaHidden":124},[123],[116,38807,38809,38812],{"className":38808},[128],[116,38810],{"className":38811,"style":1890},[132],[116,38813,38815],{"className":38814},[137],"40"," °F and winds from ",[116,38818,38820],{"className":38819},[119],[116,38821,38823],{"className":38822,"ariaHidden":124},[123],[116,38824,38826,38829],{"className":38825},[128],[116,38827],{"className":38828,"style":1890},[132],[116,38830,6169],{"className":38831},[137],[116,38833,38835],{"className":38834},[119],[116,38836,38838],{"className":38837,"ariaHidden":124},[123],[116,38839,38841,38844],{"className":38840},[128],[116,38842],{"className":38843,"style":1890},[132],[116,38845,38847],{"className":38846},[137],"15"," mph; given a temperature it\nvaries wind alone, and given both it prints the single value.",[73,38850,38851,38854,38855,38858,38859,38862],{},[108,38852,38853],{},"words"," prints the words in a file one per line, reading from a named file\nor from standard input, scanning character by character with ",[108,38856,38857],{},"isalpha"," and\nemitting each run of letters as a line. ",[108,38860,38861],{},"histo"," reads a stream of integers\nfrom standard input into sixteen fixed bins; when a value overflows the\ncurrent range the bin width doubles and the existing counts are merged, so\nthe histogram rescales itself to fit the data.",{"title":478,"searchDepth":479,"depth":479,"links":38864},[],"2021-04-25",{},"\u002Fprojects\u002Ftrivial\u002F50-chill","https:\u002F\u002Fgithub.com\u002Fsiavava\u002FCS50.2",{"title":38499,"description":38504},"projects\u002Ftrivial\u002F50-chill","Three small command-line utilities in C: a wind-chill calculator, a word\nprinter, and a self-resizing histogram builder for streamed numbers.",[37645,24660,38495],"nUPjcYouvFTTbegVyJYK1jMDfDKW7gela2QQMjcIz8I",{"id":38875,"title":38876,"body":38877,"date":38942,"description":38943,"extension":483,"featured":2354,"meta":38944,"navigation":484,"path":38945,"references":2282,"repo":38946,"seo":38947,"stem":38948,"summary":38949,"tag":21246,"tech":38950,"url":2282,"__hash__":38952},"projects\u002Fprojects\u002Ftrivial\u002F50-bash.md","Bash Scripting",{"type":70,"value":38878,"toc":38940},[38879,38886,38911],[73,38880,38881,38882,38885],{},"A set of shell scripts that wrangle a US COVID-19 vaccine dataset,\n",[108,38883,38884],{},"vaccine_data_us.csv",", from the command line. Each treats the file as a\nstream of comma-separated lines and composes standard Unix filters\nthrough pipes.",[73,38887,38888,38891,38892,38895,38896,12861,38899,38902,38903,38906,38907,38910],{},[108,38889,38890],{},"top10.sh"," builds a Markdown table of the ten states with the most doses\nadministered. It keeps the ",[108,38893,38894],{},"All","-vaccine-type rows, projects the\n",[108,38897,38898],{},"Province_State",[108,38900,38901],{},"Doses_admin"," columns with ",[108,38904,38905],{},"cut -d ,",", sorts them\nnumerically in descending order, and takes the first ten\n(",[108,38908,38909],{},"sed -n '\u002FAll\u002Fp' | cut -d , -f2,10 | sort -t ',' -k 2 -nr | head -n 10","),\nthen wraps each field in pipe characters to form the table rows.",[73,38912,38913,38916,38917,5452,38920,21277,38923,38926,38927,38934,38935,38939],{},[108,38914,38915],{},"summarize.sh"," is a small documentation tool that emits each ",[108,38918,38919],{},".sh",[108,38921,38922],{},".c",[108,38924,38925],{},".h"," file it is given inside a fenced Markdown code block. It uses\n",[76,38928,38931],{"href":38929,"rel":38930},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSed",[80],[108,38932,38933],{},"sed"," to strip the shebang and the leading header comment, and\nselects the language by a ",[76,38936,38938],{"href":12411,"rel":38937},[80],"regular expression"," match on\nthe file extension. Between them the two scripts cover involved reporting\ntasks without a single hand-written loop over the data.",{"title":478,"searchDepth":479,"depth":479,"links":38941},[],"2021-04-05","A set of shell scripts that wrangle a US COVID-19 vaccine dataset,\nvaccine_data_us.csv, from the command line. Each treats the file as a\nstream of comma-separated lines and composes standard Unix filters\nthrough pipes.",{},"\u002Fprojects\u002Ftrivial\u002F50-bash","https:\u002F\u002Fgithub.com\u002Fsiavava\u002Fbash",{"title":38876,"description":38943},"projects\u002Ftrivial\u002F50-bash","Shell scripts over a US COVID-19 vaccine dataset: a Markdown report of the\nstates with the most doses, and a source-file summarizer, built from Unix\nfilter pipelines.",[37645,38951],"Regex","GFpEfOaF0dNwp-B7DursNLq6zqPWqOwdBmxE1drMv7Q",{"id":38954,"title":38955,"body":38956,"date":41425,"description":41426,"extension":483,"featured":484,"meta":41427,"navigation":484,"path":41428,"references":41429,"repo":41430,"seo":41431,"stem":41432,"summary":41433,"tag":14942,"tech":41434,"url":41436,"__hash__":41437},"projects\u002Fprojects\u002Fdeep-learning\u002Fneural-jl.md","Data-Driven Behavior Change",{"type":70,"value":38957,"toc":41423},[38958,38964,38970,38973,38976,38994,38997,39008,39047,39274,39299,39302,39854,40069,40072,40346,40400,40794,41255,41261,41264],[73,38959,38960,38961,38963],{},"Written solo for the Dartmouth Undergraduate Journal of Science,\n",[442,38962,38955],{}," runs in two movements: a survey of where machine\nlearning came from and what it touches, and a construction — a neural network\nimplemented from nothing in Julia, its calculus derived by hand, its behavior\nprobed by experiment.",[73,38965,38966,38969],{},[505,38967,38968],{},"The lineage."," The field's prehistory is mathematical logic discovering its\nown limits: Gödel's incompleteness results and Turing's halting problem fixed\nthe boundary of the mechanizable, and the question became what lay inside it.",[246,38971],{"hash":38972},"300893a671dcbab36562f7edcb8eb8bd3ecc9639a4d53d6403a9e631694a570c",[73,38974,38975],{},"The named discipline is a Dartmouth product — the 1956 summer workshop where\nMcCarthy coined the term — but the survey reads the arc through its proofs of\nconcept: Samuel's checkers player learning from self-play, Rosenblatt's\nperceptrons, Tesauro's temporal-difference backgammon, Deep Blue taking\nKasparov on search, AlphaGo taking Lee Sedol on learned evaluation. Each is\none thesis restated: behavior can be acquired from data rather than authored.",[73,38977,38978,38981,38982,38985,38986,38989,38990,38993],{},[505,38979,38980],{},"The taxonomy."," Learning problems factor by what supervises them.\n",[505,38983,38984],{},"Supervised"," methods fit labeled pairs — regression against housing prices\nas the canonical case. ",[505,38987,38988],{},"Unsupervised"," methods find structure with no labels\nat all — clustering chief among them. ",[505,38991,38992],{},"Reinforcement"," learning removes even\nthe dataset: an agent acts, the environment returns state and reward, and the\npolicy is whatever survives the feedback.",[246,38995],{"hash":38996},"72ef37d08e7d15ac13b63aec0976bbb7535a92422042ccb15fe263a0bc719de3",[73,38998,38999,39000,39003,39004,39007],{},"The survey walks the taxonomy through industry — diagnostic imaging reaching\nphysician parity on cell classification, machine translation spanning a\nhundred nine languages, recommenders learning continuously from the behavior\nthey shape — and through its failure modes, which are statistical before they\nare social: a model too rigid carries ",[505,39001,39002],{},"bias"," and misses the signal; one too\nflexible carries ",[505,39005,39006],{},"variance"," and memorizes the noise; and a model trained on\na skewed world reproduces it, as when advertising delivery routed a teaching\nposition to an audience ninety-four percent female and a trucking position to\none eighty-seven percent male, under no targeting instruction at all.",[73,39009,39010,39013,39014,39017,39018,39021,39022,39024,39025,39027,39028,39030,39031,39033,39034,2911,39037,39040,39041,39043,39044,39046],{},[505,39011,39012],{},"The construction."," The second movement builds the machine. The code is a\nsmall ",[108,39015,39016],{},"Neural"," module whose ",[108,39019,39020],{},"Network"," is a mutable struct of four arrays —\nactivations ",[108,39023,76],{},", weights ",[108,39026,925],{},", biases ",[108,39029,4115],{},", and a scalar step size ",[108,39032,17825],{}," — plus\nthe last ",[108,39035,39036],{},"result",[108,39038,39039],{},"setup(input_size, hidden_sizes, output_size)"," seeds each\n",[108,39042,925],{}," from a normal and each ",[108,39045,4115],{}," at zero. Each layer applies an affine map\nfollowed by a nonlinearity,",[116,39048,39050],{"className":39049},[702],[116,39051,39053],{"className":39052},[119],[116,39054,39056,39111,39221],{"className":39055,"ariaHidden":124},[123],[116,39057,39059,39062,39102,39105,39108],{"className":39058},[128],[116,39060],{"className":39061,"style":18630},[132],[116,39063,39065,39068],{"className":39064},[137],[116,39066,76],{"className":39067},[137,138],[116,39069,39071],{"className":39070},[725],[116,39072,39074],{"className":39073},[168],[116,39075,39077],{"className":39076},[173],[116,39078,39080],{"className":39079,"style":18630},[177],[116,39081,39082,39085],{"style":2488},[116,39083],{"className":39084,"style":742},[187],[116,39086,39088],{"className":39087},[746,747,748,749],[116,39089,39091,39094,39099],{"className":39090},[137,749],[116,39092,562],{"className":39093},[561,749],[116,39095,39098],{"className":39096,"style":39097},[137,138,749],"margin-right:0.0197em;","l",[116,39100,652],{"className":39101},[651,749],[116,39103],{"className":39104,"style":145},[144],[116,39106,150],{"className":39107},[149],[116,39109],{"className":39110,"style":145},[144],[116,39112,39114,39118,39121,39124,39130,39168,39212,39215,39218],{"className":39113},[128],[116,39115],{"className":39116,"style":39117},[132],"height:1.288em;vertical-align:-0.35em;",[116,39119,7217],{"className":39120,"style":139},[137,138],[116,39122],{"className":39123,"style":5218},[144],[116,39125,39127],{"className":39126},[137],[116,39128,562],{"className":39129},[1091,1002],[116,39131,39133,39136],{"className":39132},[137],[116,39134,925],{"className":39135,"style":924},[137,138],[116,39137,39139],{"className":39138},[725],[116,39140,39142],{"className":39141},[168],[116,39143,39145],{"className":39144},[173],[116,39146,39148],{"className":39147,"style":18630},[177],[116,39149,39150,39153],{"style":2488},[116,39151],{"className":39152,"style":742},[187],[116,39154,39156],{"className":39155},[746,747,748,749],[116,39157,39159,39162,39165],{"className":39158},[137,749],[116,39160,562],{"className":39161},[561,749],[116,39163,39098],{"className":39164,"style":39097},[137,138,749],[116,39166,652],{"className":39167},[651,749],[116,39169,39171,39174],{"className":39170},[137],[116,39172,76],{"className":39173},[137,138],[116,39175,39177],{"className":39176},[725],[116,39178,39180],{"className":39179},[168],[116,39181,39183],{"className":39182},[173],[116,39184,39186],{"className":39185,"style":18630},[177],[116,39187,39188,39191],{"style":2488},[116,39189],{"className":39190,"style":742},[187],[116,39192,39194],{"className":39193},[746,747,748,749],[116,39195,39197,39200,39203,39206,39209],{"className":39196},[137,749],[116,39198,562],{"className":39199},[561,749],[116,39201,39098],{"className":39202,"style":39097},[137,138,749],[116,39204,1610],{"className":39205},[574,749],[116,39207,345],{"className":39208},[137,749],[116,39210,652],{"className":39211},[651,749],[116,39213],{"className":39214,"style":570},[144],[116,39216,575],{"className":39217},[574],[116,39219],{"className":39220,"style":570},[144],[116,39222,39224,39227,39265,39271],{"className":39223},[128],[116,39225],{"className":39226,"style":39117},[132],[116,39228,39230,39233],{"className":39229},[137],[116,39231,4115],{"className":39232},[137,138],[116,39234,39236],{"className":39235},[725],[116,39237,39239],{"className":39238},[168],[116,39240,39242],{"className":39241},[173],[116,39243,39245],{"className":39244,"style":18630},[177],[116,39246,39247,39250],{"style":2488},[116,39248],{"className":39249,"style":742},[187],[116,39251,39253],{"className":39252},[746,747,748,749],[116,39254,39256,39259,39262],{"className":39255},[137,749],[116,39257,562],{"className":39258},[561,749],[116,39260,39098],{"className":39261,"style":39097},[137,138,749],[116,39263,652],{"className":39264},[651,749],[116,39266,39268],{"className":39267},[137],[116,39269,652],{"className":39270},[1091,1002],[116,39272,594],{"className":39273},[593],[73,39275,14913,39276,39279,39280,39295,39296,39298],{},[108,39277,39278],{},"forward!"," chains them from input to output. The activation ",[116,39281,39283],{"className":39282},[119],[116,39284,39286],{"className":39285,"ariaHidden":124},[123],[116,39287,39289,39292],{"className":39288},[128],[116,39290],{"className":39291,"style":133},[132],[116,39293,7217],{"className":39294,"style":139},[137,138]," is\nthe logistic sigmoid at ",[442,39297,15212],{}," layer, output included — there is no separate\nsoftmax or linear head — so training reduces to a delta rule on the squared\nerror rather than a cross-entropy objective.",[246,39300],{"hash":39301},"d9fb0a31d888c0cc3b6c4a680a5985c9a32aca06fba7a9f4c13e56b476e56901",[73,39303,39304,39305,39320,39321,39522,39523,39635,39636,39686,39687,39737,39738,39853],{},"Backpropagation is the chain rule applied layer by layer. Write the\npre-activation of layer ",[116,39306,39308],{"className":39307},[119],[116,39309,39311],{"className":39310,"ariaHidden":124},[123],[116,39312,39314,39317],{"className":39313},[128],[116,39315],{"className":39316,"style":4022},[132],[116,39318,39098],{"className":39319,"style":39097},[137,138]," as ",[116,39322,39324],{"className":39323},[119],[116,39325,39327,39380,39478],{"className":39326,"ariaHidden":124},[123],[116,39328,39330,39333,39371,39374,39377],{"className":39329},[128],[116,39331],{"className":39332,"style":36435},[132],[116,39334,39336,39339],{"className":39335},[137],[116,39337,4166],{"className":39338,"style":4559},[137,138],[116,39340,39342],{"className":39341},[725],[116,39343,39345],{"className":39344},[168],[116,39346,39348],{"className":39347},[173],[116,39349,39351],{"className":39350,"style":36435},[177],[116,39352,39353,39356],{"style":1167},[116,39354],{"className":39355,"style":742},[187],[116,39357,39359],{"className":39358},[746,747,748,749],[116,39360,39362,39365,39368],{"className":39361},[137,749],[116,39363,562],{"className":39364},[561,749],[116,39366,39098],{"className":39367,"style":39097},[137,138,749],[116,39369,652],{"className":39370},[651,749],[116,39372],{"className":39373,"style":145},[144],[116,39375,150],{"className":39376},[149],[116,39378],{"className":39379,"style":145},[144],[116,39381,39383,39387,39425,39469,39472,39475],{"className":39382},[128],[116,39384],{"className":39385,"style":39386},[132],"height:0.9713em;vertical-align:-0.0833em;",[116,39388,39390,39393],{"className":39389},[137],[116,39391,925],{"className":39392,"style":924},[137,138],[116,39394,39396],{"className":39395},[725],[116,39397,39399],{"className":39398},[168],[116,39400,39402],{"className":39401},[173],[116,39403,39405],{"className":39404,"style":36435},[177],[116,39406,39407,39410],{"style":1167},[116,39408],{"className":39409,"style":742},[187],[116,39411,39413],{"className":39412},[746,747,748,749],[116,39414,39416,39419,39422],{"className":39415},[137,749],[116,39417,562],{"className":39418},[561,749],[116,39420,39098],{"className":39421,"style":39097},[137,138,749],[116,39423,652],{"className":39424},[651,749],[116,39426,39428,39431],{"className":39427},[137],[116,39429,76],{"className":39430},[137,138],[116,39432,39434],{"className":39433},[725],[116,39435,39437],{"className":39436},[168],[116,39438,39440],{"className":39439},[173],[116,39441,39443],{"className":39442,"style":36435},[177],[116,39444,39445,39448],{"style":1167},[116,39446],{"className":39447,"style":742},[187],[116,39449,39451],{"className":39450},[746,747,748,749],[116,39452,39454,39457,39460,39463,39466],{"className":39453},[137,749],[116,39455,562],{"className":39456},[561,749],[116,39458,39098],{"className":39459,"style":39097},[137,138,749],[116,39461,1610],{"className":39462},[574,749],[116,39464,345],{"className":39465},[137,749],[116,39467,652],{"className":39468},[651,749],[116,39470],{"className":39471,"style":570},[144],[116,39473,575],{"className":39474},[574],[116,39476],{"className":39477,"style":570},[144],[116,39479,39481,39484],{"className":39480},[128],[116,39482],{"className":39483,"style":36435},[132],[116,39485,39487,39490],{"className":39486},[137],[116,39488,4115],{"className":39489},[137,138],[116,39491,39493],{"className":39492},[725],[116,39494,39496],{"className":39495},[168],[116,39497,39499],{"className":39498},[173],[116,39500,39502],{"className":39501,"style":36435},[177],[116,39503,39504,39507],{"style":1167},[116,39505],{"className":39506,"style":742},[187],[116,39508,39510],{"className":39509},[746,747,748,749],[116,39511,39513,39516,39519],{"className":39512},[137,749],[116,39514,562],{"className":39515},[561,749],[116,39517,39098],{"className":39518,"style":39097},[137,138,749],[116,39520,652],{"className":39521},[651,749],", so\n",[116,39524,39526],{"className":39525},[119],[116,39527,39529,39582],{"className":39528,"ariaHidden":124},[123],[116,39530,39532,39535,39573,39576,39579],{"className":39531},[128],[116,39533],{"className":39534,"style":36435},[132],[116,39536,39538,39541],{"className":39537},[137],[116,39539,76],{"className":39540},[137,138],[116,39542,39544],{"className":39543},[725],[116,39545,39547],{"className":39546},[168],[116,39548,39550],{"className":39549},[173],[116,39551,39553],{"className":39552,"style":36435},[177],[116,39554,39555,39558],{"style":1167},[116,39556],{"className":39557,"style":742},[187],[116,39559,39561],{"className":39560},[746,747,748,749],[116,39562,39564,39567,39570],{"className":39563},[137,749],[116,39565,562],{"className":39566},[561,749],[116,39568,39098],{"className":39569,"style":39097},[137,138,749],[116,39571,652],{"className":39572},[651,749],[116,39574],{"className":39575,"style":145},[144],[116,39577,150],{"className":39578},[149],[116,39580],{"className":39581,"style":145},[144],[116,39583,39585,39588,39591,39594,39632],{"className":39584},[128],[116,39586],{"className":39587,"style":36410},[132],[116,39589,7217],{"className":39590,"style":139},[137,138],[116,39592,562],{"className":39593},[561],[116,39595,39597,39600],{"className":39596},[137],[116,39598,4166],{"className":39599,"style":4559},[137,138],[116,39601,39603],{"className":39602},[725],[116,39604,39606],{"className":39605},[168],[116,39607,39609],{"className":39608},[173],[116,39610,39612],{"className":39611,"style":36435},[177],[116,39613,39614,39617],{"style":1167},[116,39615],{"className":39616,"style":742},[187],[116,39618,39620],{"className":39619},[746,747,748,749],[116,39621,39623,39626,39629],{"className":39622},[137,749],[116,39624,562],{"className":39625},[561,749],[116,39627,39098],{"className":39628,"style":39097},[137,138,749],[116,39630,652],{"className":39631},[651,749],[116,39633,652],{"className":39634},[651],". The loss reaches ",[116,39637,39639],{"className":39638},[119],[116,39640,39642],{"className":39641,"ariaHidden":124},[123],[116,39643,39645,39648],{"className":39644},[128],[116,39646],{"className":39647,"style":36435},[132],[116,39649,39651,39654],{"className":39650},[137],[116,39652,925],{"className":39653,"style":924},[137,138],[116,39655,39657],{"className":39656},[725],[116,39658,39660],{"className":39659},[168],[116,39661,39663],{"className":39662},[173],[116,39664,39666],{"className":39665,"style":36435},[177],[116,39667,39668,39671],{"style":1167},[116,39669],{"className":39670,"style":742},[187],[116,39672,39674],{"className":39673},[746,747,748,749],[116,39675,39677,39680,39683],{"className":39676},[137,749],[116,39678,562],{"className":39679},[561,749],[116,39681,39098],{"className":39682,"style":39097},[137,138,749],[116,39684,652],{"className":39685},[651,749]," only through\n",[116,39688,39690],{"className":39689},[119],[116,39691,39693],{"className":39692,"ariaHidden":124},[123],[116,39694,39696,39699],{"className":39695},[128],[116,39697],{"className":39698,"style":36435},[132],[116,39700,39702,39705],{"className":39701},[137],[116,39703,4166],{"className":39704,"style":4559},[137,138],[116,39706,39708],{"className":39707},[725],[116,39709,39711],{"className":39710},[168],[116,39712,39714],{"className":39713},[173],[116,39715,39717],{"className":39716,"style":36435},[177],[116,39718,39719,39722],{"style":1167},[116,39720],{"className":39721,"style":742},[187],[116,39723,39725],{"className":39724},[746,747,748,749],[116,39726,39728,39731,39734],{"className":39727},[137,749],[116,39729,562],{"className":39730},[561,749],[116,39732,39098],{"className":39733,"style":39097},[137,138,749],[116,39735,652],{"className":39736},[651,749],", so define the local sensitivity ",[116,39739,39741],{"className":39740},[119],[116,39742,39744,39797],{"className":39743,"ariaHidden":124},[123],[116,39745,39747,39750,39788,39791,39794],{"className":39746},[128],[116,39748],{"className":39749,"style":36435},[132],[116,39751,39753,39756],{"className":39752},[137],[116,39754,17765],{"className":39755,"style":17764},[137,138],[116,39757,39759],{"className":39758},[725],[116,39760,39762],{"className":39761},[168],[116,39763,39765],{"className":39764},[173],[116,39766,39768],{"className":39767,"style":36435},[177],[116,39769,39770,39773],{"style":1167},[116,39771],{"className":39772,"style":742},[187],[116,39774,39776],{"className":39775},[746,747,748,749],[116,39777,39779,39782,39785],{"className":39778},[137,749],[116,39780,562],{"className":39781},[561,749],[116,39783,39098],{"className":39784,"style":39097},[137,138,749],[116,39786,652],{"className":39787},[651,749],[116,39789],{"className":39790,"style":145},[144],[116,39792,150],{"className":39793},[149],[116,39795],{"className":39796,"style":145},[144],[116,39798,39800,39803,39806,39809,39812,39815],{"className":39799},[128],[116,39801],{"className":39802,"style":36410},[132],[116,39804,16070],{"className":39805,"style":16069},[137],[116,39807,4716],{"className":39808},[137,138],[116,39810,201],{"className":39811},[137],[116,39813,16070],{"className":39814,"style":16069},[137],[116,39816,39818,39821],{"className":39817},[137],[116,39819,4166],{"className":39820,"style":4559},[137,138],[116,39822,39824],{"className":39823},[725],[116,39825,39827],{"className":39826},[168],[116,39828,39830],{"className":39829},[173],[116,39831,39833],{"className":39832,"style":36435},[177],[116,39834,39835,39838],{"style":1167},[116,39836],{"className":39837,"style":742},[187],[116,39839,39841],{"className":39840},[746,747,748,749],[116,39842,39844,39847,39850],{"className":39843},[137,749],[116,39845,562],{"className":39846},[561,749],[116,39848,39098],{"className":39849,"style":39097},[137,138,749],[116,39851,652],{"className":39852},[651,749],".\nAt the output layer it is read off directly,",[116,39855,39857],{"className":39856},[702],[116,39858,39860],{"className":39859},[119],[116,39861,39863,39916,39975],{"className":39862,"ariaHidden":124},[123],[116,39864,39866,39869,39907,39910,39913],{"className":39865},[128],[116,39867],{"className":39868,"style":18630},[132],[116,39870,39872,39875],{"className":39871},[137],[116,39873,17765],{"className":39874,"style":17764},[137,138],[116,39876,39878],{"className":39877},[725],[116,39879,39881],{"className":39880},[168],[116,39882,39884],{"className":39883},[173],[116,39885,39887],{"className":39886,"style":18630},[177],[116,39888,39889,39892],{"style":2488},[116,39890],{"className":39891,"style":742},[187],[116,39893,39895],{"className":39894},[746,747,748,749],[116,39896,39898,39901,39904],{"className":39897},[137,749],[116,39899,562],{"className":39900},[561,749],[116,39902,4716],{"className":39903},[137,138,749],[116,39905,652],{"className":39906},[651,749],[116,39908],{"className":39909,"style":145},[144],[116,39911,150],{"className":39912},[149],[116,39914],{"className":39915,"style":145},[144],[116,39917,39919,39922,39962,39965,39968,39972],{"className":39918},[128],[116,39920],{"className":39921,"style":715},[132],[116,39923,39925,39928],{"className":39924},[137],[116,39926,8365],{"className":39927},[137],[116,39929,39931],{"className":39930},[725],[116,39932,39934,39954],{"className":39933},[168,169],[116,39935,39937,39951],{"className":39936},[173],[116,39938,39940],{"className":39939,"style":735},[177],[116,39941,39942,39945],{"style":3584},[116,39943],{"className":39944,"style":742},[187],[116,39946,39948],{"className":39947},[746,747,748,749],[116,39949,76],{"className":39950},[137,138,749],[116,39952,234],{"className":39953},[233],[116,39955,39957],{"className":39956},[173],[116,39958,39960],{"className":39959,"style":762},[177],[116,39961],{},[116,39963,4716],{"className":39964},[137,138],[116,39966],{"className":39967,"style":570},[144],[116,39969,39971],{"className":39970},[574],"⊙",[116,39973],{"className":39974,"style":570},[144],[116,39976,39978,39981,40013,40016,40022,40060,40066],{"className":39977},[128],[116,39979],{"className":39980,"style":39117},[132],[116,39982,39984,39987],{"className":39983},[137],[116,39985,7217],{"className":39986,"style":139},[137,138],[116,39988,39990],{"className":39989},[725],[116,39991,39993],{"className":39992},[168],[116,39994,39996],{"className":39995},[173],[116,39997,39999],{"className":39998,"style":5751},[177],[116,40000,40001,40004],{"style":2488},[116,40002],{"className":40003,"style":742},[187],[116,40005,40007],{"className":40006},[746,747,748,749],[116,40008,40010],{"className":40009},[137,749],[116,40011,2445],{"className":40012},[137,749],[116,40014],{"className":40015,"style":5218},[144],[116,40017,40019],{"className":40018},[137],[116,40020,562],{"className":40021},[1091,1002],[116,40023,40025,40028],{"className":40024},[137],[116,40026,4166],{"className":40027,"style":4559},[137,138],[116,40029,40031],{"className":40030},[725],[116,40032,40034],{"className":40033},[168],[116,40035,40037],{"className":40036},[173],[116,40038,40040],{"className":40039,"style":18630},[177],[116,40041,40042,40045],{"style":2488},[116,40043],{"className":40044,"style":742},[187],[116,40046,40048],{"className":40047},[746,747,748,749],[116,40049,40051,40054,40057],{"className":40050},[137,749],[116,40052,562],{"className":40053},[561,749],[116,40055,4716],{"className":40056},[137,138,749],[116,40058,652],{"className":40059},[651,749],[116,40061,40063],{"className":40062},[137],[116,40064,652],{"className":40065},[1091,1002],[116,40067,594],{"className":40068},[593],[73,40070,40071],{},"and for an earlier layer the chain rule passes it back through the next\nlayer's weights,",[116,40073,40075],{"className":40074},[702],[116,40076,40078],{"className":40077},[119],[116,40079,40081,40134,40252],{"className":40080,"ariaHidden":124},[123],[116,40082,40084,40087,40125,40128,40131],{"className":40083},[128],[116,40085],{"className":40086,"style":18630},[132],[116,40088,40090,40093],{"className":40089},[137],[116,40091,17765],{"className":40092,"style":17764},[137,138],[116,40094,40096],{"className":40095},[725],[116,40097,40099],{"className":40098},[168],[116,40100,40102],{"className":40101},[173],[116,40103,40105],{"className":40104,"style":18630},[177],[116,40106,40107,40110],{"style":2488},[116,40108],{"className":40109,"style":742},[187],[116,40111,40113],{"className":40112},[746,747,748,749],[116,40114,40116,40119,40122],{"className":40115},[137,749],[116,40117,562],{"className":40118},[561,749],[116,40120,39098],{"className":40121,"style":39097},[137,138,749],[116,40123,652],{"className":40124},[651,749],[116,40126],{"className":40127,"style":145},[144],[116,40129,150],{"className":40130},[149],[116,40132],{"className":40133,"style":145},[144],[116,40135,40137,40140,40146,40193,40237,40243,40246,40249],{"className":40136},[128],[116,40138],{"className":40139,"style":39117},[132],[116,40141,40143],{"className":40142},[137],[116,40144,562],{"className":40145},[1091,1002],[116,40147,40149,40152],{"className":40148},[137],[116,40150,925],{"className":40151,"style":924},[137,138],[116,40153,40155],{"className":40154},[725],[116,40156,40158],{"className":40157},[168],[116,40159,40161],{"className":40160},[173],[116,40162,40164],{"className":40163,"style":18630},[177],[116,40165,40166,40169],{"style":2488},[116,40167],{"className":40168,"style":742},[187],[116,40170,40172],{"className":40171},[746,747,748,749],[116,40173,40175,40178,40181,40184,40187,40190],{"className":40174},[137,749],[116,40176,562],{"className":40177},[561,749],[116,40179,39098],{"className":40180,"style":39097},[137,138,749],[116,40182,575],{"className":40183},[574,749],[116,40185,345],{"className":40186},[137,749],[116,40188,652],{"className":40189},[651,749],[116,40191,1006],{"className":40192},[137,749],[116,40194,40196,40199],{"className":40195},[137],[116,40197,17765],{"className":40198,"style":17764},[137,138],[116,40200,40202],{"className":40201},[725],[116,40203,40205],{"className":40204},[168],[116,40206,40208],{"className":40207},[173],[116,40209,40211],{"className":40210,"style":18630},[177],[116,40212,40213,40216],{"style":2488},[116,40214],{"className":40215,"style":742},[187],[116,40217,40219],{"className":40218},[746,747,748,749],[116,40220,40222,40225,40228,40231,40234],{"className":40221},[137,749],[116,40223,562],{"className":40224},[561,749],[116,40226,39098],{"className":40227,"style":39097},[137,138,749],[116,40229,575],{"className":40230},[574,749],[116,40232,345],{"className":40233},[137,749],[116,40235,652],{"className":40236},[651,749],[116,40238,40240],{"className":40239},[137],[116,40241,652],{"className":40242},[1091,1002],[116,40244],{"className":40245,"style":570},[144],[116,40247,39971],{"className":40248},[574],[116,40250],{"className":40251,"style":570},[144],[116,40253,40255,40258,40290,40293,40299,40337,40343],{"className":40254},[128],[116,40256],{"className":40257,"style":39117},[132],[116,40259,40261,40264],{"className":40260},[137],[116,40262,7217],{"className":40263,"style":139},[137,138],[116,40265,40267],{"className":40266},[725],[116,40268,40270],{"className":40269},[168],[116,40271,40273],{"className":40272},[173],[116,40274,40276],{"className":40275,"style":5751},[177],[116,40277,40278,40281],{"style":2488},[116,40279],{"className":40280,"style":742},[187],[116,40282,40284],{"className":40283},[746,747,748,749],[116,40285,40287],{"className":40286},[137,749],[116,40288,2445],{"className":40289},[137,749],[116,40291],{"className":40292,"style":5218},[144],[116,40294,40296],{"className":40295},[137],[116,40297,562],{"className":40298},[1091,1002],[116,40300,40302,40305],{"className":40301},[137],[116,40303,4166],{"className":40304,"style":4559},[137,138],[116,40306,40308],{"className":40307},[725],[116,40309,40311],{"className":40310},[168],[116,40312,40314],{"className":40313},[173],[116,40315,40317],{"className":40316,"style":18630},[177],[116,40318,40319,40322],{"style":2488},[116,40320],{"className":40321,"style":742},[187],[116,40323,40325],{"className":40324},[746,747,748,749],[116,40326,40328,40331,40334],{"className":40327},[137,749],[116,40329,562],{"className":40330},[561,749],[116,40332,39098],{"className":40333,"style":39097},[137,138,749],[116,40335,652],{"className":40336},[651,749],[116,40338,40340],{"className":40339},[137],[116,40341,652],{"className":40342},[1091,1002],[116,40344,1852],{"className":40345},[137],[73,40347,40348,40349,40399],{},"Once ",[116,40350,40352],{"className":40351},[119],[116,40353,40355],{"className":40354,"ariaHidden":124},[123],[116,40356,40358,40361],{"className":40357},[128],[116,40359],{"className":40360,"style":36435},[132],[116,40362,40364,40367],{"className":40363},[137],[116,40365,17765],{"className":40366,"style":17764},[137,138],[116,40368,40370],{"className":40369},[725],[116,40371,40373],{"className":40372},[168],[116,40374,40376],{"className":40375},[173],[116,40377,40379],{"className":40378,"style":36435},[177],[116,40380,40381,40384],{"style":1167},[116,40382],{"className":40383,"style":742},[187],[116,40385,40387],{"className":40386},[746,747,748,749],[116,40388,40390,40393,40396],{"className":40389},[137,749],[116,40391,562],{"className":40392},[561,749],[116,40394,39098],{"className":40395,"style":39097},[137,138,749],[116,40397,652],{"className":40398},[651,749]," is known the parameter gradients are outer products,",[116,40401,40403],{"className":40402},[702],[116,40404,40406],{"className":40405},[119],[116,40407,40409,40531,40746],{"className":40408,"ariaHidden":124},[123],[116,40410,40412,40416,40522,40525,40528],{"className":40411},[128],[116,40413],{"className":40414,"style":40415},[132],"height:2.0754em;vertical-align:-0.704em;",[116,40417,40419,40422,40519],{"className":40418},[137],[116,40420],{"className":40421},[561,4427],[116,40423,40425],{"className":40424},[4431],[116,40426,40428,40510],{"className":40427},[168,169],[116,40429,40431,40507],{"className":40430},[173],[116,40432,40434,40485,40493],{"className":40433,"style":16056},[177],[116,40435,40437,40440],{"style":40436},"top:-2.296em;",[116,40438],{"className":40439,"style":1119},[187],[116,40441,40443,40446],{"className":40442},[137],[116,40444,16070],{"className":40445,"style":16069},[137],[116,40447,40449,40452],{"className":40448},[137],[116,40450,925],{"className":40451,"style":924},[137,138],[116,40453,40455],{"className":40454},[725],[116,40456,40458],{"className":40457},[168],[116,40459,40461],{"className":40460},[173],[116,40462,40465],{"className":40463,"style":40464},[177],"height:0.814em;",[116,40466,40467,40470],{"style":7391},[116,40468],{"className":40469,"style":742},[187],[116,40471,40473],{"className":40472},[746,747,748,749],[116,40474,40476,40479,40482],{"className":40475},[137,749],[116,40477,562],{"className":40478},[561,749],[116,40480,39098],{"className":40481,"style":39097},[137,138,749],[116,40483,652],{"className":40484},[651,749],[116,40486,40487,40490],{"style":4597},[116,40488],{"className":40489,"style":1119},[187],[116,40491],{"className":40492,"style":4605},[4604],[116,40494,40495,40498],{"style":4608},[116,40496],{"className":40497,"style":1119},[187],[116,40499,40501,40504],{"className":40500},[137],[116,40502,16070],{"className":40503,"style":16069},[137],[116,40505,4716],{"className":40506},[137,138],[116,40508,234],{"className":40509},[233],[116,40511,40513],{"className":40512},[173],[116,40514,40517],{"className":40515,"style":40516},[177],"height:0.704em;",[116,40518],{},[116,40520],{"className":40521},[651,4427],[116,40523],{"className":40524,"style":145},[144],[116,40526,150],{"className":40527},[149],[116,40529],{"className":40530,"style":145},[144],[116,40532,40534,40537,40575,40578,40625,40628,40631,40634,40737,40740,40743],{"className":40533},[128],[116,40535],{"className":40536,"style":40415},[132],[116,40538,40540,40543],{"className":40539},[137],[116,40541,17765],{"className":40542,"style":17764},[137,138],[116,40544,40546],{"className":40545},[725],[116,40547,40549],{"className":40548},[168],[116,40550,40552],{"className":40551},[173],[116,40553,40555],{"className":40554,"style":18630},[177],[116,40556,40557,40560],{"style":2488},[116,40558],{"className":40559,"style":742},[187],[116,40561,40563],{"className":40562},[746,747,748,749],[116,40564,40566,40569,40572],{"className":40565},[137,749],[116,40567,562],{"className":40568},[561,749],[116,40570,39098],{"className":40571,"style":39097},[137,138,749],[116,40573,652],{"className":40574},[651,749],[116,40576],{"className":40577,"style":279},[144],[116,40579,40581,40584],{"className":40580},[137],[116,40582,76],{"className":40583},[137,138],[116,40585,40587],{"className":40586},[725],[116,40588,40590],{"className":40589},[168],[116,40591,40593],{"className":40592},[173],[116,40594,40596],{"className":40595,"style":18630},[177],[116,40597,40598,40601],{"style":2488},[116,40599],{"className":40600,"style":742},[187],[116,40602,40604],{"className":40603},[746,747,748,749],[116,40605,40607,40610,40613,40616,40619,40622],{"className":40606},[137,749],[116,40608,562],{"className":40609},[561,749],[116,40611,39098],{"className":40612,"style":39097},[137,138,749],[116,40614,1610],{"className":40615},[574,749],[116,40617,345],{"className":40618},[137,749],[116,40620,652],{"className":40621},[651,749],[116,40623,1006],{"className":40624},[137,749],[116,40626,594],{"className":40627},[593],[116,40629],{"className":40630,"style":4159},[144],[116,40632],{"className":40633,"style":279},[144],[116,40635,40637,40640,40734],{"className":40636},[137],[116,40638],{"className":40639},[561,4427],[116,40641,40643],{"className":40642},[4431],[116,40644,40646,40726],{"className":40645},[168,169],[116,40647,40649,40723],{"className":40648},[173],[116,40650,40652,40701,40709],{"className":40651,"style":16056},[177],[116,40653,40654,40657],{"style":40436},[116,40655],{"className":40656,"style":1119},[187],[116,40658,40660,40663],{"className":40659},[137],[116,40661,16070],{"className":40662,"style":16069},[137],[116,40664,40666,40669],{"className":40665},[137],[116,40667,4115],{"className":40668},[137,138],[116,40670,40672],{"className":40671},[725],[116,40673,40675],{"className":40674},[168],[116,40676,40678],{"className":40677},[173],[116,40679,40681],{"className":40680,"style":40464},[177],[116,40682,40683,40686],{"style":7391},[116,40684],{"className":40685,"style":742},[187],[116,40687,40689],{"className":40688},[746,747,748,749],[116,40690,40692,40695,40698],{"className":40691},[137,749],[116,40693,562],{"className":40694},[561,749],[116,40696,39098],{"className":40697,"style":39097},[137,138,749],[116,40699,652],{"className":40700},[651,749],[116,40702,40703,40706],{"style":4597},[116,40704],{"className":40705,"style":1119},[187],[116,40707],{"className":40708,"style":4605},[4604],[116,40710,40711,40714],{"style":4608},[116,40712],{"className":40713,"style":1119},[187],[116,40715,40717,40720],{"className":40716},[137],[116,40718,16070],{"className":40719,"style":16069},[137],[116,40721,4716],{"className":40722},[137,138],[116,40724,234],{"className":40725},[233],[116,40727,40729],{"className":40728},[173],[116,40730,40732],{"className":40731,"style":40516},[177],[116,40733],{},[116,40735],{"className":40736},[651,4427],[116,40738],{"className":40739,"style":145},[144],[116,40741,150],{"className":40742},[149],[116,40744],{"className":40745,"style":145},[144],[116,40747,40749,40753,40791],{"className":40748},[128],[116,40750],{"className":40751,"style":40752},[132],"height:1.1324em;vertical-align:-0.1944em;",[116,40754,40756,40759],{"className":40755},[137],[116,40757,17765],{"className":40758,"style":17764},[137,138],[116,40760,40762],{"className":40761},[725],[116,40763,40765],{"className":40764},[168],[116,40766,40768],{"className":40767},[173],[116,40769,40771],{"className":40770,"style":18630},[177],[116,40772,40773,40776],{"style":2488},[116,40774],{"className":40775,"style":742},[187],[116,40777,40779],{"className":40778},[746,747,748,749],[116,40780,40782,40785,40788],{"className":40781},[137,749],[116,40783,562],{"className":40784},[561,749],[116,40786,39098],{"className":40787,"style":39097},[137,138,749],[116,40789,652],{"className":40790},[651,749],[116,40792,594],{"className":40793},[593],[73,40795,40796,40797,40847,40848,40904,40905,40920,40921,22208,41010,41120,41121,41124,41125,41197,41198,41201,41202,13768,41246,41249,41250,14493,41252,41254],{},"and one backward sweep computes every gradient, each ",[116,40798,40800],{"className":40799},[119],[116,40801,40803],{"className":40802,"ariaHidden":124},[123],[116,40804,40806,40809],{"className":40805},[128],[116,40807],{"className":40808,"style":36435},[132],[116,40810,40812,40815],{"className":40811},[137],[116,40813,17765],{"className":40814,"style":17764},[137,138],[116,40816,40818],{"className":40817},[725],[116,40819,40821],{"className":40820},[168],[116,40822,40824],{"className":40823},[173],[116,40825,40827],{"className":40826,"style":36435},[177],[116,40828,40829,40832],{"style":1167},[116,40830],{"className":40831,"style":742},[187],[116,40833,40835],{"className":40834},[746,747,748,749],[116,40836,40838,40841,40844],{"className":40837},[137,749],[116,40839,562],{"className":40840},[561,749],[116,40842,39098],{"className":40843,"style":39097},[137,138,749],[116,40845,652],{"className":40846},[651,749]," built from\nthe ",[116,40849,40851],{"className":40850},[119],[116,40852,40854],{"className":40853,"ariaHidden":124},[123],[116,40855,40857,40860],{"className":40856},[128],[116,40858],{"className":40859,"style":36435},[132],[116,40861,40863,40866],{"className":40862},[137],[116,40864,17765],{"className":40865,"style":17764},[137,138],[116,40867,40869],{"className":40868},[725],[116,40870,40872],{"className":40871},[168],[116,40873,40875],{"className":40874},[173],[116,40876,40878],{"className":40877,"style":36435},[177],[116,40879,40880,40883],{"style":1167},[116,40881],{"className":40882,"style":742},[187],[116,40884,40886],{"className":40885},[746,747,748,749],[116,40887,40889,40892,40895,40898,40901],{"className":40888},[137,749],[116,40890,562],{"className":40891},[561,749],[116,40893,39098],{"className":40894,"style":39097},[137,138,749],[116,40896,575],{"className":40897},[574,749],[116,40899,345],{"className":40900},[137,749],[116,40902,652],{"className":40903},[651,749]," after it — the forward pass's own values, walked in\nreverse. The derivative itself is derived rather than imported: treating\n",[116,40906,40908],{"className":40907},[119],[116,40909,40911],{"className":40910,"ariaHidden":124},[123],[116,40912,40914,40917],{"className":40913},[128],[116,40915],{"className":40916,"style":133},[132],[116,40918,7217],{"className":40919,"style":139},[137,138]," as the solution of its own differential equation gives\n",[116,40922,40924],{"className":40923},[119],[116,40925,40927,40974,40998],{"className":40926,"ariaHidden":124},[123],[116,40928,40930,40933,40965,40968,40971],{"className":40929},[128],[116,40931],{"className":40932,"style":2412},[132],[116,40934,40936,40939],{"className":40935},[137],[116,40937,7217],{"className":40938,"style":139},[137,138],[116,40940,40942],{"className":40941},[725],[116,40943,40945],{"className":40944},[168],[116,40946,40948],{"className":40947},[173],[116,40949,40951],{"className":40950,"style":2412},[177],[116,40952,40953,40956],{"style":1167},[116,40954],{"className":40955,"style":742},[187],[116,40957,40959],{"className":40958},[746,747,748,749],[116,40960,40962],{"className":40961},[137,749],[116,40963,2445],{"className":40964},[137,749],[116,40966],{"className":40967,"style":145},[144],[116,40969,150],{"className":40970},[149],[116,40972],{"className":40973,"style":145},[144],[116,40975,40977,40980,40983,40986,40989,40992,40995],{"className":40976},[128],[116,40978],{"className":40979,"style":552},[132],[116,40981,7217],{"className":40982,"style":139},[137,138],[116,40984,562],{"className":40985},[561],[116,40987,345],{"className":40988},[137],[116,40990],{"className":40991,"style":570},[144],[116,40993,1610],{"className":40994},[574],[116,40996],{"className":40997,"style":570},[144],[116,40999,41001,41004,41007],{"className":41000},[128],[116,41002],{"className":41003,"style":552},[132],[116,41005,7217],{"className":41006,"style":139},[137,138],[116,41008,652],{"className":41009},[651],[116,41011,41013],{"className":41012},[119],[116,41014,41016,41066,41084],{"className":41015,"ariaHidden":124},[123],[116,41017,41019,41023,41057,41060,41063],{"className":41018},[128],[116,41020],{"className":41021,"style":41022},[132],"height:0.8362em;",[116,41024,41026,41030],{"className":41025},[1126],[116,41027,41029],{"className":41028},[1126],"tanh",[116,41031,41033],{"className":41032},[725],[116,41034,41036],{"className":41035},[168],[116,41037,41039],{"className":41038},[173],[116,41040,41042],{"className":41041,"style":41022},[177],[116,41043,41045,41048],{"style":41044},"top:-3.1473em;margin-right:0.05em;",[116,41046],{"className":41047,"style":742},[187],[116,41049,41051],{"className":41050},[746,747,748,749],[116,41052,41054],{"className":41053},[137,749],[116,41055,2445],{"className":41056},[137,749],[116,41058],{"className":41059,"style":145},[144],[116,41061,150],{"className":41062},[149],[116,41064],{"className":41065,"style":145},[144],[116,41067,41069,41072,41075,41078,41081],{"className":41068},[128],[116,41070],{"className":41071,"style":1871},[132],[116,41073,345],{"className":41074},[137],[116,41076],{"className":41077,"style":570},[144],[116,41079,1610],{"className":41080},[574],[116,41082],{"className":41083,"style":570},[144],[116,41085,41087,41091],{"className":41086},[128],[116,41088],{"className":41089,"style":41090},[132],"height:0.8984em;",[116,41092,41094,41097],{"className":41093},[1126],[116,41095,41029],{"className":41096},[1126],[116,41098,41100],{"className":41099},[725],[116,41101,41103],{"className":41102},[168],[116,41104,41106],{"className":41105},[173],[116,41107,41109],{"className":41108,"style":41090},[177],[116,41110,41111,41114],{"style":41044},[116,41112],{"className":41113,"style":742},[187],[116,41115,41117],{"className":41116},[746,747,748,749],[116,41118,359],{"className":41119},[137,749]," as its companion.\nIn the code this is exactly ",[108,41122,41123],{},"backward!",": the output error is ",[116,41126,41128],{"className":41127},[119],[116,41129,41131,41149],{"className":41130,"ariaHidden":124},[123],[116,41132,41134,41137,41140,41143,41146],{"className":41133},[128],[116,41135],{"className":41136,"style":585},[132],[116,41138,601],{"className":41139,"style":139},[137,138],[116,41141],{"className":41142,"style":570},[144],[116,41144,1610],{"className":41145},[574],[116,41147],{"className":41148,"style":570},[144],[116,41150,41152,41155],{"className":41151},[128],[116,41153],{"className":41154,"style":4241},[132],[116,41156,41158],{"className":41157},[137,7716],[116,41159,41161,41189],{"className":41160},[168,169],[116,41162,41164,41186],{"className":41163},[173],[116,41165,41167,41175],{"className":41166,"style":4022},[177],[116,41168,41169,41172],{"style":3376},[116,41170],{"className":41171,"style":1119},[187],[116,41173,601],{"className":41174,"style":139},[137,138],[116,41176,41177,41180],{"style":3376},[116,41178],{"className":41179,"style":1119},[187],[116,41181,41183],{"className":41182,"style":7743},[7742],[116,41184,7747],{"className":41185},[137],[116,41187,234],{"className":41188},[233],[116,41190,41192],{"className":41191},[173],[116,41193,41195],{"className":41194,"style":7757},[177],[116,41196],{},",\neach ",[108,41199,41200],{},"delta"," is that error times ",[116,41203,41205],{"className":41204},[119],[116,41206,41208],{"className":41207,"ariaHidden":124},[123],[116,41209,41211,41214],{"className":41210},[128],[116,41212],{"className":41213,"style":2412},[132],[116,41215,41217,41220],{"className":41216},[137],[116,41218,7217],{"className":41219,"style":139},[137,138],[116,41221,41223],{"className":41222},[725],[116,41224,41226],{"className":41225},[168],[116,41227,41229],{"className":41228},[173],[116,41230,41232],{"className":41231,"style":2412},[177],[116,41233,41234,41237],{"style":1167},[116,41235],{"className":41236,"style":742},[187],[116,41238,41240],{"className":41239},[746,747,748,749],[116,41241,41243],{"className":41242},[137,749],[116,41244,2445],{"className":41245},[137,749],[108,41247,41248],{},"train!"," runs ",[108,41251,39278],{},[108,41253,41123],{}," for ten thousand iterations over the whole batch at once.",[73,41256,41257,41260],{},[505,41258,41259],{},"The experiments."," Four probes fix what the machine can and cannot do. An\nexponential sequence resists a linear fit until the target passes through a\nlogarithm — representation is half the model. A two-class boundary drawn by a\nnetwork with no hidden layers is a straight line; four hidden layers bend it\naround the quadrant-labeled data — depth purchases curvature. Higher-order\nregression obeys the same law. And a deliberately noisy sequence defeats the\ndeep model precisely through its flexibility: it memorizes the noise, the\noverfitting canonical to high variance. The survey closes into deep learning\nproper — convolutional and recurrent architectures, and the hardware fact that\ntraining is matrix arithmetic, which is why graphics processors built to shade\npixels in parallel cut training time roughly twentyfold.",[246,41262],{"hash":41263},"4ad6540cb0d04b5a04fbede4c666acfb930d8a561f36a986266952a34cff1b27",[73,41265,41266,41267,41317,41318,41362,41363,41422],{},"A framework hides ",[116,41268,41270],{"className":41269},[119],[116,41271,41273],{"className":41272,"ariaHidden":124},[123],[116,41274,41276,41279],{"className":41275},[128],[116,41277],{"className":41278,"style":36435},[132],[116,41280,41282,41285],{"className":41281},[137],[116,41283,17765],{"className":41284,"style":17764},[137,138],[116,41286,41288],{"className":41287},[725],[116,41289,41291],{"className":41290},[168],[116,41292,41294],{"className":41293},[173],[116,41295,41297],{"className":41296,"style":36435},[177],[116,41298,41299,41302],{"style":1167},[116,41300],{"className":41301,"style":742},[187],[116,41303,41305],{"className":41304},[746,747,748,749],[116,41306,41308,41311,41314],{"className":41307},[137,749],[116,41309,562],{"className":41310},[561,749],[116,41312,39098],{"className":41313,"style":39097},[137,138,749],[116,41315,652],{"className":41316},[651,749]," behind autodiff. Writing the network in Julia\nwithout one meant deriving and coding each ",[116,41319,41321],{"className":41320},[119],[116,41322,41324],{"className":41323,"ariaHidden":124},[123],[116,41325,41327,41330],{"className":41326},[128],[116,41328],{"className":41329,"style":2412},[132],[116,41331,41333,41336],{"className":41332},[137],[116,41334,7217],{"className":41335,"style":139},[137,138],[116,41337,41339],{"className":41338},[725],[116,41340,41342],{"className":41341},[168],[116,41343,41345],{"className":41344},[173],[116,41346,41348],{"className":41347,"style":2412},[177],[116,41349,41350,41353],{"style":1167},[116,41351],{"className":41352,"style":742},[187],[116,41354,41356],{"className":41355},[746,747,748,749],[116,41357,41359],{"className":41358},[137,749],[116,41360,2445],{"className":41361},[137,749],", each transpose\n",[116,41364,41366],{"className":41365},[119],[116,41367,41369],{"className":41368,"ariaHidden":124},[123],[116,41370,41372,41375],{"className":41371},[128],[116,41373],{"className":41374,"style":36435},[132],[116,41376,41378,41381],{"className":41377},[137],[116,41379,925],{"className":41380,"style":924},[137,138],[116,41382,41384],{"className":41383},[725],[116,41385,41387],{"className":41386},[168],[116,41388,41390],{"className":41389},[173],[116,41391,41393],{"className":41392,"style":36435},[177],[116,41394,41395,41398],{"style":1167},[116,41396],{"className":41397,"style":742},[187],[116,41399,41401],{"className":41400},[746,747,748,749],[116,41402,41404,41407,41410,41413,41416,41419],{"className":41403},[137,749],[116,41405,562],{"className":41406},[561,749],[116,41408,39098],{"className":41409,"style":39097},[137,138,749],[116,41411,575],{"className":41412},[574,749],[116,41414,345],{"className":41415},[137,749],[116,41417,652],{"className":41418},[651,749],[116,41420,1006],{"className":41421},[137,749],", and each outer product by hand, so nothing about the gradient\nstayed implicit — which was the point of the demonstration, and the reason the\npublication's title reads in both directions: models trained on human behavior\nchange it, and the discipline's own behavior is changed by what its data\ncontains.",{"title":478,"searchDepth":479,"depth":479,"links":41424},[],"2021-03-15","Written solo for the Dartmouth Undergraduate Journal of Science,\nData-Driven Behavior Change runs in two movements: a survey of where machine\nlearning came from and what it touches, and a construction — a neural network\nimplemented from nothing in Julia, its calculus derived by hand, its behavior\nprobed by experiment.",{},"\u002Fprojects\u002Fdeep-learning\u002Fneural-jl",[8855,14937],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Fneural-demo",{"title":38955,"description":41426},"projects\u002Fdeep-learning\u002Fneural-jl","A solo publication in the Dartmouth Undergraduate Journal of Science: a\nsurvey of machine learning's lineage, taxonomy, and industrial reach, closed\nby a neural network built from scratch in Julia — forward pass, hand-derived\nbackpropagation, and experiments on what depth buys and where it fails.",[41435,14944],"Julia","\u002Fpapers\u002Fdujs\u002Fdata-driven-behavior-change.pdf","l4Us9QTqJ8o6QHDvooor-Hp7jR81p04OEKZ8RfjagBs",{"id":41439,"title":41440,"body":41441,"date":41521,"description":41445,"extension":483,"featured":2354,"meta":41522,"navigation":484,"path":41523,"references":2282,"repo":41524,"seo":41525,"stem":41526,"summary":41527,"tag":21246,"tech":41528,"url":2282,"__hash__":41532},"projects\u002Fprojects\u002Ftrivial\u002F10-collaborative-editor.md","Collaborative Editor",{"type":70,"value":41442,"toc":41519},[41443,41446,41485,41488],[73,41444,41445],{},"A collaborative drawing editor over a shared canvas. Multiple clients\nconnect at once, and each sees the others' edits in real time.",[73,41447,41448,41449,41452,41453,20050,41456,41459,41460,41462,41463,12917,41466,5452,41469,41472,41473,41476,41477,41480,41481,41484],{},"The server is the single source of truth. ",[108,41450,41451],{},"SketchServer"," listens on port\n4242 and holds the authoritative ",[108,41454,41455],{},"Sketch",[108,41457,41458],{},"TreeMap\u003CInteger, Shape>"," keyed\nby shape id. A client's ",[108,41461,21280],{}," never mutates shared state directly: it\nsends a one-line message — ",[108,41464,41465],{},"draw \u003Ctype> x1 y1 x2 y2 color",[108,41467,41468],{},"move id dx dy",[108,41470,41471],{},"recolor id color",", or ",[108,41474,41475],{},"delete id"," — over its\n",[108,41478,41479],{},"EditorCommunicator",". The server stamps each new shape with an\nincrementing id, applies the change through ",[108,41482,41483],{},"MessageParser",", then\nbroadcasts it to every client, the originator included, so all views\nconverge. A client that joins mid-session first receives the entire\ncurrent sketch replayed as draw messages, then the stream of later edits.",[246,41486],{"hash":41487},"d52ed5966f3c65f5ea5c5dcd14e0def614a5c1c0a63244c62f600a56c71d658e",[73,41489,41490,41491,41494,41495,12917,41498,13768,41501,41504,41505,41508,41509,41512,41513,41518],{},"Concurrency stays safe because the server dedicates one\n",[108,41492,41493],{},"SketchServerCommunicator"," thread to each client, so edits can arrive at\nthe same instant. The methods that touch shared state — ",[108,41496,41497],{},"addCommunicator",[108,41499,41500],{},"removeCommunicator",[108,41502,41503],{},"broadcast"," — are ",[108,41506,41507],{},"synchronized",", so one thread\nfinishes applying an edit and broadcasting it before the next begins.\nSerializing writes this way prevents the ",[442,41510,41511],{},"data races"," that concurrent\nupdates to a single sketch would otherwise cause, and routing every\nchange through the one server sidesteps the\n",[76,41514,41517],{"href":41515,"rel":41516},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDeadlock",[80],"deadlock"," that competing locks\non shared state could invite.",{"title":478,"searchDepth":479,"depth":479,"links":41520},[],"2021-03-07",{},"\u002Fprojects\u002Ftrivial\u002F10-collaborative-editor","https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-java\u002Ftree\u002Fmain\u002FProblem%20Sets\u002FPS-6",{"title":41440,"description":41445},"projects\u002Ftrivial\u002F10-collaborative-editor","A shared drawing canvas in Java where multiple clients edit in real time,\nkept consistent by a server that serializes every change.",[41529,41530,41531,37647],"Java","Threads","Mutexes","Fh-n9WekbxDhAEQYCDugDBRet9oweoJht6dornGS2Jk",{"id":41534,"title":41535,"body":41536,"date":42978,"description":42979,"extension":483,"featured":2354,"meta":42980,"navigation":484,"path":42981,"references":42982,"repo":42984,"seo":42985,"stem":42986,"summary":42987,"tag":32399,"tech":42988,"url":2282,"__hash__":42990},"projects\u002Fprojects\u002Fai\u002F10-pos-tagging.md","Parts-Of-Speech Tagging",{"type":70,"value":41537,"toc":42976},[41538,41548,41942,42378,42432,42529,42834,42877,42880,42883,42933,42974],[73,41539,5131,41540,41543,41544,41547],{},[76,41541,31169],{"href":31167,"rel":41542},[80],"\ntreats a sentence as a sequence of hidden states — the part-of-speech tags —\nthat emit the observed words. Tagging recovers the tag sequence most likely to\nhave produced the sentence, and the\n",[76,41545,32382],{"href":32380,"rel":41546},[80]," finds it\nexactly in time linear in the sentence length.",[73,41549,41550,41551,41676,41677,41793,41794,41797,41798,41801,41802,41805,41806,2344,41809,41812,41813,41816,41817,41878,41879,41941],{},"The model rests on two distributions, both estimated by counting over a tagged\ncorpus: transition probabilities ",[116,41552,41554],{"className":41553},[119],[116,41555,41557,41618],{"className":41556,"ariaHidden":124},[123],[116,41558,41560,41563,41566,41569,41609,41612,41615],{"className":41559},[128],[116,41561],{"className":41562,"style":552},[132],[116,41564,2794],{"className":41565,"style":924},[137,138],[116,41567,562],{"className":41568},[561],[116,41570,41572,41575],{"className":41571},[137],[116,41573,287],{"className":41574},[137,138],[116,41576,41578],{"className":41577},[725],[116,41579,41581,41601],{"className":41580},[168,169],[116,41582,41584,41598],{"className":41583},[173],[116,41585,41587],{"className":41586,"style":3145},[177],[116,41588,41589,41592],{"style":3584},[116,41590],{"className":41591,"style":742},[187],[116,41593,41595],{"className":41594},[746,747,748,749],[116,41596,3158],{"className":41597},[137,138,749],[116,41599,234],{"className":41600},[233],[116,41602,41604],{"className":41603},[173],[116,41605,41607],{"className":41606,"style":762},[177],[116,41608],{},[116,41610],{"className":41611,"style":145},[144],[116,41613,4389],{"className":41614},[149],[116,41616],{"className":41617,"style":145},[144],[116,41619,41621,41624,41673],{"className":41620},[128],[116,41622],{"className":41623,"style":552},[132],[116,41625,41627,41630],{"className":41626},[137],[116,41628,287],{"className":41629},[137,138],[116,41631,41633],{"className":41632},[725],[116,41634,41636,41665],{"className":41635},[168,169],[116,41637,41639,41662],{"className":41638},[173],[116,41640,41642],{"className":41641,"style":3145},[177],[116,41643,41644,41647],{"style":3584},[116,41645],{"className":41646,"style":742},[187],[116,41648,41650],{"className":41649},[746,747,748,749],[116,41651,41653,41656,41659],{"className":41652},[137,749],[116,41654,3158],{"className":41655},[137,138,749],[116,41657,1610],{"className":41658},[574,749],[116,41660,345],{"className":41661},[137,749],[116,41663,234],{"className":41664},[233],[116,41666,41668],{"className":41667},[173],[116,41669,41671],{"className":41670,"style":10931},[177],[116,41672],{},[116,41674,652],{"className":41675},[651]," between adjacent tags,\nand emission probabilities ",[116,41678,41680],{"className":41679},[119],[116,41681,41683,41744],{"className":41682,"ariaHidden":124},[123],[116,41684,41686,41689,41692,41695,41735,41738,41741],{"className":41685},[128],[116,41687],{"className":41688,"style":552},[132],[116,41690,2794],{"className":41691,"style":924},[137,138],[116,41693,562],{"className":41694},[561],[116,41696,41698,41701],{"className":41697},[137],[116,41699,6825],{"className":41700,"style":6824},[137,138],[116,41702,41704],{"className":41703},[725],[116,41705,41707,41727],{"className":41706},[168,169],[116,41708,41710,41724],{"className":41709},[173],[116,41711,41713],{"className":41712,"style":3145},[177],[116,41714,41715,41718],{"style":9162},[116,41716],{"className":41717,"style":742},[187],[116,41719,41721],{"className":41720},[746,747,748,749],[116,41722,3158],{"className":41723},[137,138,749],[116,41725,234],{"className":41726},[233],[116,41728,41730],{"className":41729},[173],[116,41731,41733],{"className":41732,"style":762},[177],[116,41734],{},[116,41736],{"className":41737,"style":145},[144],[116,41739,4389],{"className":41740},[149],[116,41742],{"className":41743,"style":145},[144],[116,41745,41747,41750,41790],{"className":41746},[128],[116,41748],{"className":41749,"style":552},[132],[116,41751,41753,41756],{"className":41752},[137],[116,41754,287],{"className":41755},[137,138],[116,41757,41759],{"className":41758},[725],[116,41760,41762,41782],{"className":41761},[168,169],[116,41763,41765,41779],{"className":41764},[173],[116,41766,41768],{"className":41767,"style":3145},[177],[116,41769,41770,41773],{"style":3584},[116,41771],{"className":41772,"style":742},[187],[116,41774,41776],{"className":41775},[746,747,748,749],[116,41777,3158],{"className":41778},[137,138,749],[116,41780,234],{"className":41781},[233],[116,41783,41785],{"className":41784},[173],[116,41786,41788],{"className":41787,"style":762},[177],[116,41789],{},[116,41791,652],{"className":41792},[651]," of a word given its tag. The ",[108,41795,41796],{},"HMM","\nclass keeps them as two nested maps, ",[108,41799,41800],{},"states"," (tag to word to probability) and\n",[108,41803,41804],{},"transitions"," (tag to following tag to probability), trained by reading paired\nsentence and tag files — the Brown corpus in ",[108,41807,41808],{},"brown-train-sentences.txt",[108,41810,41811],{},"brown-train-tags.txt"," — with a ",[108,41814,41815],{},"#"," token marking each sentence start. Under the\nMarkov assumption, the joint probability of a sentence ",[116,41818,41820],{"className":41819},[119],[116,41821,41823],{"className":41822,"ariaHidden":124},[123],[116,41824,41826,41829],{"className":41825},[128],[116,41827],{"className":41828,"style":9326},[132],[116,41830,41832,41835],{"className":41831},[137],[116,41833,6825],{"className":41834,"style":6824},[137,138],[116,41836,41838],{"className":41837},[725],[116,41839,41841,41870],{"className":41840},[168,169],[116,41842,41844,41867],{"className":41843},[173],[116,41845,41847],{"className":41846,"style":4068},[177],[116,41848,41849,41852],{"style":9162},[116,41850],{"className":41851,"style":742},[187],[116,41853,41855],{"className":41854},[746,747,748,749],[116,41856,41858,41861,41864],{"className":41857},[137,749],[116,41859,345],{"className":41860},[137,749],[116,41862,3225],{"className":41863},[149,749],[116,41865,9120],{"className":41866},[137,138,749],[116,41868,234],{"className":41869},[233],[116,41871,41873],{"className":41872},[173],[116,41874,41876],{"className":41875,"style":762},[177],[116,41877],{}," and a tag\nsequence ",[116,41880,41882],{"className":41881},[119],[116,41883,41885],{"className":41884,"ariaHidden":124},[123],[116,41886,41888,41892],{"className":41887},[128],[116,41889],{"className":41890,"style":41891},[132],"height:0.7651em;vertical-align:-0.15em;",[116,41893,41895,41898],{"className":41894},[137],[116,41896,287],{"className":41897},[137,138],[116,41899,41901],{"className":41900},[725],[116,41902,41904,41933],{"className":41903},[168,169],[116,41905,41907,41930],{"className":41906},[173],[116,41908,41910],{"className":41909,"style":4068},[177],[116,41911,41912,41915],{"style":3584},[116,41913],{"className":41914,"style":742},[187],[116,41916,41918],{"className":41917},[746,747,748,749],[116,41919,41921,41924,41927],{"className":41920},[137,749],[116,41922,345],{"className":41923},[137,749],[116,41925,3225],{"className":41926},[149,749],[116,41928,9120],{"className":41929},[137,138,749],[116,41931,234],{"className":41932},[233],[116,41934,41936],{"className":41935},[173],[116,41937,41939],{"className":41938,"style":762},[177],[116,41940],{}," factors as",[116,41943,41945],{"className":41944},[702],[116,41946,41948],{"className":41947},[119],[116,41949,41951,42079,42210,42326],{"className":41950,"ariaHidden":124},[123],[116,41952,41954,41957,41960,41963,42012,42015,42018,42067,42070,42073,42076],{"className":41953},[128],[116,41955],{"className":41956,"style":552},[132],[116,41958,2794],{"className":41959,"style":924},[137,138],[116,41961,562],{"className":41962},[561],[116,41964,41966,41969],{"className":41965},[137],[116,41967,6825],{"className":41968,"style":6824},[137,138],[116,41970,41972],{"className":41971},[725],[116,41973,41975,42004],{"className":41974},[168,169],[116,41976,41978,42001],{"className":41977},[173],[116,41979,41981],{"className":41980,"style":4068},[177],[116,41982,41983,41986],{"style":9162},[116,41984],{"className":41985,"style":742},[187],[116,41987,41989],{"className":41988},[746,747,748,749],[116,41990,41992,41995,41998],{"className":41991},[137,749],[116,41993,345],{"className":41994},[137,749],[116,41996,3225],{"className":41997},[149,749],[116,41999,9120],{"className":42000},[137,138,749],[116,42002,234],{"className":42003},[233],[116,42005,42007],{"className":42006},[173],[116,42008,42010],{"className":42009,"style":762},[177],[116,42011],{},[116,42013,594],{"className":42014},[593],[116,42016],{"className":42017,"style":279},[144],[116,42019,42021,42024],{"className":42020},[137],[116,42022,287],{"className":42023},[137,138],[116,42025,42027],{"className":42026},[725],[116,42028,42030,42059],{"className":42029},[168,169],[116,42031,42033,42056],{"className":42032},[173],[116,42034,42036],{"className":42035,"style":4068},[177],[116,42037,42038,42041],{"style":3584},[116,42039],{"className":42040,"style":742},[187],[116,42042,42044],{"className":42043},[746,747,748,749],[116,42045,42047,42050,42053],{"className":42046},[137,749],[116,42048,345],{"className":42049},[137,749],[116,42051,3225],{"className":42052},[149,749],[116,42054,9120],{"className":42055},[137,138,749],[116,42057,234],{"className":42058},[233],[116,42060,42062],{"className":42061},[173],[116,42063,42065],{"className":42064,"style":762},[177],[116,42066],{},[116,42068,652],{"className":42069},[651],[116,42071],{"className":42072,"style":145},[144],[116,42074,150],{"className":42075},[149],[116,42077],{"className":42078,"style":145},[144],[116,42080,42082,42085,42152,42155,42158,42161,42201,42204,42207],{"className":42081},[128],[116,42083],{"className":42084,"style":8979},[132],[116,42086,42088],{"className":42087},[1126,3245],[116,42089,42091,42144],{"className":42090},[168,169],[116,42092,42094,42141],{"className":42093},[173],[116,42095,42097,42117,42127],{"className":42096,"style":9073},[177],[116,42098,42099,42102],{"style":3420},[116,42100],{"className":42101,"style":3424},[187],[116,42103,42105],{"className":42104},[746,747,748,749],[116,42106,42108,42111,42114],{"className":42107},[137,749],[116,42109,3158],{"className":42110},[137,138,749],[116,42112,150],{"className":42113},[149,749],[116,42115,345],{"className":42116},[137,749],[116,42118,42119,42122],{"style":3445},[116,42120],{"className":42121,"style":3424},[187],[116,42123,42124],{},[116,42125,9104],{"className":42126},[1126,1127,3454],[116,42128,42129,42132],{"style":9107},[116,42130],{"className":42131,"style":3424},[187],[116,42133,42135],{"className":42134},[746,747,748,749],[116,42136,42138],{"className":42137},[137,749],[116,42139,9120],{"className":42140},[137,138,749],[116,42142,234],{"className":42143},[233],[116,42145,42147],{"className":42146},[173],[116,42148,42150],{"className":42149,"style":9130},[177],[116,42151],{},[116,42153],{"className":42154,"style":279},[144],[116,42156,2794],{"className":42157,"style":924},[137,138],[116,42159,562],{"className":42160},[561],[116,42162,42164,42167],{"className":42163},[137],[116,42165,287],{"className":42166},[137,138],[116,42168,42170],{"className":42169},[725],[116,42171,42173,42193],{"className":42172},[168,169],[116,42174,42176,42190],{"className":42175},[173],[116,42177,42179],{"className":42178,"style":3145},[177],[116,42180,42181,42184],{"style":3584},[116,42182],{"className":42183,"style":742},[187],[116,42185,42187],{"className":42186},[746,747,748,749],[116,42188,3158],{"className":42189},[137,138,749],[116,42191,234],{"className":42192},[233],[116,42194,42196],{"className":42195},[173],[116,42197,42199],{"className":42198,"style":762},[177],[116,42200],{},[116,42202],{"className":42203,"style":145},[144],[116,42205,4389],{"className":42206},[149],[116,42208],{"className":42209,"style":145},[144],[116,42211,42213,42216,42265,42268,42271,42274,42277,42317,42320,42323],{"className":42212},[128],[116,42214],{"className":42215,"style":552},[132],[116,42217,42219,42222],{"className":42218},[137],[116,42220,287],{"className":42221},[137,138],[116,42223,42225],{"className":42224},[725],[116,42226,42228,42257],{"className":42227},[168,169],[116,42229,42231,42254],{"className":42230},[173],[116,42232,42234],{"className":42233,"style":3145},[177],[116,42235,42236,42239],{"style":3584},[116,42237],{"className":42238,"style":742},[187],[116,42240,42242],{"className":42241},[746,747,748,749],[116,42243,42245,42248,42251],{"className":42244},[137,749],[116,42246,3158],{"className":42247},[137,138,749],[116,42249,1610],{"className":42250},[574,749],[116,42252,345],{"className":42253},[137,749],[116,42255,234],{"className":42256},[233],[116,42258,42260],{"className":42259},[173],[116,42261,42263],{"className":42262,"style":10931},[177],[116,42264],{},[116,42266,652],{"className":42267},[651],[116,42269],{"className":42270,"style":279},[144],[116,42272,2794],{"className":42273,"style":924},[137,138],[116,42275,562],{"className":42276},[561],[116,42278,42280,42283],{"className":42279},[137],[116,42281,6825],{"className":42282,"style":6824},[137,138],[116,42284,42286],{"className":42285},[725],[116,42287,42289,42309],{"className":42288},[168,169],[116,42290,42292,42306],{"className":42291},[173],[116,42293,42295],{"className":42294,"style":3145},[177],[116,42296,42297,42300],{"style":9162},[116,42298],{"className":42299,"style":742},[187],[116,42301,42303],{"className":42302},[746,747,748,749],[116,42304,3158],{"className":42305},[137,138,749],[116,42307,234],{"className":42308},[233],[116,42310,42312],{"className":42311},[173],[116,42313,42315],{"className":42314,"style":762},[177],[116,42316],{},[116,42318],{"className":42319,"style":145},[144],[116,42321,4389],{"className":42322},[149],[116,42324],{"className":42325,"style":145},[144],[116,42327,42329,42332,42372,42375],{"className":42328},[128],[116,42330],{"className":42331,"style":552},[132],[116,42333,42335,42338],{"className":42334},[137],[116,42336,287],{"className":42337},[137,138],[116,42339,42341],{"className":42340},[725],[116,42342,42344,42364],{"className":42343},[168,169],[116,42345,42347,42361],{"className":42346},[173],[116,42348,42350],{"className":42349,"style":3145},[177],[116,42351,42352,42355],{"style":3584},[116,42353],{"className":42354,"style":742},[187],[116,42356,42358],{"className":42357},[746,747,748,749],[116,42359,3158],{"className":42360},[137,138,749],[116,42362,234],{"className":42363},[233],[116,42365,42367],{"className":42366},[173],[116,42368,42370],{"className":42369,"style":762},[177],[116,42371],{},[116,42373,652],{"className":42374},[651],[116,42376,594],{"className":42377},[593],[73,42379,42380,42381,42431],{},"and tagging asks for the tag sequence that maximizes it. Enumerating all\n",[116,42382,42384],{"className":42383},[119],[116,42385,42387],{"className":42386,"ariaHidden":124},[123],[116,42388,42390,42393,42396,42399],{"className":42389},[128],[116,42391],{"className":42392,"style":552},[132],[116,42394,4389],{"className":42395},[137],[116,42397,17096],{"className":42398,"style":924},[137,138],[116,42400,42402,42405],{"className":42401},[137],[116,42403,4389],{"className":42404},[137],[116,42406,42408],{"className":42407},[725],[116,42409,42411],{"className":42410},[168],[116,42412,42414],{"className":42413},[173],[116,42415,42417],{"className":42416,"style":4633},[177],[116,42418,42419,42422],{"style":1167},[116,42420],{"className":42421,"style":742},[187],[116,42423,42425],{"className":42424},[746,747,748,749],[116,42426,42428],{"className":42427},[137,749],[116,42429,9120],{"className":42430},[137,138,749]," sequences is exponential, so the search is folded into a dynamic\nprogram.",[73,42433,42434,42435,42496,42497,42512,42513,42528],{},"The decoder works from a single recurrence. Let ",[116,42436,42438],{"className":42437},[119],[116,42439,42441],{"className":42440,"ariaHidden":124},[123],[116,42442,42444,42447,42487,42490,42493],{"className":42443},[128],[116,42445],{"className":42446,"style":552},[132],[116,42448,42450,42453],{"className":42449},[137],[116,42451,140],{"className":42452,"style":139},[137,138],[116,42454,42456],{"className":42455},[725],[116,42457,42459,42479],{"className":42458},[168,169],[116,42460,42462,42476],{"className":42461},[173],[116,42463,42465],{"className":42464,"style":3145},[177],[116,42466,42467,42470],{"style":3490},[116,42468],{"className":42469,"style":742},[187],[116,42471,42473],{"className":42472},[746,747,748,749],[116,42474,3158],{"className":42475},[137,138,749],[116,42477,234],{"className":42478},[233],[116,42480,42482],{"className":42481},[173],[116,42483,42485],{"className":42484,"style":762},[177],[116,42486],{},[116,42488,562],{"className":42489},[561],[116,42491,287],{"className":42492},[137,138],[116,42494,652],{"className":42495},[651]," be the probability of\nthe best tag sequence ending in tag ",[116,42498,42500],{"className":42499},[119],[116,42501,42503],{"className":42502,"ariaHidden":124},[123],[116,42504,42506,42509],{"className":42505},[128],[116,42507],{"className":42508,"style":2770},[132],[116,42510,287],{"className":42511},[137,138]," at position ",[116,42514,42516],{"className":42515},[119],[116,42517,42519],{"className":42518,"ariaHidden":124},[123],[116,42520,42522,42525],{"className":42521},[128],[116,42523],{"className":42524,"style":3948},[132],[116,42526,3158],{"className":42527},[137,138],"; it depends only on the\nprevious column,",[116,42530,42532],{"className":42531},[702],[116,42533,42535],{"className":42534},[119],[116,42536,42538,42602,42663,42819],{"className":42537,"ariaHidden":124},[123],[116,42539,42541,42544,42584,42587,42590,42593,42596,42599],{"className":42540},[128],[116,42542],{"className":42543,"style":552},[132],[116,42545,42547,42550],{"className":42546},[137],[116,42548,140],{"className":42549,"style":139},[137,138],[116,42551,42553],{"className":42552},[725],[116,42554,42556,42576],{"className":42555},[168,169],[116,42557,42559,42573],{"className":42558},[173],[116,42560,42562],{"className":42561,"style":3145},[177],[116,42563,42564,42567],{"style":3490},[116,42565],{"className":42566,"style":742},[187],[116,42568,42570],{"className":42569},[746,747,748,749],[116,42571,3158],{"className":42572},[137,138,749],[116,42574,234],{"className":42575},[233],[116,42577,42579],{"className":42578},[173],[116,42580,42582],{"className":42581,"style":762},[177],[116,42583],{},[116,42585,562],{"className":42586},[561],[116,42588,287],{"className":42589},[137,138],[116,42591,652],{"className":42592},[651],[116,42594],{"className":42595,"style":145},[144],[116,42597,150],{"className":42598},[149],[116,42600],{"className":42601,"style":145},[144],[116,42603,42605,42608,42611,42614,42654,42657,42660],{"className":42604},[128],[116,42606],{"className":42607,"style":552},[132],[116,42609,2794],{"className":42610,"style":924},[137,138],[116,42612,562],{"className":42613},[561],[116,42615,42617,42620],{"className":42616},[137],[116,42618,6825],{"className":42619,"style":6824},[137,138],[116,42621,42623],{"className":42622},[725],[116,42624,42626,42646],{"className":42625},[168,169],[116,42627,42629,42643],{"className":42628},[173],[116,42630,42632],{"className":42631,"style":3145},[177],[116,42633,42634,42637],{"style":9162},[116,42635],{"className":42636,"style":742},[187],[116,42638,42640],{"className":42639},[746,747,748,749],[116,42641,3158],{"className":42642},[137,138,749],[116,42644,234],{"className":42645},[233],[116,42647,42649],{"className":42648},[173],[116,42650,42652],{"className":42651,"style":762},[177],[116,42653],{},[116,42655],{"className":42656,"style":145},[144],[116,42658,4389],{"className":42659},[149],[116,42661],{"className":42662,"style":145},[144],[116,42664,42666,42670,42673,42676,42679,42682,42734,42737,42740,42789,42792,42795,42798,42801,42804,42807,42810,42813,42816],{"className":42665},[128],[116,42667],{"className":42668,"style":42669},[132],"height:1.45em;vertical-align:-0.7em;",[116,42671,287],{"className":42672},[137,138],[116,42674,652],{"className":42675},[651],[116,42677],{"className":42678,"style":279},[144],[116,42680],{"className":42681,"style":279},[144],[116,42683,42685],{"className":42684},[1126,3245],[116,42686,42688,42725],{"className":42687},[168,169],[116,42689,42691,42722],{"className":42690},[173],[116,42692,42694,42709],{"className":42693,"style":133},[177],[116,42695,42697,42700],{"style":42696},"top:-2.4em;margin-left:0em;",[116,42698],{"className":42699,"style":1119},[187],[116,42701,42703],{"className":42702},[746,747,748,749],[116,42704,42706],{"className":42705},[137,749],[116,42707,16940],{"className":42708},[137,138,749],[116,42710,42711,42714],{"style":3376},[116,42712],{"className":42713,"style":1119},[187],[116,42715,42716],{},[116,42717,42719],{"className":42718},[1126],[116,42720,9027],{"className":42721},[137,3388],[116,42723,234],{"className":42724},[233],[116,42726,42728],{"className":42727},[173],[116,42729,42732],{"className":42730,"style":42731},[177],"height:0.7em;",[116,42733],{},[116,42735],{"className":42736,"style":145},[144],[116,42738],{"className":42739,"style":279},[144],[116,42741,42743,42746],{"className":42742},[137],[116,42744,140],{"className":42745,"style":139},[137,138],[116,42747,42749],{"className":42748},[725],[116,42750,42752,42781],{"className":42751},[168,169],[116,42753,42755,42778],{"className":42754},[173],[116,42756,42758],{"className":42757,"style":3145},[177],[116,42759,42760,42763],{"style":3490},[116,42761],{"className":42762,"style":742},[187],[116,42764,42766],{"className":42765},[746,747,748,749],[116,42767,42769,42772,42775],{"className":42768},[137,749],[116,42770,3158],{"className":42771},[137,138,749],[116,42773,1610],{"className":42774},[574,749],[116,42776,345],{"className":42777},[137,749],[116,42779,234],{"className":42780},[233],[116,42782,42784],{"className":42783},[173],[116,42785,42787],{"className":42786,"style":10931},[177],[116,42788],{},[116,42790,562],{"className":42791},[561],[116,42793,16940],{"className":42794},[137,138],[116,42796,652],{"className":42797},[651],[116,42799],{"className":42800,"style":279},[144],[116,42802,2794],{"className":42803,"style":924},[137,138],[116,42805,562],{"className":42806},[561],[116,42808,287],{"className":42809},[137,138],[116,42811],{"className":42812,"style":145},[144],[116,42814,4389],{"className":42815},[149],[116,42817],{"className":42818,"style":145},[144],[116,42820,42822,42825,42828,42831],{"className":42821},[128],[116,42823],{"className":42824,"style":552},[132],[116,42826,16940],{"className":42827},[137,138],[116,42829,652],{"className":42830},[651],[116,42832,594],{"className":42833},[593],[73,42835,42836,42837,42876],{},"so one left-to-right sweep fills an ",[116,42838,42840],{"className":42839},[119],[116,42841,42843,42861],{"className":42842,"ariaHidden":124},[123],[116,42844,42846,42849,42852,42855,42858],{"className":42845},[128],[116,42847],{"className":42848,"style":2930},[132],[116,42850,9120],{"className":42851},[137,138],[116,42853],{"className":42854,"style":570},[144],[116,42856,439],{"className":42857},[574],[116,42859],{"className":42860,"style":570},[144],[116,42862,42864,42867,42870,42873],{"className":42863},[128],[116,42865],{"className":42866,"style":552},[132],[116,42868,4389],{"className":42869},[137],[116,42871,17096],{"className":42872,"style":924},[137,138],[116,42874,4389],{"className":42875},[137]," table, and back-pointers\nrecover the winning sequence. A greedy tagger that commits to the best tag at\neach word can be led astray by a locally attractive choice; Viterbi keeps every\noption open until the whole sentence is scored. Probabilities are accumulated in\nlog space, turning the products into sums and avoiding underflow on long\nsentences.",[73,42878,42879],{},"Laid out as a grid of positions by tags, the recurrence fills one column from the\none before it, and every cell records which predecessor it chose — the\nback-pointer that lets the winning sequence be traced once the last column is\nscored:",[246,42881],{"hash":42882},"a02e68ddac5db44c28bf93d7e28052c449c4eb3f4ded63e52cdc933914443e1f",[2107,42884,42886],{"className":2109,"code":42885,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Viterbi}(w_{1:n})$ — decode the most likely tag sequence\ninput: a sentence $w_1 \\ldots w_n$, transitions $P(t \\mid s)$, emissions $P(w \\mid t)$\nfor each tag $t$ do\n  $v_1(t) \\gets P(t \\mid \\textsc{Start})\\, P(w_1 \\mid t)$\nfor $i \\gets 2$ to $n$ do\n  for each tag $t$ do\n    $v_i(t) \\gets P(w_i \\mid t)\\, \\max_{s}\\; v_{i-1}(s)\\, P(t \\mid s)$\n    $\\mathrm{back}_i(t) \\gets \\operatorname{arg\\,max}_{s}\\; v_{i-1}(s)\\, P(t \\mid s)$\nreturn the sequence traced back from $\\operatorname{arg\\,max}_{t} v_n(t)$\n",[108,42887,42888,42893,42898,42903,42908,42913,42918,42923,42928],{"__ignoreMap":478},[116,42889,42890],{"class":2116,"line":2117},[116,42891,42892],{},"caption: $\\textsc{Viterbi}(w_{1:n})$ — decode the most likely tag sequence\n",[116,42894,42895],{"class":2116,"line":479},[116,42896,42897],{},"input: a sentence $w_1 \\ldots w_n$, transitions $P(t \\mid s)$, emissions $P(w \\mid t)$\n",[116,42899,42900],{"class":2116,"line":2128},[116,42901,42902],{},"for each tag $t$ do\n",[116,42904,42905],{"class":2116,"line":2134},[116,42906,42907],{},"  $v_1(t) \\gets P(t \\mid \\textsc{Start})\\, P(w_1 \\mid t)$\n",[116,42909,42910],{"class":2116,"line":2140},[116,42911,42912],{},"for $i \\gets 2$ to $n$ do\n",[116,42914,42915],{"class":2116,"line":2146},[116,42916,42917],{},"  for each tag $t$ do\n",[116,42919,42920],{"class":2116,"line":2152},[116,42921,42922],{},"    $v_i(t) \\gets P(w_i \\mid t)\\, \\max_{s}\\; v_{i-1}(s)\\, P(t \\mid s)$\n",[116,42924,42925],{"class":2116,"line":2158},[116,42926,42927],{},"    $\\mathrm{back}_i(t) \\gets \\operatorname{arg\\,max}_{s}\\; v_{i-1}(s)\\, P(t \\mid s)$\n",[116,42929,42930],{"class":2116,"line":2164},[116,42931,42932],{},"return the sequence traced back from $\\operatorname{arg\\,max}_{t} v_n(t)$\n",[73,42934,42935,42936,42939,42940,13893,42943,42961,42962,42965,42966,42969,42970,42973],{},"A word never seen in training has zero emission probability under every tag,\nwhich would zero out any path through it. To keep such a word from killing an\notherwise good sequence, ",[108,42937,42938],{},"HMM.viterbi"," charges a fixed ",[108,42941,42942],{},"unseenPenalty",[116,42944,42946],{"className":42945},[119],[116,42947,42949],{"className":42948,"ariaHidden":124},[123],[116,42950,42952,42955,42958],{"className":42951},[128],[116,42953],{"className":42954,"style":1871},[132],[116,42956,1610],{"className":42957},[137],[116,42959,6772],{"className":42960},[137],"\nin log space for an unseen word, letting the transition structure pick a\nplausible tag from context alone. Run over held-out data, ",[108,42963,42964],{},"testFile"," tags ",[108,42967,42968],{},"brown-test-sentences.txt"," and\nscores its output against ",[108,42971,42972],{},"brown-test-tags.txt",", counting correct against\nincorrect tags.",[2263,42975,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":42977},[],"2021-03-02","A hidden Markov model\ntreats a sentence as a sequence of hidden states — the part-of-speech tags —\nthat emit the observed words. Tagging recovers the tag sequence most likely to\nhave produced the sentence, and the\nViterbi algorithm finds it\nexactly in time linear in the sentence length.",{},"\u002Fprojects\u002Fai\u002F10-pos-tagging",[42983,32393],"https:\u002F\u002Fnotes.amittai.studio\u002Fnatural-language-processing\u002Fsequences\u002Fsequence-labeling","https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-java\u002Ftree\u002Fmain\u002FProblem%20Sets\u002FPS-5",{"title":41535,"description":42979},"projects\u002Fai\u002F10-pos-tagging","Part-of-speech tagging as a hidden Markov model, decoded with the Viterbi\nalgorithm over tag-transition and word-emission probabilities.",[41529,42989],"Markov Decision Processes","qrCLWHtHT2Z_kXBVdBfjFAwoK0a6v39E0x_ht0x94c8",{"id":42992,"title":42993,"body":42994,"date":43803,"description":43804,"extension":483,"featured":2354,"meta":43805,"navigation":484,"path":43806,"references":43807,"repo":25793,"seo":43810,"stem":43811,"summary":43812,"tag":43813,"tech":43814,"url":2282,"__hash__":43816},"projects\u002Fprojects\u002Finformation-theory\u002F10-huffman-encoding.md","Huffman Coding",{"type":70,"value":42995,"toc":43801},[42996,43005,43008,43058,43061,43064,43067,43220,43307,43310,43488,43516,43638,43799],[73,42997,42998,42999,43004],{},"Lossless text compression by ",[76,43000,43003],{"href":43001,"rel":43002},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHuffman_coding#Compression",[80],"Huffman\ncoding",".\nFrequent characters get short binary codes and rare ones long codes, and\nno code is a prefix of another, so the compressed stream decodes back to\nthe original with no ambiguity.",[73,43006,43007],{},"The codes come from a binary tree built bottom up. Start with one leaf per\ncharacter, keyed by its frequency, and\nrepeatedly merge the two lowest-frequency nodes under a new parent whose\nfrequency is their sum, until a single tree remains. Reading the tree\nroot-to-leaf — 0 for a left branch, 1 for a right — gives each character\nits code.",[2107,43009,43011],{"className":2109,"code":43010,"language":2111,"meta":478,"style":478},"caption: $\\textsc{Huffman}(C)$ — build an optimal prefix code from frequencies\ninput: characters $C$, each with frequency $f[c]$\n$Q \\gets$ min-priority queue over $C$, keyed by $f$\nfor $i \\gets 1$ to $\\lvert C \\rvert - 1$ do\n  $x \\gets \\textsc{Extract-Min}(Q)$\n  $y \\gets \\textsc{Extract-Min}(Q)$\n  $z \\gets$ new node with children $x, y$ and $f[z] \\gets f[x] + f[y]$\n  insert $z$ into $Q$\nreturn $\\textsc{Extract-Min}(Q)$\n",[108,43012,43013,43018,43023,43028,43033,43038,43043,43048,43053],{"__ignoreMap":478},[116,43014,43015],{"class":2116,"line":2117},[116,43016,43017],{},"caption: $\\textsc{Huffman}(C)$ — build an optimal prefix code from frequencies\n",[116,43019,43020],{"class":2116,"line":479},[116,43021,43022],{},"input: characters $C$, each with frequency $f[c]$\n",[116,43024,43025],{"class":2116,"line":2128},[116,43026,43027],{},"$Q \\gets$ min-priority queue over $C$, keyed by $f$\n",[116,43029,43030],{"class":2116,"line":2134},[116,43031,43032],{},"for $i \\gets 1$ to $\\lvert C \\rvert - 1$ do\n",[116,43034,43035],{"class":2116,"line":2140},[116,43036,43037],{},"  $x \\gets \\textsc{Extract-Min}(Q)$\n",[116,43039,43040],{"class":2116,"line":2146},[116,43041,43042],{},"  $y \\gets \\textsc{Extract-Min}(Q)$\n",[116,43044,43045],{"class":2116,"line":2152},[116,43046,43047],{},"  $z \\gets$ new node with children $x, y$ and $f[z] \\gets f[x] + f[y]$\n",[116,43049,43050],{"class":2116,"line":2158},[116,43051,43052],{},"  insert $z$ into $Q$\n",[116,43054,43055],{"class":2116,"line":2164},[116,43056,43057],{},"return $\\textsc{Extract-Min}(Q)$\n",[246,43059],{"hash":43060},"0dd5b0b05e606eef0abca0f12c56d1b0cee372b5bdac77079bcaff51dd44781a",[73,43062,43063],{},"Because every symbol lands on a leaf, no codeword is a prefix of another, and\nthe compressed stream needs no separators between symbols.\nDecoding walks the tree from the root, branching left on a 0 and right on a 1;\nthe moment it reaches a leaf it emits that symbol and jumps back to the root. Each\ninput bit is read once, so decoding is linear in the length of the stream.",[73,43065,43066],{},"The greedy choice turns out to be optimal, and the reason is structural. A\nprefix code is exactly a labeling where every character is a leaf, so no code\nsits on the path to another.\nThe cost of a tree is the expected code length",[116,43068,43070],{"className":43069},[702],[116,43071,43073],{"className":43072},[119],[116,43074,43076,43125],{"className":43075,"ariaHidden":124},[123],[116,43077,43079,43083,43116,43119,43122],{"className":43078},[128],[116,43080],{"className":43081,"style":43082},[132],"height:0.8201em;",[116,43084,43086],{"className":43085},[137,7716],[116,43087,43089],{"className":43088},[168],[116,43090,43092],{"className":43091},[173],[116,43093,43095,43103],{"className":43094,"style":43082},[177],[116,43096,43097,43100],{"style":3376},[116,43098],{"className":43099,"style":1119},[187],[116,43101,4716],{"className":43102},[137,138],[116,43104,43105,43108],{"style":26932},[116,43106],{"className":43107,"style":1119},[187],[116,43109,43112],{"className":43110,"style":43111},[7742],"left:-0.2222em;",[116,43113,43115],{"className":43114},[137],"ˉ",[116,43117],{"className":43118,"style":145},[144],[116,43120,150],{"className":43121},[149],[116,43123],{"className":43124,"style":145},[144],[116,43126,43128,43132,43187,43190,43193,43196,43199,43202,43205,43208,43211,43214,43217],{"className":43127},[128],[116,43129],{"className":43130,"style":43131},[132],"height:2.3717em;vertical-align:-1.3217em;",[116,43133,43135],{"className":43134},[1126,3245],[116,43136,43138,43178],{"className":43137},[168,169],[116,43139,43141,43175],{"className":43140},[173],[116,43142,43144,43165],{"className":43143,"style":3417},[177],[116,43145,43147,43150],{"style":43146},"top:-1.8557em;margin-left:0em;",[116,43148],{"className":43149,"style":3424},[187],[116,43151,43153],{"className":43152},[746,747,748,749],[116,43154,43156,43159,43162],{"className":43155},[137,749],[116,43157,8916],{"className":43158},[137,138,749],[116,43160,35940],{"className":43161},[149,749],[116,43163,24660],{"className":43164,"style":2666},[137,138,749],[116,43166,43167,43170],{"style":3445},[116,43168],{"className":43169,"style":3424},[187],[116,43171,43172],{},[116,43173,1130],{"className":43174},[1126,1127,3454],[116,43176,234],{"className":43177},[233],[116,43179,43181],{"className":43180},[173],[116,43182,43185],{"className":43183,"style":43184},[177],"height:1.3217em;",[116,43186],{},[116,43188],{"className":43189,"style":279},[144],[116,43191,26047],{"className":43192,"style":33277},[137,138],[116,43194,1092],{"className":43195},[561],[116,43197,8916],{"className":43198},[137,138],[116,43200,1493],{"className":43201},[651],[116,43203],{"className":43204,"style":279},[144],[116,43206,32585],{"className":43207},[137],[116,43209,562],{"className":43210},[561],[116,43212,8916],{"className":43213},[137,138],[116,43215,652],{"className":43216},[651],[116,43218,594],{"className":43219},[593],[73,43221,2532,43222,43246,43247,43262,43263,43306],{},[116,43223,43225],{"className":43224},[119],[116,43226,43228],{"className":43227,"ariaHidden":124},[123],[116,43229,43231,43234,43237,43240,43243],{"className":43230},[128],[116,43232],{"className":43233,"style":552},[132],[116,43235,32585],{"className":43236},[137],[116,43238,562],{"className":43239},[561],[116,43241,8916],{"className":43242},[137,138],[116,43244,652],{"className":43245},[651]," is the depth of leaf ",[116,43248,43250],{"className":43249},[119],[116,43251,43253],{"className":43252,"ariaHidden":124},[123],[116,43254,43256,43259],{"className":43255},[128],[116,43257],{"className":43258,"style":133},[132],[116,43260,8916],{"className":43261},[137,138],". Merging the two rarest symbols\nfirst is safe because they can always be pushed to the deepest level of\nsome optimal tree without raising ",[116,43264,43266],{"className":43265},[119],[116,43267,43269],{"className":43268,"ariaHidden":124},[123],[116,43270,43272,43275],{"className":43271},[128],[116,43273],{"className":43274,"style":43082},[132],[116,43276,43278],{"className":43277},[137,7716],[116,43279,43281],{"className":43280},[168],[116,43282,43284],{"className":43283},[173],[116,43285,43287,43295],{"className":43286,"style":43082},[177],[116,43288,43289,43292],{"style":3376},[116,43290],{"className":43291,"style":1119},[187],[116,43293,4716],{"className":43294},[137,138],[116,43296,43297,43300],{"style":26932},[116,43298],{"className":43299,"style":1119},[187],[116,43301,43303],{"className":43302,"style":43111},[7742],[116,43304,43115],{"className":43305},[137],"; induction on the merges then\ngives a globally optimal code. No prefix code beats it.",[73,43308,43309],{},"The theoretical floor sits just below that. Shannon's source coding theorem\nsets the entropy",[116,43311,43313],{"className":43312},[702],[116,43314,43316],{"className":43315},[119],[116,43317,43319,43346],{"className":43318,"ariaHidden":124},[123],[116,43320,43322,43325,43328,43331,43334,43337,43340,43343],{"className":43321},[128],[116,43323],{"className":43324,"style":552},[132],[116,43326,5804],{"className":43327,"style":5803},[137,138],[116,43329,562],{"className":43330},[561],[116,43332,2910],{"className":43333,"style":556},[137,138],[116,43335,652],{"className":43336},[651],[116,43338],{"className":43339,"style":145},[144],[116,43341,150],{"className":43342},[149],[116,43344],{"className":43345,"style":145},[144],[116,43347,43349,43352,43355,43358,43411,43414,43417,43420,43423,43426,43429,43473,43476,43479,43482,43485],{"className":43348},[128],[116,43350],{"className":43351,"style":43131},[132],[116,43353,1610],{"className":43354},[137],[116,43356],{"className":43357,"style":279},[144],[116,43359,43361],{"className":43360},[1126,3245],[116,43362,43364,43403],{"className":43363},[168,169],[116,43365,43367,43400],{"className":43366},[173],[116,43368,43370,43390],{"className":43369,"style":3417},[177],[116,43371,43372,43375],{"style":43146},[116,43373],{"className":43374,"style":3424},[187],[116,43376,43378],{"className":43377},[746,747,748,749],[116,43379,43381,43384,43387],{"className":43380},[137,749],[116,43382,8916],{"className":43383},[137,138,749],[116,43385,35940],{"className":43386},[149,749],[116,43388,24660],{"className":43389,"style":2666},[137,138,749],[116,43391,43392,43395],{"style":3445},[116,43393],{"className":43394,"style":3424},[187],[116,43396,43397],{},[116,43398,1130],{"className":43399},[1126,1127,3454],[116,43401,234],{"className":43402},[233],[116,43404,43406],{"className":43405},[173],[116,43407,43409],{"className":43408,"style":43184},[177],[116,43410],{},[116,43412],{"className":43413,"style":279},[144],[116,43415,73],{"className":43416},[137,138],[116,43418,1092],{"className":43419},[561],[116,43421,8916],{"className":43422},[137,138],[116,43424,1493],{"className":43425},[651],[116,43427],{"className":43428,"style":279},[144],[116,43430,43432,43438],{"className":43431},[1126],[116,43433,43435],{"className":43434},[1126],[116,43436,4745],{"className":43437,"style":4744},[137,3388],[116,43439,43441],{"className":43440},[725],[116,43442,43444,43465],{"className":43443},[168,169],[116,43445,43447,43462],{"className":43446},[173],[116,43448,43451],{"className":43449,"style":43450},[177],"height:0.207em;",[116,43452,43453,43456],{"style":18715},[116,43454],{"className":43455,"style":742},[187],[116,43457,43459],{"className":43458},[746,747,748,749],[116,43460,359],{"className":43461},[137,749],[116,43463,234],{"className":43464},[233],[116,43466,43468],{"className":43467},[173],[116,43469,43471],{"className":43470,"style":18813},[177],[116,43472],{},[116,43474],{"className":43475,"style":279},[144],[116,43477,73],{"className":43478},[137,138],[116,43480,1092],{"className":43481},[561],[116,43483,8916],{"className":43484},[137,138],[116,43486,1493],{"className":43487},[651],[73,43489,43490,43491,43515],{},"as the average number of bits per symbol no lossless code can undercut, where\n",[116,43492,43494],{"className":43493},[119],[116,43495,43497],{"className":43496,"ariaHidden":124},[123],[116,43498,43500,43503,43506,43509,43512],{"className":43499},[128],[116,43501],{"className":43502,"style":552},[132],[116,43504,73],{"className":43505},[137,138],[116,43507,1092],{"className":43508},[561],[116,43510,8916],{"className":43511},[137,138],[116,43513,1493],{"className":43514},[651]," is the symbol's probability. Huffman coding lands within one bit of it,",[116,43517,43519],{"className":43518},[702],[116,43520,43522],{"className":43521},[119],[116,43523,43525,43552,43599,43626],{"className":43524,"ariaHidden":124},[123],[116,43526,43528,43531,43534,43537,43540,43543,43546,43549],{"className":43527},[128],[116,43529],{"className":43530,"style":552},[132],[116,43532,5804],{"className":43533,"style":5803},[137,138],[116,43535,562],{"className":43536},[561],[116,43538,2910],{"className":43539,"style":556},[137,138],[116,43541,652],{"className":43542},[651],[116,43544],{"className":43545,"style":145},[144],[116,43547,14886],{"className":43548},[149],[116,43550],{"className":43551,"style":145},[144],[116,43553,43555,43559,43590,43593,43596],{"className":43554},[128],[116,43556],{"className":43557,"style":43558},[132],"height:0.8592em;vertical-align:-0.0391em;",[116,43560,43562],{"className":43561},[137,7716],[116,43563,43565],{"className":43564},[168],[116,43566,43568],{"className":43567},[173],[116,43569,43571,43579],{"className":43570,"style":43082},[177],[116,43572,43573,43576],{"style":3376},[116,43574],{"className":43575,"style":1119},[187],[116,43577,4716],{"className":43578},[137,138],[116,43580,43581,43584],{"style":26932},[116,43582],{"className":43583,"style":1119},[187],[116,43585,43587],{"className":43586,"style":43111},[7742],[116,43588,43115],{"className":43589},[137],[116,43591],{"className":43592,"style":145},[144],[116,43594,24389],{"className":43595},[149],[116,43597],{"className":43598,"style":145},[144],[116,43600,43602,43605,43608,43611,43614,43617,43620,43623],{"className":43601},[128],[116,43603],{"className":43604,"style":552},[132],[116,43606,5804],{"className":43607,"style":5803},[137,138],[116,43609,562],{"className":43610},[561],[116,43612,2910],{"className":43613,"style":556},[137,138],[116,43615,652],{"className":43616},[651],[116,43618],{"className":43619,"style":570},[144],[116,43621,575],{"className":43622},[574],[116,43624],{"className":43625,"style":570},[144],[116,43627,43629,43632,43635],{"className":43628},[128],[116,43630],{"className":43631,"style":899},[132],[116,43633,345],{"className":43634},[137],[116,43636,594],{"className":43637},[593],[73,43639,43640,43641,43717,43718,43798],{},"the slack being the cost of using a whole number of bits per symbol when the\nideal length ",[116,43642,43644],{"className":43643},[119],[116,43645,43647],{"className":43646,"ariaHidden":124},[123],[116,43648,43650,43653,43656,43659,43702,43705,43708,43711,43714],{"className":43649},[128],[116,43651],{"className":43652,"style":552},[132],[116,43654,1610],{"className":43655},[137],[116,43657],{"className":43658,"style":279},[144],[116,43660,43662,43668],{"className":43661},[1126],[116,43663,43665],{"className":43664},[1126],[116,43666,4745],{"className":43667,"style":4744},[137,3388],[116,43669,43671],{"className":43670},[725],[116,43672,43674,43694],{"className":43673},[168,169],[116,43675,43677,43691],{"className":43676},[173],[116,43678,43680],{"className":43679,"style":43450},[177],[116,43681,43682,43685],{"style":18715},[116,43683],{"className":43684,"style":742},[187],[116,43686,43688],{"className":43687},[746,747,748,749],[116,43689,359],{"className":43690},[137,749],[116,43692,234],{"className":43693},[233],[116,43695,43697],{"className":43696},[173],[116,43698,43700],{"className":43699,"style":18813},[177],[116,43701],{},[116,43703],{"className":43704,"style":279},[144],[116,43706,73],{"className":43707},[137,138],[116,43709,1092],{"className":43710},[561],[116,43712,8916],{"className":43713},[137,138],[116,43715,1493],{"className":43716},[651]," is usually fractional. The gap shrinks to nothing when\nthe probabilities are exact powers of ",[116,43719,43721],{"className":43720},[119],[116,43722,43724],{"className":43723,"ariaHidden":124},[123],[116,43725,43727,43730],{"className":43726},[128],[116,43728],{"className":43729,"style":23588},[132],[116,43731,43733,43736,43795],{"className":43732},[137],[116,43734],{"className":43735},[561,4427],[116,43737,43739],{"className":43738},[4431],[116,43740,43742,43787],{"className":43741},[168,169],[116,43743,43745,43784],{"className":43744},[173],[116,43746,43748,43762,43770],{"className":43747,"style":19612},[177],[116,43749,43750,43753],{"style":8709},[116,43751],{"className":43752,"style":1119},[187],[116,43754,43756],{"className":43755},[746,747,748,749],[116,43757,43759],{"className":43758},[137,749],[116,43760,359],{"className":43761},[137,749],[116,43763,43764,43767],{"style":4597},[116,43765],{"className":43766,"style":1119},[187],[116,43768],{"className":43769,"style":4605},[4604],[116,43771,43772,43775],{"style":8732},[116,43773],{"className":43774,"style":1119},[187],[116,43776,43778],{"className":43777},[746,747,748,749],[116,43779,43781],{"className":43780},[137,749],[116,43782,345],{"className":43783},[137,749],[116,43785,234],{"className":43786},[233],[116,43788,43790],{"className":43789},[173],[116,43791,43793],{"className":43792,"style":8755},[177],[116,43794],{},[116,43796],{"className":43797},[651,4427],", and it is amortized away in\npractice by coding blocks of symbols at once.",[2263,43800,2265],{},{"title":478,"searchDepth":479,"depth":479,"links":43802},[],"2021-03-01","Lossless text compression by Huffman\ncoding.\nFrequent characters get short binary codes and rare ones long codes, and\nno code is a prefix of another, so the compressed stream decodes back to\nthe original with no ambiguity.",{},"\u002Fprojects\u002Finformation-theory\u002F10-huffman-encoding",[43808,43809],"https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fgreedy\u002Fhuffman-codes","https:\u002F\u002Fnotes.amittai.studio\u002Falgorithms\u002Fgreedy\u002Fthe-greedy-method",{"title":42993,"description":43804},"projects\u002Finformation-theory\u002F10-huffman-encoding","Lossless text compression by Huffman coding — a greedy frequency tree that\ngives frequent characters the shortest prefix-free codes.","information theory",[41529,43815],"Information Theory","dl0c27ytuTkMDkQ0yBdSuFkRsfLJSfKzCzM8ogZPHxk",{"id":43818,"title":43819,"body":43820,"date":43900,"description":43824,"extension":483,"featured":2354,"meta":43901,"navigation":484,"path":43902,"references":43903,"repo":43904,"seo":43905,"stem":43906,"summary":43907,"tag":38493,"tech":43908,"url":2282,"__hash__":43911},"projects\u002Fprojects\u002Ftrivial\u002F10-bacon.md","Actor Network Semantics",{"type":70,"value":43821,"toc":43898},[43822,43825,43859],[73,43823,43824],{},"The Kevin Bacon game: given any two actors, find the shortest chain of\nshared-film connections between them.",[73,43826,43827,43830,43831,12861,43834,43837,43838,43841,43842,43847,43850,43851,43854,43855,43858],{},[108,43828,43829],{},"Bacon"," reads three pipe-delimited files — ",[108,43832,43833],{},"actors.txt",[108,43835,43836],{},"movies.txt","\nmap numeric codes to names, and ",[108,43839,43840],{},"movie-actors.txt"," pairs each movie with\nits cast — and builds a\n",[76,43843,43846],{"href":43844,"rel":43845},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGraph_(discrete_mathematics)",[80],"graph",[108,43848,43849],{},"Graph\u003CString, HashSet\u003CString>>",", backed by an ",[108,43852,43853],{},"AdjacencyMapGraph",".\nActors are the vertices; two actors who shared a film get an undirected\nedge whose label is the ",[108,43856,43857],{},"HashSet"," of movies they appeared in together.",[73,43860,43861,43862,43865,43866,43869,43870,43873,43874,12861,43877,43880,43881,43884,43885,43888,43889,5452,43891,5452,43893,13768,43895,43897],{},"To answer a query, ",[108,43863,43864],{},"GraphLib.bfs"," re-centers the whole network on a\nchosen actor:\n",[76,43867,36675],{"href":36673,"rel":43868},[80],"\nfrom that center records every reachable actor's parent, producing a\nshortest-path tree rooted at the center. ",[108,43871,43872],{},"getPath"," then walks the parent\nedges from any actor back to the root, naming the linking film at each\nstep, while ",[108,43875,43876],{},"getSeparation",[108,43878,43879],{},"averageSeparation"," measure distances\nwithin the tree. The interactive loop exposes this directly: ",[108,43882,43883],{},"u \u003Cname>","\nmakes an actor the center, ",[108,43886,43887],{},"p \u003Cname>"," prints a path to them, and the\n",[108,43890,8916],{},[108,43892,5288],{},[108,43894,16940],{},[108,43896,3158],{}," commands rank actors by average separation, by\ndegree, by distance, or list those with no connection at all.",{"title":478,"searchDepth":479,"depth":479,"links":43899},[],"2021-02-05",{},"\u002Fprojects\u002Ftrivial\u002F10-bacon",[13716],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-java\u002Ftree\u002Fmain\u002FProblem%20Sets\u002FPS-4",{"title":43819,"description":43824},"projects\u002Ftrivial\u002F10-bacon","The Kevin Bacon game in Java: build a graph of actors linked by shared films\nand find the shortest connection between any two.",[41529,43909,43910],"Graph Algorithms","Social Graphs","X8wNbzDAi5DflDamV4-9wWNhicBPpsfrbY1tSDLG918",{"id":43913,"title":43914,"body":43915,"date":44141,"description":44142,"extension":483,"featured":2354,"meta":44143,"navigation":484,"path":44144,"references":44145,"repo":44146,"seo":44147,"stem":44148,"summary":44149,"tag":38493,"tech":44150,"url":2282,"__hash__":44152},"projects\u002Fprojects\u002Ftrivial\u002F10-collision-gui.md","Efficient Spatial Collision Detection",{"type":70,"value":43916,"toc":44139},[43917,43976,43999],[73,43918,43919,43920,21456,43970,43975],{},"Detecting collisions among many moving blobs in 2D gets expensive fast:\nchecking every pair each frame is ",[116,43921,43923],{"className":43922},[119],[116,43924,43926],{"className":43925,"ariaHidden":124},[123],[116,43927,43929,43932,43935,43938,43967],{"className":43928},[128],[116,43930],{"className":43931,"style":2205},[132],[116,43933,29069],{"className":43934,"style":205},[137,138],[116,43936,562],{"className":43937},[561],[116,43939,43941,43944],{"className":43940},[137],[116,43942,9120],{"className":43943},[137,138],[116,43945,43947],{"className":43946},[725],[116,43948,43950],{"className":43949},[168],[116,43951,43953],{"className":43952},[173],[116,43954,43956],{"className":43955,"style":1152},[177],[116,43957,43958,43961],{"style":1167},[116,43959],{"className":43960,"style":742},[187],[116,43962,43964],{"className":43963},[746,747,748,749],[116,43965,359],{"className":43966},[137,749],[116,43968,652],{"className":43969},[651],[76,43971,43974],{"href":43972,"rel":43973},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FQuadtree",[80],"quad-tree"," brings\nthat down by only comparing blobs that share a region of space.",[73,43977,43978,43979,43982,43983,43986,43987,43990,43991,43994,43995,43998],{},"On every tick, ",[108,43980,43981],{},"CollisionGUI"," rebuilds a ",[108,43984,43985],{},"PointQuadtree\u003CBlob>"," over the\nwhole 800×600 field. Each node holds one blob, the rectangle it governs,\nand up to four children ",[108,43988,43989],{},"c1","–",[108,43992,43993],{},"c4",", one per quadrant; ",[108,43996,43997],{},"insert"," sends a new\nblob down the quadrant its coordinates fall in, subdividing as it descends.\nBlobs near each other in space therefore land in the same or adjacent\ncells.",[73,44000,44001,44002,44005,44006,44009,44010,44013,44014,44047,44048,44087,44088,44138],{},"Finding collisions then means asking each blob's neighborhood through\n",[108,44003,44004],{},"findInCircle(x, y, radius)",". The search prunes any node whose rectangle\nfails an ",[108,44007,44008],{},"intersectsCircle"," test and collects the rest with ",[108,44011,44012],{},"isInCircle",",\nso it walks a shallow path of cells rather than the whole population. More\nthan one hit inside a blob's radius flags a collision, and the handler\ncolors the culprits red, destroys them, or freezes them in place. Each\nquery touches roughly ",[116,44015,44017],{"className":44016},[119],[116,44018,44020],{"className":44019,"ariaHidden":124},[123],[116,44021,44023,44026,44029,44032,44038,44041,44044],{"className":44022},[128],[116,44024],{"className":44025,"style":552},[132],[116,44027,29069],{"className":44028,"style":205},[137,138],[116,44030,562],{"className":44031},[561],[116,44033,44035],{"className":44034},[1126],[116,44036,4745],{"className":44037,"style":4744},[137,3388],[116,44039],{"className":44040,"style":279},[144],[116,44042,9120],{"className":44043},[137,138],[116,44045,652],{"className":44046},[651]," cells, so a frame costs about\n",[116,44049,44051],{"className":44050},[119],[116,44052,44054],{"className":44053,"ariaHidden":124},[123],[116,44055,44057,44060,44063,44066,44069,44072,44078,44081,44084],{"className":44056},[128],[116,44058],{"className":44059,"style":552},[132],[116,44061,29069],{"className":44062,"style":205},[137,138],[116,44064,562],{"className":44065},[561],[116,44067,9120],{"className":44068},[137,138],[116,44070],{"className":44071,"style":279},[144],[116,44073,44075],{"className":44074},[1126],[116,44076,4745],{"className":44077,"style":4744},[137,3388],[116,44079],{"className":44080,"style":279},[144],[116,44082,9120],{"className":44083},[137,138],[116,44085,652],{"className":44086},[651]," instead of ",[116,44089,44091],{"className":44090},[119],[116,44092,44094],{"className":44093,"ariaHidden":124},[123],[116,44095,44097,44100,44103,44106,44135],{"className":44096},[128],[116,44098],{"className":44099,"style":2205},[132],[116,44101,29069],{"className":44102,"style":205},[137,138],[116,44104,562],{"className":44105},[561],[116,44107,44109,44112],{"className":44108},[137],[116,44110,9120],{"className":44111},[137,138],[116,44113,44115],{"className":44114},[725],[116,44116,44118],{"className":44117},[168],[116,44119,44121],{"className":44120},[173],[116,44122,44124],{"className":44123,"style":1152},[177],[116,44125,44126,44129],{"style":1167},[116,44127],{"className":44128,"style":742},[187],[116,44130,44132],{"className":44131},[746,747,748,749],[116,44133,359],{"className":44134},[137,749],[116,44136,652],{"className":44137},[651],", and rebuilding the tree each tick keeps\nit accurate as the blobs move.",{"title":478,"searchDepth":479,"depth":479,"links":44140},[],"2021-01-29","Detecting collisions among many moving blobs in 2D gets expensive fast:\nchecking every pair each frame is O(n2). A quad-tree brings\nthat down by only comparing blobs that share a region of space.",{},"\u002Fprojects\u002Ftrivial\u002F10-collision-gui",[29276],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-java\u002Ftree\u002Fmain\u002FProblem%20Sets\u002FPS-2",{"title":43914,"description":44142},"projects\u002Ftrivial\u002F10-collision-gui","Collision detection among moving 2D blobs, made cheap by indexing them in a\nquad-tree instead of checking every pair.",[41529,44151],"Spatial Search","q5uJugA8V3PdMiGrDXz3-c4tQkfKwyWISEVuuQkyzj8",{"id":44154,"title":44155,"body":44156,"date":44206,"description":44160,"extension":483,"featured":2354,"meta":44207,"navigation":484,"path":44208,"references":2282,"repo":44209,"seo":44210,"stem":44211,"summary":44212,"tag":38493,"tech":44213,"url":2282,"__hash__":44215},"projects\u002Fprojects\u002Ftrivial\u002F10-campaint.md","Cam Paint",{"type":70,"value":44157,"toc":44204},[44158,44161,44193],[73,44159,44160],{},"An interactive webcam painting program in Java. Point the camera at a\ncolored object, click to sample its color, and the program tracks that\nobject frame to frame, trailing a painted stroke across a persistent\ncanvas.",[73,44162,44163,44166,44167,44170,44171,44174,44175,44180,44181,44184,44185,44188,44189,44192],{},[108,44164,44165],{},"CamPaint"," stores the clicked pixel as its ",[108,44168,44169],{},"targetColor"," and each frame\nhands the image to a ",[108,44172,44173],{},"RegionFinder",", which grows regions by color. That\nfinder ",[76,44176,44179],{"href":44177,"rel":44178},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFlood_fill",[80],"flood fills"," outward\nfrom every matching seed, queuing a pixel's neighbors when its red,\ngreen, and blue channels each fall within ",[108,44182,44183],{},"maxColorDiff"," (45) of the\ntarget; a scratch image marks visited pixels, and any region smaller\nthan ",[108,44186,44187],{},"minRegion"," (20) points is dropped as noise. ",[108,44190,44191],{},"largestRegion()","\nreturns the biggest surviving region as the brush.",[73,44194,44195,44196,44199,44200,44203],{},"Rather than track a single centroid, the program stamps every pixel of\nthat largest region, in blue, into a separate ",[108,44197,44198],{},"painting"," layer, an ARGB\n",[108,44201,44202],{},"BufferedImage"," that accumulates across frames. The live camera feed\nrefreshes underneath, so the drawing\nstays put as the hand moves, and a keypress switches the display among\nthe raw webcam, the regions recolored at random, and the painting alone.",{"title":478,"searchDepth":479,"depth":479,"links":44205},[],"2021-01-17",{},"\u002Fprojects\u002Ftrivial\u002F10-campaint","https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-java\u002Ftree\u002Fmain\u002FProblem%20Sets\u002FPS-1",{"title":44155,"description":44160},"projects\u002Ftrivial\u002F10-campaint","A webcam painting program in Java that tracks a colored object frame to\nframe and trails a brushstroke across a canvas.",[41529,44214],"Image Recognition","NtuBrmu0e6xDHp3DUpoeTiC4oNvOcFmmnCTrd3kqSDc",{"id":44217,"title":44218,"body":44219,"date":44543,"description":44223,"extension":483,"featured":484,"meta":44544,"navigation":484,"path":44545,"references":2282,"repo":2282,"seo":44546,"stem":44547,"summary":44548,"tag":44549,"tech":2282,"url":44550,"__hash__":44551},"projects\u002Fprojects\u002Fwriting\u002F1.new-space-race.md","The New Space Race",{"type":70,"value":44220,"toc":44541},[44221,44224,44230,44233,44256,44489,44511,44514,44520,44523,44529,44532,44535],[73,44222,44223],{},"Two space races share a name. The first was a state project — a contest of\nnational prestige conducted through machines, financed by Cold War anxiety and\npaid for in public money. The second is a market, run by firms whose central\ninvention is not a faster engine but a reusable one. This team survey, written\nfor the Dartmouth Undergraduate Journal of Science, traces the line from one to\nthe other: the history, the physics that constrains every participant equally,\nand the two disasters that taught the field what risk actually is.",[73,44225,44226,44229],{},[505,44227,44228],{},"The state era, compressed."," The lineage begins with captured hardware —\nOperation Paperclip carried the V-2's architects to the United States, and\ntheir descendants powered Mercury, Gemini, and Apollo. NASA itself was born of\nlegislative panic: Sputnik in 1957, the National Aeronautics and Space Act by\nJuly 1958. The sequence that followed reads as a ladder of proofs — primates\nbefore pilots, Gagarin before Shepard, Glenn's three orbits, Gemini's two-man\nrehearsals, Apollo 8 around the moon, Apollo 11 upon it — and then the long\nplateau: Skylab, the Apollo-Soyuz handshake, and a Shuttle program that flew\n135 missions over three decades at a cost of $113.7 billion, retiring in 2011\nwith no successor standing by.",[246,44231],{"hash":44232},"7c747fb18e1061db5fd64fb2109cc87f1794f0c2037a5f62f8881b93fe2df5b5",[73,44234,44235,44238,44239,44255],{},[505,44236,44237],{},"The physics is indifferent to the flag."," A rocket at rest is Newton's first\nlaw; a rocket in flight is his second, applied to a body shedding its own mass.\nThe typical mass fraction is ",[116,44240,44242],{"className":44241},[119],[116,44243,44245],{"className":44244,"ariaHidden":124},[123],[116,44246,44248,44251],{"className":44247},[128],[116,44249],{"className":44250,"style":1890},[132],[116,44252,44254],{"className":44253},[137],"0.8"," — four fifths of the vehicle on the pad is\npropellant — and the consequence is the Tsiolkovsky relation,",[116,44257,44259],{"className":44258},[702],[116,44260,44262],{"className":44261},[119],[116,44263,44265,44286],{"className":44264,"ariaHidden":124},[123],[116,44266,44268,44271,44274,44277,44280,44283],{"className":44267},[128],[116,44269],{"className":44270,"style":272},[132],[116,44272,283],{"className":44273},[137],[116,44275,140],{"className":44276,"style":139},[137,138],[116,44278],{"className":44279,"style":145},[144],[116,44281,150],{"className":44282},[149],[116,44284],{"className":44285,"style":145},[144],[116,44287,44289,44293,44333,44336,44343,44346,44349,44486],{"className":44288},[128],[116,44290],{"className":44291,"style":44292},[132],"height:1.9436em;vertical-align:-0.836em;",[116,44294,44296,44299],{"className":44295},[137],[116,44297,140],{"className":44298,"style":139},[137,138],[116,44300,44302],{"className":44301},[725],[116,44303,44305,44325],{"className":44304},[168,169],[116,44306,44308,44322],{"className":44307},[173],[116,44309,44311],{"className":44310,"style":735},[177],[116,44312,44313,44316],{"style":3490},[116,44314],{"className":44315,"style":742},[187],[116,44317,44319],{"className":44318},[746,747,748,749],[116,44320,4527],{"className":44321},[137,138,749],[116,44323,234],{"className":44324},[233],[116,44326,44328],{"className":44327},[173],[116,44329,44331],{"className":44330,"style":762},[177],[116,44332],{},[116,44334],{"className":44335,"style":279},[144],[116,44337,44339],{"className":44338},[1126],[116,44340,44342],{"className":44341},[137,3388],"ln",[116,44344],{"className":44345,"style":5218},[144],[116,44347],{"className":44348,"style":279},[144],[116,44350,44352,44355,44483],{"className":44351},[137],[116,44353],{"className":44354},[561,4427],[116,44356,44358],{"className":44357},[4431],[116,44359,44361,44475],{"className":44360},[168,169],[116,44362,44364,44472],{"className":44363},[173],[116,44365,44368,44416,44424],{"className":44366,"style":44367},[177],"height:1.1076em;",[116,44369,44370,44373],{"style":5010},[116,44371],{"className":44372,"style":1119},[187],[116,44374,44376],{"className":44375},[137],[116,44377,44379,44382],{"className":44378},[137],[116,44380,10717],{"className":44381},[137,138],[116,44383,44385],{"className":44384},[725],[116,44386,44388,44408],{"className":44387},[168,169],[116,44389,44391,44405],{"className":44390},[173],[116,44392,44394],{"className":44393,"style":4068},[177],[116,44395,44396,44399],{"style":3584},[116,44397],{"className":44398,"style":742},[187],[116,44400,44402],{"className":44401},[746,747,748,749],[116,44403,345],{"className":44404},[137,749],[116,44406,234],{"className":44407},[233],[116,44409,44411],{"className":44410},[173],[116,44412,44414],{"className":44413,"style":762},[177],[116,44415],{},[116,44417,44418,44421],{"style":4597},[116,44419],{"className":44420,"style":1119},[187],[116,44422],{"className":44423,"style":4605},[4604],[116,44425,44426,44429],{"style":4608},[116,44427],{"className":44428,"style":1119},[187],[116,44430,44432],{"className":44431},[137],[116,44433,44435,44438],{"className":44434},[137],[116,44436,10717],{"className":44437},[137,138],[116,44439,44441],{"className":44440},[725],[116,44442,44444,44464],{"className":44443},[168,169],[116,44445,44447,44461],{"className":44446},[173],[116,44448,44450],{"className":44449,"style":4068},[177],[116,44451,44452,44455],{"style":3584},[116,44453],{"className":44454,"style":742},[187],[116,44456,44458],{"className":44457},[746,747,748,749],[116,44459,331],{"className":44460},[137,749],[116,44462,234],{"className":44463},[233],[116,44465,44467],{"className":44466},[173],[116,44468,44470],{"className":44469,"style":762},[177],[116,44471],{},[116,44473,234],{"className":44474},[233],[116,44476,44478],{"className":44477},[173],[116,44479,44481],{"className":44480,"style":30620},[177],[116,44482],{},[116,44484],{"className":44485},[651,4427],[116,44487,594],{"className":44488},[593],[73,44490,44491,44492,44510],{},"in which the achievable change in velocity is bought logarithmically: each\nincrement of ",[116,44493,44495],{"className":44494},[119],[116,44496,44498],{"className":44497,"ariaHidden":124},[123],[116,44499,44501,44504,44507],{"className":44500},[128],[116,44502],{"className":44503,"style":272},[132],[116,44505,283],{"className":44506},[137],[116,44508,140],{"className":44509,"style":139},[137,138]," demands geometrically more propellant, which is why\nascent is staged and why solid boosters carrying seventy-one percent of liftoff\nthrust are dropped at forty-five kilometers the moment their mass stops paying\nfor itself. Propellant chemistry divides the same way the survey's taxonomy\ndoes — solid grains binding fuel and oxidizer in one chamber, cryogenic pairs\nheld apart until the combustion chamber, hypergolics that ignite on contact and\nrestart on command — and the return trip inverts the problem: seventeen\nthousand miles per hour surrendered to air friction at sixteen hundred fifty\ndegrees Celsius against a ceramic skin. The body aboard fares no better than\nthe machine: twice-normal gravity at liftoff, then months of weightlessness\nthat thin muscle and bone on a two-to-three-year recovery horizon.",[246,44512],{"hash":44513},"591f1263ad2e68bccd1b5e95864806029233584c1ea6b8f0c70b1479ed14a285",[73,44515,44516,44519],{},[505,44517,44518],{},"What Challenger taught about risk."," The Rogers Commission's enduring product\nis an epistemology lesson. NASA's assessments priced failure per part — one in\na hundred million for a screw — and composed those prices into a vehicle that\ncould not fail; the engineers Feynman interviewed individually put the whole\nshuttle's odds between one in fifty and one in two hundred. The gap between the\ntwo numbers is where the disaster lived. Its physical seat was the booster\nfield joint: an O-ring seal qualified above fifty degrees Fahrenheit, flown\non a morning in the thirties, stiff when the joint rotated open under thrust.\nMorton Thiokol's own engineer had recommended redesign in writing; the schedule\nprevailed; the market repriced Thiokol twelve percent in a day.",[246,44521],{"hash":44522},"9f2cc3cc7bba58a50d71e1141b34483031e6ad49ee07a3473fc5235a47a382bf",[73,44524,44525,44528],{},[505,44526,44527],{},"The market era."," The successor race is an economics of turnaround. SpaceX\nflies a two-stage vehicle whose first stage lands and flies again — at the\nsurvey's date of record, ninety-four launches, fifty-five landings, forty\nboosters reflown, with a cargo capsule at twenty-three flights and nine reuses;\nits heavy variant lifts on twenty-seven engines and five million pounds of\nthrust. Blue Origin sells the suborbital hop: a capsule-and-booster stack to\none hundred kilometers, both elements landing vertically, the same airframe\nrelaunched sixty-one days after its first proof. Virgin Galactic launches from\naltitude instead — a carrier aircraft hauls the spaceplane through the dense\natmosphere before release — and finances the venture as the first publicly\ntraded spaceflight firm, selling quarter-million-dollar seats against two\nhundred ten million dollars of annual loss. Three architectures, one wager:\nthat the expendable rocket was an accounting error.",[246,44530],{"hash":44531},"7fd22a0dfc2bca62f9ce8eb744b52bc894314137d8677543f807d193c0905d15",[246,44533],{"hash":44534},"f53bcf330023f57a2b93a0162172ef60d5a3d0bdbfedd0a45665bb99453c74d2",[73,44536,44537,44540],{},[505,44538,44539],{},"The residue on the ground."," The survey closes its ledger with what fell back\nto Earth: the CMOS active-pixel sensor invented at the Jet Propulsion\nLaboratory before it became the phone camera, image-processing lineage feeding\nclinical MRI, the silver-iodizer water purifier serving developing-world\nsystems, the astronaut headset becoming the wireless one, and satellite\natmospherics — NASA's Aura pairing with Sentinel-5 to watch a pandemic lower a\ncontinent's nitrogen dioxide. Artemis aims a crew at the moon again; a defense\nanalysis prices a feasible Mars landing no earlier than 2037. The technology\nand the ambition, the survey concludes, are both increasing in supply.",{"title":478,"searchDepth":479,"depth":479,"links":44542},[],"2020-12-05",{},"\u002Fprojects\u002Fwriting\u002Fnew-space-race",{"title":44218,"description":44223},"projects\u002Fwriting\u002F1.new-space-race","A team survey for the Dartmouth Undergraduate Journal of Science tracing\nspaceflight from the V-2 to the private fleet: the Cold War programs, the\nphysics and physiology of ascent, what the Challenger inquiry revealed about\nrisk, and the economics of the reusable rocket.","writing","\u002Fpapers\u002Fdujs\u002Fnew-space-race.pdf","QWcAma-fo0XfO1ST0pg_QkDp17eS70uTz9igDJ_7qYc",{"id":44553,"title":44554,"body":44555,"date":44621,"description":44559,"extension":483,"featured":484,"meta":44622,"navigation":484,"path":44623,"references":2282,"repo":2282,"seo":44624,"stem":44625,"summary":44626,"tag":44549,"tech":2282,"url":44627,"__hash__":44628},"projects\u002Fprojects\u002Fwriting\u002F2.tech-dev-world.md","Technology and the Developing World",{"type":70,"value":44556,"toc":44619},[44557,44560,44566,44569,44575,44578,44581,44587,44590,44596,44616],[73,44558,44559],{},"The technology gap between economies is usually narrated as a deficit — a\nledger of what the developing world lacks. This essay, written solo for the\nDartmouth Undergraduate Journal of Science, argues the more interesting\nproposition: that arriving late to infrastructure is occasionally an advantage,\nbecause the latecomer is not obliged to build the intermediate rungs at all.\nThe mechanism has a name — leapfrogging — and its canonical demonstration is\nEast African.",[73,44561,44562,44565],{},[505,44563,44564],{},"The mechanism."," Development economics sorts nations by their command of\ntechnology — developed, developing, least developed — and the historical\naccount of that ordering is energetic: each industrial transition was a\ntransition in harnessed power. The orthodox prescription was transfer, the slow\ndiffusion of yesterday's plant down the income gradient. Leapfrogging is the\nalternative: where no legacy system exists, its absence is a clean\nfoundation. A country with no copper telephone plant never retires one; it\nproceeds directly to the cellular tower, and every service that assumed the\nolder layer must be reinvented against the newer one — frequently in a form\nthe developed world then imports back.",[246,44567],{"hash":44568},"85f161fcc92ac02549ed366195d50cfbf781e65a31d12af6fac49ed57d58d5a5",[73,44570,44571,44574],{},[505,44572,44573],{},"The canonical case."," M-Pesa launched in Kenya in 2007 as a text-message\nledger: value held against a phone number, cashed in and out through a\ndistributed network of human agents standing where branch offices never stood.\nBy 2014, fifty-eight percent of Kenyan adults held accounts; by fiscal 2020 the\nsystem was turning over the equivalent of forty-three percent of the country's\nGDP. The distributional result is the striking one — the study the essay leans\non estimates that access to mobile money lifted one hundred ninety-four\nthousand households, roughly two percent of the country, out of extreme\npoverty, with the largest gains accruing to female-headed households that\nformal banking had priced out entirely.",[246,44576],{"hash":44577},"8adea6a8349aa8fff1f43b7abb6a4e8b10e70a7df46764948b07c6b558414063",[246,44579],{"hash":44580},"67e35f755fad3109a4719216c0dc6db394551403c927fef4b28d04561b728c97",[73,44582,44583,44586],{},[505,44584,44585],{},"Beyond the ledger."," The essay's survey runs the same pattern through other\nsectors. Zipline's fixed-wing drones deliver blood and vaccines across Rwanda\nand Ghana, substituting airspace for roads that do not exist. Airtel's 321\nservice folds market prices and agronomy into voice menus reachable from any\nfeature phone. Purpose-built transit — Addis Ababa's light rail, the\nMombasa-Nairobi standard-gauge line — compresses a century of incremental\nrail into single projects. A fintech layer accretes above the money rail:\ncross-border transfer startups raising venture rounds against remittance\ncorridors the banks never served. And an AI economy arrives early rather than\nlate — a sixty-six-million-dollar African market by 2017, Google siting its\nfirst African AI laboratory in Accra in 2019, Microsoft opening development\ncenters in Nairobi and Lagos.",[246,44588],{"hash":44589},"ca3a722a34b608a36b471bee2adbfc56e6c56aaa91ac202260e458856d790416",[73,44591,44592,44595],{},[505,44593,44594],{},"Where the leap concentrates risk."," The essay declines the triumphal ending.\nThree failure modes travel with the mechanism:",[10278,44597,44598,44604,44610],{},[10281,44599,44600,44603],{},[505,44601,44602],{},"The internal divide"," — every leap lands in cities first, and a\nconnectivity gap inside a country can widen faster than the gap between\ncountries closes.",[10281,44605,44606,44609],{},[505,44607,44608],{},"Displacement"," — economies whose comparative advantage is abundant labor\nimport automation designed by economies trying to eliminate it, and the\nimported incentive does not match the local one.",[10281,44611,44612,44615],{},[505,44613,44614],{},"Monopoly"," — the leapfrog winner inherits the field whole; a payments rail\nholding a ninety-nine percent share is infrastructure governed as a private\nproduct, and the regulator arrives after the fact.",[73,44617,44618],{},"The closing argument is symmetrical: the developing world's shortage is not\naptitude but the freedom to adopt on its own terms — and the developed world's\nnext borrowed idea is already running on a feature phone somewhere south of it.",{"title":478,"searchDepth":479,"depth":479,"links":44620},[],"2020-11-20",{},"\u002Fprojects\u002Fwriting\u002Ftech-dev-world",{"title":44554,"description":44559},"projects\u002Fwriting\u002F2.tech-dev-world","A solo essay for the Dartmouth Undergraduate Journal of Science on\ntechnological leapfrogging: how mobile money, drone logistics, and\npurpose-built infrastructure let developing economies skip the legacy rungs\nof the industrial ladder, and where the same leap concentrates new risk.","\u002Fpapers\u002Fdujs\u002Ftech-dev-world.pdf","DBpbw7ZV2aeQGzjya2hZ699KZvBSlsva63L5tj39ZFs",{"id":44630,"title":44631,"body":44632,"date":44699,"description":44700,"extension":483,"featured":2354,"meta":44701,"navigation":484,"path":44702,"references":44703,"repo":44704,"seo":44705,"stem":44706,"summary":44707,"tag":38493,"tech":44708,"url":2282,"__hash__":44709},"projects\u002Fprojects\u002Ftrivial\u002F01-dartmouth-pathfinder.md","Pathfinder",{"type":70,"value":44633,"toc":44697},[44634,44672],[73,44635,5131,44636,44638,44639,44642,44643,44646,44647,44650,44651,44654,44655,44657,44658,44660,44661,13611,44664,44667,44668,44671],{},[108,44637,475],{}," app that draws a Dartmouth campus map and, when the user picks\ntwo locations, highlights the shortest walk between them. ",[108,44640,44641],{},"load_graph","\nreads ",[108,44644,44645],{},"dartmouth_graph.txt"," in two passes — first building a ",[108,44648,44649],{},"Vertex"," for\neach ",[108,44652,44653],{},"name; neighbors; x,y"," line, then wiring up every adjacency list —\ninto a name-to-",[108,44656,44649],{}," dictionary. Each ",[108,44659,44649],{}," carries its pixel\nposition, its neighbors, and a ",[108,44662,44663],{},"backpointer",[108,44665,44666],{},"mouse_press"," sets the start\nnode and ",[108,44669,44670],{},"mouse_move"," tracks the goal under the cursor.",[73,44673,44674,44675,44678,44679,44682,44683,44686,44687,44689,44690,13768,44693,44696],{},"The map is a graph, so\n",[76,44676,36675],{"href":36673,"rel":44677},[80],"\nfinds the fewest-edge route. ",[108,44680,44681],{},"bfs"," walks a ",[108,44684,44685],{},"deque"," frontier out from the\nstart in rings of increasing distance, stamping a ",[108,44688,44663],{}," on each\nnewly reached vertex; the first time it pops the goal, that path is\nminimal in edges. Following backpointers from the goal back to the start\nrecovers ",[108,44691,44692],{},"path_used",[108,44694,44695],{},"draw_connections"," paints those edges red (with\nthe live frontier in yellow) over the map.",{"title":478,"searchDepth":479,"depth":479,"links":44698},[],"2020-11-02","A cs1lib app that draws a Dartmouth campus map and, when the user picks\ntwo locations, highlights the shortest walk between them. load_graph\nreads dartmouth_graph.txt in two passes — first building a Vertex for\neach name; neighbors; x,y line, then wiring up every adjacency list —\ninto a name-to-Vertex dictionary. Each Vertex carries its pixel\nposition, its neighbors, and a backpointer; mouse_press sets the start\nnode and mouse_move tracks the goal under the cursor.",{},"\u002Fprojects\u002Ftrivial\u002F01-dartmouth-pathfinder",[13716],"https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-python\u002Ftree\u002Fmain\u002FCS1\u002FLAB\u002FLAB%204\u002FXC",{"title":44631,"description":44700},"projects\u002Ftrivial\u002F01-dartmouth-pathfinder","A cs1lib app over a Dartmouth campus map that runs breadth-first search\nbetween two clicked Vertex nodes and draws the shortest path via\nbackpointers.",[2279,43909],"Nf_uTscYi09hCFP5_RXV0_nIvBpAzuqU800OoEkHKYc",{"id":44711,"title":44712,"body":44713,"date":44749,"description":44750,"extension":483,"featured":2354,"meta":44751,"navigation":484,"path":44752,"references":2282,"repo":44753,"seo":44754,"stem":44755,"summary":44756,"tag":44757,"tech":44758,"url":2282,"__hash__":44760},"projects\u002Fprojects\u002Ftrivial\u002F01-city-info.md","City Demographics",{"type":70,"value":44714,"toc":44747},[44715,44734],[73,44716,44717,44718,44721,44722,44725,44726,44729,44730,44733],{},"A small pipeline over ",[108,44719,44720],{},"world_cities.txt",", a comma-separated table of\ncountry code, name, region, population, latitude, and longitude. The\ndriver parses each line into a ",[108,44723,44724],{},"City"," object, and ",[108,44727,44728],{},"sort_cities"," runs a\nhand-written ",[108,44731,44732],{},"quicksort"," over the list three ways — by name, by\npopulation, and by latitude — each with its own comparison function,\nwriting the ordered results to separate files.",[73,44735,44736,44737,44739,44740,12917,44743,44746],{},"The extra-credit visualizer reads back the population-sorted file and\nanimates the 50 most-populous cities over a world map drawn with\n",[108,44738,475],{},". It adds one city every 30 frames, converting each\nlongitude\u002Flatitude into pixel coordinates (",[108,44741,44742],{},"scaled_x = 2*lon + 360",[108,44744,44745],{},"scaled_y = (90 - lat) * height\u002F180","), dropping a marker with the city's\nrank and population and leaving the earlier markers behind as it works\ndown the list.",{"title":478,"searchDepth":479,"depth":479,"links":44748},[],"2020-10-04","A small pipeline over world_cities.txt, a comma-separated table of\ncountry code, name, region, population, latitude, and longitude. The\ndriver parses each line into a City object, and sort_cities runs a\nhand-written quicksort over the list three ways — by name, by\npopulation, and by latitude — each with its own comparison function,\nwriting the ordered results to separate files.",{},"\u002Fprojects\u002Ftrivial\u002F01-city-info","https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-python\u002Ftree\u002Fmain\u002FCS1\u002FLAB\u002FLAB%203\u002FXC",{"title":44712,"description":44750},"projects\u002Ftrivial\u002F01-city-info","A program that parses a world-cities file into City objects, quicksorts them\nby name, population, and latitude, and animates the 50 most-populous over a\nworld map.","data insights",[2279,44759],"Data Processing","g_TNrd4XJpW6Vl9d09-qXv59VGzi1zq6LH0F2yy1xe0",{"id":44762,"title":44763,"body":44764,"date":44836,"description":44837,"extension":483,"featured":2354,"meta":44838,"navigation":484,"path":44839,"references":2282,"repo":44840,"seo":44841,"stem":44842,"summary":44843,"tag":493,"tech":44844,"url":2282,"__hash__":44846},"projects\u002Fprojects\u002Ftrivial\u002F01-pong.md","Pong Game",{"type":70,"value":44765,"toc":44834},[44766,44806],[73,44767,44768,44769,44771,44772,201,44774,44776,44777,201,44779,44781,44782,44785,44786,44788,44789,44792,44793,44796,44797,5452,44800,13768,44803,1852],{},"A pong game drawn with ",[108,44770,475],{},", the Dartmouth CS1 graphics library. Two\npaddles share the court: ",[108,44773,76],{},[108,44775,4166],{}," drive the left one, ",[108,44778,4382],{},[108,44780,10717],{}," the right,\n",[108,44783,44784],{},"space"," resets the round, and ",[108,44787,37103],{}," quits. The whole thing runs out of a\nsingle ",[108,44790,44791],{},"run_all"," callback that ",[108,44794,44795],{},"start_graphics"," calls each frame, which\nin turn steps ",[108,44798,44799],{},"paddle_movement",[108,44801,44802],{},"ball_movement",[108,44804,44805],{},"draw_to_canvas",[73,44807,44808,44810,44811,44814,44815,44818,44819,44822,44823,44826,44827,44829,44830,44833],{},[108,44809,44802],{}," is the collision core. Each frame it adds the velocity to\nthe ball position and checks for contact: touching a paddle flips\n",[108,44812,44813],{},"ball_velocity_x",", hitting the top or bottom edge flips\n",[108,44816,44817],{},"ball_velocity_y",", and slipping past a paddle sets ",[108,44820,44821],{},"ball_out_of_bounds",",\nwhich draws ",[108,44824,44825],{},"GAME OVER",". The extra-credit build keeps a running ",[108,44828,19557],{},",\nadds 5 on every paddle hit, and folds it into ",[108,44831,44832],{},"highest_score"," at reset so\nthe best run persists across rounds in the same session.",{"title":478,"searchDepth":479,"depth":479,"links":44835},[],"2020-09-23","A pong game drawn with cs1lib, the Dartmouth CS1 graphics library. Two\npaddles share the court: a\u002Fz drive the left one, k\u002Fm the right,\nspace resets the round, and q quits. The whole thing runs out of a\nsingle run_all callback that start_graphics calls each frame, which\nin turn steps paddle_movement, ball_movement, and draw_to_canvas.",{},"\u002Fprojects\u002Ftrivial\u002F01-pong","https:\u002F\u002Fgithub.com\u002Flostflux\u002Felementary-python\u002Ftree\u002Fmain\u002FCS1\u002FLAB\u002FLAB%201",{"title":44763,"description":44837},"projects\u002Ftrivial\u002F01-pong","A two-paddle pong game on Dartmouth's cs1lib — keyboard input, velocity-flip\ncollisions, and a high score that carries across rounds.",[2279,44845],"Graphics Simulation","tA26TJ8sAl4LkUQtqzwzaBASpuior-5Qfo1eR-OKsI4",{"left":44848,"top":44848,"width":44849,"height":44849,"rotate":44848,"vFlip":2354,"hFlip":2354,"body":44850},0,24,"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"18\" cy=\"5\" r=\"3\"\u002F>\u003Ccircle cx=\"6\" cy=\"12\" r=\"3\"\u002F>\u003Ccircle cx=\"18\" cy=\"19\" r=\"3\"\u002F>\u003Cpath d=\"m8.59 13.51l6.83 3.98m-.01-10.98l-6.82 3.98\"\u002F>\u003C\u002Fg>",{"left":44848,"top":44848,"width":44849,"height":44849,"rotate":44848,"vFlip":2354,"hFlip":2354,"body":44852},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\"\u002F>","\u003Csvg style=\"width:100%;max-width:291.867px;height:auto\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"-75 -75 218.900 77.021\">\u003Cg stroke=\"currentColor\" style=\"stroke-miterlimit:10;stroke-width:.4\">\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\" style=\"stroke-width:.8\">\u003Cpath d=\"M15.91-57.644h14.227V-71.87H15.91Z\"\u002F>\u003Cg transform=\"translate(83.365 -54.65)\">\u003Cpath d=\"M-61.539-8.398Q-61.419-8.241-61.228-8.142Q-61.036-8.042-60.821-8.003Q-60.606-7.964-60.383-7.964Q-60.086-7.964-59.891-8.119Q-59.696-8.275-59.606-8.529Q-59.515-8.784-59.515-9.068Q-59.515-9.362-59.607-9.613Q-59.700-9.864-59.898-10.020Q-60.096-10.175-60.390-10.175L-60.906-10.175Q-60.934-10.175-60.959-10.201Q-60.985-10.226-60.985-10.250L-60.985-10.322Q-60.985-10.353-60.959-10.375Q-60.934-10.397-60.906-10.397L-60.465-10.428Q-60.103-10.428-59.883-10.785Q-59.662-11.143-59.662-11.532Q-59.662-11.860-59.857-12.064Q-60.052-12.267-60.383-12.267Q-60.670-12.267-60.923-12.183Q-61.176-12.100-61.340-11.912Q-61.193-11.912-61.093-11.797Q-60.992-11.683-60.992-11.532Q-60.992-11.382-61.098-11.272Q-61.204-11.163-61.361-11.163Q-61.522-11.163-61.631-11.272Q-61.740-11.382-61.740-11.532Q-61.740-11.857-61.532-12.076Q-61.323-12.294-61.007-12.397Q-60.691-12.499-60.383-12.499Q-60.065-12.499-59.737-12.395Q-59.409-12.291-59.182-12.069Q-58.955-11.847-58.955-11.532Q-58.955-11.098-59.242-10.773Q-59.529-10.449-59.963-10.302Q-59.652-10.237-59.372-10.071Q-59.091-9.905-58.914-9.647Q-58.736-9.389-58.736-9.068Q-58.736-8.658-58.980-8.348Q-59.225-8.039-59.606-7.875Q-59.987-7.711-60.383-7.711Q-60.752-7.711-61.110-7.824Q-61.467-7.936-61.711-8.186Q-61.956-8.435-61.956-8.805Q-61.956-8.976-61.839-9.088Q-61.723-9.201-61.552-9.201Q-61.443-9.201-61.352-9.150Q-61.262-9.099-61.207-9.006Q-61.152-8.914-61.152-8.805Q-61.152-8.637-61.265-8.518Q-61.378-8.398-61.539-8.398\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M-32.46-36.304a7.113 7.113 0 1 0-14.226 0 7.113 7.113 0 0 0 14.227 0Zm-7.113 0\"\u002F>\u003Cg transform=\"translate(20.77 -26.197)\">\u003Cpath d=\"M-61.539-8.398Q-61.419-8.241-61.228-8.142Q-61.036-8.042-60.821-8.003Q-60.606-7.964-60.383-7.964Q-60.086-7.964-59.891-8.119Q-59.696-8.275-59.606-8.529Q-59.515-8.784-59.515-9.068Q-59.515-9.362-59.607-9.613Q-59.700-9.864-59.898-10.020Q-60.096-10.175-60.390-10.175L-60.906-10.175Q-60.934-10.175-60.959-10.201Q-60.985-10.226-60.985-10.250L-60.985-10.322Q-60.985-10.353-60.959-10.375Q-60.934-10.397-60.906-10.397L-60.465-10.428Q-60.103-10.428-59.883-10.785Q-59.662-11.143-59.662-11.532Q-59.662-11.860-59.857-12.064Q-60.052-12.267-60.383-12.267Q-60.670-12.267-60.923-12.183Q-61.176-12.100-61.340-11.912Q-61.193-11.912-61.093-11.797Q-60.992-11.683-60.992-11.532Q-60.992-11.382-61.098-11.272Q-61.204-11.163-61.361-11.163Q-61.522-11.163-61.631-11.272Q-61.740-11.382-61.740-11.532Q-61.740-11.857-61.532-12.076Q-61.323-12.294-61.007-12.397Q-60.691-12.499-60.383-12.499Q-60.065-12.499-59.737-12.395Q-59.409-12.291-59.182-12.069Q-58.955-11.847-58.955-11.532Q-58.955-11.098-59.242-10.773Q-59.529-10.449-59.963-10.302Q-59.652-10.237-59.372-10.071Q-59.091-9.905-58.914-9.647Q-58.736-9.389-58.736-9.068Q-58.736-8.658-58.980-8.348Q-59.225-8.039-59.606-7.875Q-59.987-7.711-60.383-7.711Q-60.752-7.711-61.110-7.824Q-61.467-7.936-61.711-8.186Q-61.956-8.435-61.956-8.805Q-61.956-8.976-61.839-9.088Q-61.723-9.201-61.552-9.201Q-61.443-9.201-61.352-9.150Q-61.262-9.099-61.207-9.006Q-61.152-8.914-61.152-8.805Q-61.152-8.637-61.265-8.518Q-61.378-8.398-61.539-8.398\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M30.137-36.304a7.113 7.113 0 1 0-14.227 0 7.113 7.113 0 0 0 14.227 0Zm-7.114 0\"\u002F>\u003Cg transform=\"translate(83.365 -26.197)\">\u003Cpath d=\"M-59.009-7.851L-61.894-7.851L-61.894-8.053Q-61.894-8.083-61.867-8.111L-60.619-9.328Q-60.547-9.403-60.505-9.445Q-60.462-9.488-60.383-9.567Q-59.970-9.980-59.739-10.338Q-59.508-10.695-59.508-11.119Q-59.508-11.351-59.587-11.554Q-59.666-11.758-59.807-11.908Q-59.949-12.059-60.144-12.139Q-60.339-12.219-60.571-12.219Q-60.882-12.219-61.140-12.060Q-61.398-11.901-61.528-11.624L-61.508-11.624Q-61.340-11.624-61.233-11.513Q-61.125-11.402-61.125-11.238Q-61.125-11.081-61.234-10.968Q-61.344-10.855-61.508-10.855Q-61.668-10.855-61.781-10.968Q-61.894-11.081-61.894-11.238Q-61.894-11.614-61.686-11.901Q-61.477-12.188-61.142-12.344Q-60.807-12.499-60.452-12.499Q-60.028-12.499-59.648-12.341Q-59.269-12.182-59.035-11.865Q-58.801-11.549-58.801-11.119Q-58.801-10.808-58.941-10.539Q-59.081-10.271-59.286-10.066Q-59.491-9.861-59.854-9.579Q-60.216-9.297-60.325-9.201L-61.180-8.473L-60.537-8.473Q-60.274-8.473-59.985-8.475Q-59.696-8.476-59.478-8.485Q-59.259-8.494-59.242-8.511Q-59.180-8.576-59.143-8.743Q-59.105-8.911-59.067-9.153L-58.801-9.153\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M92.733-36.304a7.113 7.113 0 1 0-14.227 0 7.113 7.113 0 0 0 14.227 0Zm-7.114 0\"\u002F>\u003Cg transform=\"translate(145.961 -26.197)\">\u003Cpath d=\"M-61.528-8.613L-61.559-8.613Q-61.422-8.316-61.125-8.140Q-60.828-7.964-60.500-7.964Q-60.137-7.964-59.910-8.142Q-59.683-8.319-59.589-8.608Q-59.495-8.897-59.495-9.259Q-59.495-9.574-59.549-9.859Q-59.604-10.144-59.777-10.350Q-59.949-10.555-60.264-10.555Q-60.537-10.555-60.720-10.488Q-60.903-10.421-61.007-10.332Q-61.111-10.244-61.207-10.134Q-61.303-10.025-61.347-10.015L-61.426-10.015Q-61.498-10.032-61.515-10.103L-61.515-12.421Q-61.515-12.455-61.491-12.477Q-61.467-12.499-61.433-12.499L-61.405-12.499Q-61.118-12.383-60.850-12.329Q-60.582-12.274-60.305-12.274Q-60.028-12.274-59.758-12.329Q-59.488-12.383-59.208-12.499L-59.184-12.499Q-59.149-12.499-59.126-12.476Q-59.102-12.452-59.102-12.421L-59.102-12.352Q-59.102-12.325-59.122-12.305Q-59.396-11.990-59.780-11.814Q-60.165-11.638-60.578-11.638Q-60.917-11.638-61.234-11.724L-61.234-10.442Q-60.838-10.777-60.264-10.777Q-59.860-10.777-59.524-10.567Q-59.187-10.356-58.994-10.004Q-58.801-9.652-58.801-9.252Q-58.801-8.921-58.941-8.635Q-59.081-8.350-59.325-8.140Q-59.570-7.930-59.872-7.820Q-60.175-7.711-60.493-7.711Q-60.852-7.711-61.178-7.875Q-61.504-8.039-61.699-8.331Q-61.894-8.623-61.894-8.986Q-61.894-9.136-61.788-9.242Q-61.682-9.348-61.528-9.348Q-61.375-9.348-61.270-9.244Q-61.166-9.140-61.166-8.986Q-61.166-8.829-61.270-8.721Q-61.375-8.613-61.528-8.613\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M-55.933-7.851a6.402 6.402 0 1 0-12.804 0 6.402 6.402 0 0 0 12.804 0Zm-6.402 0\"\u002F>\u003Cg transform=\"translate(-1.993 2.256)\">\u003Cpath d=\"M-61.539-8.398Q-61.419-8.241-61.228-8.142Q-61.036-8.042-60.821-8.003Q-60.606-7.964-60.383-7.964Q-60.086-7.964-59.891-8.119Q-59.696-8.275-59.606-8.529Q-59.515-8.784-59.515-9.068Q-59.515-9.362-59.607-9.613Q-59.700-9.864-59.898-10.020Q-60.096-10.175-60.390-10.175L-60.906-10.175Q-60.934-10.175-60.959-10.201Q-60.985-10.226-60.985-10.250L-60.985-10.322Q-60.985-10.353-60.959-10.375Q-60.934-10.397-60.906-10.397L-60.465-10.428Q-60.103-10.428-59.883-10.785Q-59.662-11.143-59.662-11.532Q-59.662-11.860-59.857-12.064Q-60.052-12.267-60.383-12.267Q-60.670-12.267-60.923-12.183Q-61.176-12.100-61.340-11.912Q-61.193-11.912-61.093-11.797Q-60.992-11.683-60.992-11.532Q-60.992-11.382-61.098-11.272Q-61.204-11.163-61.361-11.163Q-61.522-11.163-61.631-11.272Q-61.740-11.382-61.740-11.532Q-61.740-11.857-61.532-12.076Q-61.323-12.294-61.007-12.397Q-60.691-12.499-60.383-12.499Q-60.065-12.499-59.737-12.395Q-59.409-12.291-59.182-12.069Q-58.955-11.847-58.955-11.532Q-58.955-11.098-59.242-10.773Q-59.529-10.449-59.963-10.302Q-59.652-10.237-59.372-10.071Q-59.091-9.905-58.914-9.647Q-58.736-9.389-58.736-9.068Q-58.736-8.658-58.980-8.348Q-59.225-8.039-59.606-7.875Q-59.987-7.711-60.383-7.711Q-60.752-7.711-61.110-7.824Q-61.467-7.936-61.711-8.186Q-61.956-8.435-61.956-8.805Q-61.956-8.976-61.839-9.088Q-61.723-9.201-61.552-9.201Q-61.443-9.201-61.352-9.150Q-61.262-9.099-61.207-9.006Q-61.152-8.914-61.152-8.805Q-61.152-8.637-61.265-8.518Q-61.378-8.398-61.539-8.398\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M-33.17-7.851a6.402 6.402 0 1 0-12.804 0 6.402 6.402 0 0 0 12.803 0Zm-6.403 0\"\u002F>\u003Cg transform=\"translate(20.77 2.256)\">\u003Cpath d=\"M-61.361-8.165Q-61.241-8.049-61.064-8.007Q-60.886-7.964-60.670-7.964Q-60.431-7.964-60.221-8.073Q-60.011-8.183-59.857-8.365Q-59.703-8.548-59.604-8.781Q-59.437-9.208-59.437-10.028Q-59.587-9.734-59.850-9.555Q-60.113-9.375-60.431-9.375Q-60.865-9.375-61.212-9.584Q-61.559-9.792-61.757-10.153Q-61.956-10.514-61.956-10.937Q-61.956-11.272-61.826-11.561Q-61.696-11.850-61.465-12.064Q-61.234-12.277-60.935-12.388Q-60.636-12.499-60.305-12.499Q-59.447-12.499-59.091-11.785Q-58.736-11.071-58.736-10.114Q-58.736-9.697-58.864-9.269Q-58.992-8.842-59.249-8.487Q-59.505-8.131-59.867-7.921Q-60.230-7.711-60.670-7.711Q-61.125-7.711-61.443-7.899Q-61.761-8.087-61.761-8.511Q-61.761-8.661-61.662-8.760Q-61.563-8.859-61.412-8.859Q-61.344-8.859-61.277-8.832Q-61.210-8.805-61.166-8.760Q-61.122-8.716-61.094-8.649Q-61.067-8.582-61.067-8.511Q-61.067-8.381-61.147-8.283Q-61.228-8.186-61.361-8.165M-60.390-9.601Q-60.096-9.601-59.881-9.779Q-59.666-9.956-59.558-10.232Q-59.450-10.507-59.450-10.797Q-59.450-10.842-59.452-10.869Q-59.454-10.896-59.457-10.931Q-59.454-10.941-59.452-10.948Q-59.450-10.955-59.450-10.965Q-59.450-11.467-59.648-11.867Q-59.847-12.267-60.305-12.267Q-60.872-12.267-61.065-11.908Q-61.258-11.549-61.258-10.937Q-61.258-10.551-61.204-10.268Q-61.149-9.984-60.954-9.792Q-60.759-9.601-60.390-9.601\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M-10.408-7.851a6.402 6.402 0 1 0-12.804 0 6.402 6.402 0 0 0 12.804 0Zm-6.402 0\"\u002F>\u003Cg transform=\"translate(43.532 2.256)\">\u003Cpath d=\"M-60.899-8.059Q-60.899-8.565-60.770-9.073Q-60.640-9.580-60.402-10.042Q-60.165-10.503-59.830-10.924L-59.184-11.737L-59.997-11.737Q-60.582-11.737-60.978-11.729Q-61.375-11.720-61.398-11.700Q-61.501-11.583-61.580-11.057L-61.846-11.057L-61.600-12.581L-61.334-12.581L-61.334-12.561Q-61.334-12.493-61.258-12.450Q-61.183-12.407-61.105-12.400Q-60.913-12.376-60.718-12.370Q-60.523-12.363-60.332-12.361Q-60.141-12.359-59.942-12.359L-58.521-12.359L-58.521-12.171Q-58.531-12.123-58.541-12.113L-59.597-10.790Q-59.816-10.517-59.939-10.204Q-60.062-9.892-60.120-9.543Q-60.178-9.194-60.192-8.863Q-60.206-8.531-60.206-8.059Q-60.206-7.909-60.305-7.810Q-60.404-7.711-60.551-7.711Q-60.701-7.711-60.800-7.810Q-60.899-7.909-60.899-8.059\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M18.044-7.851a6.402 6.402 0 1 0-12.803 0 6.402 6.402 0 0 0 12.803 0Zm-6.402 0\"\u002F>\u003Cg transform=\"translate(71.984 2.256)\">\u003Cpath d=\"M-59.009-7.851L-61.894-7.851L-61.894-8.053Q-61.894-8.083-61.867-8.111L-60.619-9.328Q-60.547-9.403-60.505-9.445Q-60.462-9.488-60.383-9.567Q-59.970-9.980-59.739-10.338Q-59.508-10.695-59.508-11.119Q-59.508-11.351-59.587-11.554Q-59.666-11.758-59.807-11.908Q-59.949-12.059-60.144-12.139Q-60.339-12.219-60.571-12.219Q-60.882-12.219-61.140-12.060Q-61.398-11.901-61.528-11.624L-61.508-11.624Q-61.340-11.624-61.233-11.513Q-61.125-11.402-61.125-11.238Q-61.125-11.081-61.234-10.968Q-61.344-10.855-61.508-10.855Q-61.668-10.855-61.781-10.968Q-61.894-11.081-61.894-11.238Q-61.894-11.614-61.686-11.901Q-61.477-12.188-61.142-12.344Q-60.807-12.499-60.452-12.499Q-60.028-12.499-59.648-12.341Q-59.269-12.182-59.035-11.865Q-58.801-11.549-58.801-11.119Q-58.801-10.808-58.941-10.539Q-59.081-10.271-59.286-10.066Q-59.491-9.861-59.854-9.579Q-60.216-9.297-60.325-9.201L-61.180-8.473L-60.537-8.473Q-60.274-8.473-59.985-8.475Q-59.696-8.476-59.478-8.485Q-59.259-8.494-59.242-8.511Q-59.180-8.576-59.143-8.743Q-59.105-8.911-59.067-9.153L-58.801-9.153\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg stroke=\"var(--tk-line)\" style=\"stroke-dasharray:3.0,3.0\">\u003Cpath fill=\"none\" d=\"M40.806-7.851a6.402 6.402 0 1 0-12.803 0 6.402 6.402 0 0 0 12.803 0Zm-6.402 0\"\u002F>\u003Cg transform=\"translate(94.854 2.43)\">\u003Cpath d=\"M-60.978-8.271Q-60.978-8.439-60.852-8.562Q-60.725-8.685-60.558-8.685Q-60.390-8.685-60.267-8.562Q-60.144-8.439-60.144-8.271Q-60.144-8.097-60.267-7.974Q-60.390-7.851-60.558-7.851Q-60.725-7.851-60.852-7.974Q-60.978-8.097-60.978-8.271M-60.691-9.307L-60.691-9.649Q-60.691-9.997-60.578-10.336Q-60.465-10.674-60.264-10.944Q-60.202-11.026-60.084-11.143Q-59.966-11.259-59.889-11.349Q-59.813-11.440-59.768-11.553Q-59.724-11.665-59.724-11.826Q-59.724-12.253-59.917-12.404Q-60.110-12.554-60.558-12.554Q-60.835-12.554-61.084-12.460Q-61.334-12.366-61.467-12.171Q-61.330-12.171-61.241-12.065Q-61.152-11.959-61.152-11.826Q-61.152-11.730-61.199-11.652Q-61.245-11.573-61.325-11.529Q-61.405-11.484-61.494-11.484Q-61.645-11.484-61.745-11.582Q-61.846-11.679-61.846-11.826Q-61.846-12.137-61.653-12.354Q-61.460-12.571-61.163-12.675Q-60.865-12.780-60.558-12.780Q-60.301-12.780-60.040-12.737Q-59.778-12.694-59.560-12.592Q-59.341-12.489-59.201-12.298Q-59.061-12.106-59.061-11.826Q-59.061-11.611-59.170-11.423Q-59.279-11.235-59.471-11.112Q-59.748-10.941-59.961-10.719Q-60.175-10.497-60.300-10.218Q-60.424-9.939-60.424-9.635L-60.424-9.307Q-60.424-9.276-60.448-9.252Q-60.472-9.228-60.500-9.228L-60.612-9.228Q-60.643-9.228-60.667-9.252Q-60.691-9.276-60.691-9.307\" fill=\"var(--tk-line)\" stroke=\"var(--tk-line)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M69.259-7.851a6.402 6.402 0 1 0-12.804 0 6.402 6.402 0 0 0 12.804 0Zm-6.402 0\"\u002F>\u003Cg transform=\"translate(123.199 2.256)\">\u003Cpath d=\"M-61.528-8.613L-61.559-8.613Q-61.422-8.316-61.125-8.140Q-60.828-7.964-60.500-7.964Q-60.137-7.964-59.910-8.142Q-59.683-8.319-59.589-8.608Q-59.495-8.897-59.495-9.259Q-59.495-9.574-59.549-9.859Q-59.604-10.144-59.777-10.350Q-59.949-10.555-60.264-10.555Q-60.537-10.555-60.720-10.488Q-60.903-10.421-61.007-10.332Q-61.111-10.244-61.207-10.134Q-61.303-10.025-61.347-10.015L-61.426-10.015Q-61.498-10.032-61.515-10.103L-61.515-12.421Q-61.515-12.455-61.491-12.477Q-61.467-12.499-61.433-12.499L-61.405-12.499Q-61.118-12.383-60.850-12.329Q-60.582-12.274-60.305-12.274Q-60.028-12.274-59.758-12.329Q-59.488-12.383-59.208-12.499L-59.184-12.499Q-59.149-12.499-59.126-12.476Q-59.102-12.452-59.102-12.421L-59.102-12.352Q-59.102-12.325-59.122-12.305Q-59.396-11.990-59.780-11.814Q-60.165-11.638-60.578-11.638Q-60.917-11.638-61.234-11.724L-61.234-10.442Q-60.838-10.777-60.264-10.777Q-59.860-10.777-59.524-10.567Q-59.187-10.356-58.994-10.004Q-58.801-9.652-58.801-9.252Q-58.801-8.921-58.941-8.635Q-59.081-8.350-59.325-8.140Q-59.570-7.930-59.872-7.820Q-60.175-7.711-60.493-7.711Q-60.852-7.711-61.178-7.875Q-61.504-8.039-61.699-8.331Q-61.894-8.623-61.894-8.986Q-61.894-9.136-61.788-9.242Q-61.682-9.348-61.528-9.348Q-61.375-9.348-61.270-9.244Q-61.166-9.140-61.166-8.986Q-61.166-8.829-61.270-8.721Q-61.375-8.613-61.528-8.613\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M92.021-7.851a6.402 6.402 0 1 0-12.803 0 6.402 6.402 0 0 0 12.803 0Zm-6.402 0\"\u002F>\u003Cg transform=\"translate(145.961 2.256)\">\u003Cpath d=\"M-61.956-8.928Q-61.956-9.369-61.653-9.690Q-61.351-10.011-60.899-10.203L-61.139-10.343Q-61.409-10.503-61.575-10.761Q-61.740-11.019-61.740-11.317Q-61.740-11.669-61.535-11.941Q-61.330-12.212-61.009-12.356Q-60.688-12.499-60.346-12.499Q-60.024-12.499-59.701-12.383Q-59.378-12.267-59.167-12.026Q-58.955-11.785-58.955-11.450Q-58.955-11.088-59.199-10.825Q-59.443-10.561-59.823-10.384L-59.423-10.148Q-59.228-10.035-59.069-9.866Q-58.910-9.697-58.823-9.488Q-58.736-9.280-58.736-9.047Q-58.736-8.644-58.970-8.340Q-59.204-8.036-59.578-7.873Q-59.953-7.711-60.346-7.711Q-60.732-7.711-61.101-7.848Q-61.470-7.984-61.713-8.261Q-61.956-8.538-61.956-8.928M-61.508-8.928Q-61.508-8.641-61.339-8.418Q-61.169-8.196-60.901-8.080Q-60.633-7.964-60.346-7.964Q-59.908-7.964-59.546-8.181Q-59.184-8.398-59.184-8.805Q-59.184-9.006-59.312-9.184Q-59.440-9.362-59.618-9.461L-60.640-10.056Q-60.879-9.946-61.077-9.780Q-61.275-9.615-61.392-9.399Q-61.508-9.184-61.508-8.928M-60.985-11.057L-60.065-10.524Q-59.758-10.684-59.556-10.917Q-59.355-11.149-59.355-11.450Q-59.355-11.689-59.500-11.879Q-59.645-12.069-59.877-12.168Q-60.110-12.267-60.346-12.267Q-60.568-12.267-60.797-12.197Q-61.026-12.127-61.183-11.970Q-61.340-11.812-61.340-11.583Q-61.340-11.269-60.985-11.057\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M114.783-7.851a6.402 6.402 0 1 0-12.803 0 6.402 6.402 0 0 0 12.803 0Zm-6.401 0\"\u002F>\u003Cg transform=\"translate(168.723 2.256)\">\u003Cpath d=\"M-60.346-7.711Q-60.804-7.711-61.122-7.926Q-61.439-8.142-61.621-8.494Q-61.802-8.846-61.879-9.266Q-61.956-9.686-61.956-10.114Q-61.956-10.698-61.703-11.254Q-61.450-11.809-60.980-12.154Q-60.510-12.499-59.912-12.499Q-59.502-12.499-59.218-12.301Q-58.934-12.103-58.934-11.700Q-58.934-11.604-58.980-11.525Q-59.026-11.447-59.107-11.402Q-59.187-11.358-59.276-11.358Q-59.423-11.358-59.524-11.455Q-59.625-11.553-59.625-11.700Q-59.625-11.830-59.534-11.937Q-59.443-12.045-59.310-12.045Q-59.498-12.267-59.912-12.267Q-60.226-12.267-60.500-12.103Q-60.773-11.939-60.940-11.665Q-61.128-11.375-61.193-11.009Q-61.258-10.643-61.258-10.189Q-61.108-10.483-60.843-10.661Q-60.578-10.838-60.264-10.838Q-59.833-10.838-59.484-10.632Q-59.136-10.425-58.936-10.069Q-58.736-9.714-58.736-9.287Q-58.736-8.842-58.953-8.482Q-59.170-8.121-59.543-7.916Q-59.915-7.711-60.346-7.711M-60.346-7.964Q-59.970-7.964-59.766-8.147Q-59.563-8.330-59.500-8.613Q-59.437-8.897-59.437-9.287Q-59.437-9.673-59.491-9.953Q-59.546-10.233-59.741-10.425Q-59.936-10.616-60.305-10.616Q-60.595-10.616-60.807-10.440Q-61.019-10.264-61.127-9.991Q-61.234-9.717-61.234-9.434L-61.234-9.293L-61.234-9.252Q-61.234-8.747-61.023-8.355Q-60.811-7.964-60.346-7.964\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cpath fill=\"none\" d=\"M15.51-61.343-32.915-39.33M23.023-57.244v13.627M30.537-61.343 78.962-39.33M-44.14-30.594l-14.07 17.588M-39.573-28.99v14.537M-35.004-30.594l14.07 17.588M20.308-29.514l-6.214 15.533\"\u002F>\u003Cpath fill=\"none\" stroke=\"var(--tk-line)\" d=\"m25.74-29.514 6.213 15.533\" style=\"stroke-dasharray:3.0,3.0\"\u002F>\u003Cpath fill=\"none\" d=\"m81.051-30.594-14.07 17.588M85.62-28.99v14.537M90.188-30.594l14.07 17.588\"\u002F>\u003Cg transform=\"translate(188.476 -54.767)\">\u003Cpath d=\"M-62.236-8.059L-62.236-8.138Q-62.191-8.319-62.021-8.340L-61.867-8.340L-61.867-11.638L-62.021-11.638Q-62.191-11.659-62.236-11.847L-62.236-11.925Q-62.191-12.106-62.021-12.127L-61.419-12.127Q-61.306-12.127-61.219-12.060Q-61.132-11.994-61.098-11.898Q-61.070-11.806-60.876-11.202Q-60.681-10.599-60.580-10.252Q-60.479-9.905-60.479-9.840Q-60.472-9.909-60.424-10.081Q-60.377-10.254-60.277-10.579Q-60.178-10.903-60.050-11.308Q-59.922-11.713-59.864-11.898Q-59.830-11.994-59.739-12.060Q-59.648-12.127-59.543-12.127L-58.941-12.127Q-58.767-12.106-58.722-11.925L-58.722-11.847Q-58.767-11.659-58.941-11.638L-59.095-11.638L-59.095-8.340L-58.941-8.340Q-58.767-8.319-58.722-8.138L-58.722-8.059Q-58.767-7.872-58.941-7.851L-59.710-7.851Q-59.881-7.872-59.925-8.059L-59.925-8.138Q-59.881-8.319-59.710-8.340L-59.556-8.340L-59.556-11.566Q-59.556-11.515-59.630-11.254Q-59.703-10.992-59.794-10.702Q-59.884-10.411-59.999-10.054Q-60.113-9.697-60.171-9.509Q-60.206-9.410-60.293-9.345Q-60.380-9.280-60.479-9.280Q-60.578-9.280-60.665-9.345Q-60.752-9.410-60.787-9.509Q-60.845-9.697-60.963-10.062Q-61.081-10.428-61.200-10.816Q-61.320-11.204-61.359-11.348Q-61.398-11.491-61.405-11.566L-61.405-8.340L-61.252-8.340Q-61.077-8.319-61.033-8.138L-61.033-8.059Q-61.077-7.872-61.252-7.851L-62.021-7.851Q-62.191-7.872-62.236-8.059M-58.418-8.059L-58.418-8.138Q-58.367-8.323-58.199-8.340L-58.004-8.340L-57.170-12Q-57.150-12.103-57.066-12.168Q-56.982-12.233-56.883-12.233L-56.644-12.233Q-56.545-12.233-56.461-12.166Q-56.377-12.100-56.357-12L-55.526-8.340L-55.328-8.340Q-55.147-8.319-55.113-8.138L-55.113-8.059Q-55.157-7.872-55.328-7.851L-56.275-7.851Q-56.446-7.872-56.490-8.059L-56.490-8.138Q-56.446-8.319-56.275-8.340L-56.101-8.340Q-56.213-8.835-56.234-8.907L-57.297-8.907Q-57.335-8.747-57.430-8.340L-57.256-8.340Q-57.082-8.319-57.037-8.138L-57.037-8.059Q-57.082-7.872-57.256-7.851L-58.199-7.851Q-58.380-7.872-58.418-8.059M-57.191-9.399L-56.336-9.399Q-56.757-11.266-56.757-11.566L-56.764-11.566Q-56.764-11.406-56.887-10.808Q-57.010-10.209-57.191-9.399M-54.696-8.059L-54.696-8.138Q-54.658-8.319-54.477-8.340L-54.255-8.340L-53.363-10.134L-54.163-11.638L-54.402-11.638Q-54.573-11.659-54.617-11.847L-54.617-11.925Q-54.573-12.106-54.402-12.127L-53.462-12.127Q-53.291-12.106-53.247-11.925L-53.247-11.847Q-53.291-11.659-53.462-11.638L-53.534-11.638L-53.086-10.784L-52.679-11.638L-52.761-11.638Q-52.946-11.659-52.980-11.847L-52.980-11.925Q-52.946-12.106-52.761-12.127L-51.832-12.127Q-51.664-12.106-51.613-11.925L-51.613-11.847Q-51.664-11.659-51.832-11.638L-52.064-11.638L-52.813-10.134L-51.866-8.340L-51.630-8.340Q-51.456-8.319-51.411-8.138L-51.411-8.059Q-51.456-7.872-51.630-7.851L-52.560-7.851Q-52.741-7.872-52.775-8.059L-52.775-8.138Q-52.741-8.319-52.560-8.340L-52.481-8.340L-53.086-9.553L-53.643-8.340L-53.547-8.340Q-53.373-8.319-53.329-8.138L-53.329-8.059Q-53.373-7.872-53.547-7.851L-54.477-7.851Q-54.658-7.872-54.696-8.059\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003Cg transform=\"translate(188.476 -26.314)\">\u003Cpath d=\"M-62.236-8.059L-62.236-8.138Q-62.191-8.319-62.021-8.340L-61.867-8.340L-61.867-11.638L-62.021-11.638Q-62.191-11.659-62.236-11.847L-62.236-11.925Q-62.191-12.106-62.021-12.127L-61.419-12.127Q-61.306-12.127-61.219-12.060Q-61.132-11.994-61.098-11.898Q-61.070-11.806-60.876-11.202Q-60.681-10.599-60.580-10.252Q-60.479-9.905-60.479-9.840Q-60.472-9.909-60.424-10.081Q-60.377-10.254-60.277-10.579Q-60.178-10.903-60.050-11.308Q-59.922-11.713-59.864-11.898Q-59.830-11.994-59.739-12.060Q-59.648-12.127-59.543-12.127L-58.941-12.127Q-58.767-12.106-58.722-11.925L-58.722-11.847Q-58.767-11.659-58.941-11.638L-59.095-11.638L-59.095-8.340L-58.941-8.340Q-58.767-8.319-58.722-8.138L-58.722-8.059Q-58.767-7.872-58.941-7.851L-59.710-7.851Q-59.881-7.872-59.925-8.059L-59.925-8.138Q-59.881-8.319-59.710-8.340L-59.556-8.340L-59.556-11.566Q-59.556-11.515-59.630-11.254Q-59.703-10.992-59.794-10.702Q-59.884-10.411-59.999-10.054Q-60.113-9.697-60.171-9.509Q-60.206-9.410-60.293-9.345Q-60.380-9.280-60.479-9.280Q-60.578-9.280-60.665-9.345Q-60.752-9.410-60.787-9.509Q-60.845-9.697-60.963-10.062Q-61.081-10.428-61.200-10.816Q-61.320-11.204-61.359-11.348Q-61.398-11.491-61.405-11.566L-61.405-8.340L-61.252-8.340Q-61.077-8.319-61.033-8.138L-61.033-8.059Q-61.077-7.872-61.252-7.851L-62.021-7.851Q-62.191-7.872-62.236-8.059M-58.080-8.059L-58.080-8.138Q-58.035-8.319-57.864-8.340L-57.044-8.340L-57.044-11.638L-57.864-11.638Q-58.035-11.659-58.080-11.847L-58.080-11.925Q-58.035-12.106-57.864-12.127L-55.667-12.127Q-55.492-12.106-55.448-11.925L-55.448-11.847Q-55.492-11.659-55.667-11.638L-56.483-11.638L-56.483-8.340L-55.667-8.340Q-55.492-8.319-55.448-8.138L-55.448-8.059Q-55.492-7.872-55.667-7.851L-57.864-7.851Q-58.035-7.872-58.080-8.059M-54.730-8.059L-54.730-8.138Q-54.686-8.319-54.511-8.340L-54.275-8.340L-54.275-11.638L-54.511-11.638Q-54.686-11.659-54.730-11.847L-54.730-11.925Q-54.686-12.106-54.511-12.127L-53.828-12.127Q-53.715-12.127-53.623-12.062Q-53.530-11.997-53.496-11.898Q-53.253-11.207-53.113-10.814Q-52.973-10.421-52.751-9.792Q-52.529-9.163-52.408-8.805Q-52.286-8.446-52.286-8.412L-52.286-11.638L-52.525-11.638Q-52.696-11.659-52.741-11.847L-52.741-11.925Q-52.696-12.106-52.525-12.127L-51.585-12.127Q-51.415-12.106-51.370-11.925L-51.370-11.847Q-51.415-11.659-51.585-11.638L-51.825-11.638L-51.825-8.059Q-51.869-7.872-52.040-7.851L-52.273-7.851Q-52.382-7.851-52.472-7.916Q-52.563-7.981-52.601-8.083Q-52.860-8.825-53.187-9.743Q-53.513-10.661-53.662-11.088Q-53.811-11.515-53.814-11.566L-53.814-8.340L-53.575-8.340Q-53.407-8.319-53.356-8.138L-53.356-8.059Q-53.407-7.872-53.575-7.851L-54.511-7.851Q-54.686-7.872-54.730-8.059\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>\u003Cfigcaption class=\"tikz-cap\">A MAX root chooses among three MIN nodes. After the middle child resolves to \u003Cspan class=\"katex\">\u003Cspan class=\"katex-html\" aria-hidden=\"true\">\u003Cspan class=\"base\">\u003Cspan class=\"strut\" style=\"height:0.7804em;vertical-align:-0.136em;\">\u003C\u002Fspan>\u003Cspan class=\"mord\">2\u003C\u002Fspan>\u003Cspan class=\"mspace\" style=\"margin-right:0.2778em;\">\u003C\u002Fspan>\u003Cspan class=\"mrel\">≤\u003C\u002Fspan>\u003Cspan class=\"mspace\" style=\"margin-right:0.2778em;\">\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"base\">\u003Cspan class=\"strut\" style=\"height:0.4306em;\">\u003C\u002Fspan>\u003Cspan class=\"mord mathnormal\" style=\"margin-right:0.0037em;\">α\u003C\u002Fspan>\u003Cspan class=\"mspace\" style=\"margin-right:0.2778em;\">\u003C\u002Fspan>\u003Cspan class=\"mrel\">=\u003C\u002Fspan>\u003Cspan class=\"mspace\" style=\"margin-right:0.2778em;\">\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"base\">\u003Cspan class=\"strut\" style=\"height:0.6444em;\">\u003C\u002Fspan>\u003Cspan class=\"mord\">3\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fspan>, its remaining leaf (dashed) can never be played — the root already has a better line — so the search skips it.\u003C\u002Ffigcaption>","\u003Csvg style=\"width:100%;max-width:327.058px;height:auto\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"-75 -75 245.293 88.059\">\u003Cg stroke=\"currentColor\" style=\"stroke-miterlimit:10;stroke-width:.4\">\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M-44.552-54.43h42.679v-17.64h-42.68Z\"\u002F>\u003Cg transform=\"translate(47.72 -83.997)\">\u003Cpath d=\"M-85.746 23.459L-85.746 23.384Q-85.709 23.192-85.528 23.172L-85.159 23.172L-85.159 19.583L-85.528 19.583Q-85.709 19.563-85.746 19.371L-85.746 19.296Q-85.705 19.111-85.528 19.091L-84.813 19.091Q-84.642 19.108-84.598 19.296L-84.598 19.358Q-84.413 19.211-84.183 19.134Q-83.952 19.057-83.716 19.057Q-83.419 19.057-83.159 19.183Q-82.899 19.310-82.711 19.530Q-82.523 19.751-82.423 20.024Q-82.322 20.297-82.322 20.598Q-82.322 21.005-82.520 21.364Q-82.718 21.723-83.057 21.933Q-83.395 22.143-83.805 22.143Q-84.260 22.143-84.598 21.822L-84.598 23.172L-84.225 23.172Q-84.044 23.192-84.010 23.384L-84.010 23.459Q-84.044 23.644-84.225 23.664L-85.528 23.664Q-85.705 23.644-85.746 23.459M-83.843 21.654Q-83.573 21.654-83.354 21.506Q-83.135 21.357-83.009 21.111Q-82.882 20.865-82.882 20.598Q-82.882 20.345-82.992 20.101Q-83.101 19.857-83.304 19.701Q-83.508 19.546-83.771 19.546Q-84.051 19.546-84.280 19.708Q-84.509 19.870-84.598 20.133L-84.598 20.879Q-84.519 21.200-84.326 21.427Q-84.133 21.654-83.843 21.654M-80.237 22.143Q-80.650 22.143-80.987 21.930Q-81.324 21.716-81.518 21.357Q-81.713 20.998-81.713 20.598Q-81.713 20.297-81.604 20.015Q-81.495 19.734-81.293 19.511Q-81.091 19.289-80.823 19.163Q-80.555 19.036-80.237 19.036Q-79.919 19.036-79.645 19.164Q-79.372 19.293-79.177 19.508Q-78.982 19.723-78.871 20.004Q-78.760 20.284-78.760 20.598Q-78.760 20.998-78.957 21.359Q-79.153 21.719-79.490 21.931Q-79.827 22.143-80.237 22.143M-80.237 21.654Q-79.830 21.654-79.575 21.309Q-79.321 20.964-79.321 20.540Q-79.321 20.284-79.439 20.050Q-79.557 19.816-79.767 19.670Q-79.977 19.525-80.237 19.525Q-80.503 19.525-80.712 19.670Q-80.920 19.816-81.038 20.050Q-81.156 20.284-81.156 20.540Q-81.156 20.961-80.900 21.307Q-80.643 21.654-80.237 21.654M-77.865 21.935L-77.865 21.135Q-77.841 20.954-77.656 20.933L-77.509 20.933Q-77.366 20.954-77.314 21.094Q-77.137 21.654-76.501 21.654Q-76.320 21.654-76.120 21.624Q-75.920 21.593-75.773 21.492Q-75.626 21.391-75.626 21.213Q-75.626 21.029-75.821 20.930Q-76.016 20.831-76.255 20.793L-76.867 20.694Q-77.865 20.509-77.865 19.877Q-77.865 19.624-77.738 19.458Q-77.612 19.293-77.402 19.199Q-77.191 19.105-76.967 19.070Q-76.744 19.036-76.501 19.036Q-76.282 19.036-76.113 19.062Q-75.944 19.088-75.800 19.156Q-75.732 19.053-75.619 19.036L-75.551 19.036Q-75.465 19.047-75.411 19.101Q-75.356 19.156-75.346 19.238L-75.346 19.857Q-75.356 19.939-75.411 19.997Q-75.465 20.055-75.551 20.065L-75.698 20.065Q-75.780 20.055-75.838 19.997Q-75.896 19.939-75.906 19.857Q-75.906 19.525-76.515 19.525Q-76.819 19.525-77.097 19.597Q-77.376 19.669-77.376 19.884Q-77.376 20.116-76.788 20.212L-76.173 20.318Q-75.749 20.390-75.443 20.607Q-75.137 20.824-75.137 21.213Q-75.137 21.555-75.344 21.767Q-75.551 21.979-75.857 22.061Q-76.162 22.143-76.501 22.143Q-77.007 22.143-77.355 21.921Q-77.417 22.030-77.460 22.080Q-77.502 22.130-77.595 22.143L-77.656 22.143Q-77.844 22.123-77.865 21.935M-74.122 21.901L-74.122 21.822Q-74.078 21.641-73.907 21.620L-72.997 21.620L-72.997 19.583L-73.849 19.583Q-74.023 19.563-74.067 19.371L-74.067 19.296Q-74.023 19.111-73.849 19.091L-72.652 19.091Q-72.481 19.108-72.437 19.296L-72.437 21.620L-71.637 21.620Q-71.466 21.641-71.422 21.822L-71.422 21.901Q-71.466 22.088-71.637 22.109L-73.907 22.109Q-74.078 22.088-74.122 21.901M-73.220 18.236L-73.220 18.189Q-73.220 18.038-73.100 17.932Q-72.980 17.826-72.827 17.826Q-72.676 17.826-72.557 17.932Q-72.437 18.038-72.437 18.189L-72.437 18.236Q-72.437 18.390-72.557 18.496Q-72.676 18.602-72.827 18.602Q-72.980 18.602-73.100 18.496Q-73.220 18.390-73.220 18.236M-69.897 21.142L-69.897 19.583L-70.554 19.583Q-70.728 19.563-70.772 19.371L-70.772 19.296Q-70.728 19.111-70.554 19.091L-69.897 19.091L-69.897 18.435Q-69.853 18.254-69.679 18.230L-69.552 18.230Q-69.381 18.254-69.337 18.435L-69.337 19.091L-68.147 19.091Q-67.980 19.108-67.929 19.296L-67.929 19.371Q-67.976 19.563-68.147 19.583L-69.337 19.583L-69.337 21.114Q-69.337 21.654-68.834 21.654Q-68.616 21.654-68.472 21.492Q-68.329 21.330-68.329 21.114Q-68.329 21.032-68.265 20.971Q-68.202 20.909-68.113 20.899L-67.987 20.899Q-67.812 20.920-67.768 21.101L-67.768 21.142Q-67.768 21.425-67.929 21.656Q-68.089 21.887-68.346 22.015Q-68.602 22.143-68.882 22.143Q-69.330 22.143-69.614 21.871Q-69.897 21.600-69.897 21.142M-66.691 21.901L-66.691 21.822Q-66.647 21.641-66.476 21.620L-65.567 21.620L-65.567 19.583L-66.418 19.583Q-66.592 19.563-66.637 19.371L-66.637 19.296Q-66.592 19.111-66.418 19.091L-65.222 19.091Q-65.051 19.108-65.006 19.296L-65.006 21.620L-64.206 21.620Q-64.036 21.641-63.991 21.822L-63.991 21.901Q-64.036 22.088-64.206 22.109L-66.476 22.109Q-66.647 22.088-66.691 21.901M-65.789 18.236L-65.789 18.189Q-65.789 18.038-65.669 17.932Q-65.550 17.826-65.396 17.826Q-65.246 17.826-65.126 17.932Q-65.006 18.038-65.006 18.189L-65.006 18.236Q-65.006 18.390-65.126 18.496Q-65.246 18.602-65.396 18.602Q-65.550 18.602-65.669 18.496Q-65.789 18.390-65.789 18.236M-61.660 22.143Q-62.074 22.143-62.410 21.930Q-62.747 21.716-62.942 21.357Q-63.137 20.998-63.137 20.598Q-63.137 20.297-63.027 20.015Q-62.918 19.734-62.716 19.511Q-62.515 19.289-62.246 19.163Q-61.978 19.036-61.660 19.036Q-61.342 19.036-61.069 19.164Q-60.795 19.293-60.600 19.508Q-60.406 19.723-60.295 20.004Q-60.183 20.284-60.183 20.598Q-60.183 20.998-60.380 21.359Q-60.577 21.719-60.913 21.931Q-61.250 22.143-61.660 22.143M-61.660 21.654Q-61.253 21.654-60.999 21.309Q-60.744 20.964-60.744 20.540Q-60.744 20.284-60.862 20.050Q-60.980 19.816-61.190 19.670Q-61.400 19.525-61.660 19.525Q-61.927 19.525-62.135 19.670Q-62.344 19.816-62.462 20.050Q-62.579 20.284-62.579 20.540Q-62.579 20.961-62.323 21.307Q-62.067 21.654-61.660 21.654M-59.739 21.901L-59.739 21.822Q-59.702 21.641-59.520 21.620L-59.151 21.620L-59.151 19.583L-59.520 19.583Q-59.702 19.563-59.739 19.371L-59.739 19.296Q-59.698 19.111-59.520 19.091L-58.806 19.091Q-58.635 19.111-58.591 19.296L-58.591 19.371L-58.598 19.392Q-58.399 19.234-58.160 19.146Q-57.921 19.057-57.664 19.057Q-57.360 19.057-57.152 19.180Q-56.943 19.303-56.842 19.528Q-56.742 19.754-56.742 20.065L-56.742 21.620L-56.369 21.620Q-56.188 21.641-56.154 21.822L-56.154 21.901Q-56.188 22.088-56.369 22.109L-57.589 22.109Q-57.760 22.088-57.805 21.901L-57.805 21.822Q-57.760 21.637-57.589 21.620L-57.302 21.620L-57.302 20.092Q-57.302 19.822-57.381 19.684Q-57.459 19.546-57.716 19.546Q-57.952 19.546-58.152 19.660Q-58.351 19.775-58.471 19.974Q-58.591 20.174-58.591 20.407L-58.591 21.620L-58.218 21.620Q-58.037 21.641-58.003 21.822L-58.003 21.901Q-58.037 22.088-58.218 22.109L-59.520 22.109Q-59.702 22.088-59.739 21.901\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M-4.718-24.554h42.68v-17.64h-42.68Z\"\u002F>\u003Cg transform=\"translate(96.852 -53.83)\">\u003Cpath d=\"M-85.179 21.829Q-85.261 21.695-85.306 21.502Q-85.350 21.309-85.374 21.046Q-85.398 20.783-85.403 20.542Q-85.408 20.301-85.408 19.966Q-85.408 19.518-85.398 19.202Q-85.388 18.886-85.336 18.582Q-85.285 18.277-85.179 18.113Q-85.022 17.884-84.707 17.823Q-84.393 17.761-83.952 17.761Q-83.511 17.761-83.198 17.823Q-82.886 17.884-82.728 18.113Q-82.619 18.274-82.568 18.580Q-82.516 18.886-82.506 19.202Q-82.496 19.518-82.496 19.966Q-82.496 20.421-82.506 20.737Q-82.516 21.053-82.568 21.360Q-82.619 21.668-82.728 21.829Q-82.817 21.979-83.029 22.068L-82.616 22.851Q-82.602 22.892-82.602 22.922Q-82.602 22.991-82.645 23.037Q-82.687 23.083-82.756 23.083L-83.036 23.083Q-83.166 23.083-83.224 22.970L-83.631 22.171Q-83.737 22.177-83.952 22.177Q-84.393 22.177-84.706 22.116Q-85.018 22.054-85.179 21.829M-84.707 21.415Q-84.615 21.593-84.419 21.641Q-84.222 21.689-83.952 21.689L-83.877 21.689L-84.150 21.142Q-84.171 21.111-84.171 21.073Q-84.171 21.012-84.121 20.962Q-84.072 20.913-84.010 20.913L-83.703 20.913Q-83.631 20.913-83.610 20.967L-83.303 21.542Q-83.145 21.388-83.101 20.935Q-83.057 20.482-83.057 19.966Q-83.057 18.797-83.197 18.524Q-83.286 18.353-83.477 18.303Q-83.668 18.254-83.952 18.254Q-84.137 18.254-84.268 18.269Q-84.400 18.284-84.525 18.344Q-84.649 18.404-84.707 18.524Q-84.848 18.797-84.848 19.966Q-84.848 20.509-84.824 20.868Q-84.800 21.227-84.707 21.415M-81.867 21.901L-81.867 21.822Q-81.833 21.641-81.652 21.620L-81.296 21.620L-80.483 20.554L-81.245 19.583L-81.611 19.583Q-81.782 19.566-81.826 19.371L-81.826 19.296Q-81.782 19.111-81.611 19.091L-80.596 19.091Q-80.421 19.111-80.377 19.296L-80.377 19.371Q-80.421 19.563-80.596 19.583L-80.691 19.583L-80.257 20.157L-79.840 19.583L-79.943 19.583Q-80.117 19.563-80.162 19.371L-80.162 19.296Q-80.117 19.111-79.943 19.091L-78.928 19.091Q-78.757 19.108-78.712 19.296L-78.712 19.371Q-78.757 19.563-78.928 19.583L-79.287 19.583L-80.028 20.554L-79.187 21.620L-78.832 21.620Q-78.658 21.641-78.613 21.822L-78.613 21.901Q-78.647 22.088-78.832 22.109L-79.840 22.109Q-80.021 22.088-80.056 21.901L-80.056 21.822Q-80.021 21.641-79.840 21.620L-79.727 21.620L-80.257 20.872L-80.770 21.620L-80.643 21.620Q-80.462 21.641-80.428 21.822L-80.428 21.901Q-80.462 22.088-80.643 22.109L-81.652 22.109Q-81.823 22.092-81.867 21.901M-78.217 21.901L-78.217 21.822Q-78.183 21.641-77.998 21.620L-77.728 21.620L-77.728 18.322L-77.998 18.322Q-78.183 18.301-78.217 18.113L-78.217 18.035Q-78.183 17.854-77.998 17.833L-76.292 17.833Q-75.944 17.833-75.641 18.009Q-75.339 18.185-75.158 18.488Q-74.976 18.790-74.976 19.142Q-74.976 19.498-75.156 19.798Q-75.335 20.099-75.638 20.279Q-75.940 20.458-76.292 20.458L-77.167 20.458L-77.167 21.620L-76.894 21.620Q-76.709 21.641-76.675 21.822L-76.675 21.901Q-76.709 22.088-76.894 22.109L-77.998 22.109Q-78.183 22.088-78.217 21.901M-77.167 18.322L-77.167 19.966L-76.433 19.966Q-76.204 19.966-75.997 19.858Q-75.790 19.751-75.663 19.563Q-75.537 19.375-75.537 19.142Q-75.537 18.906-75.663 18.722Q-75.790 18.537-75.997 18.430Q-76.204 18.322-76.433 18.322\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-soft-accent)\" stroke=\"var(--tk-accent)\">\u003Cpath d=\"M35.116 9.59h42.679V-8.052h-42.68Z\"\u002F>\u003Cg transform=\"translate(136.686 -19.687)\">\u003Cpath d=\"M-84.431 22.109L-85.466 22.109Q-85.637 22.088-85.682 21.901L-85.682 21.822Q-85.637 21.641-85.466 21.620L-85.227 21.620L-85.227 18.322L-85.466 18.322Q-85.637 18.301-85.682 18.113L-85.682 18.035Q-85.637 17.854-85.466 17.833L-84.092 17.833Q-83.754 17.833-83.443 17.982Q-83.132 18.130-82.937 18.402Q-82.742 18.674-82.742 19.023Q-82.742 19.221-82.814 19.404Q-82.886 19.587-83.010 19.734Q-83.135 19.880-83.303 19.986Q-83.132 20.120-83.031 20.309Q-82.930 20.499-82.930 20.708L-82.930 21.213Q-82.930 21.689-82.756 21.689Q-82.715 21.689-82.693 21.576Q-82.670 21.463-82.670 21.374Q-82.626 21.193-82.455 21.172L-82.329 21.172Q-82.158 21.190-82.113 21.374L-82.113 21.422Q-82.113 21.713-82.293 21.945Q-82.472 22.177-82.749 22.177Q-83.111 22.177-83.301 21.909Q-83.491 21.641-83.491 21.261L-83.491 20.759Q-83.491 20.506-83.673 20.359Q-83.856 20.212-84.106 20.212L-84.666 20.212L-84.666 21.620L-84.431 21.620Q-84.256 21.641-84.212 21.822L-84.212 21.901Q-84.256 22.088-84.431 22.109M-84.666 18.322L-84.666 19.723L-84.164 19.723Q-83.959 19.723-83.761 19.640Q-83.562 19.556-83.433 19.395Q-83.303 19.234-83.303 19.023Q-83.303 18.811-83.433 18.650Q-83.562 18.489-83.759 18.406Q-83.955 18.322-84.164 18.322L-84.666 18.322M-81.867 21.901L-81.867 21.822Q-81.833 21.641-81.652 21.620L-81.296 21.620L-80.483 20.554L-81.245 19.583L-81.611 19.583Q-81.782 19.566-81.826 19.371L-81.826 19.296Q-81.782 19.111-81.611 19.091L-80.596 19.091Q-80.421 19.111-80.377 19.296L-80.377 19.371Q-80.421 19.563-80.596 19.583L-80.691 19.583L-80.257 20.157L-79.840 19.583L-79.943 19.583Q-80.117 19.563-80.162 19.371L-80.162 19.296Q-80.117 19.111-79.943 19.091L-78.928 19.091Q-78.757 19.108-78.712 19.296L-78.712 19.371Q-78.757 19.563-78.928 19.583L-79.287 19.583L-80.028 20.554L-79.187 21.620L-78.832 21.620Q-78.658 21.641-78.613 21.822L-78.613 21.901Q-78.647 22.088-78.832 22.109L-79.840 22.109Q-80.021 22.088-80.056 21.901L-80.056 21.822Q-80.021 21.641-79.840 21.620L-79.727 21.620L-80.257 20.872L-80.770 21.620L-80.643 21.620Q-80.462 21.641-80.428 21.822L-80.428 21.901Q-80.462 22.088-80.643 22.109L-81.652 22.109Q-81.823 22.092-81.867 21.901M-77.748 21.829Q-77.830 21.695-77.875 21.502Q-77.919 21.309-77.943 21.046Q-77.967 20.783-77.972 20.542Q-77.977 20.301-77.977 19.966Q-77.977 19.518-77.967 19.202Q-77.957 18.886-77.906 18.582Q-77.854 18.277-77.748 18.113Q-77.591 17.884-77.277 17.823Q-76.962 17.761-76.521 17.761Q-76.080 17.761-75.768 17.823Q-75.455 17.884-75.298 18.113Q-75.188 18.274-75.137 18.580Q-75.086 18.886-75.076 19.202Q-75.065 19.518-75.065 19.966Q-75.065 20.421-75.076 20.737Q-75.086 21.053-75.137 21.360Q-75.188 21.668-75.298 21.829Q-75.387 21.979-75.599 22.068L-75.185 22.851Q-75.171 22.892-75.171 22.922Q-75.171 22.991-75.214 23.037Q-75.257 23.083-75.325 23.083L-75.605 23.083Q-75.735 23.083-75.793 22.970L-76.200 22.171Q-76.306 22.177-76.521 22.177Q-76.962 22.177-77.275 22.116Q-77.588 22.054-77.748 21.829M-77.277 21.415Q-77.184 21.593-76.988 21.641Q-76.791 21.689-76.521 21.689L-76.446 21.689L-76.720 21.142Q-76.740 21.111-76.740 21.073Q-76.740 21.012-76.691 20.962Q-76.641 20.913-76.579 20.913L-76.272 20.913Q-76.200 20.913-76.180 20.967L-75.872 21.542Q-75.715 21.388-75.670 20.935Q-75.626 20.482-75.626 19.966Q-75.626 18.797-75.766 18.524Q-75.855 18.353-76.046 18.303Q-76.238 18.254-76.521 18.254Q-76.706 18.254-76.838 18.269Q-76.969 18.284-77.094 18.344Q-77.219 18.404-77.277 18.524Q-77.417 18.797-77.417 19.966Q-77.417 20.509-77.393 20.868Q-77.369 21.227-77.277 21.415\" fill=\"currentColor\" stroke=\"currentColor\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cpath fill=\"none\" stroke=\"var(--tk-line)\" d=\"M-11.186-54.23 4.598-42.394\"\u002F>\u003Cpath fill=\"none\" stroke=\"var(--tk-line)\" d=\"m27.144-24.354 18.79 16.103\" style=\"stroke-dasharray:3.0,3.0\"\u002F>\u003Cpath fill=\"none\" stroke=\"var(--tk-soft-neutral)\" d=\"M-68.737-17.725h221.931\" style=\"stroke-dasharray:3.0,3.0\"\u002F>\u003Cg fill=\"var(--tk-line)\" stroke=\"none\" font-family=\"cmtt8\" font-size=\"7\">\u003Cg transform=\"translate(183.407 -45.359)\">\u003Cpath d=\"M-85.295 21.935L-85.295 21.135Q-85.271 20.954-85.087 20.933L-84.940 20.933Q-84.796 20.954-84.745 21.094Q-84.567 21.654-83.932 21.654Q-83.750 21.654-83.550 21.624Q-83.350 21.593-83.204 21.492Q-83.057 21.391-83.057 21.213Q-83.057 21.029-83.251 20.930Q-83.446 20.831-83.685 20.793L-84.297 20.694Q-85.295 20.509-85.295 19.877Q-85.295 19.624-85.169 19.458Q-85.042 19.293-84.832 19.199Q-84.622 19.105-84.398 19.070Q-84.174 19.036-83.932 19.036Q-83.713 19.036-83.544 19.062Q-83.374 19.088-83.231 19.156Q-83.162 19.053-83.050 19.036L-82.981 19.036Q-82.896 19.047-82.841 19.101Q-82.787 19.156-82.776 19.238L-82.776 19.857Q-82.787 19.939-82.841 19.997Q-82.896 20.055-82.981 20.065L-83.128 20.065Q-83.210 20.055-83.268 19.997Q-83.327 19.939-83.337 19.857Q-83.337 19.525-83.945 19.525Q-84.249 19.525-84.528 19.597Q-84.807 19.669-84.807 19.884Q-84.807 20.116-84.219 20.212L-83.603 20.318Q-83.180 20.390-82.874 20.607Q-82.568 20.824-82.568 21.213Q-82.568 21.555-82.775 21.767Q-82.981 21.979-83.287 22.061Q-83.593 22.143-83.932 22.143Q-84.437 22.143-84.786 21.921Q-84.848 22.030-84.890 22.080Q-84.933 22.130-85.025 22.143L-85.087 22.143Q-85.275 22.123-85.295 21.935M-79.020 20.807L-81.156 20.807Q-81.108 21.049-80.936 21.244Q-80.763 21.439-80.520 21.547Q-80.278 21.654-80.028 21.654Q-79.615 21.654-79.420 21.401Q-79.413 21.391-79.363 21.299Q-79.314 21.207-79.271 21.169Q-79.228 21.131-79.146 21.121L-79.020 21.121Q-78.852 21.138-78.801 21.326L-78.801 21.374Q-78.859 21.637-79.061 21.810Q-79.263 21.983-79.536 22.063Q-79.809 22.143-80.076 22.143Q-80.500 22.143-80.884 21.943Q-81.269 21.743-81.503 21.393Q-81.737 21.043-81.737 20.612L-81.737 20.561Q-81.737 20.151-81.522 19.798Q-81.307 19.446-80.949 19.241Q-80.592 19.036-80.182 19.036Q-79.741 19.036-79.432 19.231Q-79.122 19.426-78.962 19.766Q-78.801 20.106-78.801 20.547L-78.801 20.598Q-78.852 20.786-79.020 20.807M-81.149 20.325L-79.375 20.325Q-79.416 19.966-79.625 19.745Q-79.833 19.525-80.182 19.525Q-80.527 19.525-80.796 19.754Q-81.064 19.983-81.149 20.325M-78.022 21.135Q-78.022 20.745-77.660 20.520Q-77.297 20.294-76.824 20.207Q-76.350 20.120-75.906 20.113Q-75.906 19.925-76.024 19.792Q-76.142 19.658-76.323 19.592Q-76.504 19.525-76.689 19.525Q-76.990 19.525-77.130 19.546L-77.130 19.597Q-77.130 19.744-77.234 19.845Q-77.338 19.945-77.482 19.945Q-77.636 19.945-77.736 19.838Q-77.837 19.730-77.837 19.583Q-77.837 19.228-77.504 19.132Q-77.171 19.036-76.682 19.036Q-76.446 19.036-76.212 19.105Q-75.978 19.173-75.781 19.305Q-75.585 19.436-75.465 19.629Q-75.346 19.822-75.346 20.065L-75.346 21.569Q-75.346 21.620-74.884 21.620Q-74.713 21.637-74.669 21.822L-74.669 21.901Q-74.713 22.088-74.884 22.109L-75.011 22.109Q-75.311 22.109-75.511 22.068Q-75.711 22.027-75.838 21.863Q-76.241 22.143-76.860 22.143Q-77.154 22.143-77.420 22.020Q-77.687 21.897-77.854 21.668Q-78.022 21.439-78.022 21.135M-77.461 21.142Q-77.461 21.381-77.249 21.518Q-77.037 21.654-76.788 21.654Q-76.597 21.654-76.393 21.603Q-76.190 21.552-76.048 21.431Q-75.906 21.309-75.906 21.114L-75.906 20.598Q-76.152 20.598-76.516 20.648Q-76.880 20.697-77.171 20.819Q-77.461 20.940-77.461 21.142M-74.467 21.901L-74.467 21.822Q-74.416 21.641-74.248 21.620L-73.626 21.620L-73.626 19.583L-74.248 19.583Q-74.419 19.563-74.467 19.371L-74.467 19.296Q-74.416 19.111-74.248 19.091L-73.285 19.091Q-73.110 19.108-73.066 19.296L-73.066 19.583Q-72.837 19.334-72.526 19.195Q-72.215 19.057-71.876 19.057Q-71.620 19.057-71.415 19.175Q-71.210 19.293-71.210 19.525Q-71.210 19.672-71.306 19.775Q-71.401 19.877-71.548 19.877Q-71.682 19.877-71.782 19.780Q-71.883 19.682-71.883 19.546Q-72.211 19.546-72.486 19.722Q-72.762 19.898-72.914 20.190Q-73.066 20.482-73.066 20.814L-73.066 21.620L-72.239 21.620Q-72.058 21.641-72.023 21.822L-72.023 21.901Q-72.058 22.088-72.239 22.109L-74.248 22.109Q-74.416 22.088-74.467 21.901M-70.458 20.598Q-70.458 20.178-70.244 19.816Q-70.031 19.453-69.667 19.245Q-69.303 19.036-68.882 19.036Q-68.397 19.036-68.065 19.132Q-67.734 19.228-67.734 19.583Q-67.734 19.730-67.833 19.838Q-67.932 19.945-68.082 19.945Q-68.233 19.945-68.337 19.845Q-68.441 19.744-68.441 19.597L-68.441 19.546Q-68.581 19.525-68.875 19.525Q-69.162 19.525-69.397 19.674Q-69.631 19.822-69.764 20.070Q-69.897 20.318-69.897 20.598Q-69.897 20.879-69.747 21.125Q-69.597 21.371-69.347 21.513Q-69.098 21.654-68.810 21.654Q-68.537 21.654-68.426 21.564Q-68.315 21.473-68.212 21.307Q-68.110 21.142-68.007 21.128L-67.860 21.128Q-67.768 21.138-67.712 21.198Q-67.655 21.258-67.655 21.347Q-67.655 21.388-67.672 21.422Q-67.768 21.678-67.946 21.836Q-68.123 21.993-68.364 22.068Q-68.605 22.143-68.882 22.143Q-69.306 22.143-69.670 21.935Q-70.034 21.726-70.246 21.374Q-70.458 21.022-70.458 20.598M-67.170 21.901L-67.170 21.822Q-67.132 21.641-66.951 21.620L-66.582 21.620L-66.582 18.322L-66.951 18.322Q-67.132 18.301-67.170 18.113L-67.170 18.035Q-67.132 17.854-66.951 17.833L-66.237 17.833Q-66.066 17.854-66.021 18.035L-66.021 19.392Q-65.618 19.057-65.095 19.057Q-64.791 19.057-64.582 19.180Q-64.374 19.303-64.273 19.528Q-64.172 19.754-64.172 20.065L-64.172 21.620L-63.800 21.620Q-63.619 21.641-63.584 21.822L-63.584 21.901Q-63.619 22.088-63.800 22.109L-65.020 22.109Q-65.191 22.088-65.235 21.901L-65.235 21.822Q-65.191 21.637-65.020 21.620L-64.733 21.620L-64.733 20.092Q-64.733 19.822-64.811 19.684Q-64.890 19.546-65.146 19.546Q-65.382 19.546-65.582 19.660Q-65.782 19.775-65.902 19.974Q-66.021 20.174-66.021 20.407L-66.021 21.620L-65.649 21.620Q-65.468 21.641-65.433 21.822L-65.433 21.901Q-65.468 22.088-65.649 22.109L-66.951 22.109Q-67.132 22.088-67.170 21.901\" fill=\"var(--tk-line)\" stroke=\"var(--tk-line)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003Cg transform=\"translate(183.407 -45.359)\">\u003Cpath d=\"M-59.715 21.901L-59.715 21.822Q-59.678 21.641-59.497 21.620L-59.128 21.620L-59.128 18.322L-59.497 18.322Q-59.678 18.301-59.715 18.113L-59.715 18.035Q-59.678 17.854-59.497 17.833L-58.782 17.833Q-58.611 17.854-58.567 18.035L-58.567 19.392Q-58.164 19.057-57.641 19.057Q-57.337 19.057-57.128 19.180Q-56.920 19.303-56.819 19.528Q-56.718 19.754-56.718 20.065L-56.718 21.620L-56.345 21.620Q-56.164 21.641-56.130 21.822L-56.130 21.901Q-56.164 22.088-56.345 22.109L-57.566 22.109Q-57.736 22.088-57.781 21.901L-57.781 21.822Q-57.736 21.637-57.566 21.620L-57.278 21.620L-57.278 20.092Q-57.278 19.822-57.357 19.684Q-57.436 19.546-57.692 19.546Q-57.928 19.546-58.128 19.660Q-58.328 19.775-58.447 19.974Q-58.567 20.174-58.567 20.407L-58.567 21.620L-58.194 21.620Q-58.013 21.641-57.979 21.822L-57.979 21.901Q-58.013 22.088-58.194 22.109L-59.497 22.109Q-59.678 22.088-59.715 21.901M-54.206 22.143Q-54.619 22.143-54.956 21.930Q-55.293 21.716-55.487 21.357Q-55.682 20.998-55.682 20.598Q-55.682 20.297-55.573 20.015Q-55.464 19.734-55.262 19.511Q-55.060 19.289-54.792 19.163Q-54.524 19.036-54.206 19.036Q-53.888 19.036-53.614 19.164Q-53.341 19.293-53.146 19.508Q-52.951 19.723-52.840 20.004Q-52.729 20.284-52.729 20.598Q-52.729 20.998-52.926 21.359Q-53.122 21.719-53.459 21.931Q-53.796 22.143-54.206 22.143M-54.206 21.654Q-53.799 21.654-53.544 21.309Q-53.290 20.964-53.290 20.540Q-53.290 20.284-53.408 20.050Q-53.526 19.816-53.736 19.670Q-53.946 19.525-54.206 19.525Q-54.472 19.525-54.681 19.670Q-54.889 19.816-55.007 20.050Q-55.125 20.284-55.125 20.540Q-55.125 20.961-54.869 21.307Q-54.612 21.654-54.206 21.654M-52.152 21.901L-52.152 21.822Q-52.100 21.641-51.933 21.620L-51.311 21.620L-51.311 19.583L-51.933 19.583Q-52.104 19.563-52.152 19.371L-52.152 19.296Q-52.100 19.111-51.933 19.091L-50.969 19.091Q-50.795 19.108-50.750 19.296L-50.750 19.583Q-50.521 19.334-50.210 19.195Q-49.899 19.057-49.561 19.057Q-49.304 19.057-49.099 19.175Q-48.894 19.293-48.894 19.525Q-48.894 19.672-48.990 19.775Q-49.086 19.877-49.233 19.877Q-49.366 19.877-49.467 19.780Q-49.568 19.682-49.568 19.546Q-49.896 19.546-50.171 19.722Q-50.446 19.898-50.598 20.190Q-50.750 20.482-50.750 20.814L-50.750 21.620L-49.923 21.620Q-49.742 21.641-49.708 21.822L-49.708 21.901Q-49.742 22.088-49.923 22.109L-51.933 22.109Q-52.100 22.088-52.152 21.901M-48.091 21.901L-48.091 21.822Q-48.047 21.641-47.876 21.620L-46.966 21.620L-46.966 19.583L-47.818 19.583Q-47.992 19.563-48.036 19.371L-48.036 19.296Q-47.992 19.111-47.818 19.091L-46.621 19.091Q-46.450 19.108-46.406 19.296L-46.406 21.620L-45.606 21.620Q-45.435 21.641-45.391 21.822L-45.391 21.901Q-45.435 22.088-45.606 22.109L-47.876 22.109Q-48.047 22.088-48.091 21.901M-47.189 18.236L-47.189 18.189Q-47.189 18.038-47.069 17.932Q-46.949 17.826-46.796 17.826Q-46.645 17.826-46.526 17.932Q-46.406 18.038-46.406 18.189L-46.406 18.236Q-46.406 18.390-46.526 18.496Q-46.645 18.602-46.796 18.602Q-46.949 18.602-47.069 18.496Q-47.189 18.390-47.189 18.236M-41.771 22.109L-44.454 22.109Q-44.547 22.109-44.615 22.037Q-44.683 21.965-44.683 21.877L-44.683 21.781Q-44.683 21.678-44.608 21.613L-42.424 19.583L-44.006 19.583L-44.006 19.839Q-44.051 20.031-44.222 20.051L-44.348 20.051Q-44.516 20.034-44.567 19.839L-44.567 19.296Q-44.516 19.111-44.348 19.091L-41.809 19.091Q-41.713 19.091-41.645 19.159Q-41.576 19.228-41.576 19.323L-41.576 19.422Q-41.576 19.522-41.655 19.590L-43.839 21.620L-42.116 21.620L-42.116 21.275Q-42.072 21.094-41.898 21.073L-41.771 21.073Q-41.600 21.094-41.556 21.275L-41.556 21.901Q-41.600 22.088-41.771 22.109M-39.344 22.143Q-39.758 22.143-40.095 21.930Q-40.431 21.716-40.626 21.357Q-40.821 20.998-40.821 20.598Q-40.821 20.297-40.712 20.015Q-40.602 19.734-40.401 19.511Q-40.199 19.289-39.931 19.163Q-39.662 19.036-39.344 19.036Q-39.027 19.036-38.753 19.164Q-38.480 19.293-38.285 19.508Q-38.090 19.723-37.979 20.004Q-37.868 20.284-37.868 20.598Q-37.868 20.998-38.064 21.359Q-38.261 21.719-38.598 21.931Q-38.934 22.143-39.344 22.143M-39.344 21.654Q-38.938 21.654-38.683 21.309Q-38.428 20.964-38.428 20.540Q-38.428 20.284-38.546 20.050Q-38.664 19.816-38.874 19.670Q-39.085 19.525-39.344 19.525Q-39.611 19.525-39.819 19.670Q-40.028 19.816-40.146 20.050Q-40.264 20.284-40.264 20.540Q-40.264 20.961-40.007 21.307Q-39.751 21.654-39.344 21.654M-37.423 21.901L-37.423 21.822Q-37.386 21.641-37.205 21.620L-36.836 21.620L-36.836 19.583L-37.205 19.583Q-37.386 19.563-37.423 19.371L-37.423 19.296Q-37.382 19.111-37.205 19.091L-36.490 19.091Q-36.319 19.111-36.275 19.296L-36.275 19.371L-36.282 19.392Q-36.084 19.234-35.844 19.146Q-35.605 19.057-35.349 19.057Q-35.045 19.057-34.836 19.180Q-34.628 19.303-34.527 19.528Q-34.426 19.754-34.426 20.065L-34.426 21.620L-34.053 21.620Q-33.872 21.641-33.838 21.822L-33.838 21.901Q-33.872 22.088-34.053 22.109L-35.274 22.109Q-35.444 22.088-35.489 21.901L-35.489 21.822Q-35.444 21.637-35.274 21.620L-34.986 21.620L-34.986 20.092Q-34.986 19.822-35.065 19.684Q-35.144 19.546-35.400 19.546Q-35.636 19.546-35.836 19.660Q-36.036 19.775-36.155 19.974Q-36.275 20.174-36.275 20.407L-36.275 21.620L-35.902 21.620Q-35.721 21.641-35.687 21.822L-35.687 21.901Q-35.721 22.088-35.902 22.109L-37.205 22.109Q-37.386 22.088-37.423 21.901\" fill=\"var(--tk-line)\" stroke=\"var(--tk-line)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-accent)\" stroke=\"none\" font-family=\"cmtt8\" font-size=\"7\">\u003Cg transform=\"translate(131.57 -53.344)\">\u003Cpath d=\"M-85.295 21.935L-85.295 21.135Q-85.271 20.954-85.087 20.933L-84.940 20.933Q-84.796 20.954-84.745 21.094Q-84.567 21.654-83.932 21.654Q-83.750 21.654-83.550 21.624Q-83.350 21.593-83.204 21.492Q-83.057 21.391-83.057 21.213Q-83.057 21.029-83.251 20.930Q-83.446 20.831-83.685 20.793L-84.297 20.694Q-85.295 20.509-85.295 19.877Q-85.295 19.624-85.169 19.458Q-85.042 19.293-84.832 19.199Q-84.622 19.105-84.398 19.070Q-84.174 19.036-83.932 19.036Q-83.713 19.036-83.544 19.062Q-83.374 19.088-83.231 19.156Q-83.162 19.053-83.050 19.036L-82.981 19.036Q-82.896 19.047-82.841 19.101Q-82.787 19.156-82.776 19.238L-82.776 19.857Q-82.787 19.939-82.841 19.997Q-82.896 20.055-82.981 20.065L-83.128 20.065Q-83.210 20.055-83.268 19.997Q-83.327 19.939-83.337 19.857Q-83.337 19.525-83.945 19.525Q-84.249 19.525-84.528 19.597Q-84.807 19.669-84.807 19.884Q-84.807 20.116-84.219 20.212L-83.603 20.318Q-83.180 20.390-82.874 20.607Q-82.568 20.824-82.568 21.213Q-82.568 21.555-82.775 21.767Q-82.981 21.979-83.287 22.061Q-83.593 22.143-83.932 22.143Q-84.437 22.143-84.786 21.921Q-84.848 22.030-84.890 22.080Q-84.933 22.130-85.025 22.143L-85.087 22.143Q-85.275 22.123-85.295 21.935M-81.043 21.142L-81.043 19.583L-81.700 19.583Q-81.874 19.563-81.918 19.371L-81.918 19.296Q-81.874 19.111-81.700 19.091L-81.043 19.091L-81.043 18.435Q-80.999 18.254-80.825 18.230L-80.698 18.230Q-80.527 18.254-80.483 18.435L-80.483 19.091L-79.293 19.091Q-79.126 19.108-79.075 19.296L-79.075 19.371Q-79.122 19.563-79.293 19.583L-80.483 19.583L-80.483 21.114Q-80.483 21.654-79.980 21.654Q-79.762 21.654-79.618 21.492Q-79.475 21.330-79.475 21.114Q-79.475 21.032-79.411 20.971Q-79.348 20.909-79.259 20.899L-79.133 20.899Q-78.958 20.920-78.914 21.101L-78.914 21.142Q-78.914 21.425-79.075 21.656Q-79.235 21.887-79.492 22.015Q-79.748 22.143-80.028 22.143Q-80.476 22.143-80.760 21.871Q-81.043 21.600-81.043 21.142M-78.022 21.135Q-78.022 20.745-77.660 20.520Q-77.297 20.294-76.824 20.207Q-76.350 20.120-75.906 20.113Q-75.906 19.925-76.024 19.792Q-76.142 19.658-76.323 19.592Q-76.504 19.525-76.689 19.525Q-76.990 19.525-77.130 19.546L-77.130 19.597Q-77.130 19.744-77.234 19.845Q-77.338 19.945-77.482 19.945Q-77.636 19.945-77.736 19.838Q-77.837 19.730-77.837 19.583Q-77.837 19.228-77.504 19.132Q-77.171 19.036-76.682 19.036Q-76.446 19.036-76.212 19.105Q-75.978 19.173-75.781 19.305Q-75.585 19.436-75.465 19.629Q-75.346 19.822-75.346 20.065L-75.346 21.569Q-75.346 21.620-74.884 21.620Q-74.713 21.637-74.669 21.822L-74.669 21.901Q-74.713 22.088-74.884 22.109L-75.011 22.109Q-75.311 22.109-75.511 22.068Q-75.711 22.027-75.838 21.863Q-76.241 22.143-76.860 22.143Q-77.154 22.143-77.420 22.020Q-77.687 21.897-77.854 21.668Q-78.022 21.439-78.022 21.135M-77.461 21.142Q-77.461 21.381-77.249 21.518Q-77.037 21.654-76.788 21.654Q-76.597 21.654-76.393 21.603Q-76.190 21.552-76.048 21.431Q-75.906 21.309-75.906 21.114L-75.906 20.598Q-76.152 20.598-76.516 20.648Q-76.880 20.697-77.171 20.819Q-77.461 20.940-77.461 21.142M-73.613 21.142L-73.613 19.583L-74.269 19.583Q-74.443 19.563-74.488 19.371L-74.488 19.296Q-74.443 19.111-74.269 19.091L-73.613 19.091L-73.613 18.435Q-73.568 18.254-73.394 18.230L-73.267 18.230Q-73.097 18.254-73.052 18.435L-73.052 19.091L-71.863 19.091Q-71.695 19.108-71.644 19.296L-71.644 19.371Q-71.692 19.563-71.863 19.583L-73.052 19.583L-73.052 21.114Q-73.052 21.654-72.550 21.654Q-72.331 21.654-72.187 21.492Q-72.044 21.330-72.044 21.114Q-72.044 21.032-71.981 20.971Q-71.917 20.909-71.829 20.899L-71.702 20.899Q-71.528 20.920-71.483 21.101L-71.483 21.142Q-71.483 21.425-71.644 21.656Q-71.805 21.887-72.061 22.015Q-72.317 22.143-72.598 22.143Q-73.045 22.143-73.329 21.871Q-73.613 21.600-73.613 21.142M-70.407 21.901L-70.407 21.822Q-70.362 21.641-70.191 21.620L-69.282 21.620L-69.282 19.583L-70.133 19.583Q-70.308 19.563-70.352 19.371L-70.352 19.296Q-70.308 19.111-70.133 19.091L-68.937 19.091Q-68.766 19.108-68.722 19.296L-68.722 21.620L-67.922 21.620Q-67.751 21.641-67.706 21.822L-67.706 21.901Q-67.751 22.088-67.922 22.109L-70.191 22.109Q-70.362 22.088-70.407 21.901M-69.504 18.236L-69.504 18.189Q-69.504 18.038-69.385 17.932Q-69.265 17.826-69.111 17.826Q-68.961 17.826-68.841 17.932Q-68.722 18.038-68.722 18.189L-68.722 18.236Q-68.722 18.390-68.841 18.496Q-68.961 18.602-69.111 18.602Q-69.265 18.602-69.385 18.496Q-69.504 18.390-69.504 18.236M-66.743 20.598Q-66.743 20.178-66.529 19.816Q-66.315 19.453-65.951 19.245Q-65.587 19.036-65.167 19.036Q-64.682 19.036-64.350 19.132Q-64.018 19.228-64.018 19.583Q-64.018 19.730-64.118 19.838Q-64.217 19.945-64.367 19.945Q-64.517 19.945-64.622 19.845Q-64.726 19.744-64.726 19.597L-64.726 19.546Q-64.866 19.525-65.160 19.525Q-65.447 19.525-65.681 19.674Q-65.915 19.822-66.049 20.070Q-66.182 20.318-66.182 20.598Q-66.182 20.879-66.032 21.125Q-65.881 21.371-65.632 21.513Q-65.382 21.654-65.095 21.654Q-64.822 21.654-64.711 21.564Q-64.600 21.473-64.497 21.307Q-64.394 21.142-64.292 21.128L-64.145 21.128Q-64.053 21.138-63.996 21.198Q-63.940 21.258-63.940 21.347Q-63.940 21.388-63.957 21.422Q-64.053 21.678-64.230 21.836Q-64.408 21.993-64.649 22.068Q-64.890 22.143-65.167 22.143Q-65.591 22.143-65.955 21.935Q-66.319 21.726-66.531 21.374Q-66.743 21.022-66.743 20.598\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003Cg transform=\"translate(131.57 -53.344)\">\u003Cpath d=\"M-56.704 20.807L-58.840 20.807Q-58.793 21.049-58.620 21.244Q-58.447 21.439-58.205 21.547Q-57.962 21.654-57.713 21.654Q-57.299 21.654-57.104 21.401Q-57.097 21.391-57.048 21.299Q-56.998 21.207-56.955 21.169Q-56.913 21.131-56.831 21.121L-56.704 21.121Q-56.537 21.138-56.485 21.326L-56.485 21.374Q-56.544 21.637-56.745 21.810Q-56.947 21.983-57.220 22.063Q-57.494 22.143-57.760 22.143Q-58.184 22.143-58.569 21.943Q-58.953 21.743-59.187 21.393Q-59.422 21.043-59.422 20.612L-59.422 20.561Q-59.422 20.151-59.206 19.798Q-58.991 19.446-58.634 19.241Q-58.277 19.036-57.866 19.036Q-57.425 19.036-57.116 19.231Q-56.807 19.426-56.646 19.766Q-56.485 20.106-56.485 20.547L-56.485 20.598Q-56.537 20.786-56.704 20.807M-58.834 20.325L-57.060 20.325Q-57.101 19.966-57.309 19.745Q-57.518 19.525-57.866 19.525Q-58.212 19.525-58.480 19.754Q-58.748 19.983-58.834 20.325M-54.612 21.914L-55.388 19.583L-55.669 19.583Q-55.843 19.563-55.887 19.371L-55.887 19.296Q-55.843 19.111-55.669 19.091L-54.653 19.091Q-54.483 19.108-54.438 19.296L-54.438 19.371Q-54.483 19.563-54.653 19.583L-54.900 19.583L-54.206 21.661L-53.515 19.583L-53.758 19.583Q-53.932 19.563-53.977 19.371L-53.977 19.296Q-53.932 19.111-53.758 19.091L-52.743 19.091Q-52.572 19.111-52.527 19.296L-52.527 19.371Q-52.572 19.563-52.743 19.583L-53.023 19.583L-53.799 21.914Q-53.837 22.013-53.925 22.078Q-54.014 22.143-54.124 22.143L-54.291 22.143Q-54.394 22.143-54.484 22.080Q-54.575 22.017-54.612 21.914M-51.991 21.135Q-51.991 20.745-51.629 20.520Q-51.266 20.294-50.793 20.207Q-50.319 20.120-49.875 20.113Q-49.875 19.925-49.993 19.792Q-50.111 19.658-50.292 19.592Q-50.473 19.525-50.658 19.525Q-50.959 19.525-51.099 19.546L-51.099 19.597Q-51.099 19.744-51.203 19.845Q-51.307 19.945-51.451 19.945Q-51.605 19.945-51.705 19.838Q-51.806 19.730-51.806 19.583Q-51.806 19.228-51.473 19.132Q-51.140 19.036-50.651 19.036Q-50.415 19.036-50.181 19.105Q-49.947 19.173-49.750 19.305Q-49.554 19.436-49.434 19.629Q-49.315 19.822-49.315 20.065L-49.315 21.569Q-49.315 21.620-48.853 21.620Q-48.682 21.637-48.638 21.822L-48.638 21.901Q-48.682 22.088-48.853 22.109L-48.980 22.109Q-49.280 22.109-49.480 22.068Q-49.680 22.027-49.807 21.863Q-50.210 22.143-50.829 22.143Q-51.123 22.143-51.389 22.020Q-51.656 21.897-51.823 21.668Q-51.991 21.439-51.991 21.135M-51.430 21.142Q-51.430 21.381-51.218 21.518Q-51.006 21.654-50.757 21.654Q-50.566 21.654-50.362 21.603Q-50.159 21.552-50.017 21.431Q-49.875 21.309-49.875 21.114L-49.875 20.598Q-50.121 20.598-50.485 20.648Q-50.849 20.697-51.140 20.819Q-51.430 20.940-51.430 21.142M-48.238 21.901L-48.238 21.822Q-48.194 21.641-48.023 21.620L-47.055 21.620L-47.055 18.322L-48.023 18.322Q-48.194 18.301-48.238 18.113L-48.238 18.035Q-48.194 17.854-48.023 17.833L-46.714 17.833Q-46.546 17.854-46.495 18.035L-46.495 21.620L-45.531 21.620Q-45.357 21.641-45.312 21.822L-45.312 21.901Q-45.357 22.088-45.531 22.109L-48.023 22.109Q-48.194 22.088-48.238 21.901M-43.545 21.620Q-43.545 21.425-43.400 21.280Q-43.255 21.135-43.053 21.135Q-42.923 21.135-42.812 21.203Q-42.701 21.272-42.636 21.381Q-42.571 21.490-42.571 21.620Q-42.571 21.818-42.716 21.964Q-42.861 22.109-43.053 22.109Q-43.251 22.109-43.398 21.962Q-43.545 21.815-43.545 21.620M-43.545 19.576Q-43.545 19.381-43.400 19.236Q-43.255 19.091-43.053 19.091Q-42.923 19.091-42.812 19.159Q-42.701 19.228-42.636 19.337Q-42.571 19.446-42.571 19.576Q-42.571 19.775-42.716 19.920Q-42.861 20.065-43.053 20.065Q-43.251 20.065-43.398 19.918Q-43.545 19.771-43.545 19.576\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003Cg transform=\"translate(131.57 -53.344)\">\u003Cpath d=\"M-32.156 21.302L-32.156 20.239L-33.219 20.239Q-33.328 20.229-33.403 20.154Q-33.478 20.079-33.478 19.966Q-33.478 19.853-33.403 19.781Q-33.328 19.710-33.219 19.699L-32.156 19.699L-32.156 18.630Q-32.145 18.520-32.070 18.448Q-31.995 18.377-31.882 18.377Q-31.769 18.377-31.698 18.448Q-31.626 18.520-31.616 18.630L-31.616 19.699L-30.553 19.699Q-30.443 19.710-30.371 19.781Q-30.300 19.853-30.300 19.966Q-30.300 20.079-30.371 20.154Q-30.443 20.229-30.553 20.239L-31.616 20.239L-31.616 21.302Q-31.626 21.412-31.698 21.487Q-31.769 21.562-31.882 21.562Q-31.995 21.562-32.070 21.487Q-32.145 21.412-32.156 21.302M-29.281 21.901L-29.281 21.822Q-29.237 21.641-29.062 21.620L-28.348 21.620L-28.348 18.835Q-28.680 19.105-29.076 19.105Q-29.278 19.105-29.322 18.903L-29.322 18.824Q-29.278 18.636-29.107 18.616Q-28.820 18.616-28.598 18.407Q-28.375 18.199-28.252 17.895Q-28.191 17.782-28.054 17.761L-28.006 17.761Q-27.835 17.778-27.791 17.966L-27.791 21.620L-27.077 21.620Q-26.902 21.641-26.858 21.822L-26.858 21.901Q-26.902 22.088-27.077 22.109L-29.062 22.109Q-29.237 22.088-29.281 21.901\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg fill=\"var(--tk-accent)\" stroke=\"none\" font-family=\"cmtt8\" font-size=\"7\">\u003Cg transform=\"translate(171.404 -19.978)\">\u003Cpath d=\"M-83.785 23.459L-83.785 23.384Q-83.740 23.192-83.569 23.172L-83.162 23.172L-83.162 21.774Q-83.559 22.143-84.092 22.143Q-84.403 22.143-84.670 22.018Q-84.936 21.894-85.140 21.675Q-85.343 21.456-85.453 21.174Q-85.562 20.892-85.562 20.598Q-85.562 20.174-85.353 19.824Q-85.145 19.474-84.789 19.265Q-84.434 19.057-84.017 19.057Q-83.525 19.057-83.162 19.399L-83.162 19.258Q-83.118 19.074-82.944 19.057L-82.821 19.057Q-82.646 19.077-82.602 19.258L-82.602 23.172L-82.195 23.172Q-82.024 23.192-81.980 23.384L-81.980 23.459Q-82.024 23.644-82.195 23.664L-83.569 23.664Q-83.740 23.644-83.785 23.459M-84.051 21.654Q-83.726 21.654-83.485 21.432Q-83.245 21.210-83.162 20.892L-83.162 20.352Q-83.200 20.144-83.308 19.957Q-83.415 19.771-83.588 19.658Q-83.761 19.546-83.973 19.546Q-84.249 19.546-84.487 19.691Q-84.725 19.836-84.863 20.082Q-85.001 20.328-85.001 20.605Q-85.001 21.012-84.726 21.333Q-84.451 21.654-84.051 21.654M-81.443 21.360L-81.443 19.583L-81.812 19.583Q-81.994 19.563-82.031 19.371L-82.031 19.296Q-81.990 19.111-81.812 19.091L-81.098 19.091Q-80.927 19.111-80.883 19.296L-80.883 21.333Q-80.883 21.538-80.734 21.596Q-80.585 21.654-80.336 21.654Q-80.155 21.654-79.984 21.588Q-79.813 21.521-79.704 21.390Q-79.594 21.258-79.594 21.073L-79.594 19.583L-79.963 19.583Q-80.148 19.563-80.182 19.371L-80.182 19.296Q-80.148 19.111-79.963 19.091L-79.252 19.091Q-79.078 19.111-79.034 19.296L-79.034 21.620L-78.661 21.620Q-78.480 21.641-78.446 21.822L-78.446 21.901Q-78.480 22.088-78.661 22.109L-79.375 22.109Q-79.550 22.088-79.594 21.914Q-79.946 22.143-80.391 22.143Q-80.596 22.143-80.784 22.107Q-80.972 22.071-81.117 21.983Q-81.262 21.894-81.353 21.738Q-81.443 21.583-81.443 21.360M-77.837 21.901L-77.837 21.822Q-77.793 21.641-77.622 21.620L-76.713 21.620L-76.713 19.583L-77.564 19.583Q-77.738 19.563-77.783 19.371L-77.783 19.296Q-77.738 19.111-77.564 19.091L-76.368 19.091Q-76.197 19.108-76.152 19.296L-76.152 21.620L-75.352 21.620Q-75.182 21.641-75.137 21.822L-75.137 21.901Q-75.182 22.088-75.352 22.109L-77.622 22.109Q-77.793 22.088-77.837 21.901M-76.935 18.236L-76.935 18.189Q-76.935 18.038-76.815 17.932Q-76.696 17.826-76.542 17.826Q-76.391 17.826-76.272 17.932Q-76.152 18.038-76.152 18.189L-76.152 18.236Q-76.152 18.390-76.272 18.496Q-76.391 18.602-76.542 18.602Q-76.696 18.602-76.815 18.496Q-76.935 18.390-76.935 18.236M-71.589 20.807L-73.725 20.807Q-73.678 21.049-73.505 21.244Q-73.332 21.439-73.090 21.547Q-72.847 21.654-72.598 21.654Q-72.184 21.654-71.989 21.401Q-71.982 21.391-71.933 21.299Q-71.883 21.207-71.840 21.169Q-71.798 21.131-71.716 21.121L-71.589 21.121Q-71.422 21.138-71.371 21.326L-71.371 21.374Q-71.429 21.637-71.630 21.810Q-71.832 21.983-72.105 22.063Q-72.379 22.143-72.645 22.143Q-73.069 22.143-73.454 21.943Q-73.838 21.743-74.072 21.393Q-74.307 21.043-74.307 20.612L-74.307 20.561Q-74.307 20.151-74.091 19.798Q-73.876 19.446-73.519 19.241Q-73.162 19.036-72.751 19.036Q-72.310 19.036-72.001 19.231Q-71.692 19.426-71.531 19.766Q-71.371 20.106-71.371 20.547L-71.371 20.598Q-71.422 20.786-71.589 20.807M-73.719 20.325L-71.945 20.325Q-71.986 19.966-72.194 19.745Q-72.403 19.525-72.751 19.525Q-73.097 19.525-73.365 19.754Q-73.633 19.983-73.719 20.325M-70.434 21.935L-70.434 21.135Q-70.410 20.954-70.225 20.933L-70.079 20.933Q-69.935 20.954-69.884 21.094Q-69.706 21.654-69.070 21.654Q-68.889 21.654-68.689 21.624Q-68.489 21.593-68.342 21.492Q-68.195 21.391-68.195 21.213Q-68.195 21.029-68.390 20.930Q-68.585 20.831-68.824 20.793L-69.436 20.694Q-70.434 20.509-70.434 19.877Q-70.434 19.624-70.308 19.458Q-70.181 19.293-69.971 19.199Q-69.761 19.105-69.537 19.070Q-69.313 19.036-69.070 19.036Q-68.851 19.036-68.682 19.062Q-68.513 19.088-68.370 19.156Q-68.301 19.053-68.188 19.036L-68.120 19.036Q-68.035 19.047-67.980 19.101Q-67.925 19.156-67.915 19.238L-67.915 19.857Q-67.925 19.939-67.980 19.997Q-68.035 20.055-68.120 20.065L-68.267 20.065Q-68.349 20.055-68.407 19.997Q-68.465 19.939-68.475 19.857Q-68.475 19.525-69.084 19.525Q-69.388 19.525-69.667 19.597Q-69.945 19.669-69.945 19.884Q-69.945 20.116-69.357 20.212L-68.742 20.318Q-68.318 20.390-68.012 20.607Q-67.706 20.824-67.706 21.213Q-67.706 21.555-67.913 21.767Q-68.120 21.979-68.426 22.061Q-68.732 22.143-69.070 22.143Q-69.576 22.143-69.925 21.921Q-69.986 22.030-70.029 22.080Q-70.072 22.130-70.164 22.143L-70.225 22.143Q-70.413 22.123-70.434 21.935M-66.743 20.598Q-66.743 20.178-66.529 19.816Q-66.315 19.453-65.951 19.245Q-65.587 19.036-65.167 19.036Q-64.682 19.036-64.350 19.132Q-64.018 19.228-64.018 19.583Q-64.018 19.730-64.118 19.838Q-64.217 19.945-64.367 19.945Q-64.517 19.945-64.622 19.845Q-64.726 19.744-64.726 19.597L-64.726 19.546Q-64.866 19.525-65.160 19.525Q-65.447 19.525-65.681 19.674Q-65.915 19.822-66.049 20.070Q-66.182 20.318-66.182 20.598Q-66.182 20.879-66.032 21.125Q-65.881 21.371-65.632 21.513Q-65.382 21.654-65.095 21.654Q-64.822 21.654-64.711 21.564Q-64.600 21.473-64.497 21.307Q-64.394 21.142-64.292 21.128L-64.145 21.128Q-64.053 21.138-63.996 21.198Q-63.940 21.258-63.940 21.347Q-63.940 21.388-63.957 21.422Q-64.053 21.678-64.230 21.836Q-64.408 21.993-64.649 22.068Q-64.890 22.143-65.167 22.143Q-65.591 22.143-65.955 21.935Q-66.319 21.726-66.531 21.374Q-66.743 21.022-66.743 20.598M-60.443 20.807L-62.579 20.807Q-62.532 21.049-62.359 21.244Q-62.186 21.439-61.944 21.547Q-61.701 21.654-61.452 21.654Q-61.038 21.654-60.843 21.401Q-60.836 21.391-60.787 21.299Q-60.737 21.207-60.694 21.169Q-60.652 21.131-60.570 21.121L-60.443 21.121Q-60.276 21.138-60.225 21.326L-60.225 21.374Q-60.283 21.637-60.484 21.810Q-60.686 21.983-60.959 22.063Q-61.233 22.143-61.499 22.143Q-61.923 22.143-62.308 21.943Q-62.692 21.743-62.926 21.393Q-63.161 21.043-63.161 20.612L-63.161 20.561Q-63.161 20.151-62.945 19.798Q-62.730 19.446-62.373 19.241Q-62.016 19.036-61.605 19.036Q-61.164 19.036-60.855 19.231Q-60.546 19.426-60.385 19.766Q-60.225 20.106-60.225 20.547L-60.225 20.598Q-60.276 20.786-60.443 20.807M-62.573 20.325L-60.799 20.325Q-60.840 19.966-61.048 19.745Q-61.257 19.525-61.605 19.525Q-61.951 19.525-62.219 19.754Q-62.487 19.983-62.573 20.325M-59.739 21.901L-59.739 21.822Q-59.702 21.641-59.520 21.620L-59.151 21.620L-59.151 19.583L-59.520 19.583Q-59.702 19.563-59.739 19.371L-59.739 19.296Q-59.698 19.111-59.520 19.091L-58.806 19.091Q-58.635 19.111-58.591 19.296L-58.591 19.371L-58.598 19.392Q-58.399 19.234-58.160 19.146Q-57.921 19.057-57.664 19.057Q-57.360 19.057-57.152 19.180Q-56.943 19.303-56.842 19.528Q-56.742 19.754-56.742 20.065L-56.742 21.620L-56.369 21.620Q-56.188 21.641-56.154 21.822L-56.154 21.901Q-56.188 22.088-56.369 22.109L-57.589 22.109Q-57.760 22.088-57.805 21.901L-57.805 21.822Q-57.760 21.637-57.589 21.620L-57.302 21.620L-57.302 20.092Q-57.302 19.822-57.381 19.684Q-57.459 19.546-57.716 19.546Q-57.952 19.546-58.152 19.660Q-58.351 19.775-58.471 19.974Q-58.591 20.174-58.591 20.407L-58.591 21.620L-58.218 21.620Q-58.037 21.641-58.003 21.822L-58.003 21.901Q-58.037 22.088-58.218 22.109L-59.520 22.109Q-59.702 22.088-59.739 21.901M-55.597 20.598Q-55.597 20.178-55.383 19.816Q-55.169 19.453-54.805 19.245Q-54.441 19.036-54.021 19.036Q-53.536 19.036-53.204 19.132Q-52.872 19.228-52.872 19.583Q-52.872 19.730-52.972 19.838Q-53.071 19.945-53.221 19.945Q-53.371 19.945-53.476 19.845Q-53.580 19.744-53.580 19.597L-53.580 19.546Q-53.720 19.525-54.014 19.525Q-54.301 19.525-54.535 19.674Q-54.769 19.822-54.903 20.070Q-55.036 20.318-55.036 20.598Q-55.036 20.879-54.886 21.125Q-54.735 21.371-54.486 21.513Q-54.236 21.654-53.949 21.654Q-53.676 21.654-53.565 21.564Q-53.454 21.473-53.351 21.307Q-53.248 21.142-53.146 21.128L-52.999 21.128Q-52.907 21.138-52.850 21.198Q-52.794 21.258-52.794 21.347Q-52.794 21.388-52.811 21.422Q-52.907 21.678-53.084 21.836Q-53.262 21.993-53.503 22.068Q-53.744 22.143-54.021 22.143Q-54.445 22.143-54.809 21.935Q-55.173 21.726-55.385 21.374Q-55.597 21.022-55.597 20.598M-49.297 20.807L-51.433 20.807Q-51.386 21.049-51.213 21.244Q-51.040 21.439-50.798 21.547Q-50.555 21.654-50.306 21.654Q-49.892 21.654-49.697 21.401Q-49.690 21.391-49.641 21.299Q-49.591 21.207-49.548 21.169Q-49.506 21.131-49.424 21.121L-49.297 21.121Q-49.130 21.138-49.079 21.326L-49.079 21.374Q-49.137 21.637-49.338 21.810Q-49.540 21.983-49.813 22.063Q-50.087 22.143-50.353 22.143Q-50.777 22.143-51.162 21.943Q-51.546 21.743-51.780 21.393Q-52.015 21.043-52.015 20.612L-52.015 20.561Q-52.015 20.151-51.799 19.798Q-51.584 19.446-51.227 19.241Q-50.870 19.036-50.459 19.036Q-50.018 19.036-49.709 19.231Q-49.400 19.426-49.239 19.766Q-49.079 20.106-49.079 20.547L-49.079 20.598Q-49.130 20.786-49.297 20.807M-51.427 20.325L-49.653 20.325Q-49.694 19.966-49.902 19.745Q-50.111 19.525-50.459 19.525Q-50.805 19.525-51.073 19.754Q-51.341 19.983-51.427 20.325\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003Cg transform=\"translate(171.404 -19.978)\">\u003Cpath d=\"M-44.622 21.901L-44.622 21.822Q-44.577 21.641-44.406 21.620L-43.634 21.620L-43.634 19.583L-44.382 19.583Q-44.557 19.563-44.601 19.371L-44.601 19.296Q-44.557 19.111-44.382 19.091L-43.634 19.091L-43.634 18.694Q-43.634 18.288-43.278 18.042Q-42.923 17.796-42.503 17.796Q-42.229 17.796-42.016 17.901Q-41.802 18.007-41.802 18.254Q-41.802 18.397-41.898 18.500Q-41.993 18.602-42.137 18.602Q-42.267 18.602-42.373 18.510Q-42.479 18.418-42.479 18.288L-42.550 18.288Q-42.684 18.288-42.803 18.341Q-42.923 18.394-42.998 18.494Q-43.073 18.595-43.073 18.722L-43.073 19.091L-42.171 19.091Q-42 19.108-41.956 19.296L-41.956 19.371Q-42 19.563-42.171 19.583L-43.073 19.583L-43.073 21.620L-42.304 21.620Q-42.133 21.641-42.089 21.822L-42.089 21.901Q-42.133 22.088-42.304 22.109L-44.406 22.109Q-44.577 22.088-44.622 21.901M-40.647 21.901L-40.647 21.822Q-40.602 21.641-40.431 21.620L-39.522 21.620L-39.522 19.583L-40.373 19.583Q-40.548 19.563-40.592 19.371L-40.592 19.296Q-40.548 19.111-40.373 19.091L-39.177 19.091Q-39.006 19.108-38.962 19.296L-38.962 21.620L-38.162 21.620Q-37.991 21.641-37.946 21.822L-37.946 21.901Q-37.991 22.088-38.162 22.109L-40.431 22.109Q-40.602 22.088-40.647 21.901M-39.744 18.236L-39.744 18.189Q-39.744 18.038-39.625 17.932Q-39.505 17.826-39.351 17.826Q-39.201 17.826-39.081 17.932Q-38.962 18.038-38.962 18.189L-38.962 18.236Q-38.962 18.390-39.081 18.496Q-39.201 18.602-39.351 18.602Q-39.505 18.602-39.625 18.496Q-39.744 18.390-39.744 18.236M-37.410 21.901L-37.410 21.822Q-37.372 21.641-37.191 21.620L-36.822 21.620L-36.822 19.583L-37.191 19.583Q-37.372 19.563-37.410 19.371L-37.410 19.296Q-37.369 19.111-37.191 19.091L-36.477 19.091Q-36.306 19.111-36.261 19.296L-36.261 19.371L-36.268 19.392Q-36.070 19.234-35.831 19.146Q-35.591 19.057-35.335 19.057Q-35.031 19.057-34.822 19.180Q-34.614 19.303-34.513 19.528Q-34.412 19.754-34.412 20.065L-34.412 21.620L-34.040 21.620Q-33.859 21.641-33.824 21.822L-33.824 21.901Q-33.859 22.088-34.040 22.109L-35.260 22.109Q-35.431 22.088-35.475 21.901L-35.475 21.822Q-35.431 21.637-35.260 21.620L-34.973 21.620L-34.973 20.092Q-34.973 19.822-35.051 19.684Q-35.130 19.546-35.386 19.546Q-35.622 19.546-35.822 19.660Q-36.022 19.775-36.142 19.974Q-36.261 20.174-36.261 20.407L-36.261 21.620L-35.889 21.620Q-35.708 21.641-35.673 21.822L-35.673 21.901Q-35.708 22.088-35.889 22.109L-37.191 22.109Q-37.372 22.088-37.410 21.901M-32.126 22.143Q-32.532 22.143-32.852 21.924Q-33.172 21.706-33.351 21.352Q-33.530 20.998-33.530 20.598Q-33.530 20.297-33.421 20.017Q-33.312 19.737-33.108 19.518Q-32.905 19.299-32.638 19.178Q-32.372 19.057-32.061 19.057Q-31.613 19.057-31.257 19.337L-31.257 18.322L-31.627 18.322Q-31.811 18.301-31.845 18.113L-31.845 18.035Q-31.811 17.854-31.627 17.833L-30.916 17.833Q-30.741 17.854-30.697 18.035L-30.697 21.620L-30.324 21.620Q-30.143 21.641-30.109 21.822L-30.109 21.901Q-30.143 22.088-30.324 22.109L-31.039 22.109Q-31.213 22.088-31.257 21.901L-31.257 21.788Q-31.428 21.955-31.657 22.049Q-31.886 22.143-32.126 22.143M-32.091 21.654Q-31.777 21.654-31.557 21.419Q-31.336 21.183-31.257 20.855L-31.257 20.127Q-31.309 19.963-31.420 19.831Q-31.531 19.699-31.686 19.622Q-31.842 19.546-32.013 19.546Q-32.283 19.546-32.502 19.694Q-32.720 19.843-32.847 20.092Q-32.973 20.342-32.973 20.605Q-32.973 20.998-32.724 21.326Q-32.474 21.654-32.091 21.654M-29.528 21.935L-29.528 21.135Q-29.504 20.954-29.319 20.933L-29.173 20.933Q-29.029 20.954-28.978 21.094Q-28.800 21.654-28.164 21.654Q-27.983 21.654-27.783 21.624Q-27.583 21.593-27.436 21.492Q-27.289 21.391-27.289 21.213Q-27.289 21.029-27.484 20.930Q-27.679 20.831-27.918 20.793L-28.530 20.694Q-29.528 20.509-29.528 19.877Q-29.528 19.624-29.402 19.458Q-29.275 19.293-29.065 19.199Q-28.855 19.105-28.631 19.070Q-28.407 19.036-28.164 19.036Q-27.945 19.036-27.776 19.062Q-27.607 19.088-27.464 19.156Q-27.395 19.053-27.282 19.036L-27.214 19.036Q-27.129 19.047-27.074 19.101Q-27.019 19.156-27.009 19.238L-27.009 19.857Q-27.019 19.939-27.074 19.997Q-27.129 20.055-27.214 20.065L-27.361 20.065Q-27.443 20.055-27.501 19.997Q-27.559 19.939-27.569 19.857Q-27.569 19.525-28.178 19.525Q-28.482 19.525-28.761 19.597Q-29.039 19.669-29.039 19.884Q-29.039 20.116-28.451 20.212L-27.836 20.318Q-27.412 20.390-27.106 20.607Q-26.800 20.824-26.800 21.213Q-26.800 21.555-27.007 21.767Q-27.214 21.979-27.520 22.061Q-27.826 22.143-28.164 22.143Q-28.670 22.143-29.019 21.921Q-29.080 22.030-29.123 22.080Q-29.166 22.130-29.258 22.143L-29.319 22.143Q-29.507 22.123-29.528 21.935M-24.955 21.620Q-24.955 21.425-24.809 21.280Q-24.664 21.135-24.463 21.135Q-24.333 21.135-24.222 21.203Q-24.110 21.272-24.046 21.381Q-23.981 21.490-23.981 21.620Q-23.981 21.818-24.126 21.964Q-24.271 22.109-24.463 22.109Q-24.661 22.109-24.808 21.962Q-24.955 21.815-24.955 21.620M-24.955 19.576Q-24.955 19.381-24.809 19.236Q-24.664 19.091-24.463 19.091Q-24.333 19.091-24.222 19.159Q-24.110 19.228-24.046 19.337Q-23.981 19.446-23.981 19.576Q-23.981 19.775-24.126 19.920Q-24.271 20.065-24.463 20.065Q-24.661 20.065-24.808 19.918Q-24.955 19.771-24.955 19.576\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003Cg transform=\"translate(171.404 -19.978)\">\u003Cpath d=\"M-12.092 20.239L-14.491 20.239Q-14.601 20.229-14.676 20.154Q-14.751 20.079-14.751 19.966Q-14.751 19.853-14.676 19.781Q-14.601 19.710-14.491 19.699L-12.092 19.699Q-11.983 19.710-11.911 19.781Q-11.839 19.853-11.839 19.966Q-11.839 20.079-11.911 20.154Q-11.983 20.229-12.092 20.239M-11.128 20.872Q-11.128 20.622-10.991 20.400Q-10.855 20.178-10.636 20.026Q-10.417 19.874-10.168 19.798Q-10.376 19.734-10.574 19.609Q-10.773 19.484-10.897 19.301Q-11.022 19.118-11.022 18.903Q-11.022 18.554-10.807 18.296Q-10.591 18.038-10.256 17.900Q-9.922 17.761-9.580 17.761Q-9.238 17.761-8.903 17.900Q-8.568 18.038-8.353 18.300Q-8.137 18.561-8.137 18.903Q-8.137 19.118-8.262 19.299Q-8.387 19.481-8.585 19.607Q-8.783 19.734-8.992 19.798Q-8.595 19.918-8.315 20.203Q-8.035 20.489-8.035 20.872Q-8.035 21.255-8.260 21.555Q-8.486 21.856-8.845 22.017Q-9.204 22.177-9.580 22.177Q-9.956 22.177-10.315 22.018Q-10.673 21.859-10.901 21.559Q-11.128 21.258-11.128 20.872M-10.568 20.872Q-10.568 21.111-10.422 21.299Q-10.277 21.487-10.048 21.588Q-9.819 21.689-9.580 21.689Q-9.340 21.689-9.113 21.588Q-8.886 21.487-8.741 21.297Q-8.595 21.108-8.595 20.872Q-8.595 20.629-8.741 20.439Q-8.886 20.250-9.113 20.147Q-9.340 20.045-9.580 20.045Q-9.819 20.045-10.048 20.147Q-10.277 20.250-10.422 20.438Q-10.568 20.626-10.568 20.872M-10.462 18.903Q-10.462 19.111-10.325 19.258Q-10.188 19.405-9.981 19.479Q-9.775 19.552-9.580 19.552Q-9.388 19.552-9.180 19.479Q-8.971 19.405-8.835 19.257Q-8.698 19.108-8.698 18.903Q-8.698 18.698-8.835 18.549Q-8.971 18.401-9.180 18.327Q-9.388 18.254-9.580 18.254Q-9.775 18.254-9.981 18.327Q-10.188 18.401-10.325 18.547Q-10.462 18.694-10.462 18.903\" fill=\"var(--tk-accent)\" stroke=\"var(--tk-accent)\" class=\"tikz-text\" style=\"stroke-width:0.210\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>\u003Cfigcaption class=\"tikz-cap\">The horizon effect, and why leaves are only scored when quiet. A fixed-depth search ends one ply after the queen takes a pawn and scores the position a pawn up. Quiescence search keeps following captures past the horizon, finds the recapture that loses the queen, and returns the true score instead.\u003C\u002Ffigcaption>",1786059085340]