Kafnets: Kernel-based non-parametric activation functions for neural networks.

Simone Scardapane, Steven Van Vaerenbergh, Simone Totaro, Aurelio Uncini · DOI · OpenReview

TL;DR

This paper introduces "Kafnets," a novel family of flexible, kernel-based activation functions for neural networks. These functions offer a compelling blend of desirable properties, including smoothness, linearity in parameters, and adaptability, outperforming existing methods on various benchmarks and offering a new avenue for enhancing neural network expressivity.

What Problem Does This Paper Address?

Neural networks (NNs) typically rely on fixed, element-wise non-linear activation functions. While this has been effective, researchers have explored ways to make these functions more flexible and adaptable to improve NN performance. Existing approaches to "non-parametric" activation functions (where the number of parameters can grow) often sacrifice desirable properties like smoothness or introduce complexity. This paper aims to bridge this gap by proposing a new class of activation functions that are smooth, adaptable, and computationally efficient, addressing the need for more expressive and versatile activation functions in deep learning.

Methods

The core innovation is the introduction of Kernel Activation Functions (KAFs). These functions are defined as a linear superposition of kernel evaluations, where the dictionary of these kernels is fixed beforehand. Specifically, a KAF is represented as:

$g(s) = \sum_{i=1}^{D} a_i \kappa(s, d_i)$

where:

  • $a_i$ are the adaptable mixing coefficients.
  • $d_i$ are the fixed dictionary elements (sampled points on the x-axis).
  • $\kappa(\cdot, \cdot)$ is a 1D kernel function (e.g., Gaussian).

This formulation offers several advantages:

  • Linearity in Parameters: The adaptable parameters are the mixing coefficients ($a_i$), making the optimization process linear with respect to them.
  • Smoothness: By choosing smooth kernel functions (like the Gaussian kernel), the resulting KAFs are smooth over their entire domain.
  • Local Effects: With the Gaussian kernel, the mixing coefficients have a local influence on the function's shape, controlled by the kernel bandwidth ($\gamma$).
  • Regularization: Standard regularization techniques (like $l_1$ or $l_2$) can be applied to the mixing coefficients.
  • Computational Efficiency: The kernel expansion can be efficiently computed using vector-matrix operations, suitable for mini-batch training.

The authors also propose a 2D-KAF variant that operates on pairs of activation values, allowing for the learning of two-dimensional functions and generalizing concepts like maxout neurons.

Datasets

The paper uses the following datasets:

  • Sensorless dataset: A relatively small benchmark for supervised techniques, consisting of 58,509 examples with 49 input features, used for investigating activation function shapes and initial performance gains.
  • SUSY benchmark: A large-scale dataset from Baldi et al. (2014) for particle physics classification, comprising five million examples, used to evaluate performance on a realistic use case.
  • CIFAR-10 dataset: A standard benchmark for image classification, used to test KAFs and 2D-KAFs on convolutional neural networks.
  • MuJoCo environments (OpenAI Gym): Used for reinforcement learning scenarios to evaluate the performance of KAFs in learning complex control policies.

Key Insights and Ideas

  • Bridging Kernels and NNs: KAFs elegantly connect the power of kernel methods with the architecture of neural networks, offering a new paradigm for activation function design.
  • Flexibility without Sacrifices: The proposed KAFs achieve a desirable balance of flexibility, smoothness, and parameter efficiency, overcoming limitations of previous non-parametric activation functions.
  • Local Adaptability: The use of kernels, particularly the Gaussian kernel, allows for localized adaptation of the activation function's shape, which is beneficial for optimization.
  • Initialization Matters (but Adaptability Dominates): While initialization can influence the initial shape, the experiments suggest that the final learned shapes are often independent of initialization and are crucial for achieving high performance.
  • Generalization Across Architectures: KAFs and their 2D variants demonstrate strong performance not only in feedforward networks but also in convolutional neural networks and reinforcement learning tasks.

Key Results

  • Sensorless Dataset: KAFs achieved a test accuracy of 99.80% with two hidden layers, outperforming other baselines and parametric methods like PReLU. The learned shapes were diverse and often independent of initialization.
  • SUSY Benchmark: KAFs (one layer: 0.8756 AUC, two layers: 0.8758 AUC) and 2D-KAFs (one layer: 0.8750 AUC, two layers: 0.8764 AUC) achieved the best results among the tested activation functions, with the 2D-KAF with two layers yielding the highest AUC (0.8764). Notably, these improvements were achieved with fewer trainable parameters than some other sophisticated activation functions.
  • CIFAR-10 (CNNs): KAFs and 2D-KAFs significantly improved test accuracy compared to ELU baselines, even with fewer convolutional modules, and the 2D-KAF achieved this with a substantial reduction in trainable parameters.
  • Reinforcement Learning: Policy networks using KAFs consistently learned faster and achieved higher cumulative rewards than the baseline (tanh) in MuJoCo environments.

Limitations and Future Work

  • Design Choices: The authors acknowledge that their initial model made specific design choices (fixed dictionary, Gaussian kernel, specific bandwidth selection) and that many alternative choices are possible.
  • Dictionary Selection: While they used a fixed dictionary for simplicity, they note that dictionary selection strategies are an active area of research in kernel methods and could be explored further.
  • Kernel Variety: Exploring alternative kernels beyond Gaussian and polynomial could lead to new variations and capabilities.
  • Multidimensional Extensions: The paper introduces a 2D-KAF, but further exploration of higher-dimensional KAFs and their applications could be beneficial.
  • Theoretical Guarantees: While empirical results are strong, further theoretical analysis of the approximation capabilities and convergence properties of KAFs could be valuable.

Summary updated

BibTeX
@inproceedings{scardapane2017kafnets,
  author = {Simone Scardapane and Steven Van Vaerenbergh and Simone Totaro and Aurelio Uncini},
  title = {{Kafnets: Kernel-based non-parametric activation functions for neural networks.}},
  booktitle = {Neural Networks},
  year = {2017},
  doi = {10.1016/j.neunet.2018.11.002},
}
Figure