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