187 Followers
40 Following
51 Posts
linguistics/bio/computers/history/SF/gamedev enjoyer. i share stuff here sometimes, almost all made with my wife. dev at SecureDNA. she/they 🏳️‍⚧️
website / bloghttps://vgel.me
pronounsshe/they

New blog post: making a transformer by hand, without training! Want to understand transformers and attention better? This post goes through assigning each weight for a GPT-2-like transformer to understand how they work.

Goes thru designing a simple tokenization scheme, embeddings, the qkv weights and attention head, and projecting that back to get 100% accuracy at predicting a simple sequence! It even has explainers for matrices and softmax if you're a little rusty :-)

https://vgel.me/posts/handmade-transformer

I made a transformer by hand (no training!)

To better understand how transformers work, I hand-assigned all the weights to predict a simple sequence.

implications,,,

float z=-9.;vec2 F=FC.xy/r.xy-.5;for(int i=0;i++<30;){float X=F.x*cos(t)-z*sin(t),Z=F.x*sin(t)+z*cos(t),h=sqrt(X*X+F.y*F.y)-.2,d=sqrt(h*h+Z*Z)-.05;if(d<.01){vec3 n=normalize(vec3(X*h,F.y*h,Z*(h+.2)));o=vec4(.95,.5,mix(.8,.3,sign(n.z+.3)),1.)*vec4(.3+max(0.,n.y));break;}z+=d;}

// #sdf #rendering #glsl #donut

12 cases now! (instead of sleeping... it's 5am, whoops) added pointers-to-stack, if, while, modulus and bitwise ops, multiple declarations (int x, *p, **pp), and fixed my busted stack frame implementation😅

335 lines of code so far! getting scared about writing this up...

4 cases! (I added declaration support). I also rewrote the stack from using the webassembly stack to an explicit stack to allow pointers to stack variables, but I didn't actually add pointers yet...
my c compiler is passing 3 test cases in the c testsuite 😎

game inspiration brewing...

(from http://blog.presentandcorrect.com/27986-2)

Button it. – Present&Correct

New blog post! Signed distance functions in 46 lines of Python, where I demonstrate how simple SDFs can be, by iteratively building up to a program that renders this ASCII donut. https://vgel.me/posts/donut/

#python #sdf #graphics #blog

Signed distance functions in 46 lines of Python

A walkthrough of 46 lines of code that render a 3D ASCII donut using signed distance functions.

basque isn't an isolate it's an offshoot of proto-martian

me and my wife made a new game in 3 hours! Blackout in Apopol: The power has been out for a generation in Apopol, can you turn it back on? A texty, post-apocalyptic map exploration game with a roguelite twist!

https://vgel.itch.io/blackout-in-apopol

#indiedev #gamedev #indiegame #gamejam

Blackout in Apopol by vgel, linneaisaac

The power has been out for a generation in Apopol. Can you turn it back on?

itch.io