Read the equation
For x≠1 the derivative has the displayed signed reciprocal-square form. At x=1 the original function has unequal one-sided derivatives and no ordinary derivative. The C++ compute_phi_grad function below this comment actually returns the derivative of the smoothed formula, so callers need to distinguish the reference formula from the implemented choice.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| x | Activation value |
| Phi | Original unity score |
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
float smooth_abs = std::sqrt(diff * diff + temperature);
return 1.0f / (1.0f + smooth_abs);
}
/**
* compute_phi_grad - Gradient of consciousness w.r.t. activation
*
* d(Phi)/dx = -sign(x-1) / (1 + |x-1|)^2
*
* For smooth version:
* d(Phi_smooth)/dx = -(x-1) / (sqrt((x-1)^2 + T) * (1 + sqrt((x-1)^2 + T))^2)
*
* @param activation The activation value
* @param temperature Smoothing temperature
* @return Gradient of phi w.r.t. activation
*/
inline double compute_phi_grad(double activation, double temperature = TEMPERATURE_DEFAULT) {
double diff = activation - 1.0;Exact original notation
d(Phi)/dx = -sign(x-1) / (1 + |x-1|)^2