Introduction
In the landscape of deep learning, the choice of activation function—such as ReLU, Sigmoid, or Swish—is a critical hyperparameter typically fixed for an entire layer. While these functions are effective, they are often suboptimal for specific neurons or datasets, particularly those exhibiting complex oscillatory or periodic patterns. Representing a sine wave with ReLUs, for instance, requires a large number of neurons to create a piecewise linear approximation.
This paper introduces Differential Equation Units (DEUs), a novel approach where each neuron learns its own non-linear activation function by solving a parameterized second-order ordinary differential equation (ODE). By allowing the "shape" of the activation to evolve alongside network weights, DEUs enable significantly more compact architectures that can outperform much larger models.
The DEU Approach
The core innovation is defining the activation function $y(t)$ as the solution to a second-order linear ODE: $$ay''(t) + by'(t) + cy(t) = u(t)$$ where $u(t)$ is the Heaviside step function, and $a, b, c$ are learnable parameters. These parameters, along with learnable initial conditions $c_1, c_2$, define the "physics" of the activation function.
Implementation Efficiency
To maintain training speed, DEUs do not use iterative ODE solvers. Instead, they utilize closed-form solutions. Depending on the parameters, a DEU can morph into various forms: exponential growth/decay, linear, quadratic, or oscillatory (sines and cosines). To handle the mathematical singularities that occur when parameters approach zero, the authors employ subspace masking—calculating all possible solution forms in parallel and selecting the correct one via a mask—and outward gravitation to prevent parameters from stalling in singular regions.
Experimental Evaluation
The authors evaluated DEUs across diverse tasks, including image classification (MNIST, CIFAR-10), regression (Diabetes dataset), and time-series forecasting (Traffic, Solar, Electricity).
Compactness and Efficiency
One of the most compelling findings is the efficiency of DEUs in low-parameter regimes. In a toy problem of separating nested noisy circles, a single layer of just two DEUs achieved a decision boundary comparable to two layers of four ReLUs.
Key Results
- Image Classification: On Fashion-MNIST, a DEU-based CNN with 21k parameters achieved 91.5% accuracy, surpassing a standard ReLU-CNN with 30k parameters (90.2%).
- Regression: In the Diabetes regression task, a network with a single DEU outperformed networks utilizing up to eight ReLU or Swish neurons.
- Handling Oscillations: Due to their ability to produce harmonic solutions, DEUs are naturally suited for periodic data that standard deep neural networks struggle to represent efficiently.
Discussion and Limitations
While DEUs offer superior parameter efficiency, they come with a "complexity tax." Training a DEU-based model is computationally more intensive per neuron; for example, training on a Tesla K40c took 640ms per batch for DEUs versus 180ms for ReLU. However, DEUs scale better than Maxout units in large layers because their parameter count is independent of the number of inputs.
Conclusion
Differential Equation Units represent a shift from selecting fixed activations to learning functional forms directly from data. By allowing neurons to "become" the functions needed for the task—whether a simple threshold or a complex oscillator—DEUs pave the way for highly efficient, specialized neural architectures, particularly for memory-constrained environments or complex physical signals.
Summary updated