Atelier des rouesLab FR
Objects/Documentation

poids12.py

I provide this item to inspect or reproduce the check AT.H13.

Download ↓
"""Post-route check of complemented weights against a specialised population count."""
import argparse,json,tempfile
from hashlib import sha256
from pathlib import Path
from statistics import median
from apprendre import descriptions,learn
from neurones import build,scalar
from porter import netcheck,path_stats
HERE=Path(__file__).resolve().parent

def run(tools=None,export=None):
    original,truth,quality=learn()
    model=[(w^255,t) for w,t in original]
    expected=bytes(sum(int(scalar(x,w)>=t)<<i for i,(w,t) in enumerate(model)) for x in range(256))
    assert all(expected[x]==truth[x^255] for x in range(256))
    src,selection=descriptions(model)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.