Reasoning about neural networks

Priors, functions, and uncertainty: a language for thinking about neural networks.

Placeholder. This note will explore how priors over weights become beliefs about functions. The examples below are an editable starting point for the article.

Math

Put inline mathematics between single dollar signs: $f[x;\theta]$ renders as f[x;θ]f[x;\theta]. Use double dollar signs on separate lines for a displayed equation:

$$
p[\theta\mid D] = \frac{p[D\mid\theta]p[\theta]}{p[D]}.
$$
p[θ∣D]=p[D∣θ]p[θ]p[D].p[\theta\mid D] = \frac{p[D\mid\theta]p[\theta]}{p[D]}.

Math is rendered at build time with KaTeX, so equations do not need browser JavaScript.

Figures

Keep a figure beside this article’s index.mdx, import it, and give it descriptive alternative text. A caption explains what the reader should notice.

import networkFigure from "./network.svg";

<figure>
  <img src={networkFigure.src} width="720" height="280"
    loading="lazy" alt="Two inputs connect to three hidden units and one output." />
  <figcaption>A small network represents a family of functions.</figcaption>
</figure>
Two input nodes connect to three hidden units, which connect to one output node.
A small network represents a family of functions indexed by its weights.

Use the same local import pattern for PNG and JPEG figures. Put exploratory notebooks and figure-generation scripts in research/, then keep the small exported figure beside the article.

Interactive charts

Import the shared chart component and pass plain arrays. It loads Plotly only when the chart approaches the viewport. Hover over the curves for their values; click a legend entry to hide or show a curve.

import PlotlyChart from "@site/components/PlotlyChart.astro";

export const predictions = [{
  x: [-2, -1, 0, 1, 2],
  y: [-0.96, -0.76, 0, 0.76, 0.96],
  type: "scatter", mode: "lines", name: "Function"
}];

<PlotlyChart data={predictions}
  layout={{ xaxis: { title: { text: "Input x" } } }}
  config={{ responsive: true, displayModeBar: false }}
  title="An illustrative neural-network function" />

These three hand-chosen functions illustrate different weights; they are not posterior samples or experimental results.

Use ordinary Markdown links, such as [Sampling Bayesian neural networks](/writing/sampling-bayesian-neural-networks/). Fenced code blocks can name a language for syntax highlighting:

def posterior_predictive_mean(predictions):
    # predictions has shape [number_of_samples, number_of_inputs]
    return predictions.mean(axis=0)

Continue with Sampling Bayesian neural networks for a trace-chart template, or Samples as a data modality for a table and heatmap template.