feat: land superpaper v1 notes scaffold
Add the ledger schema, class router, lint codes, ingest/build pipeline, and three work-tree examples: align derivation, superfig delegation, and supertensor delegation.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
schema: superpaper.ledger/v1
|
||||
retired_ids: []
|
||||
paper:
|
||||
id: pipeline-delegate
|
||||
title: A One-Step Predictor
|
||||
authors: ["Fixture"]
|
||||
notes_language: zh
|
||||
source: {kind: excerpt}
|
||||
coverage:
|
||||
mode: excerpt
|
||||
sections_in: ["1"]
|
||||
questions:
|
||||
- {id: Q1, text: "前向主路和损失如何分开?", source: "excerpt"}
|
||||
claims:
|
||||
- id: C1
|
||||
text: "一次前向是 x → f_θ → ŷ;损失不在主路上"
|
||||
kind: contribution
|
||||
status: core
|
||||
supports: [Q1]
|
||||
definitions: []
|
||||
assumptions: []
|
||||
lemmas: []
|
||||
symbols:
|
||||
- {name: x, latex: "x", meaning: "输入", kind: value}
|
||||
- {name: yhat, latex: "\\hat y", meaning: "预测", kind: value}
|
||||
- {name: L, latex: "L", meaning: "损失", kind: scalar}
|
||||
derivations:
|
||||
- id: DER1
|
||||
claim: C1
|
||||
title: "前向定义"
|
||||
expand: true
|
||||
figure: null
|
||||
steps:
|
||||
- {id: S1, from: "x", to: "f_\\theta(x)=\\hat y", rule: definition}
|
||||
figures:
|
||||
- id: F1
|
||||
claim: C1
|
||||
title: "一次前向与侧路损失"
|
||||
grammar: pipeline
|
||||
toolkit: superfig
|
||||
signals: [pipeline, what-eats-what]
|
||||
request: figures/F1/F1.request.md
|
||||
include: figures/F1/build/F1.pdf
|
||||
status: included
|
||||
evidence: []
|
||||
terms: []
|
||||
source_assets: []
|
||||
@@ -0,0 +1 @@
|
||||
一次前向 $x\to f_\theta\to\hat y$。损失挂在预测下方,不是主路车站。
|
||||
@@ -0,0 +1,27 @@
|
||||
# Figure request F1
|
||||
toolkit: superfig
|
||||
language: cjk
|
||||
claim: 一次前向是 x → f_θ → ŷ;损失不在主路上。
|
||||
grammar: pipeline
|
||||
work_rel_dir: figures/F1
|
||||
|
||||
## Roles
|
||||
- {role: input, color: sfTeal}
|
||||
- {role: model, color: sfOrange}
|
||||
- {role: loss, color: sfCoral}
|
||||
- {role: output, color: sfViolet}
|
||||
|
||||
## Flow (cursor). \sfconn 没有 endpoints。
|
||||
stage: {name: SA, text: "推理流程:一次前向"}
|
||||
row: {name: R1, height: 16mm}
|
||||
in_row:
|
||||
- {macro: sfnode, name: x, role: input, label: "输入 $x$", w: 16mm, h: 12mm}
|
||||
- {macro: sfconn, name: e1, label: 预处理}
|
||||
- {macro: sfnode, name: f, role: model, label: "模型 $f_\\theta$", w: 18mm, h: 12mm}
|
||||
- {macro: sfconn, name: e2, label: logits}
|
||||
- {macro: sfnode, name: y, role: output, label: "预测 $\\hat y$", w: 16mm, h: 12mm}
|
||||
|
||||
## Fixed topology
|
||||
- {macro: sfnode, name: s, role: loss, label: "损失 $L$", w: 14mm, h: 12mm,
|
||||
at: "($(y.south)+(0,-22mm)$)"}
|
||||
- {macro: sfarrowlabel, from: "y.south", to: "s.north", label: "$L(\\hat y, y)$"}
|
||||
@@ -0,0 +1,47 @@
|
||||
% superfig golden example 1 -- one horizontal paper-figure pipeline.
|
||||
% Main path is input -> model -> prediction. Loss is a side object, not a
|
||||
% station on the forward path.
|
||||
% ../scripts/build.sh pipeline.tex
|
||||
\documentclass[border=10pt]{standalone}
|
||||
\usepackage[cjk]{superfig}
|
||||
|
||||
\sfsetrole{input}{sfTeal}
|
||||
\sfsetrole{model}{sfOrange}
|
||||
\sfsetrole{loss}{sfCoral}
|
||||
\sfsetrole{output}{sfViolet}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
|
||||
\sfstage{SA}{推理流程:一次前向}
|
||||
\sfrow{R1}{16mm}
|
||||
\sfnode[role=input]{x}{输入 $x$}{16mm}{12mm}
|
||||
\sfconn{e1}{预处理}
|
||||
\sfnode[role=model]{f}{模型 $f_\theta$}{18mm}{12mm}
|
||||
\sfconn{e2}{logits}
|
||||
\sfnode[role=output]{y}{预测 $\hat y$}{16mm}{12mm}
|
||||
\sfrowend
|
||||
|
||||
% Loss compares the prediction with the target; it is not on the main path.
|
||||
% Hang it below ŷ with enough shaft that no caption sits on the arrow.
|
||||
\sfnode[role=loss, at={($(y.south)+(0,-22mm)$)}]{s}{损失 $L$}{14mm}{12mm}
|
||||
\sfarrowlabel{y.south}{s.north}{$L(\hat y,y)$}
|
||||
|
||||
\sflane{R1}
|
||||
\sfcaption{x}{$x$}{原始输入}
|
||||
\sfcaption{f}{$f_\theta$}{可学习参数}
|
||||
\sfnolane
|
||||
\sfcaption{s}{$L$}{与真值比较}
|
||||
|
||||
\sfbbox{all}
|
||||
\sftopformula{F}{%
|
||||
$x \;\xrightarrow{\;f_\theta\;}\; \hat y,\qquad
|
||||
\min_\theta\; L\bigl(f_\theta(x),\,y\bigr)$}
|
||||
\sfmeaningbox{mb}{96mm}{all}
|
||||
{一次从输入到预测的前向;损失在预测之后单独计算}
|
||||
{数据、模型参数、预测、损失}
|
||||
{预处理后送入模型;模型产生 logits 得到预测;损失比较预测与真值,梯度再回到参数}
|
||||
\sfsignature{推理流程示意}{mb}
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 169 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 313 KiB |
@@ -0,0 +1,14 @@
|
||||
\documentclass[a4paper]{article}
|
||||
\input{notes-macros}
|
||||
\renewcommand{\notetitle}{一次前向与侧路损失}
|
||||
\renewcommand{\notepaper}{A One-Step Predictor}
|
||||
\begin{document}
|
||||
\tableofcontents
|
||||
\newpage
|
||||
\input{sections/sec-01.tex}
|
||||
\input{sections/sec-02.tex}
|
||||
\input{sections/sec-03.tex}
|
||||
\appendix
|
||||
\section{符号表}
|
||||
\input{sections/symbols.tex}
|
||||
\end{document}
|
||||
@@ -0,0 +1,2 @@
|
||||
\section{这篇论文在问什么}
|
||||
预测怎么从输入算出来,损失该不该站在前向主路上?
|
||||
@@ -0,0 +1,8 @@
|
||||
\section{主张与贡献}
|
||||
\splabel{C1}
|
||||
一次前向是 $x\to f_\theta\to\hat y$。损失在预测之后单独比较。
|
||||
|
||||
\spfig{F1}{一次前向与侧路损失。}{重绘自 fixture Figure~1;toolkit: \texttt{superfig};ledger id: F1。}
|
||||
|
||||
\subsection{本章小结}
|
||||
损失不是前向的一站。
|
||||
@@ -0,0 +1,2 @@
|
||||
\section{总结与延伸}
|
||||
这张图走 superfig,因为要画的是谁吃谁,不是轴长。
|
||||
@@ -0,0 +1,14 @@
|
||||
# Outline: A One-Step Predictor
|
||||
|
||||
## Lecture map
|
||||
|
||||
| file | lecture_title | paper_sections | ledger_ids |
|
||||
|---|---|---|---|
|
||||
| sec-01.tex | 这篇论文在问什么 | 1 | Q1 |
|
||||
| sec-02.tex | 主张与贡献 | 1 | C1, F1 |
|
||||
| sec-03.tex | 总结与延伸 | 1 | C1 |
|
||||
| sec-app-a.tex | 符号表 | — | |
|
||||
|
||||
## Locked
|
||||
- 首节标题必须是「这篇论文在问什么」
|
||||
- 末节(appendix 前)必须是「总结与延伸」
|
||||
Reference in New Issue
Block a user