Views
No views yet
| Inputs | 5 |
| Outputs | 1 |
| Neurons | 1 |
| Layers | 1 |
| Parameters | 6 |
| Magnitude | 8 |
1from safetensors.torch import load_file
2import torch
3
4w = load_file('model.safetensors')
5
6def majority5(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(majority5(0, 0, 1, 1, 1)) # 1
11print(majority5(0, 0, 0, 1, 1)) # 0