Here's a shadertoy that simulates the behavior: https://www.shadertoy.com/view/fs3yRl
757 karma · joined April 23, 2022
What a crazy take. Writers can write whatever they want. A book of poetry or prose doesn't have to meet some HN rationalist level of accuracy and rigour.
import * as torch from "./torch.mjs";
...
const w0 = torch.tensor(weights["conv1.0.weight"]);
const b0 = torch.tensor(weights["conv1.0.bias"]);
const w1 = torch.tensor(weights["conv2.0.weight"]);
const b1 = torch.tensor(weights["conv2.0.bias"]);
const lw = torch.tensor(weights["out.weight"]);
const lb = torch.tensor(weights["out.bias"]);
const convs = nn.Sequential(
nn.Conv2d(w0, b0, 1, 2),
nn.MaxPool2d(2),
nn.ReLU(),
nn.Conv2d(w1, b1, 1, 2),
nn.MaxPool2d(2),
nn.ReLU()
);
...
Looks like near identical python torch code except apparantely running in local js!