Loading slide
How does the program know what to do with that giant pile of numbers? The answer is simpler than you'd expect.
In code, a network is plainer than people imagine. Stripped of the technical wording, it just lays out a shape: "first layer, two numbers in, three out. Next layer, three in, one out." And the moment you write that shape down, the number of weights is fixed. The program never lists the weights themselves. It only sets up empty slots, like an egg carton with a known number of cups, in a fixed order.
The weights file is the other half: just numbers, one after another, no labels. It doesn't need any. To load the model, the program reads the file from the top and drops each number into the next slot, in order. Press the button and watch.
The order is the address. That's the whole trick.
Which is why the two files are a matched pair. Change the shape by a single neuron and the numbers no longer line up. Too many, or too few, and the model simply refuses to run. The weights are meaningless without the shape that reads them. The shape is empty without the weights.