Views
No views yet
x1 x2 x3 x4
│ │ │ │
└───┴───┴───┘
│
▼
┌──────────┐
│w:-1,-1,-1,-1│
│ b: 0 │
└──────────┘
│
▼
NOR4(x1,x2,x3,x4)| Weights | [-1, -1, -1, -1] |
| Bias | 0 |
| Magnitude | 4 |
| Magnitude | Valid Configs |
|---|---|
| 0-3 | 0 |
| 4 | 1 |
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def nor4(x1, x2, x3, x4):
7 inputs = torch.tensor([float(x1), float(x2), float(x3), float(x4)])
8 return int((inputs * w['weight']).sum() + w['bias'] >= 0)