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