Doomformer将整数神经网络编译成ZDoom地图,并在ViZDoom中运行。 巫术娃娃(复制品)
DOOM 产卵给额外玩家-1启动的玩家)进行算术,扇区光度和平面高度保持
金额。 Python从正在运行的游戏中读回每一个曝光值,并将其与一个NumPy整数引用,容忍度0.
一个值一个值,运行失败。 速度慢:在小型MLP上比NumPy慢约23 000倍(引擎时间;65 000)
一个手写数字需要163秒的实时 DOOM 在地图上
默认时间表和8秒的 --opt 3
· 安装证据 · 如何工作 · 电影 · 文档
pip安装 git+https://github.com/mottopanikeiku/doomformer# Python 3.11+,Linux或macOS
#2s:一个小的 MLP,每个值检查
末日画图 -- -- 数字 7 # 15 s:海军陆战队行走 7,水平读它
末日医生检查 ViZDoom, Freedoom 和显示器,如果缺失则建立 ACC,并编译 ACS 探测器
在报告成功之前。 第一个构建需要git,cmake,一个C编译器和github.com的网络访问。
Linux使用动态运行时间:不需要glibc-static. 在 Fedora 上:sudo dnf 安装 git cmake gcc-ccc++ 制造。
Colab 笔记本
不需要设置,但你画的浏览器是 canvas 和末日前的 mnist —— 图像输入到 DOOM,没有海洋。
持有FIRE,海军陆战队的墨水 3×3刷子的地板细胞在他下面。 READ 使关卡将784像素写入
和1355个巫术娃娃在同一地图中计算用-数字,Python代表你:它按下
{\fn华文楷体\fs16\1cHE0E0E0}然后只推进时钟和读数
▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄████████████████
████▀▀ ▀████▀
▀▀▀ ▄███▀
████
███
███
███
████
███▀
████
▀███
DOOM写道:7(右)——胜者娃娃在7区展示上点燃。
EXACT: DOOM计算的所有248个值[.]等于NumPy整数参考值(容忍度0)
READ通过:273 游戏tics = 8 s of 实时 DOOM 在35 tics/s, 3 s wall [.]
缩写为[...];docs/commands.md拥有全部输出。 绘图构建其
使用 --opt 3 的映射图,所以 READ 需要 273 游戏 tics;在 --opt 0 时,原始调度需要 5 705 个( 实时 163 s)
(原始内容存档于2017-09-29). DOM. 没有数字,命令打开一个窗口,你就走动并绘制自己;然后DOOM实时运行。
玩偶计算出784像素64个隐藏单位45对比得分比较10胜数。 只有赢得其所有9个比较的位数才能得到一个玩偶通过,而玩偶交叉的线开始显示时点亮位数的关卡脚本。 Python读回了784像素,隐藏的图层,每次比较以及答案和检查全部248个值(119个值,每个值读取其否定的双子,加上10个输出).
EXACT表示DOM等于整数网络。 称没有关于数字是否正确的问题。 在第一次100 MNIST测试
DOOM读数正确99,从所有10 000个样本中抽取966个样本;每个结果都是准确的。 整数网络
在所有10,000人中得分97.16%(浮标模式得分97.58%)。 30个行走数字(0到9,3个脚本中风)
在 --opt 3 上,网络还接受了中风分布培训:
这个演示的第一个版本,一个784-32-10的网络训练仅关于MNIST,只读41.08%的这种中风。 通过真实的X
关键事件 a raw 7 读取在默认情况下的精确度 -- opt 3; a 7 和 a 1 尝试在 -- opt 0 上使用更早的网络。
细节电影
末日博物馆的建筑写着Museum.wad,一个没有Python就可以玩的地图。 你踩到七层楼的地板上
数字按读取码。 136个巫术娃娃计算出一个手写的小字
网络:每个数字的分数计算出与其一致的片段,胜者娃娃点亮显示。 马塔特
在运行的级别内重新连接网络中的一个连接:段 到数字 7 通过更改从 + 1 到 - 1。
它的两条重量线的特长同样的7,然后读为1, RESTORE把它放回去。 HUD和一个记分牌
显示每个 READ 之后的 10 个分数,和一个相机站显示数字 7 的第六个分数玩偶:它通过它的门之前
MUTATE,然后停在它的前面之后。
末日博物馆核实
7 pads abc w 7a + 1 DOOM 读取 7 分 [4, 6, 3, 5, 4, 3, 2, 7, 3, 4] EXACT (148 值;744 tics; [.])
在MUTATE 垫片 abc w 7a-1 DOOM 之后的 7 读取 1 分 [4, 6, 3, 5, 4, 3, 2, 5, 3, 4] EXACT (148 值;744 tics; [.])
在 RESTORE 垫片 abc w 7a + 1 DOOM 之后的 7 读取 7 分 [4, 6, 3, 5, 4, 3, 3, 2, 7, 3, 4] EXACT (148 值;744 tics; [.])
Python在这里演奏:它按着海军陆战队的钥匙和USE,在每一次读取时,它只读取,有警戒读取。 它将所有148个值与网络的NumPy参考值进行比较,因为它当时是wired. 不运行DOOM,静态提取器也显示,即重联地图的网单是完全有一个重量变化的网络。 我只在维兹杜姆管理整个地图其自试地图读数为0至9,然后是MUTATE和RESTORE之后的7,没有玩家。 在GitHub跑道上,它记录了GZDoom 4.1.4.2、LZDoom 3.88b、UZDoom 5.0.3和ZDoom 2.8.1中的确切值,仅在每个扇区标记低于32 768时才记录Zandronum 3.2.1中的确切值。 细节
Python 从运行的游戏中读取扇区光度和地板及天花板高度,并将每个光度与一个光度比较
独立的 NumPy 整数执行同一网络。 检查是整数平等相对于运行
称没有关于未运行的输入。 测试攻击它:在小编译中提升一个重量线
从 5 到 6 的映射必须在 5 到 6 的玩偶越过 5 到 6 的输入上以 + 1 准确失败。
Python 所写值必须失败(pytest test/ test tamper.py, 3个测试,约 15 s).
Readback被默认守护:在每页前,Python毒药并检查其USER槽,然后要求
页面替换它们。 丢弃一个页面不能默默地重用重复输入的答案或上一页的值。
guard=False是一个明确的一幅图历史选择退出。 守卫建筑有新的散列(ACS和元数据,没有)
几何或算术;散列记录解释变化。
末日模糊 -- -- 40网比较了DOOM(306次通过、0次不匹配、约10秒)运行的40个随机网的每个值。
--works 2;找到一个已安装的编译器错误). 模糊 -- -- 网点将权重、偏差和投入置于幅度限度:15 000个蚊帐
超过10个新鲜种子,在-0点,在-3点,作为瓷砖地图,有113 605次通过,并将1 987 632个值与
没有不匹配(范围检查拒绝了47 686项输入,约占30%),在发电机拓宽后再增加3 000项
飞机从以下界限附近开始(22 682次通过),另外2 000次也从15 000次到16 000次(14 782次)
通过了,没有不匹配。 早期的竞选活动有2 000个随机的MLP
(15 374个通过,276 594个值),300个刺网和100个随机变压器,覆盖所有8个注意力、规范和MLP变体
(99个运行;一个全零矩阵不支持),在安排修正后;200个尖顶网,12 794个通过
没有不匹配。 模糊- 尖端不绘制变压器。 CI 绒网 60
每推一次都要有新鲜的印刷种子每周一还要有更长的竞选时间模糊和独立的运行找到了四个
这repo自己的地图的断层:两个调度错误和两个平面限制。 超过14 018的飞机动作
零的单位让移动器忙着做3个计数器然后在飞机上放下下一个请求和开始的飞机
16 000以上在第一个通行证上是准确的,在后面的通行证上是错误的,因此,DOOM不同意在蚊帐上提及
网友接受检查检查和编译现在拒绝它们:飞机从内部开始[15 000,16 000]并在内部移动
±14,018(户口验证-飞机扫瞄,docs/核查.md).
末日者核查一个小型MLP的每一个输入类(这些类别与20个蚊帐中的20个的每个输入类一致,在一个
假设在同一页中说明)。 df. 覆盖值计算比较值:在MNIST上,所有248个暴露值,即
129值参考定义和119对双胞胎,当一个读出名称被丢弃时计数下降。 地图没有
披露903个楼梯和1 351个门对同一个网的比较;通过它们提供的数量加以检查。
末日者验证 - extract net.wad - net net.npz 从编译的地图中读回网,而不启动 DOOM 和
将每个重量、偏差和阈值与源网进行比较:运回的MNIST网(784-64-45-10-10)相等
仅从地图上的 -- opt 0 至 3,490个随机渔网中的484个也是如此。
(b) 飞机合同)和199飞机中的199飞机,每架1至3飞机。 EQUAL包括算术网名单、飞机合同
触发和重复标记、 移动器速度、 重设脚本和读出页;计时和几何打印为 NOT
检查。 显示的重量变化正好就是这个重量在23,622个单一编辑器中,有23,622个编辑器在 --opt 0 the
提取器探测到17,906,DOOM运行于12个输入的98个未被发现的编辑器都是精确的。 它的显示什么是
称地图;DOOM按读时运行的地图就是精确度检查测试。
变形带改变地图的一条线:在1 004个运行的站点(5 578个站点中)中,297个站点被杀死,所有重量,标志
和他们中的目标阶级。 在707名幸存者中,590人符合规则(一个多余的卷轴,一个冻结线,一个前传)
(b) 117个是输入缺口(只有部分输入暴露的行走地板);
证明是等同的。 末日前 lint -- fuzz 比较静态
在5,397张地图上与DOOM进行调度检查:0假底片。 方法是翻译验证(Pnueli、Siegel和
Singerman, 1998):每个编译器的测试,而不是编译器是正确的证明。
谁做什么:
- 玩偶们做每一个乘积,激活和比较。 ACS 级别脚本地址单元格,移动输入门,倒带
玩偶们,感受世界复制结果出来。 网络的算术都没有在ACS运行。 这个工具箱
df.Agent是一个例外:它在ACS(docs/agents.md)中取其矩形。
- mnist:Python写784像素端口,决定玩偶何时停止;玩偶选择数字。
- 演示和问:Python写着符号标识,并决定玩偶何时停止,对每个字母进行抽样
对数 DOM 计算,当一个模型被切成多个地图时,复制整数从一个游戏到下一个游戏。 演示 -- 1- 映射是一个图,层间没有 Python; Python 在每封信之后写下符号和样本
通过。
- 绘图和他的大脑是关卡:Python只推进时钟并运行读取脚本(在绘图中,从READ上).
关卡提供输入(784像素,感应符),玩偶选择数字或动作。
- demo - one-map - loop: Python 只推进时钟并运行读取脚本。 玩偶们每封信都挑一写
它进入下一个位置。
- 苍蝇循环:Python只推进时钟并运行读出脚本,在它所写的单独游戏上校准了步骤期后。 关卡画出输入尖顶,输出尖顶点燃推力线。
- --opt 3( 绘图的默认值;其他 --opt 0,带防守的原始时间表): ACS 脚本副本
每一层的光度进入下一层的门高。 它新增和比无,玩偶仍然做
总和,阈值,比较和选择,但"层间无ACS"只持有-opt 0至2.
- 末日机器:娃娃运行程序计数器和登记器。 默认循环、倒带和停止
检查是ACS脚本,存储的程序由主机在第一个tic之前加载。 用 -- cours 玩偶循环
玩偶和线条特殊功能重新启动,倒带和停止关卡,ACS只读取玩偶拥有的值和检查
已停止(文件/机器.md)。
- 学习数字:Python 写每个考试的像素和标签
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Doomformer compiles integer neural networks into ZDoom maps and runs them in ViZDoom. Voodoo dolls (the copies of the
player that DOOM spawns for extra player-1 starts) do the arithmetic, and sector light levels and plane heights hold the
sums. Python reads every exposed value back from the running game and compares it with a NumPy integer reference, tolerance 0.
One value off by one and the run fails. It is slow: about 23,000 times slower than NumPy on a small MLP (engine time; 65,000
times with a timer around the whole call), and a handwritten digit takes 163 seconds of real-time DOOM in one map at the
default schedule and 8 seconds at --opt 3.
Install · Proof · How it works · Films · Docs
pip install git+https://github.com/mottopanikeiku/doomformer # Python 3.11+, Linux or macOS
doomformer hello # 2 s: a small MLP, every value checked
doomformer draw --digit 7 # 15 s: the marine walks a 7 and the level reads it
doomformer doctor checks ViZDoom, Freedoom and the display, builds ACC if it is absent, and compiles an ACS probe
before reporting success. The first build needs git, cmake, a C compiler and network access to github.com.
Linux uses dynamic runtimes: glibc-static is not required. On Fedora: sudo dnf install git cmake gcc gcc-c++ make.
The Colab notebook
needs no setup, but you draw on a browser canvas and doomformer mnist --image feeds it to DOOM, with no marine.
Holding FIRE, the marine inks a 3×3 brush of floor cells under him. READ makes the level write the 784 pixels into the
network, and 1,355 voodoo dolls in the same map compute it. With --digit, Python stands in for you: it presses the
marine's keys and USE once, then only advances the clock and reads.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄████████████████
████▀▀ ▀████▀
▀▀▀ ▄███▀
████
███
███
███
████
███▀
████
▀███
DOOM reads: 7 (right) -- the winner's doll lit it on the 7-segment display
EXACT: all 248 values DOOM computed [...] equal the NumPy integer reference (tolerance 0)
READ pass: 273 game tics = 8 s of real-time DOOM at 35 tics/s, 3 s wall [...]
Abridged at [...]; docs/commands.md has the whole output. draw builds its
map with --opt 3, so a READ takes 273 game tics; at --opt 0, the original schedule, it takes 5,705 (163 s of real-time
DOOM). Without --digit the command opens a window and you walk and draw yourself; DOOM then runs in real time.
The dolls compute 784 pixels → 64 hidden units → 45 pairwise score comparisons → 10 win counts. Only the digit that wins all nine of its comparisons gets a doll through, and the line that doll crosses starts the level script that lights the digit on the display. Python reads back the 784 pixels, the hidden layer, every comparison and the answer and checks all 248 values (119 values, each read with its negated twin, plus 10 outputs).
EXACT means DOOM equals the integer network. It says nothing about whether the digit is right. On the first 100 MNIST test
digits DOOM reads 99 correctly, and 966 of 1,000 sampled from all 10,000; every result is exact. The integer network
scores 97.16 % on all 10,000 (the float model scores 97.58 %). The 30 walked digits (0 to 9, three scripted stroke
variants each) all read correctly and exact at --opt 3, and the network is also trained on that stroke distribution: the
first version of this demo, a 784-32-10 network trained on MNIST alone, reads only 41.08 % of such strokes. Through real X
key events a drawn 7 read exact at the default --opt 3; a 7 and a 1 were tried at --opt 0 with an earlier network.
Details · film
doomformer museum build writes museum.wad, a map you can play without Python. You step on seven floor pads to light
a digit and press READ. 136 voodoo dolls compute a small hand-written
network: each digit's score counts the segments that agree with it, and the winner's doll lights the display. MUTATE
rewires one connection of that network inside the running level: segment a to digit 7 goes from +1 to -1, by changing
the specials of its two weight lines. The same 7 then reads as 1, and RESTORE puts it back. The HUD and a scoreboard
show the ten scores after each READ, and a camera station shows digit 7's sixth score doll: it passes its gate before
MUTATE and stops in front of it after.
$ doomformer museum verify
7 pads abc w_7a +1 DOOM reads 7 scores [4, 6, 3, 5, 4, 3, 2, 7, 3, 4] EXACT (148 values; 744 tics; [...])
7 after MUTATE pads abc w_7a -1 DOOM reads 1 scores [4, 6, 3, 5, 4, 3, 2, 5, 3, 4] EXACT (148 values; 744 tics; [...])
7 after RESTORE pads abc w_7a +1 DOOM reads 7 scores [4, 6, 3, 5, 4, 3, 2, 7, 3, 4] EXACT (148 values; 744 tics; [...])
Here Python plays: it presses the marine's keys and USE, and during each READ it only reads, with guarded readouts. It compares all 148 values with the NumPy reference of the network as it is wired at that moment. Without running DOOM, the static extractor also shows that the rewired map's netlist is the network with exactly that one weight changed. I have run the whole map only in ViZDoom. Its self-test map reads the digits 0 to 9, then the 7 after MUTATE and after RESTORE, without a player. On a GitHub runner it logs the exact values in GZDoom 4.14.2, LZDoom 3.88b, UZDoom 5.0.3 and ZDoom 2.8.1, and in Zandronum 3.2.1 only when every sector tag is below 32,768. Details
Python reads sector light levels and floor and ceiling heights from the running game and compares each with an
independent NumPy integer implementation of the same network. The check is integer equality over the runs that were
made, and says nothing about inputs that were not run. The tests attack it: raising one weight line in a small compiled
map from 5 to 6 must fail by exactly +1 on exactly the inputs whose dolls cross that line, and a readout that echoes a
value Python wrote must fail (pytest tests/test_tamper.py, three tests, about 15 s).
Readback is guarded by default: before each page, Python poisons and checks its USER slots, then requires the
page to replace them. Dropping a page cannot silently reuse a repeated input's answer or the previous page's values.
guard=False is an explicit one-map historical opt-out. Guarded builds have new hashes (ACS and metadata, not
geometry or arithmetic); the hash record explains the change.
doomformer fuzz --nets 40 compares every value of 40 random nets run in DOOM (306 passes, 0 mismatches, about 10 s with
--workers 2; a planted compiler bug is found). fuzz --edge puts weights, biases and inputs at the range limits: 15,000 nets
over ten fresh seeds, at --opt 0, at --opt 3 and as tile maps, made 113,605 passes and compared 1,987,632 values with
no mismatch (the range check refused 47,686 of the inputs it drew, about 30 %), 3,000 more with the generator widened
to plane starts near the bounds below (22,682 passes) and 2,000 more that also draw starts from 15,000 to 16,000 (14,782
passes), all with no mismatch. Earlier campaigns ran 2,000 random MLPs
(15,374 passes, 276,594 values), 300 spiking nets and 100 random transformers over all 8 attention, norm and MLP variants
(99 ran; one all-zero matrix is unsupported), after the scheduling fixes; 200 spiking --edge nets made 12,794 passes with
no mismatch. fuzz --edge does not draw transformers. CI fuzzes 60 nets
with a fresh, printed seed on every push and a longer campaign every Monday. The fuzzer and independent runs found four
faults in this repo's own maps: two scheduling bugs and two plane limits. A plane move that starts more than 14,018
units from zero keeps its mover busy for three tics and drops the next request on that plane, and a plane that starts
above 16,000 is exact on the first pass and wrong on later ones, so DOOM disagreed with the reference on nets that
net.check had accepted. check and compile now refuse them: planes start inside [-15,000, 16,000] and move within
±14,018 (doomformer verify --plane-sweep, docs/verification.md).
doomformer verify runs every input class of a small MLP (the classes agree with every input on 20 of 20 nets, under an
assumption stated in the same page). df.coverage counts what is compared: on MNIST all 248 exposed values, which are
129 values the reference defines and 119 twins, and the count falls when a readout name is dropped. The map does not
expose the 903 staircase counts and 1,351 gate comparisons of the same net; they are checked through the sums they feed.
doomformer verify --extract net.wad --net net.npz reads the net back out of a compiled map without starting DOOM and
compares every weight, bias and threshold with the source net: the shipped MNIST net (784-64-45-10-10) comes back equal
from its map alone at --opt 0 to 3, and so do 484 of 490 random nets at --opt 0 (the other 6 are equal but break the
plane contract) and 199 of 199 at each of --opt 1 to 3. EQUAL covers the arithmetic netlist, the plane contract, the
trigger and repeat flags, the mover speeds, the reset script and the readout pages; timing and geometry are printed as NOT
CHECKED. A changed weight line shows as exactly that weight. Of 23,622 single edits to a small map at --opt 0 the
extractor detects 17,906, and the 98 undetected edits that were run in DOOM on 12 inputs were all exact. It shows what the
map says; that DOOM runs the map as read is what the exactness checks test.
A mutation harness changes one line of a compiled map: of the 1,004 sites run (of 5,578) 297 are killed, all weight, sign
and target classes among them. Of the 707 survivors 590 match a rule (a redundant scroller, a freeze line a forward pass
never needs) that aggregate controls support, and 117 are input gaps (walking floors that only some inputs expose); none
is proven equivalent. doomformer lint --fuzz compared the static
schedule checker with DOOM on 5,397 maps: 0 false negatives. The method is translation validation (Pnueli, Siegel and
Singerman, 1998): a test of each compile, not a proof that the compiler is right.
Who does what:
- The dolls do every multiply-add, activation and comparison. ACS level scripts address cells, move input gates, rewind
the dolls, sense the world and copy results out. None of the network's arithmetic runs in ACS. The toolkit's
df.Agent is the one exception: it takes its argmax in ACS (docs/agents.md).
- mnist: Python writes the 784 pixel ports and decides when the dolls have stopped; the dolls pick the digit.
- demo and ask: Python writes the token ids and decides when the dolls have stopped, samples each letter from the
logits DOOM computed and, when a model is cut into several maps, copies integers from one game to the next. demo --one-map is one map with no Python between layers; Python writes the tokens and samples the letter after each
pass.
- draw and his brain is the level: Python only advances the clock and runs readout scripts (in draw, from READ on).
The level supplies the inputs (the 784 pixels, the sensed tokens) and the dolls pick the digit or the action.
- demo --one-map --loop: Python only advances the clock and runs readout scripts. The dolls pick each letter and write
it into the next position.
- The fly loop: Python only advances the clock and runs readout scripts, after calibrating the step period on a separate game that it does write. The level draws the input spikes and the output spikes fire the thrust lines.
- --opt 3 (the default of draw; elsewhere --opt 0, the original schedule with guarded readback): an ACS script copies
each layer's light levels into the next layer's gate heights. It adds and compares nothing, and the dolls still do the
sums, thresholds, comparisons and the choice, but "no ACS between layers" holds at --opt 0 to 2 only.
- doomformer machine: the dolls run the program counter and the registers. By default the loop, the rewind and the halt
check are an ACS script, and a stored program is loaded by the host before the first tic. With --clock dolls a loop
doll and line specials restart, rewind and stop the level, and ACS only reads values and checks that the dolls have
stopped (docs/machine.md).
- learn digits: Python writes the pixels and the label of each exampl
Auto-fetched and translated by AI Atlas. All rights belong to the original author.