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