{ "schema": "wrsi.model_spec.resnet20a.v1", "model_id": "mc7dde8f4", "arch": "resnet20_a", "input": { "kind": "images", "shape": [ 3, 32, 32 ], "dtype": "uint8", "layout": "NCHW" }, "input_shape": [ 3, 32, 32 ], "preprocessing": { "mean": [ 0.490903318493413, 0.4817690980200674, 0.4460368943397672 ], "std": [ 0.24706968464047946, 0.24352667019453098, 0.26164691226372544 ], "computes": "x / 255, then per channel (x - mean[c]) / std[c]" }, "classes": [ "airplane", "automobile", "bird", "cat", "deer", "dog", "frog", "horse", "ship", "truck" ], "n_classes": 10, "parameter_layout": "PyTorch: conv weight [out, in, kh, kw]; BatchNorm weight, bias, running_mean, running_var [channels]; head weight [n_classes, 64] and bias [n_classes]; all float32", "n_parameters": 271098, "tensors": { "conv1.weight": [ 16, 3, 3, 3 ], "bn1.weight": [ 16 ], "bn1.bias": [ 16 ], "bn1.running_mean": [ 16 ], "bn1.running_var": [ 16 ], "layer1.0.conv1.weight": [ 16, 16, 3, 3 ], "layer1.0.bn1.weight": [ 16 ], "layer1.0.bn1.bias": [ 16 ], "layer1.0.bn1.running_mean": [ 16 ], "layer1.0.bn1.running_var": [ 16 ], "layer1.0.conv2.weight": [ 16, 16, 3, 3 ], "layer1.0.bn2.weight": [ 16 ], "layer1.0.bn2.bias": [ 16 ], "layer1.0.bn2.running_mean": [ 16 ], "layer1.0.bn2.running_var": [ 16 ], "layer1.1.conv1.weight": [ 16, 16, 3, 3 ], "layer1.1.bn1.weight": [ 16 ], "layer1.1.bn1.bias": [ 16 ], "layer1.1.bn1.running_mean": [ 16 ], "layer1.1.bn1.running_var": [ 16 ], "layer1.1.conv2.weight": [ 16, 16, 3, 3 ], "layer1.1.bn2.weight": [ 16 ], "layer1.1.bn2.bias": [ 16 ], "layer1.1.bn2.running_mean": [ 16 ], "layer1.1.bn2.running_var": [ 16 ], "layer1.2.conv1.weight": [ 16, 16, 3, 3 ], "layer1.2.bn1.weight": [ 16 ], "layer1.2.bn1.bias": [ 16 ], "layer1.2.bn1.running_mean": [ 16 ], "layer1.2.bn1.running_var": [ 16 ], "layer1.2.conv2.weight": [ 16, 16, 3, 3 ], "layer1.2.bn2.weight": [ 16 ], "layer1.2.bn2.bias": [ 16 ], "layer1.2.bn2.running_mean": [ 16 ], "layer1.2.bn2.running_var": [ 16 ], "layer2.0.conv1.weight": [ 32, 16, 3, 3 ], "layer2.0.bn1.weight": [ 32 ], "layer2.0.bn1.bias": [ 32 ], "layer2.0.bn1.running_mean": [ 32 ], "layer2.0.bn1.running_var": [ 32 ], "layer2.0.conv2.weight": [ 32, 32, 3, 3 ], "layer2.0.bn2.weight": [ 32 ], "layer2.0.bn2.bias": [ 32 ], "layer2.0.bn2.running_mean": [ 32 ], "layer2.0.bn2.running_var": [ 32 ], "layer2.1.conv1.weight": [ 32, 32, 3, 3 ], "layer2.1.bn1.weight": [ 32 ], "layer2.1.bn1.bias": [ 32 ], "layer2.1.bn1.running_mean": [ 32 ], "layer2.1.bn1.running_var": [ 32 ], "layer2.1.conv2.weight": [ 32, 32, 3, 3 ], "layer2.1.bn2.weight": [ 32 ], "layer2.1.bn2.bias": [ 32 ], "layer2.1.bn2.running_mean": [ 32 ], "layer2.1.bn2.running_var": [ 32 ], "layer2.2.conv1.weight": [ 32, 32, 3, 3 ], "layer2.2.bn1.weight": [ 32 ], "layer2.2.bn1.bias": [ 32 ], "layer2.2.bn1.running_mean": [ 32 ], "layer2.2.bn1.running_var": [ 32 ], "layer2.2.conv2.weight": [ 32, 32, 3, 3 ], "layer2.2.bn2.weight": [ 32 ], "layer2.2.bn2.bias": [ 32 ], "layer2.2.bn2.running_mean": [ 32 ], "layer2.2.bn2.running_var": [ 32 ], "layer3.0.conv1.weight": [ 64, 32, 3, 3 ], "layer3.0.bn1.weight": [ 64 ], "layer3.0.bn1.bias": [ 64 ], "layer3.0.bn1.running_mean": [ 64 ], "layer3.0.bn1.running_var": [ 64 ], "layer3.0.conv2.weight": [ 64, 64, 3, 3 ], "layer3.0.bn2.weight": [ 64 ], "layer3.0.bn2.bias": [ 64 ], "layer3.0.bn2.running_mean": [ 64 ], "layer3.0.bn2.running_var": [ 64 ], "layer3.1.conv1.weight": [ 64, 64, 3, 3 ], "layer3.1.bn1.weight": [ 64 ], "layer3.1.bn1.bias": [ 64 ], "layer3.1.bn1.running_mean": [ 64 ], "layer3.1.bn1.running_var": [ 64 ], "layer3.1.conv2.weight": [ 64, 64, 3, 3 ], "layer3.1.bn2.weight": [ 64 ], "layer3.1.bn2.bias": [ 64 ], "layer3.1.bn2.running_mean": [ 64 ], "layer3.1.bn2.running_var": [ 64 ], "layer3.2.conv1.weight": [ 64, 64, 3, 3 ], "layer3.2.bn1.weight": [ 64 ], "layer3.2.bn1.bias": [ 64 ], "layer3.2.bn1.running_mean": [ 64 ], "layer3.2.bn1.running_var": [ 64 ], "layer3.2.conv2.weight": [ 64, 64, 3, 3 ], "layer3.2.bn2.weight": [ 64 ], "layer3.2.bn2.bias": [ 64 ], "layer3.2.bn2.running_mean": [ 64 ], "layer3.2.bn2.running_var": [ 64 ], "fc.weight": [ 10, 64 ], "fc.bias": [ 10 ] }, "layers": [ { "name": "conv1", "op": "conv2d", "weight": "conv1.weight", "shape": [ 16, 3, 3, 3 ], "stride": 1, "padding": 1, "bias": null, "computes": "2-D cross-correlation as torch.nn.functional.conv2d with the given stride and zero padding, no bias" }, { "name": "bn1", "op": "batchnorm_eval", "tensors": { "weight": "bn1.weight", "bias": "bn1.bias", "running_mean": "bn1.running_mean", "running_var": "bn1.running_var" }, "shape": [ 16 ], "eps": 1e-05, "computes": "h = (h - running_mean) / sqrt(running_var + eps) * weight + bias, per channel" }, { "name": "relu", "op": "relu" }, { "name": "layer1.0", "op": "basic_block", "in_channels": 16, "out_channels": 16, "stride": 1, "conv1": { "weight": "layer1.0.conv1.weight", "shape": [ 16, 16, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer1.0.bn1.weight", "bias": "layer1.0.bn1.bias", "running_mean": "layer1.0.bn1.running_mean", "running_var": "layer1.0.bn1.running_var" }, "shape": [ 16 ], "eps": 1e-05 }, "conv2": { "weight": "layer1.0.conv2.weight", "shape": [ 16, 16, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer1.0.bn2.weight", "bias": "layer1.0.bn2.bias", "running_mean": "layer1.0.bn2.running_mean", "running_var": "layer1.0.bn2.running_var" }, "shape": [ 16 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer1.1", "op": "basic_block", "in_channels": 16, "out_channels": 16, "stride": 1, "conv1": { "weight": "layer1.1.conv1.weight", "shape": [ 16, 16, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer1.1.bn1.weight", "bias": "layer1.1.bn1.bias", "running_mean": "layer1.1.bn1.running_mean", "running_var": "layer1.1.bn1.running_var" }, "shape": [ 16 ], "eps": 1e-05 }, "conv2": { "weight": "layer1.1.conv2.weight", "shape": [ 16, 16, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer1.1.bn2.weight", "bias": "layer1.1.bn2.bias", "running_mean": "layer1.1.bn2.running_mean", "running_var": "layer1.1.bn2.running_var" }, "shape": [ 16 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer1.2", "op": "basic_block", "in_channels": 16, "out_channels": 16, "stride": 1, "conv1": { "weight": "layer1.2.conv1.weight", "shape": [ 16, 16, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer1.2.bn1.weight", "bias": "layer1.2.bn1.bias", "running_mean": "layer1.2.bn1.running_mean", "running_var": "layer1.2.bn1.running_var" }, "shape": [ 16 ], "eps": 1e-05 }, "conv2": { "weight": "layer1.2.conv2.weight", "shape": [ 16, 16, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer1.2.bn2.weight", "bias": "layer1.2.bn2.bias", "running_mean": "layer1.2.bn2.running_mean", "running_var": "layer1.2.bn2.running_var" }, "shape": [ 16 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer2.0", "op": "basic_block", "in_channels": 16, "out_channels": 32, "stride": 2, "conv1": { "weight": "layer2.0.conv1.weight", "shape": [ 32, 16, 3, 3 ], "stride": 2, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer2.0.bn1.weight", "bias": "layer2.0.bn1.bias", "running_mean": "layer2.0.bn1.running_mean", "running_var": "layer2.0.bn1.running_var" }, "shape": [ 32 ], "eps": 1e-05 }, "conv2": { "weight": "layer2.0.conv2.weight", "shape": [ 32, 32, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer2.0.bn2.weight", "bias": "layer2.0.bn2.bias", "running_mean": "layer2.0.bn2.running_mean", "running_var": "layer2.0.bn2.running_var" }, "shape": [ 32 ], "eps": 1e-05 }, "shortcut": { "op": "subsample_zero_pad", "stride": 2, "channel_pad_each_side": 8, "computes": "s = x[:, :, ::2, ::2] with the channels zero-padded on each side; no parameters" }, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer2.1", "op": "basic_block", "in_channels": 32, "out_channels": 32, "stride": 1, "conv1": { "weight": "layer2.1.conv1.weight", "shape": [ 32, 32, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer2.1.bn1.weight", "bias": "layer2.1.bn1.bias", "running_mean": "layer2.1.bn1.running_mean", "running_var": "layer2.1.bn1.running_var" }, "shape": [ 32 ], "eps": 1e-05 }, "conv2": { "weight": "layer2.1.conv2.weight", "shape": [ 32, 32, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer2.1.bn2.weight", "bias": "layer2.1.bn2.bias", "running_mean": "layer2.1.bn2.running_mean", "running_var": "layer2.1.bn2.running_var" }, "shape": [ 32 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer2.2", "op": "basic_block", "in_channels": 32, "out_channels": 32, "stride": 1, "conv1": { "weight": "layer2.2.conv1.weight", "shape": [ 32, 32, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer2.2.bn1.weight", "bias": "layer2.2.bn1.bias", "running_mean": "layer2.2.bn1.running_mean", "running_var": "layer2.2.bn1.running_var" }, "shape": [ 32 ], "eps": 1e-05 }, "conv2": { "weight": "layer2.2.conv2.weight", "shape": [ 32, 32, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer2.2.bn2.weight", "bias": "layer2.2.bn2.bias", "running_mean": "layer2.2.bn2.running_mean", "running_var": "layer2.2.bn2.running_var" }, "shape": [ 32 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer3.0", "op": "basic_block", "in_channels": 32, "out_channels": 64, "stride": 2, "conv1": { "weight": "layer3.0.conv1.weight", "shape": [ 64, 32, 3, 3 ], "stride": 2, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer3.0.bn1.weight", "bias": "layer3.0.bn1.bias", "running_mean": "layer3.0.bn1.running_mean", "running_var": "layer3.0.bn1.running_var" }, "shape": [ 64 ], "eps": 1e-05 }, "conv2": { "weight": "layer3.0.conv2.weight", "shape": [ 64, 64, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer3.0.bn2.weight", "bias": "layer3.0.bn2.bias", "running_mean": "layer3.0.bn2.running_mean", "running_var": "layer3.0.bn2.running_var" }, "shape": [ 64 ], "eps": 1e-05 }, "shortcut": { "op": "subsample_zero_pad", "stride": 2, "channel_pad_each_side": 16, "computes": "s = x[:, :, ::2, ::2] with the channels zero-padded on each side; no parameters" }, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer3.1", "op": "basic_block", "in_channels": 64, "out_channels": 64, "stride": 1, "conv1": { "weight": "layer3.1.conv1.weight", "shape": [ 64, 64, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer3.1.bn1.weight", "bias": "layer3.1.bn1.bias", "running_mean": "layer3.1.bn1.running_mean", "running_var": "layer3.1.bn1.running_var" }, "shape": [ 64 ], "eps": 1e-05 }, "conv2": { "weight": "layer3.1.conv2.weight", "shape": [ 64, 64, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer3.1.bn2.weight", "bias": "layer3.1.bn2.bias", "running_mean": "layer3.1.bn2.running_mean", "running_var": "layer3.1.bn2.running_var" }, "shape": [ 64 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "layer3.2", "op": "basic_block", "in_channels": 64, "out_channels": 64, "stride": 1, "conv1": { "weight": "layer3.2.conv1.weight", "shape": [ 64, 64, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn1": { "tensors": { "weight": "layer3.2.bn1.weight", "bias": "layer3.2.bn1.bias", "running_mean": "layer3.2.bn1.running_mean", "running_var": "layer3.2.bn1.running_var" }, "shape": [ 64 ], "eps": 1e-05 }, "conv2": { "weight": "layer3.2.conv2.weight", "shape": [ 64, 64, 3, 3 ], "stride": 1, "padding": 1, "bias": null }, "bn2": { "tensors": { "weight": "layer3.2.bn2.weight", "bias": "layer3.2.bn2.bias", "running_mean": "layer3.2.bn2.running_mean", "running_var": "layer3.2.bn2.running_var" }, "shape": [ 64 ], "eps": 1e-05 }, "shortcut": null, "computes": "out = relu(bn2(conv2(relu(bn1(conv1(x))))) + s), s = the shortcut of x, or s = x when the shortcut is null" }, { "name": "pool", "op": "global_avg_pool", "computes": "features = mean of h over H and W, [N, 64]" }, { "name": "fc", "op": "linear", "weight": "fc.weight", "bias": "fc.bias", "shape": [ 10, 64 ], "computes": "logits = f @ weight.T + bias" } ], "output": "logits [N, n_classes]; the prediction is the argmax", "reference_forward": "forward.py: forward(params, x_uint8 [N, 3, 32, 32]) -> float32 logits [N, n_classes]" }