757 karma · joined Apr 23, 2022 (4y ago) · 171 submissions
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
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.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
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!comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent