ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

FREE ENERGY PRINCIPLE · KL

This relation defines KL in the source section “FREE ENERGY PRINCIPLE · KL”. Uses logarithmic scaling; its base and the positivity of its argument matter. Its interpretation depends on the source’s stated variables and conditions; this record does not assign an…

Implementation mathematicsSource recovered; runtime not executed
Learn with the Atlas

Learn to read this model

Start with the symbols, follow the operations, and check what the result means.

Open guided lesson
gh-eq-fdd739076409a137source-comment-equation
KL=0.5∗(log(σp2/σq2)+σq2/σp2+(μq−μp)2/σp2−1)KL = 0.5 * (log(σ_p²/σ_q²) + σ_q²/σ_p² + (μ_q - μ_p)²/σ_p² - 1)

Read the equation

This relation defines KL in the source section “FREE ENERGY PRINCIPLE · KL”. Uses logarithmic scaling; its base and the positivity of its argument matter. Its interpretation depends on the source’s stated variables and conditions; this record does not assign an unprovided physical or cognitive meaning to them.

Terms & definitions

The recovered passage does not supply a separate symbol table. Read the source context for the notation used in this version; familiar letters may carry different meanings in other builds.

How it works

  1. Read KL as the quantity being defined or updated by this relation.

  2. Uses logarithmic scaling; its base and the positivity of its argument matter.

  3. Use this version’s variable definitions and update order. The same symbol may be assigned a different meaning in another build.

Assumptions & limits

  • This source expression was recovered from the pinned code revision. Its presence does not establish that the associated program was built, run, or scientifically validated.

Original context

Read the surrounding source passage
        // KL divergence for Gaussians (diagonal)
        float kl = 0.0f;
        for (size_t i = 0; i < DIM; ++i) {
            float var_q = sigma[i] * sigma[i];
            float var_p = sigma_prior[i] * sigma_prior[i];
            float mu_diff = mu[i] - mu_prior[i];

            // KL = 0.5 * (log(σ_p²/σ_q²) + σ_q²/σ_p² + (μ_q - μ_p)²/σ_p² - 1)
            kl += 0.5f * (std::log(var_p / var_q) + var_q / var_p +
                         mu_diff * mu_diff / var_p - 1.0f);
        }

        return kl - log_likelihood;
    }

    // Gradient of free energy w.r.t. mu
    void gradient_mu(const float* observation, float* grad_out) const {
        for (size_t i = 0; i < DIM; ++i) {
Exact original notation
KL = 0.5 * (log(σ_p²/σ_q²) + σ_q²/σ_p² + (μ_q - μ_p)²/σ_p² - 1)

Related builds

Sources & provenance

Search equations, builds, manuscript text, and recovered sources.