Sparse activation detector. Fires when few inputs are active (3 or fewer of 8).
x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇
│ │ │ │ │ │ │ │
└──┴──┴──┴──┼──┴──┴──┴──┘
▼
┌──────────┐
│ w: all -1│
│ b: +3 │
└──────────┘
│
▼
HW ≤ 3?
Negative weights flip the logic. Each active input subtracts from the sum:
These aren't complements. At HW=4, both are silent. This is the "tie zone" - neither majority nor minority.
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def minority(bits):
7 inputs = torch.tensor([float(b) for b in bits])
8 return int((inputs * w['weight']).sum() + w['bias'] >= 0)
threshold-minority/
├── model.safetensors
├── model.py
├── config.json
└── README.md