Exactly-7-out-of-8 detector. Fires when precisely seven inputs are active. The lone-dissenter detector.
x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇
│ │ │ │ │ │ │ │
└──┴──┴──┴──┼──┴──┴──┴──┘
│
┌───────┴───────┐
▼ ▼
┌─────────┐ ┌─────────┐
│ ≥ 7 │ │ ≤ 7 │
│ b = -7 │ │ b = +7 │
└─────────┘ └─────────┘
│ │
└───────┬───────┘
▼
┌─────────┐
│ AND │
└─────────┘
│
▼
one dissenter?
This circuit detects the complement of Exactly1: instead of one voice in the wilderness, it's one holdout against consensus.
Both fire on exactly 8 input patterns (one for each position).
The circuit identifies the liminal state between consensus and unanimity.
They are perfect duals. Bitwise NOT maps each Exactly1 input to a unique Exactly7 input.
Exactly7 identifies the unique scenario: overwhelming support with precisely one objector. This is useful for:
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def exactly7(bits):
7 inp = torch.tensor([float(b) for b in bits])
8 atleast = int((inp * w['atleast.weight']).sum() + w['atleast.bias'] >= 0)
9 atmost = int((inp * w['atmost.weight']).sum() + w['atmost.bias'] >= 0)
10 comb = torch.tensor([float(atleast), float(atmost)])
11 return int((comb * w['and.weight']).sum() + w['and.bias'] >= 0)
12
13# One holdout at position 3
14bits = [1, 1, 1, 0, 1, 1, 1, 1]
15print(exactly7(bits)) # 1
16
17# Complete unanimity - no holdout
18bits = [1, 1, 1, 1, 1, 1, 1, 1]
19print(exactly7(bits)) # 0
The difference: 7-out-of-8 includes unanimity. Exactly7 excludes it.
threshold-exactly7outof8/
├── model.safetensors
├── model.py
├── config.json
└── README.md