Views
No views yet
x y
│ │
└─┬─┘
▼
┌────────┐
│w: -1,-1│
│ b: +1 │
└────────┘
│
▼
NAND(x,y)| x | y | sum | output |
|---|---|---|---|
| 0 | 0 | +1 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | -1 | 0 |
| Weights | [-1, -1] |
| Bias | +1 |
| Total | 3 parameters |
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def nand_gate(x, y):
7 inputs = torch.tensor([float(x), float(y)])
8 return int((inputs * w['weight']).sum() + w['bias'] >= 0)threshold-nand/
├── model.safetensors
├── model.py
├── config.json
└── README.md