Pizdec
Collection
experimental micromodels โข 3 items โข Updated
pizdecB3 (format: n.f.c โ name.function.count) is a tiny boolean comparison model.
It takes two numbers and predicts one of three relations:
> (greater)
= (equal)
< (less)
Also supports string input in the format x?y.
| Property | Value |
|---|---|
| Parameters | ~1731 |
| Input | two floats (a, b) or string "a?b" |
| Output | <, =, or > |
| Architecture | small MLP (input features: a, b, a-b) |
| Framework | PyTorch + Safetensors |
| License | CC-BY-SA-4.0 |
Here is the visualization of the model's training metrics (Loss and Accuracy):
Extremely lightweight number comparison
Edge / constrained environments
Educational / experimental micro-models
Fun baseline for boolean tasks
Not intended for high-precision scientific computing or production systems that require perfect floating-point equality handling.
import torch
import torch.nn as nn
from safetensors.torch import load_file
from pathlib import Path
class PizdecB3(nn.Module):
def __init__(self):
super().__init__()
self.net = nn.Sequential(
nn.Linear(3, 32),
nn.ReLU(),
nn.Linear(32, 32),
nn.ReLU(),
nn.Linear(32, 16),
nn.ReLU(),
nn.Linear(16, 3)
)
def forward(self, x):
return self.net(x)
def _prepare(self, a, b):
a = torch.tensor([[float(a)]], dtype=torch.float32)
b = torch.tensor([[float(b)]], dtype=torch.float32)
return torch.cat([a, b, a - b], dim=1)
def predict(self, a, b) -> str:
with torch.no_grad():
x = self._prepare(a, b)
logits = self.forward(x)
pred = torch.argmax(logits, dim=-1).item()
return ["<", "=", ">"][pred]
def predict_str(self, s: str) -> str:
try:
left, right = s.strip().split("?")
return self.predict(left, right)
except:
return "format error"
@classmethod
def from_pretrained(cls, path="pizdecB3"):
model = cls()
state = load_file(Path(path) / "model.safetensors")
model.load_state_dict(state)
model.eval()
return model
# Load
model = PizdecB3.from_pretrained("pizdecB3")
# Usage
print(model.predict(10, 5)) # >
print(model.predict(3, 3)) # =
print(model.predict_str("8?2")) # >
100 vs 99.9, 7.0 vs 7.01)model.safetensors โ model weightsconfig.json โ basic configtraining_metrics.png โ training visualizationPart of the experimental RaspizdAI micro-model collection.