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