Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Notation

Fixed throughout. Where a symbol appears in the code under a different name, the code's name is given.

Objects

SymbolIsIn the code
xxA patch term — a tree in the typed grammarPatchTree
ppA tree path, e.g. node/0/1path keys
ttA trace — the execution record of the grammar programfugue::Trace
φ(x)R40\varphi(x) \in \R^{40}The feature vector of xxFeatures::phi()
φaudioR15\varphi_{\text{audio}} \in \R^{15}Perceptual descriptors of the renderAudioFeatures
φstructR25\varphi_{\text{struct}} \in \R^{25}Structural descriptors of the termStructFeatures
zzA standardized feature vector, z=(φμ)/sz = (\varphi - \mu)/sphi_std

φ\varphi is always the concatenation [φaudio;φstruct][\varphi_{\text{audio}} ; \varphi_{\text{struct}}], in that order. It is written φ\varphi rather than ϕ\phi throughout; the code's phi is this vector.

The taste model

SymbolIsIn the code
KKNumber of style lenses (5\le 5)TasteConfig::k_styles
ddFeature dimension (4040)TasteConfig::n_features
θkRd\theta_k \in \R^{d}Lens kk's weight vectorTasteSample::theta[k]
θ\thetaAll of them, K×dK \times dTasteSample::theta
u(x)u(x)Latent utility of xxutility_mix
uk(x)u_k(x)Lens kk's utility, θkz\theta_k^\top zutility(phi, k)
τs\tau_sSession ss's keep/kill thresholdTasteSample::tau[s]
cjc_jStar cutpoint jjTasteSample::cuts[j]
σθ\sigma_\thetaPrior SD of one θ\theta coordinateTasteConfig::sigma_theta()
sKs_KMax-of-KK-normals SD correctionMAX_NORMAL_SD
SSNumber of sessions in the logFitSet::n_sessions()
SymbolIsIn the code
pgrammar(x)p_{\text{grammar}}(x)Prior probability of term xxPatchGrammarPrior
β\betaBoltzmann sharpnessSessionConfig::beta
πβ\pi_\betaThe target, pgrammar(x)eβE[uθ(x)]\propto p_{\text{grammar}}(x),e^{\beta,\E[u_\theta(x)]}
η\etaProposal-tilt strengthSessionConfig::proposal_tilt
L\mathcal{L}The set of locked addresseslocked: HashSet<String>

Conventions

  • σ()\sigma(\cdot) is the logistic function σ(v)=1/(1+ev)\sigma(v) = 1/(1+e^{-v}), never a standard deviation. Standard deviations are always subscripted (σθ\sigma_\theta) or written as ss.
  • log\log is natural. Log-losses are in nats.
  • Indices are 0-based, matching the code, including cutpoint indices, which matters for reading the ordinal likelihood.
  • Weights ww are always normalized unless stated: importance weights sum to one, recency weights are relative to the newest observation being 11.
  • "Standardized" always means after the affine transform in Standardization. The taste model never sees raw φ\varphi; the observation log never stores anything else.

KaTeX macros

Defined in www/reference/book.toml so a symbol cannot mean two things on two pages:

MacroRenders
\RR\R
\EE\E
\phivecφ\phivec
\thetakθk\thetak
\sigσ\sig