threshold-xor3

3-input XOR gate. Cascade of two standard XOR circuits (OR + NAND + AND).

Architecture

a  b           c
β”‚  β”‚           β”‚
└──┴──┐        β”‚
      β–Ό        β”‚
   β”Œβ”€β”€β”€β”€β”€β”     β”‚
   β”‚ XOR β”‚     β”‚
   β””β”€β”€β”¬β”€β”€β”˜     β”‚
      β”‚        β”‚
      β””β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
           β–Ό
        β”Œβ”€β”€β”€β”€β”€β”
        β”‚ XOR β”‚
        β””β”€β”€β”¬β”€β”€β”˜
           β–Ό
      XOR3(a,b,c)

Each XOR uses the standard OR + NAND + AND structure:

  • OR: w=[1,1], b=-1 (magnitude 3)
  • NAND: w=[-1,-1], b=1 (magnitude 3)
  • AND: w=[1,1], b=-2 (magnitude 4)

Parameters

Neurons 6
Layers 4
Parameters 18
Magnitude 20

Optimized Version

See threshold-xor3-mag14 for a 30% magnitude reduction using optimized XOR blocks.

Usage

from safetensors.torch import load_file

w = load_file('model.safetensors')
# See model.py for implementation

License

MIT

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

Collection including phanerozoic/threshold-xor3