Views
No views yet
| a | b | a <= b |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| Inputs | 2 |
| Outputs | 1 |
| Neurons | 1 |
| Layers | 1 |
| Parameters | 3 |
| Magnitude | 2 |
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def lte(a, b):
7 inp = torch.tensor([float(a), float(b)])
8 return int((inp @ w['neuron.weight'].T + w['neuron.bias'] >= 0).item())
9
10print(lte(0, 1)) # 1
11print(lte(1, 0)) # 0