Visualizes an activation function as an elementwise mapping a=f(z) and its local gradient f'(z) used in backprop. The animation scans z across the input range while cycling through ReLU, sigmoid, and tanh, showing how saturation (small f') causes vanishing gradients and how different nonlinearities change forward outputs and training dynamics.
Pure Canvas2D; responsive scale via baseSize. Uses a step-based cycle (ReLU/sigmoid/tanh) and an eased scanner that moves z across [-4,4]. Plots are drawn as low-resolution polylines with snapped coordinates for a blocky aesthetic; saturation regions are shaded and backprop signal is shown as g_out = g_in * f'(z).