PAJAMA / LEARN
← Course overview

Learn from observations / 10 OF 12

Why training sometimes adds or removes Gaussians

After this lessonDistinguish optimizing existing parameters from changing representation capacity, without treating clone/split as exact preservation.

One huge soft brush can cover a region but cannot describe every small edge. Moving that one brush forever may not solve the problem; sometimes you need more brushes in the right places.

Build the idea, one step at a time

Need a math refresher?

Open only the tool you need; return here to use it in the next step.

Squares & square roots

STEP 1 / 5

Parameters and capacity are separate

Gradient descent changes values for existing primitives. Density control changes how many primitives exist and where optimization effort is available. Regions with persistent errors or large accumulated screen-space position gradients can motivate extra primitives, but large error alone does not identify its cause: pose mistakes or exposure differences can also create it.

PUT NUMBERS IN

At one pixel with A = 0.5: duplicate unchanged → 0.75; assign each child A/2 → 0.4375; use 1 − √(1 − A) for each child → 0.5. The third equality is only the stated coincident one-pixel setup.

FORMULA → RUNNING CODE

Find the same operation in the code

These excerpts are read from the current repository when the site is built. Expand one to inspect it; the full snapshot opens in a separate tab.

public/learn/models.mjsL21–21

The exact arithmetic behind this lesson’s controls and worked example.

export function duplication(alpha){return {unchanged:1-(1-alpha)**2,halved:1-(1-alpha/2)**2,child:1-Math.sqrt(1-alpha),preserved:alpha};}
Open the deployed source snapshot ↗
src/splat.wgslL130–136

The same alpha law explains why adding primitives changes their combined footprint.

fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
  let power = -0.5 * dot(input.local, input.local);
  let alpha = min(0.99, input.color_opacity.a * exp(power));
  if (alpha < 0.0039215686) {
    discard;
  }
  return vec4<f32>(input.color_opacity.rgb * alpha, alpha);
Open the deployed source snapshot ↗

CHECK YOUR UNDERSTANDING

Can you predict the result?

Two coincident layers each have alpha 0.5. Their combined alpha is…

This is your own review mark. You can remove it at any time.

Go deeper with primary sources

3DGS · density control implementation ↗Spacetime Gaussian Feature Splatting · paper ↗Full mathematical derivation ↗