RACE-Net-M weights, card and code
Browse filesFiles changed (11)
- .gitattributes+2
- README.mdAdded+103
- ablation.jsonAdded+129
- config.jsonAdded+23
- model.safetensorsAdded+3
- racenet_m.pyAdded+144
- racenet_m_architecture.pngAdded
- trackD.pyAdded+414
- trackD_vs_liars.pngAdded
- train_racenet_m.pyAdded+140
- training_log.jsonAdded+266
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363732 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textracenet_m_architecture.png filter=lfs diff=lfs merge=lfs -texttrackD_vs_liars.png filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103---license: otherlicense_name: roborace-mixedlicense_link: https://huggingface.co/datasets/Nabidnur/RoboRACE-Bench/blob/main/LICENSES.mdlibrary_name: pytorchpipeline_tag: othertags: [robotics, multi-agent, byzantine-robustness, map-fusion, truth-inference, set-transformer, roborace]datasets: [Nabidnur/RoboRACE-Bench]model-index:- name: RACE-Net-M results: - task: {type: other, name: Byzantine-robust map fusion} dataset: {name: RoboRACE-Bench Track D, type: Nabidnur/RoboRACE-Bench, config: trackD_maze_results, split: train} metrics: - {type: spl, value: 70.2, name: mean SPL x100 over 500 cells}---
# RACE-Net-M — receiver-anchored channel estimation for map fusion
**A 44,837-parameter model that fuses the map reports of a robot swarm when some robots lie.**Part of [RoboRACE](https://huggingface.co/datasets/Nabidnur/RoboRACE-Bench) · sibling model for camera swarms: [RACE-Net-V](https://huggingface.co/Nabidnur/RoboRACE-Net) ·[showcase Space](https://huggingface.co/spaces/Nabidnur/RoboRACE) · code: [github.com/Hisernberg/robotics](https://github.com/Hisernberg/robotics)
<p align="center"><img src="racenet_m_architecture.png" width="640"></p>
## What it does
Robots explore an unknown map and broadcast what they sensed (cell is *free* / *wall*). Some robots corrupt their broadcasts: they inverteverything, invent walls or openings, answer at random, turn bad later, or collude. A receiving robot has to decide which cells are walls.RACE-Net-M returns the log-odds of *wall* for every reported cell. It assumes one thing only: **the receiver's own sensor is right**.
1. **Anchored counts.** Each peer's claims are compared with the cells the receiver sensed itself (claim × truth, recent and old claims apart).2. **Peer transformer.** A small transformer across peers turns the counts into a channel embedding per peer.3. **Signed read-out.** Each kind of claim gets a signed evidence value: a reliable peer is trusted, a consistent liar is *inverted and used*, a random one is ignored. Reputation systems can only discard a liar.4. **Refinement (3 rounds).** Each peer is also checked against the belief of all the *other* peers on cells the receiver has not sensed (leave-one-out), so a robot can verify a peer it never overlapped with through a peer it already trusts.
Peers and cells are sets (no positions): any map size and any swarm size.
## Use
```pythonimport sys, numpy as npfrom huggingface_hub import snapshot_downloadd = snapshot_download("Nabidnur/RoboRACE-Net-M"); sys.path.insert(0, d)import racenet_m
# own [H, W] the receiver's own observations: -1 unknown, 0 free, 1 wall# claims [n, H, W] latest broadcast of every robot (same coding); stamp [n, H, W] time of that broadcastlog_odds = racenet_m.wall_logodds(own, claims, stamp, i=0, t=now, path=d) # i = index of the receiverwall = log_odds > 2.0 # threshold chosen on development mazes```About 2 ms per call on one CPU core. Dependencies: `torch`, `numpy`, `safetensors`.
## Training
45,361 snapshots from simulated maze swarms (maze seeds 5000–7399) in which liars follow**random two-coin channels with an optional change point** (`racenet_m.sample_channels`). The benchmark's attack names never appear in training,and the colluding ring attack is outside that family. 4,000 AdamW steps on a CPU (8 min including thesimulation). Benchmark mazes (seeds 1000–1019) and tuning mazes (seeds 0–39) are disjoint from training and validation mazes.
## Evaluation: RoboRACE Track D
Six robots, 20 fresh mazes × 25 conditions (6 attacks × 1–4 liars, plus the clean case) = 500 cells. Score = SPL ×100 (success weighted by pathlength) of the honest robots. Ranks are medians over 2,000 bootstrap resamples of cells.
| rank | fusion rule | mean SPL | no liars | liars < 50% | liars ≥ 50% | goal reached % ||---:|---|---:|---:|---:|---:|---:|| 1 | **RACE-Net-M + reachability repair (this model)** | 70.2 | 76.8 | 73.1 | 66.8 | 97.8 || 2 | **RACE-Net-M (this model)** | 69.8 | 76.8 | 72.6 | 66.4 | 97.4 || 3 | race_map (hand-written Bayesian rule, ours) | 66.2 | 76.8 | 69.7 | 61.8 | 94.2 || 4 | W-MSR-style trimming (LeBlanc et al. 2013; F known) | 64.1 | 76.8 | 65.6 | 61.5 | 96.5 || 5 | beta-reputation (Jøsang & Ismail 2002) | 63.8 | 76.8 | 67.9 | 58.5 | 91.9 || 6 | EigenTrust (Kamvar et al. 2003) | 63.0 | 75.0 | 66.8 | 58.2 | 91.8 || 7 | Dawid–Skene (1979), unanchored | 62.0 | 76.3 | 67.4 | 55.5 | 90.1 || 8 | no communication | 61.6 | 61.5 | 62.0 | 61.2 | 95.2 || 9 | naive map merging | 56.7 | 76.8 | 59.9 | 51.7 | 83.8 || 10 | per-cell majority | 55.7 | 76.8 | 61.5 | 48.1 | 82.1 || – | *oracle that knows the liars (reference)* | 71.3 | 76.8 | 74.5 | 67.5 | 98.2 |
<p align="center"><img src="trackD_vs_liars.png" width="900"></p>
Belief quality on held-out mazes (accuracy on cells a peer reported and the receiver has not sensed):
| model | all | 3 of 5 peers lie | 5 of 5 peers lie ||---|---:|---:|---:|| race_map (hand-written Bayesian rule) | 90.1 | 82.7 | 72.9 || rounds = 1 (no refinement) | 91.8 | 85.7 | 76.1 || rounds = 2 | 92.2 | 86.4 | 77.4 || rounds = 3 (released) | 92.3 | 86.7 | 77.6 || rounds = 3, second seed | 92.3 | 86.7 | 77.6 |
## Limitations
- **Collusion on a few cells.** A bloc that is honest everywhere except around the goal looks reliable until a robot gets there; the reachability repair recovers part of the loss, the oracle is still better.- One simulator (grid mazes, exact 8-neighbour sensing, six robots). Not tested on real robots or noisy sensors.- Claims are assumed conditionally independent given the truth; the model has no notion of where a peer was when it made a claim.
## Files`model.safetensors` · `config.json` · `training_log.json` · `ablation.json` · `racenet_m.py` (model, training distribution, inference) ·`train_racenet_m.py` · `trackD.py` (the benchmark, baselines and planner)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129{ "metric": "accuracy on cells that a peer reported and the receiver has not sensed, 6,111 held-out snapshots (maze seeds 9000+)", "rows": [ { "model": "rounds = 1 (no refinement)", "val_cell_acc": 0.9181, "val_cell_acc_bma": 0.9014, "by_liars": { "0": [ 0.9996, 1.0 ], "1": [ 0.9492, 0.9398 ], "2": [ 0.9003, 0.8725 ], "3": [ 0.8566, 0.8269 ], "4": [ 0.8295, 0.7985 ], "5": [ 0.7606, 0.7293 ] } }, { "model": "rounds = 2", "val_cell_acc": 0.922, "val_cell_acc_bma": 0.9014, "by_liars": { "0": [ 0.9997, 1.0 ], "1": [ 0.9525, 0.9398 ], "2": [ 0.9029, 0.8725 ], "3": [ 0.8636, 0.8269 ], "4": [ 0.8378, 0.7985 ], "5": [ 0.7744, 0.7293 ] } }, { "model": "rounds = 3 (released)", "val_cell_acc": 0.9233, "val_cell_acc_bma": 0.9014, "by_liars": { "0": [ 0.9998, 1.0 ], "1": [ 0.9542, 0.9398 ], "2": [ 0.9035, 0.8725 ], "3": [ 0.8673, 0.8269 ], "4": [ 0.839, 0.7985 ], "5": [ 0.7762, 0.7293 ] } }, { "model": "rounds = 3, second seed", "val_cell_acc": 0.9233, "val_cell_acc_bma": 0.9014, "by_liars": { "0": [ 0.9996, 1.0 ], "1": [ 0.9539, 0.9398 ], "2": [ 0.9042, 0.8725 ], "3": [ 0.8665, 0.8269 ], "4": [ 0.8401, 0.7985 ], "5": [ 0.7764, 0.7293 ] } } ]}1234567891011121314151617181920212223{ "d": 48, "heads": 4, "layers": 2, "rounds": 3, "n_params": 44837, "architecture": "RaceNetM (anchored channel encoder + peer transformer + signed read-out, iterative)", "input": "peer claims [P peers, N cells] in {none, free, wall} with a recent/old flag, and the receiver's own sensed cells", "output": "log-odds of 'wall' per cell", "training": { "data": "maze swarms with random two-coin liars and change points (racenet_m.sample_channels)", "train_seeds": [ 5000, 7399 ], "val_seeds_from": 9000, "snapshots": 45361, "steps": 4000, "batch": 48, "lr": 0.002, "seed": 0 }}123version https://git-lfs.github.com/spec/v1oid sha256:65f379bd022bbe68a38cf38ecd049334059d8aae4d5e4334865b3ebc0a2a8fc5size 182476123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144"""RACE-Net-M — receiver-anchored channel estimation for MAP fusion (this repo's second model).
Same design as RACE-Net-V (`racenet.py`), applied to a map instead of a window of episodes: anchor the receiver's own sensed cells are the only trusted evidence channels for every peer, its claims are compared with the anchor inside the current map (in-context channel estimation: hard counts on cells the receiver sensed itself) swarm view a small transformer across peers lets the estimate of one peer depend on the others signed use the read-out gives each kind of claim a signed evidence value (log-likelihood ratio of 'wall'): a reliable peer is trusted, a consistent liar is inverted, a random one ignored refinement the fused belief is fed back as soft counts on cells the receiver has NOT sensed (each peer is checked against the belief of all the *other* peers), for R rounds; this is what lets a robot verify a peer it has never overlapped with, through a peer it trusts
Peers and cells are sets: no positions, so the model works for any map size and swarm size.It is trained on random two-coin liars with a random change point (`sample_channels`); the benchmark'sattack names never appear in training, and the colluding ring attack is outside that family."""from __future__ import annotations
import jsonimport osfrom pathlib import Path
import numpy as npimport torchimport torch.nn as nn
CONFIG = {"d": 48, "heads": 4, "layers": 2, "rounds": 3}_HERE = Path(__file__).resolve()DEFAULT_DIR = (_HERE.parents[3] / "models/racenet_m") if len(_HERE.parents) > 3 and (_HERE.parents[3] / "models/racenet_m").exists() \ else _HERE.parentif os.environ.get("RACENET_M_DIR"): DEFAULT_DIR = Path(os.environ["RACENET_M_DIR"])
class RaceNetM(nn.Module): def __init__(self, d=48, heads=4, layers=2, rounds=3): super().__init__() self.rounds = rounds self.embed = nn.Sequential(nn.Linear(36, d), nn.GELU(), nn.Linear(d, d)) self.round_emb = nn.Parameter(torch.zeros(rounds, d)) enc = nn.TransformerEncoderLayer(d, heads, 2 * d, dropout=0.0, batch_first=True, norm_first=True) self.peers = nn.TransformerEncoder(enc, layers, enable_nested_tensor=False) self.head = nn.Sequential(nn.LayerNorm(d), nn.Linear(d, d), nn.GELU(), nn.Linear(d, 4)) self.bias = nn.Parameter(torch.zeros(1)) nn.init.normal_(self.round_emb, std=0.02)
@staticmethod def _feats(n): """n: [B, P, 2 (truth), 4 (epoch*2 + claim)] counts -> 16 features (log-counts and per-truth rates).""" tot = n.reshape(*n.shape[:2], 2, 2, 2).sum(-1, keepdim=True) # per (truth, epoch) rate = (n.reshape(*n.shape[:2], 2, 2, 2) + 0.5) / (tot + 1.0) return torch.cat([torch.log1p(n).flatten(2), rate.flatten(2)], -1)
def forward(self, claim, epoch, own, return_all=False): """claim [B, P, N] in {-1 none, 0 free, 1 wall}; epoch [B, P, N] in {0 old, 1 recent}; own [B, N] in {-1, 0, 1}. Returns log-odds of 'wall' per cell [B, N] (list over rounds if return_all).""" has = claim >= 0 idx = (epoch * 2 + claim.clamp(min=0)).long() # 0..3 oh = torch.nn.functional.one_hot(idx, 4).float() * has[..., None] # [B, P, N, 4] seen = (own >= 0)[:, None, :, None].float() truth = (own == 1)[:, None, :, None].float() hard = torch.stack([(oh * seen * (1 - truth)).sum(2), (oh * seen * truth).sum(2)], 2) # [B, P, 2, 4] f_hard = self._feats(hard) cover = torch.log1p(oh.sum(2)) # [B, P, 4] how much it reported unseen = 1 - seen logit, outs = None, [] for r in range(self.rounds): if logit is None: soft = torch.zeros_like(hard) else: ev_own = (oh * ev[:, :, None, :]).sum(-1) # this peer's own contribution q = torch.sigmoid(logit[:, None, :] - ev_own)[..., None] # belief of everybody else soft = torch.stack([(oh * unseen * (1 - q)).sum(2), (oh * unseen * q).sum(2)], 2) x = self.embed(torch.cat([f_hard, self._feats(soft), cover], -1)) + self.round_emb[r] ev = self.head(self.peers(x)) # [B, P, 4] signed evidence logit = self.bias + (oh * ev[:, :, None, :]).sum((1, 3)) outs.append(logit) return outs if return_all else logit
# ----------------------------------------------------------------------------- training distributiondef sample_channels(rng: np.random.Generator, n=6, receiver=None): """Random liars for one training episode: {robot: (t00, t11, t_change)}. Two-coin channels drawn from a broad family, with an optional change point (a peer that turns bad later). No named benchmark attack is used.""" F = int(rng.integers(0, n)) liars = rng.choice([j for j in range(n) if j != receiver], min(F, n - 1 if receiver is not None else n), replace=False) ch = {} for j in liars: kind = rng.choice(["uniform", "both_low", "wall_inventor", "free_inventor", "coin"], p=[0.3, 0.25, 0.2, 0.15, 0.1]) if kind == "uniform": t00, t11 = rng.uniform(0, 1, 2) elif kind == "both_low": t00, t11 = rng.uniform(0, 0.3, 2) elif kind == "wall_inventor": t00, t11 = rng.uniform(0, 0.7), rng.uniform(0.9, 1) elif kind == "free_inventor": t00, t11 = rng.uniform(0.9, 1), rng.uniform(0, 0.7) else: t00, t11 = rng.uniform(0.4, 0.6, 2) ch[int(j)] = (float(t00), float(t11), int(rng.integers(10, 90)) if rng.random() < 0.3 else 0) return ch
def tensors(own, claims, stamp, i, t, window=30): """One snapshot -> (claim [P, N], epoch [P, N], own [N]) int8 arrays; peers = every robot except i.""" peers = [j for j in range(len(claims)) if j != i] c = claims[peers].reshape(len(peers), -1) e = (stamp[peers].reshape(len(peers), -1) >= t - window).astype(np.int8) return c.astype(np.int8), e, own.reshape(-1).astype(np.int8)
# ----------------------------------------------------------------------------- inference API_CACHE = {}
def load(path=None): path = Path(path or DEFAULT_DIR) if path not in _CACHE: from safetensors.torch import load_file cfg = json.loads((path / "config.json").read_text()) net = RaceNetM(**{k: cfg[k] for k in ("d", "heads", "layers", "rounds")}) net.load_state_dict(load_file(str(path / "model.safetensors"))) torch.set_num_threads(1) _CACHE[path] = net.eval() return _CACHE[path]
def available(path=None): return (Path(path or DEFAULT_DIR) / "model.safetensors").exists()
@torch.inference_mode()def wall_logodds(own, claims, stamp, i, t, window=30, path=None): """Log-odds that each cell is a wall, from the peers' broadcasts (0 where nobody reported).""" c, e, o = tensors(own, claims, stamp, i, t, window) cols = (c >= 0).any(0) # only cells somebody reported out = np.zeros(o.shape) if cols.any(): net = load(path) lg = net(torch.from_numpy(c[:, cols])[None].long(), torch.from_numpy(e[:, cols])[None].long(), torch.from_numpy(o[cols])[None].long())[0].numpy() out[cols] = np.where(lg == 0, 1e-6, lg) return out.reshape(own.shape)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414"""Track D — Byzantine cooperative maze exploration (mobile-robot swarm, numpy).
N robots must each reach a common goal in an unknown grid maze. A robot senses its 8neighbouring cells exactly and broadcasts what it sensed; everybody fuses the broadcasts intoa belief map and re-plans every step (shortest path, unknown cells optimistically free).F robots are Byzantine: they explore like everyone else but corrupt what they broadcast.
Fusion rules (per receiver; a robot's own direct observations always override peers) solo ignore peers (single-robot exploration baseline) trust_all naive map merging: the latest claim about a cell wins majority per-cell majority vote over peers wmsr_trim W-MSR-style trimming (LeBlanc et al. 2013): drop F 'wall' and F 'free' votes per cell (F known) eigentrust EigenTrust (Kamvar et al. 2003): global trust from pairwise agreement, receiver pre-trusted dawid_skene unanchored two-coin Dawid-Skene EM over the cells (1979) reputation beta-reputation (Josang & Ismail 2002): weight each peer by log-odds of its verified accuracy, clipped at 0 -> liars are DISCARDED race_map receiver-anchored channel estimation (this repo): Bayesian model averaging over each peer's two-coin channel, verified on the receiver's own cells; claims enter as signed log-likelihood ratios -> a consistent liar is INVERTED and used, a wall-inventor keeps only the weight of its 'free' claims, a random peer contributes nothing; a Bayes-factor test separates a sleeper's two epochs race_net_m RACE-Net-M (this repo): the same anchored channel estimation, LEARNED from simulated swarms with random two-coin liars (robotics.swarm.racenet_m) ... + reach-repair planner variant: when the fused map says the goal is unreachable, un-believe only the claimed walls that enclose the goal instead of dropping every peer REF oracle knows who lies (reference, not ranked)
"Verified" = cells the receiver sensed itself that the peer also reported: the receiver's ownsensor is the anchor (RACE's "I know I am honest"), so no labels and no majority are needed.
Score = SPL (Success weighted by Path Length, Anderson et al. 2018), averaged over honest robots;a robot fails if it needs more than 2.5x its optimal path length + 10 steps."""from __future__ import annotations
from collections import deque
import numpy as np
RACE_TAU = 1.0 # log-odds needed before race_map blocks a cell (chosen on development mazes, seeds 0-7)ATTACKS_D = ("none", "false_walls", "false_free", "invert", "random", "collude", "sleeper")BASELINES_D = ("solo", "trust_all", "majority", "wmsr_trim", "eigentrust", "dawid_skene", "reputation")MV = " + reach-repair"OURS_D = ("race_map", "race_net_m", "race_map" + MV, "race_net_m" + MV)ABLATION_D = ("reputation" + MV, "eigentrust" + MV, "majority" + MV) # the same planner fallback on baselinesMETHODS_D = BASELINES_D + OURS_D + ABLATION_D + ("REF oracle",)# Reachability repair (ours): the task guarantees that the goal can be reached. When the fused map says it cannot,# some believed wall around the goal must be a lie. The standard planner then drops every peer and plans on the robot's# own observations; the repair instead keeps the fused map and only un-believes the claimed walls that enclose the# goal's reachable region, layer by layer (at most REPAIR_LAYERS), until the robot is connected to the goal.# NET_TAU was chosen on development mazes (scripts/tune_trackD.py); the benchmark seeds were not used.NET_TAU, REPAIR_LAYERS = 2.0, 6NB8 = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 0), (0, 1), (1, -1), (1, 0), (1, 1)]NB4 = [(-1, 0), (1, 0), (0, -1), (0, 1)]
def make_maze(w=12, h=12, loops=0.08, seed=0): """Perfect maze by randomised DFS, then `loops` of the interior walls removed (alternative routes).""" rng = np.random.default_rng(seed) G = np.ones((2 * h + 1, 2 * w + 1), np.int8) seen = np.zeros((h, w), bool) stack = [(0, 0)] seen[0, 0] = True G[1, 1] = 0 while stack: r, c = stack[-1] nb = [(r + dr, c + dc) for dr, dc in NB4 if 0 <= r + dr < h and 0 <= c + dc < w and not seen[r + dr, c + dc]] if not nb: stack.pop() continue nr, nc = nb[rng.integers(len(nb))] G[r + nr + 1, c + nc + 1] = 0 G[2 * nr + 1, 2 * nc + 1] = 0 seen[nr, nc] = True stack.append((nr, nc)) inner = [(r, c) for r in range(1, 2 * h) for c in range(1, 2 * w) if G[r, c] == 1 and (r % 2) != (c % 2)] for k in rng.choice(len(inner), int(loops * len(inner)), replace=False): G[inner[k]] = 0 return G
def bfs(free, src): """Distance field from src over cells where free is True (4-connected).""" H, W = free.shape dist = np.full((H, W), -1, np.int32) dist[src] = 0 q = deque([src]) while q: r, c = q.popleft() d = dist[r, c] + 1 for dr, dc in NB4: rr, cc = r + dr, c + dc if 0 <= rr < H and 0 <= cc < W and free[rr, cc] and dist[rr, cc] < 0: dist[rr, cc] = d q.append((rr, cc)) return dist
def _eigentrust(own, claims, i, alpha=0.15, iters=30): """EigenTrust (Kamvar, Schlosser & Garcia-Molina 2003). Local trust c[j,k] = max(sat - unsat, 0) over the cells both j and k reported (the receiver uses its own sensed cells), row-normalised; the receiver is the only pre-trusted peer. Returns the global trust vector (discard-only: trust is never negative).""" n = len(claims) V = claims.astype(np.int16).copy() V[i] = own # the receiver rates others with what it sensed itself C = np.zeros((n, n)) for j in range(n): for k in range(n): if j != k: both = (V[j] >= 0) & (V[k] >= 0) agree = int(np.sum(V[j][both] == V[k][both])) C[j, k] = max(2 * agree - int(both.sum()), 0) p = np.zeros(n) p[i] = 1.0 rows = C.sum(1, keepdims=True) C = np.where(rows > 0, C / np.maximum(rows, 1e-9), p[None]) t = p.copy() for _ in range(iters): t = (1 - alpha) * C.T @ t + alpha * p t[i] = 0.0 return t / max(t.max(), 1e-9)
def _dawid_skene(own, claims, i, iters=25): """Unanchored two-coin Dawid-Skene EM over the map cells (Dawid & Skene 1979): every robot, the receiver included, is one annotator; initialised with the majority vote. Returns per-cell log-odds of 'wall'.""" V = claims.astype(np.int16).copy() V[i] = own has = V >= 0 m = has.any(0) if not m.any(): return np.zeros(own.shape) X, Hm = (V[:, m] == 1).astype(float), has[:, m].astype(float) # [n, cells] q = (X * Hm).sum(0) / np.maximum(Hm.sum(0), 1) for _ in range(iters): pi = np.clip(q.mean(), 0.05, 0.95) t11 = np.clip(((X * Hm) @ q + 1) / (Hm @ q + 2), 0.02, 0.98) # P(says wall | wall) t00 = np.clip((((1 - X) * Hm) @ (1 - q) + 1) / (Hm @ (1 - q) + 2), 0.02, 0.98) # P(says free | free) ll = (np.log(pi / (1 - pi)) + (Hm * (X * np.log(t11 / (1 - t00))[:, None] + (1 - X) * np.log((1 - t11) / t00)[:, None])).sum(0)) q = 1 / (1 + np.exp(-np.clip(ll, -30, 30))) score = np.zeros(own.shape) score[m] = np.clip(ll, -30, 30) return score
def _acc_weights(own, claims, i, method, byz): """One weight per peer (majority / reputation / oracle).""" n = len(claims) lam = np.zeros(n) for j in range(n): if j == i: continue if method == "REF oracle": lam[j] = 0.0 if byz[j] else 2.0 elif method == "majority": lam[j] = 1.0 else: # beta reputation: verified accuracy, discard-only both = (own >= 0) & (claims[j] >= 0) a = int(np.sum(own[both] == claims[j][both])) acc = (a + 1.2) / (int(both.sum()) + 2.0) # Beta prior: an unverified peer is mildly trusted lam[j] = max(float(np.log(acc / (1 - acc))), 0.0) return lam
# Channel prior: a peer's two-coin channel (t00 = P(says free | free), t11 = P(says wall | wall)) lies on a# 7x7 grid; 60% prior mass on the honest type, the rest uniform. No attack-specific types._LEV = np.array([0.03, 0.2, 0.4, 0.5, 0.6, 0.8, 0.97])_T00, _T11 = [x.ravel() for x in np.meshgrid(_LEV, _LEV, indexing="ij")]_LOGPRIOR = np.log(np.where((_T00 == 0.97) & (_T11 == 0.97), 0.6, 0.4 / (len(_T00) - 1)))
def _posterior(n): """n[truth][claim] verified counts -> (posterior over channel types, log marginal likelihood).""" ll = (_LOGPRIOR + n[0, 0] * np.log(_T00) + n[0, 1] * np.log1p(-_T00) + n[1, 1] * np.log(_T11) + n[1, 0] * np.log1p(-_T11)) m = ll.max() w = np.exp(ll - m) return w / w.sum(), m + np.log(w.sum())
def _llr(w): """Bayes-averaged evidence of a claim: [llr(claim free), llr(claim wall)] = log P(c | wall) / P(c | free).""" p1w, p1f = float(w @ _T11), float(w @ (1 - _T00)) return np.array([np.log((1 - p1w) / (1 - p1f)), np.log(p1w / p1f)])
def _counts(own, claim, mask): n = np.zeros((2, 2)) if mask.any(): np.add.at(n, (own[mask], claim[mask]), 1.0) return n
def _race_score(own, claims, stamp, i, t, window): """Receiver-anchored channel estimation on a map. For every peer, the receiver compares the peer's broadcasts with the cells it sensed ITSELF (its anchor) and infers the peer's two-coin channel by Bayesian model averaging. Each claim then enters as a signed log-likelihood ratio: an inverter's claims are flipped and used, a wall-inventor keeps only the weight of its 'free' claims, a random peer averages out to zero evidence. Sleepers: if a Bayes-factor test says the recent `window` steps follow a different channel than the past, the two epochs are scored with separate channels.""" score = np.zeros(own.shape) seen = own >= 0 for j in range(len(claims)): if j == i: continue has = claims[j] >= 0 rec = has & (stamp[j] >= t - window) old = has & ~rec n_rec, n_old = _counts(own, claims[j], rec & seen), _counts(own, claims[j], old & seen) w_all, m_all = _posterior(n_rec + n_old) w_rec, m_rec = _posterior(n_rec) w_old, m_old = _posterior(n_old) if m_rec + m_old - m_all > 3.0: # log Bayes factor for "the channel changed" score[rec] += _llr(w_rec)[claims[j][rec]] score[old] += _llr(w_old)[claims[j][old]] else: score[has] += _llr(w_all)[claims[j][has]] return score
def wall_logodds(own, claims, stamp, i, method, byz, t=0, window=30): """Per-cell log-odds that a cell is a wall, from the peers' broadcasts (methods that produce evidence).""" if method == "race_map": return _race_score(own, claims, stamp, i, t, window) if method == "race_net_m": from robotics.swarm import racenet_m return racenet_m.wall_logodds(own, claims, stamp, i, t, window) raise ValueError(method)
def scores(own, claims, stamp, i, method, byz, t=0, window=30): """(per-cell evidence that the cell is a wall, threshold) for every fusion rule except solo / trust_all.""" n = len(claims) vote = (claims == 1).astype(float) - (claims == 0).astype(float) if method in ("race_map", "race_net_m"): return wall_logodds(own, claims, stamp, i, method, byz, t, window), (RACE_TAU if method == "race_map" else NET_TAU) if method == "wmsr_trim": # W-MSR-style trimming (LeBlanc et al. 2013) per cell: drop up to F 'wall' and up to F 'free' votes F = int(byz.sum()) # the number of Byzantine robots is assumed known peers = np.arange(n) != i nw, nf = (claims[peers] == 1).sum(0), (claims[peers] == 0).sum(0) return np.maximum(nw - F, 0) - np.maximum(nf - F, 0).astype(float), 0.4 if method == "eigentrust": return np.tensordot(_eigentrust(own, claims, i), vote, 1), 0.4 if method == "dawid_skene": return _dawid_skene(own, claims, i), RACE_TAU return np.tensordot(_acc_weights(own, claims, i, method, byz), vote, 1), 0.4
def belief(own, claims, stamp, i, method, byz, t=0, window=30, return_score=False): """Receiver i's map: -1 unknown, 0 free, 1 wall. Planning is optimistic (anything not believed 'wall' is traversable), so only the wall threshold matters; race scores are log-likelihood ratios and need posterior odds of about 3:1 before a cell is blocked.""" if method == "solo": return (own, None) if return_score else own n = len(claims) if method == "trust_all": st = np.where(np.arange(n)[:, None, None] == i, -1, stamp) j = st.argmax(0) B = np.take_along_axis(claims, j[None], 0)[0] B = np.where(st.max(0) >= 0, B, -1) score = None else: score, tau = scores(own, claims, stamp, i, method, byz, t, window) B = np.where(score > tau, 1, np.where(score < -tau, 0, -1)).astype(np.int8) B = np.where(own >= 0, own, B) return (B, score) if return_score else B
def repair_field(own, B, goal, start, layers=None): """Distance-to-goal on the fused map after un-believing the claimed walls that enclose the goal (never walls the robot sensed itself). Returns None if the robot is still disconnected after `layers` rounds.""" B = B.copy() for _ in range(REPAIR_LAYERS if layers is None else layers): d = bfs(B != 1, goal) if d[start] >= 0: return d comp = d >= 0 edge = np.zeros_like(comp) edge[1:, :] |= comp[:-1, :] edge[:-1, :] |= comp[1:, :] edge[:, 1:] |= comp[:, :-1] edge[:, :-1] |= comp[:, 1:] peel = edge & (B == 1) & (own != 1) if not peel.any(): return None B[peel] = -1 d = bfs(B != 1, goal) return d if d[start] >= 0 else None
def episode(seed, attack="none", F=0, method="race_map", n=6, w=12, h=12, trace=None, sleeper_T=40, channels=None, snaps=None, snap_p=0.0): """channels: optional {robot: (t00, t11, t_change)} parametric two-coin liars (used to train RACE-Net-M; then `attack` is ignored for those robots). snaps: list that receives (own, claims, stamp, i, t) snapshots.""" mv = method.endswith(MV) fuse = method.replace(MV, "") rng = np.random.default_rng(seed) srng = np.random.default_rng(seed + 7_000_003) if snaps is not None else None G = make_maze(w, h, seed=seed) H, W = G.shape free_cells = np.argwhere(G == 0) goal = tuple(free_cells[rng.integers(len(free_cells))]) dgoal = bfs(G == 0, goal) far = free_cells[dgoal[free_cells[:, 0], free_cells[:, 1]] >= np.percentile(dgoal[G == 0], 55)] pos = [tuple(far[k]) for k in rng.choice(len(far), n, replace=False)] byz = np.zeros(n, bool) byz[rng.choice(n, F, replace=False)] = True if channels is not None: byz[:] = False byz[list(channels)] = True opt = np.array([dgoal[p] for p in pos]) budget = (2.5 * opt + 10).astype(int) # per-robot deadline: 2.5x its optimal path + 10 steps T = int(budget.max()) own = np.full((n, H, W), -1, np.int8) # each robot's direct observations claims = np.full((n, H, W), -1, np.int8) # latest broadcast of each robot about each cell stamp = np.full((n, H, W), -1, np.int32) steps = np.zeros(n, int) done = np.zeros(n, bool) wander = [None] * n ring = [(goal[0] + dr, goal[1] + dc) for dr, dc in NB4 if G[goal[0] + dr, goal[1] + dc] == 0] for t in range(T): # ---- sense + broadcast for i in range(n): for dr, dc in NB8: r, c = pos[i][0] + dr, pos[i][1] + dc v = G[r, c] own[i, r, c] = v say = v if byz[i] and channels is not None: t00, t11, t_change = channels[i] if t >= t_change and rng.random() > (t11 if v == 1 else t00): say = 1 - v elif byz[i]: a = attack if a == "sleeper": a = "none" if t < sleeper_T else "invert" if a == "invert": say = 1 - v elif a == "false_walls" and v == 0 and rng.random() < 0.6: say = 1 elif a == "false_free" and v == 1 and rng.random() < 0.6: say = 0 elif a == "random": say = int(rng.integers(2)) claims[i, r, c] = say stamp[i, r, c] = t if byz[i] and attack == "collude": # the bloc walls off the goal, consistently and every step for r, c in ring: claims[i, r, c] = 1 stamp[i, r, c] = t # ---- move beliefs = {} for i in range(n): if byz[i]: # liars keep exploring (random reachable targets) if wander[i] is None or pos[i] == wander[i]: wander[i] = tuple(free_cells[rng.integers(len(free_cells))]) d = bfs(G == 0, wander[i]) else: if done[i] or steps[i] >= budget[i]: continue if snaps is not None and srng.random() < snap_p: snaps.append((own[i].copy(), claims.copy(), stamp.copy(), i, t)) B, score = belief(own[i], claims, stamp, i, fuse, byz, t, return_score=True) beliefs[i] = B d = bfs(B != 1, goal) if d[pos[i]] < 0: # the fused map says the goal is unreachable d = repair_field(own[i], B, goal, pos[i]) if mv else None if d is None: # standard: fall back to the robot's own observations d = bfs(own[i] != 1, goal) r, c = pos[i] best = min(((d[r + dr, c + dc], (r + dr, c + dc)) for dr, dc in NB4 if G[r + dr, c + dc] == 0 and d[r + dr, c + dc] >= 0), default=None) if best is not None and best[0] < d[r, c] or (best is not None and d[r, c] < 0): pos[i] = best[1] if not byz[i]: steps[i] += 1 elif not byz[i]: steps[i] += 1 # waiting also costs time if not byz[i] and pos[i] == goal: done[i] = True if trace is not None: trace.append({"pos": list(pos), "done": done.copy(), "beliefs": {k: v.copy() for k, v in beliefs.items()}}) if (done | (steps >= budget))[~byz].all(): break honest = ~byz spl = np.where(done, opt / np.maximum(steps, np.maximum(opt, 1)), 0.0)[honest] return {"spl": float(spl.mean()), "success": float(done[honest].mean()), "ratio": float(np.mean((steps / np.maximum(opt, 1))[honest & done])) if (honest & done).any() else float("nan"), "G": G, "goal": goal, "byz": byz}
def _cell(args): seed, attack, F, method = args r = episode(seed, attack, F, method) return {"track": "D", "attack": attack, "liars": F, "f": round(F / 6, 2), "subset": seed, "method": method, "acc": r["spl"], "success": r["success"], "ratio": r["ratio"]}
def available_methods(): from robotics.swarm import racenet_m return tuple(m for m in METHODS_D if "race_net_m" not in m or racenet_m.available())
def run(n_mazes=20, Fs=(1, 2, 3, 4), attacks=ATTACKS_D, procs=2, only=None, first_seed=1000): """only: optional set of method names (cells are deterministic, so new methods can be added to saved rows).""" jobs = [(first_seed + s, a, F, m) for a in attacks for F in ((0,) if a == "none" else Fs) for s in range(n_mazes) for m in available_methods() if only is None or m in only] if procs > 1: from multiprocessing import Pool with Pool(procs) as p: return p.map(_cell, jobs, chunksize=8) return [_cell(j) for j in jobs]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140#!/usr/bin/env python3"""Train RACE-Net-M (map fusion) on simulated maze swarms with random two-coin liars (CPU, ~20 min).
python scripts/train_racenet_m.py [--episodes 2400] [--steps 4000] [--procs 3]Training mazes use seeds 5000+, validation 9000+; the benchmark uses seeds 1000-1019 and tuning uses 0-39.Liars follow random two-coin channels with an optional change point (`racenet_m.sample_channels`): thebenchmark's attack names are never used, and the colluding ring attack is outside that family.Writes models/racenet_m/{model.safetensors, config.json, training_log.json}."""import argparseimport jsonimport sysimport timefrom multiprocessing import Poolfrom pathlib import Path
import numpy as npimport torch
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))from robotics.bench import trackD # noqa: E402from robotics.swarm import racenet_m # noqa: E402
NAV = ("solo", "race_map", "trust_all") # how honest robots move while data is collected
def _episode(seed): rng = np.random.default_rng(seed) snaps = [] ch = racenet_m.sample_channels(rng) r = trackD.episode(seed, "none", 0, NAV[seed % len(NAV)], channels=ch, snaps=snaps, snap_p=0.06) out = [] for own, claims, stamp, i, t in snaps: c, e, o = racenet_m.tensors(own, claims, stamp, i, t) base = trackD._race_score(own, claims, stamp, i, t, 30).reshape(-1) # the hand-written BMA, for reference out.append((c, e, o, r["G"].reshape(-1).astype(np.int8), len(ch), base.astype(np.float32))) return out
def collect(seeds, procs): with Pool(procs) as p: eps = p.map(_episode, seeds, chunksize=8) S = [s for ep in eps for s in ep] return {"c": np.stack([s[0] for s in S]), "e": np.stack([s[1] for s in S]), "o": np.stack([s[2] for s in S]), "y": np.stack([s[3] for s in S]), "F": np.array([s[4] for s in S]), "base": np.stack([s[5] for s in S])}
def evaluate(net, D, bs=256): """Accuracy on cells that somebody reported and the receiver has not sensed, by number of liars.""" net.eval() hit_n, hit_b, tot, byF = 0.0, 0.0, 0.0, {} with torch.inference_mode(): for k in range(0, len(D["o"]), bs): c, e, o, y = (torch.from_numpy(D[x][k:k + bs]).long() for x in ("c", "e", "o", "y")) m = ((c >= 0).any(1) & (o < 0)).float() pn = (net(c, e, o) > 0).long() pb = (torch.from_numpy(D["base"][k:k + bs]) > 0).long() for f in np.unique(D["F"][k:k + bs]): sel = torch.from_numpy(D["F"][k:k + bs] == f) a = byF.setdefault(int(f), [0.0, 0.0, 0.0]) a[0] += float(((pn == y).float() * m)[sel].sum()); a[1] += float(((pb == y).float() * m)[sel].sum()); a[2] += float(m[sel].sum()) hit_n += float(((pn == y).float() * m).sum()); hit_b += float(((pb == y).float() * m).sum()); tot += float(m.sum()) net.train() return hit_n / tot, hit_b / tot, {f: (round(a[0] / a[2], 4), round(a[1] / a[2], 4)) for f, a in sorted(byF.items()) if a[2]}
def main(): ap = argparse.ArgumentParser() ap.add_argument("--episodes", type=int, default=2400) ap.add_argument("--steps", type=int, default=4000) ap.add_argument("--batch", type=int, default=48) ap.add_argument("--lr", type=float, default=2e-3) ap.add_argument("--procs", type=int, default=3) ap.add_argument("--threads", type=int, default=3) ap.add_argument("--seed", type=int, default=0) ap.add_argument("--rounds", type=int, default=racenet_m.CONFIG["rounds"]) ap.add_argument("--cache", default="data/racenet_m") ap.add_argument("--out", default="models/racenet_m") a = ap.parse_args() cache = Path(a.cache) cache.mkdir(parents=True, exist_ok=True) t0 = time.time() data = {} for name, seeds in (("train", range(5000, 5000 + a.episodes)), ("val", range(9000, 9000 + max(a.episodes // 8, 60)))): f = cache / f"{name}_{len(seeds)}.npz" if not f.exists(): np.savez_compressed(f, **collect(list(seeds), a.procs)) data[name] = dict(np.load(f)) print(name, "snapshots", len(data[name]["o"]), f"[{time.time() - t0:.0f}s]", flush=True) torch.set_num_threads(a.threads) torch.manual_seed(a.seed) rng = np.random.default_rng(a.seed) arch = {**racenet_m.CONFIG, "rounds": a.rounds} net = racenet_m.RaceNetM(**arch) n_params = sum(p.numel() for p in net.parameters()) opt = torch.optim.AdamW(net.parameters(), lr=a.lr, weight_decay=0.01) sched = torch.optim.lr_scheduler.OneCycleLR(opt, max_lr=a.lr, total_steps=a.steps, pct_start=0.05) D, n = data["train"], len(data["train"]["o"]) log, run = [], 0.0 for step in range(1, a.steps + 1): k = rng.choice(n, a.batch, replace=False) c, e, o, y = (torch.from_numpy(D[x][k]).long() for x in ("c", "e", "o", "y")) P = c.shape[1] perm = torch.from_numpy(rng.permutation(P)) c, e = c[:, perm], e[:, perm] if rng.random() < 0.3: # smaller swarms: drop one or two peers keep = P - int(rng.integers(1, 3)) c, e = c[:, :keep], e[:, :keep] m = ((c >= 0).any(1) & (o < 0)).float() outs = net(c, e, o, return_all=True) loss = sum((torch.nn.functional.binary_cross_entropy_with_logits(lg, y.float(), reduction="none") * m).sum() / m.sum().clamp(min=1) for lg in outs) / len(outs) opt.zero_grad() loss.backward() torch.nn.utils.clip_grad_norm_(net.parameters(), 1.0) opt.step() sched.step() run = 0.98 * run + 0.02 * loss.item() if step > 1 else loss.item() if step % 500 == 0 or step == a.steps: acc, base, byF = evaluate(net, data["val"]) log.append({"step": step, "train_bce": round(run, 4), "val_cell_acc": round(acc, 4), "val_cell_acc_bma": round(base, 4), "val_by_liars(net, bma)": byF, "minutes": round((time.time() - t0) / 60, 1)}) print(log[-1], flush=True) out = Path(a.out) out.mkdir(parents=True, exist_ok=True) from safetensors.torch import save_file save_file(net.state_dict(), str(out / "model.safetensors")) (out / "config.json").write_text(json.dumps({ **arch, "n_params": n_params, "architecture": "RaceNetM (anchored channel encoder + peer transformer + signed read-out, iterative)", "input": "peer claims [P peers, N cells] in {none, free, wall} with a recent/old flag, and the receiver's own sensed cells", "output": "log-odds of 'wall' per cell", "training": {"data": "maze swarms with random two-coin liars and change points (racenet_m.sample_channels)", "train_seeds": [5000, 5000 + a.episodes - 1], "val_seeds_from": 9000, "snapshots": int(n), "steps": a.steps, "batch": a.batch, "lr": a.lr, "seed": a.seed}}, indent=1)) (out / "training_log.json").write_text(json.dumps(log, indent=1)) print("saved", out, "params", n_params)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266[ { "step": 500, "train_bce": 0.1853, "val_cell_acc": 0.9152, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9998, 1.0 ], "1": [ 0.9479, 0.9398 ], "2": [ 0.89, 0.8725 ], "3": [ 0.8581, 0.8269 ], "4": [ 0.8223, 0.7985 ], "5": [ 0.7564, 0.7293 ] }, "minutes": 6.6 }, { "step": 1000, "train_bce": 0.1843, "val_cell_acc": 0.9192, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9998, 1.0 ], "1": [ 0.9514, 0.9398 ], "2": [ 0.8961, 0.8725 ], "3": [ 0.8624, 0.8269 ], "4": [ 0.8309, 0.7985 ], "5": [ 0.7679, 0.7293 ] }, "minutes": 6.8 }, { "step": 1500, "train_bce": 0.1734, "val_cell_acc": 0.9192, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9999, 1.0 ], "1": [ 0.9505, 0.9398 ], "2": [ 0.8942, 0.8725 ], "3": [ 0.8644, 0.8269 ], "4": [ 0.8326, 0.7985 ], "5": [ 0.7696, 0.7293 ] }, "minutes": 7.0 }, { "step": 2000, "train_bce": 0.1706, "val_cell_acc": 0.9213, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9998, 1.0 ], "1": [ 0.9521, 0.9398 ], "2": [ 0.9002, 0.8725 ], "3": [ 0.865, 0.8269 ], "4": [ 0.8362, 0.7985 ], "5": [ 0.772, 0.7293 ] }, "minutes": 7.2 }, { "step": 2500, "train_bce": 0.1735, "val_cell_acc": 0.9217, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9996, 1.0 ], "1": [ 0.953, 0.9398 ], "2": [ 0.905, 0.8725 ], "3": [ 0.8632, 0.8269 ], "4": [ 0.835, 0.7985 ], "5": [ 0.7652, 0.7293 ] }, "minutes": 7.4 }, { "step": 3000, "train_bce": 0.1673, "val_cell_acc": 0.9223, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9996, 1.0 ], "1": [ 0.9532, 0.9398 ], "2": [ 0.9008, 0.8725 ], "3": [ 0.8667, 0.8269 ], "4": [ 0.8388, 0.7985 ], "5": [ 0.7751, 0.7293 ] }, "minutes": 7.6 }, { "step": 3500, "train_bce": 0.1686, "val_cell_acc": 0.9229, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9997, 1.0 ], "1": [ 0.9539, 0.9398 ], "2": [ 0.9029, 0.8725 ], "3": [ 0.8668, 0.8269 ], "4": [ 0.8396, 0.7985 ], "5": [ 0.7743, 0.7293 ] }, "minutes": 7.8 }, { "step": 4000, "train_bce": 0.1662, "val_cell_acc": 0.9233, "val_cell_acc_bma": 0.9014, "val_by_liars(net, bma)": { "0": [ 0.9998, 1.0 ], "1": [ 0.9542, 0.9398 ], "2": [ 0.9035, 0.8725 ], "3": [ 0.8673, 0.8269 ], "4": [ 0.839, 0.7985 ], "5": [ 0.7762, 0.7293 ] }, "minutes": 8.0 }].gitattributes+2
README.mdAdded+103
ablation.jsonAdded+129
config.jsonAdded+23
model.safetensorsAdded+3
racenet_m.pyAdded+144
racenet_m_architecture.pngAdded

Large File Pointer Details
- SHA256: 98f6c6b8660f0f84608ac2c1804cbada36389e7d2599ad2fd77622109ee9d3f2
- Pointer size: 131 Bytes
- Size of remote file: 464 kB
trackD.pyAdded+414
trackD_vs_liars.pngAdded

Large File Pointer Details
- SHA256: dd3b42f8c06459ce0f752879e59b55d52dd3a62b3169b4e179c5fec8388471f5
- Pointer size: 131 Bytes
- Size of remote file: 149 kB
train_racenet_m.pyAdded+140
training_log.jsonAdded+266