Views
No views yet
x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇
│ │ │ │ │ │ │ │
└──┴──┴──┴──┼──┴──┴──┴──┘
▼
┌─────────┐
│ w: all 1│
│ b: -2 │
└─────────┘
│
▼
HW ≥ 2| Circuit | Bias | Fires when |
|---|---|---|
| 1-out-of-8 | -1 | HW ≥ 1 |
| 2-out-of-8 | -2 | HW ≥ 2 (this) |
| 3-out-of-8 | -3 | HW ≥ 3 |
| ... | ... | ... |
| Weights | [1, 1, 1, 1, 1, 1, 1, 1] |
| Bias | -2 |
| Total | 9 parameters |
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def at_least_2(bits):
7 inputs = torch.tensor([float(b) for b in bits])
8 return int((inputs * w['weight']).sum() + w['bias'] >= 0)threshold-2outof8/
├── model.safetensors
├── model.py
├── config.json
└── README.md