ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Addition and its reverse-mode derivatives

The output is the sum of two inputs. Each input has local derivative one, so the backward pass adds the incoming output gradient to both input gradients. Accumulation is necessary when a variable contributes along multiple graph paths.

Implementation mathematicsSource recovered; runtime not executed
Learn with the Atlas

Understand the update

Build intuition for derivatives, direction, and learning steps.

Open guided lesson
gh-eq-e4d0684fb1d6d371source-comment-equation
Addition:z=x+y,dz/dx=1,dz/dy=1Addition: z = x + y, dz/dx = 1, dz/dy = 1

Read the equation

The output is the sum of two inputs. Each input has local derivative one, so the backward pass adds the incoming output gradient to both input gradients. Accumulation is necessary when a variable contributes along multiple graph paths.

Terms & definitions

TermMeaning in this source
x

First input

y

Second input

z

Sum

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
namespace ops {

// Create leaf node (input variable)
inline GradNodePtr variable(double value, bool requires_grad = true) {
    return std::make_shared<GradNode>(value, requires_grad);
}

// Addition: z = x + y, dz/dx = 1, dz/dy = 1
inline GradNodePtr add(GradNodePtr x, GradNodePtr y, TapeRecorder& tape) {
    auto z = std::make_shared<GradNode>(x->value + y->value);
    z->inputs = {x, y};
    z->backward_fn = [x, y, z]() {
        x->grad += z->grad;
        y->grad += z->grad;
    };
    return tape.record(z);
}
Exact original notation
Addition: z = x + y, dz/dx = 1, dz/dy = 1

Related builds

Sources & provenance

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