threshold-6outof8

Supermajority detector. Fires when 6 or more of 8 inputs are set (75%+).

Circuit

  xβ‚€ x₁ xβ‚‚ x₃ xβ‚„ xβ‚… x₆ x₇
   β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚
   β””β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”Όβ”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”˜
               β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ w: all 1β”‚
          β”‚ b:  -6  β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
            HW β‰₯ 6

Mechanism

  • Sum = (number of 1s) - 6
  • Fires when Hamming weight β‰₯ 6

A 75% threshold. Tolerates up to 2 missing inputs.

k-out-of-8 Family

Circuit Bias Fires when
... ... ...
5-out-of-8 -5 HW β‰₯ 5
6-out-of-8 -6 HW β‰₯ 6 (this)
7-out-of-8 -7 HW β‰₯ 7
8-out-of-8 -8 HW = 8

Parameters

Weights [1, 1, 1, 1, 1, 1, 1, 1]
Bias -6
Total 9 parameters

Usage

from safetensors.torch import load_file
import torch

w = load_file('model.safetensors')

def at_least_6(bits):
    inputs = torch.tensor([float(b) for b in bits])
    return int((inputs * w['weight']).sum() + w['bias'] >= 0)

Files

threshold-6outof8/
β”œβ”€β”€ model.safetensors
β”œβ”€β”€ model.py
β”œβ”€β”€ config.json
└── README.md

License

MIT

Downloads last month
13
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including phanerozoic/threshold-6outof8