Views
No views yet
| x3 | x2 | x1 | x0 | sum | y |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 0 | 1 | 1 | 2 | 0 |
| 0 | 1 | 1 | 1 | 3 | 1 |
| 1 | 1 | 1 | 1 | 4 | 0 |
x3 x2 x1 x0
│
┌────┴────┐
│ │
┌───┴───┐ ┌───┴───┐
│ >=1 │ │ <=1 │ │ >=3 │ │ <=3 │ Layer 1
└───┬───┘ └───┬───┘ └───┬───┘ └───┬───┘
│ │ │ │
└────┬────┘ └────┬────┘
│ │
┌───┴───┐ ┌───┴───┐
│ AND │ │ AND │ Layer 2
│exact=1│ │exact=3│
└───┬───┘ └───┬───┘
│ │
└─────────┬─────────┘
│
┌───┴───┐
│ OR │ Layer 3
└───┬───┘
│
y| Inputs | 4 |
| Outputs | 1 |
| Neurons | 7 |
| Layers | 3 |
| Parameters | 33 |
| Magnitude | 35 |
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6# Full implementation in model.py
7# s134(0, 1, 1, 1) = 1 # sum=3, odd
8# s134(1, 1, 0, 0) = 0 # sum=2, even