Activation function 2026-10-14
An activation function converts a unit's weighted input to its output. A sigmoid function, hyperbolic tangent or rectifier can give nonlinear features. Replacing all hidden activation functions by the identity collapses consecutive affine layers into a single affine map, removing the representational benefit of those hidden layers.
Logistic differential equation Created 2026-09-28 Updated 2026-10-20
The logistic differential equation is the nonlinear ordinary differential equation
As a mathematical model of population dynamics, it treats abundance as a continuous nonnegative quantity. The constant has units of inverse time, while the carrying capacity has the same units as . The useful idea is to combine growth resembling exponential growth at low abundance with a slowing approach to a finite abundance. The three trajectories below already show an important distinction: starting above the carrying capacity gives a decreasing curve, whereas starting below it gives an increasing one.
Figure 1.
Logistic trajectories approach the carrying capacity from below or above
. Here and per day. The initial conditions are ; dashed horizontal lines show the two equilibrium points and . Only the trajectory has a future inflection point, marked at and days. The other marked values are and for that same trajectory. Details.
For , dividing the derivative by abundance gives the instantaneous per-capita rate:
It decreases linearly with : it approaches at low abundance, is at , vanishes at the carrying capacity, and is negative above it. This per-capita rate differs from the total rate , which also counts how many individuals contribute. It is an instantaneous rate, rather than a fixed percentage increase over a whole day. The linear per-capita assumption and the resulting qualitative picture are developed in MIT 18.03SC's logistic-model notes.
Writing , the equilibrium points satisfy , so the constant solutions of a differential equation are and . The phase line points upward for and downward for . Also and : the criterion for fixed point stability for an autonomous differential equation makes zero an unstable equilibrium and an asymptotically stable equilibrium point. Every positive initial condition approaches as ; stays exactly zero. Instability of zero means that a small positive population grows away from it, not that a zero population spontaneously appears.
For every , the unique solution of a differential equation for all is
The denominator is positive on this domain, including when . For , this is a translated and scaled logistic function; its extension to all real times is a sigmoid function. For the coefficient of the exponential function is negative, and the future curve instead decreases toward . No nonconstant positive solution of a differential equation crosses or reaches it at finite time. A short derivation uses the dimensionless variable : the chain rule gives , so exponential decay yields . The substitution divides by , so the zero equilibrium point must be included separately.
The total growth rate is a downward-opening quadratic function of abundance. Completing the square gives its maximum without solving the differential equation:
The balance is beautiful: more individuals contribute to growth, but each contributes less, and the strongest total increase occurs halfway to the carrying capacity. This is a maximum over possible abundances. A trajectory starting above never passes through that abundance in its future.
Figure 2.
Total logistic growth is greatest at half the carrying capacity
. With and per day, the maximum is individuals per day at . The function graph crosses zero at the equilibrium points and ; beyond the rate is negative. The lower phase line has arrows toward increasing abundance below and toward decreasing abundance above , with a hollow mark for the unstable equilibrium and a filled mark for the asymptotically stable equilibrium point. Details.
The chain rule connects this maximum to the shape of the time trajectory through its second derivative:
For , the trajectory initially has convexity and then concavity, with its one future inflection point at
For , this point lies at the initial time, with concavity for . For , the inflection point belongs to the past extension, so the future trajectory has concavity throughout. Above , the decreasing trajectory has convexity and no inflection point. The two constant solutions of a differential equation have no change of concavity. Thus an entire logistic function has an S shape, but its observed future segment need not show both bends. See also [ref].
For the plotted example with , and , time measured in days gives
The initial total rate is individuals per day, and the initial per-capita rate is . The fastest total increase is individuals per day, reached at days. At that time the per-capita rate has already fallen to .
These parameters are illustrative choices, rather than an empirical fit. The equation specifies deterministic evolution under a phenomenological assumption: it summarizes how net growth depends on abundance without separately modelling every process that affects it. The carrying capacity is a parameter for a specified setting, not a universal constant for all populations. In his 1838 paper "Notice sur la loi que la population suit dans son accroissement", Correspondance mathématique et physique 10, pp. 113–121, Pierre-François Verhulst proposed , equivalent to this equation with and . He also noted that different assumed growth-retarding terms could describe the observations similarly while giving very different limiting populations. This is an early illustration of why a good-looking curve alone does not establish a unique long-term prediction.[ref]
The logistic differential equation describes continuous time. The logistic map instead advances in discrete steps and can exhibit a period-doubling cascade and Devaney chaos; the monotone positive trajectories here cannot. Their connection through the forward Euler method is explained under Euler discretization of logistic growth, where a large step can introduce behaviour absent from the original differential equation.
Apply the chain rule to the squared loss, using the same pre-update weights throughout a forward and backward pass. At the output, and . Therefore
For a gradient descent step of size , define . This gives .
A hidden activation affects all output units to which it connects. Thus
and
The learning rate is already contained in and hence in ; do not multiply by it a second time. For a sigmoid function, . Thresholds can be treated as negative biases with an extra constant input and updated by the same derivative rule.
This is squared-error backpropagation. The forward pass computes activations, while the backward pass transports output-loss derivatives through the outgoing weights and the derivatives of the activation functions, yielding an error signal for every hidden unit. That reverse flow of derivatives explains the name backpropagation.
The sigmoid function is strictly increasing. Therefore the risky region is . Its decision boundary is the hyperplane
Points on or above this score threshold are assigned to the risky class. For , the right side is zero.
The feedforward neural network has three input coordinates, two hidden sigmoid function units and two output softmax function units. Every input is connected to each hidden unit, and each hidden unit to each output unit; each hidden and output unit also has a bias. A layer diagram is
Algebraically, with ,
with responses conditionally independent. The fourteen displayed weight and bias parameters comprise six input weights, two hidden biases, four output weights and two output biases. The one-hot encoding supplies targets , , and the categorical cross-entropy loss is the negative of . There is softmax non-identifiability under a common shift of both output logits, but the predicted probabilities are well defined.
The loop divides each feature by its sample maximum, putting features with nonnegative values on comparable scales and improving numerical conditioning for gradient optimization. If exactly one hidden layer must use the sigmoid function, use layer 3. Sigmoid derivatives can become small in saturated regions; placing it latest minimizes the number of subsequent gradient multiplications affected by this saturation, while the earlier ReLU layers retain efficient gradient propagation.