ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Shifted logarithm in the implemented primitive

The comment gives log(x) and derivative 1/x, but the body evaluates log(x+EPSILON) and derivative 1/(x+EPSILON). This positive shift changes both the value and the domain to x+EPSILON>0. It mitigates a zero input but does not make every negative input valid.

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-d5c33022107a9f2esource-comment-equation
Log:z=log(x),dz/dx=1/xLog: z = log(x), dz/dx = 1/x

Read the equation

The comment gives log(x) and derivative 1/x, but the body evaluates log(x+EPSILON) and derivative 1/(x+EPSILON). This positive shift changes both the value and the domain to x+EPSILON>0. It mitigates a zero input but does not make every negative input valid.

Terms & definitions

TermMeaning in this source
x

Input

EPSILON

Added numerical offset

How it works

Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.

Assumptions & limits

Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.

Original context

Read the surrounding source passage
    z->inputs = {x};
    z->backward_fn = [x, z, e]() {
        x->grad += z->grad * e;
    };
    return tape.record(z);
}

// Log: z = log(x), dz/dx = 1/x
inline GradNodePtr log_op(GradNodePtr x, TapeRecorder& tape) {
    auto z = std::make_shared<GradNode>(std::log(x->value + EPSILON));
    z->inputs = {x};
    z->backward_fn = [x, z]() {
        x->grad += z->grad / (x->value + EPSILON);
    };
    return tape.record(z);
}

// Power: z = x^p, dz/dx = p * x^(p-1)
Exact original notation
Log: z = log(x), dz/dx = 1/x

Related builds

Sources & provenance

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