Read the equation
The logistic derivative is z(1−z), where z is the forward sigmoid output. Its maximum is one quarter at z=0.5, and it decreases toward zero in either saturated tail. The primitive applies this local sensitivity through the chain rule.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| z | Sigmoid output |
| x | Input |
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, t]() {
x->grad += z->grad * (1.0 - t * t);
};
return tape.record(z);
}
// Sigmoid: z = 1/(1+exp(-x)), dz/dx = z*(1-z)
inline GradNodePtr sigmoid(GradNodePtr x, TapeRecorder& tape) {
double s = 1.0 / (1.0 + std::exp(-x->value));
auto z = std::make_shared<GradNode>(s);
z->inputs = {x};
z->backward_fn = [x, z, s]() {
x->grad += z->grad * s * (1.0 - s);
};
return tape.record(z);
}
Exact original notation
Sigmoid: z = 1/(1+exp(-x)), dz/dx = z*(1-z)