Kernel Methods for Deep Learning
Authors: Youngmin Cho, Lawrence K. Saul
Published: 2009
Venue: NeurIPS
Link: PDF
Summary
This paper introduces arc-cosine kernels, which correspond to the computation in multilayer neural networks. These kernels provide a bridge between deep learning and kernel methods, showing how to capture hierarchical representations in a kernel framework.
Key Contributions
1. Arc-Cosine Kernels
Define a family of kernels mimicking neural network layers:
where and:
2. Correspondence to Neural Networks
Single layer:
where is the Heaviside step function.
This is the expected dot product of hidden representations after ReLU-like activations.
3. Multilayer Composition
Stack kernels by recursive composition:
where
Special Cases
Order (Step Function)
Corresponds to:
- Activation: Heaviside
- Linear separator in feature space
Order (ReLU)
Corresponds to:
- Activation: ReLU
- Most commonly used in deep learning
Order (Squared ReLU)
Corresponds to:
- Activation:
Algorithm
import numpy as np
def arc_cosine_kernel(X1, X2, order=1, depth=1):
"""
Compute arc-cosine kernel.
Parameters:
-----------
X1, X2 : arrays of shape (n1, d) and (n2, d)
order : n parameter (0, 1, or 2)
depth : number of layers
Returns:
--------
K : kernel matrix (n1, n2)
"""
# Initialize with linear kernel
K = X1 @ X2.T
norm1 = np.sqrt(np.sum(X1**2, axis=1, keepdims=True))
norm2 = np.sqrt(np.sum(X2**2, axis=1))
for _ in range(depth):
# Compute angles
cos_theta = K / (norm1 @ norm2[np.newaxis, :] + 1e-10)
cos_theta = np.clip(cos_theta, -1, 1)
theta = np.arccos(cos_theta)
# Compute J_n(theta)
if order == 0:
J = 1 - theta / np.pi
elif order == 1:
J = (np.sin(theta) + (np.pi - theta) * cos_theta) / np.pi
elif order == 2:
J = (3 * np.sin(theta) * cos_theta +
(np.pi - theta) * (1 + 2 * cos_theta**2)) / np.pi
# Update kernel and norms
K_new = (norm1 ** order) @ ((norm2 ** order)[np.newaxis, :]) * J
# Update norms for next layer
norm1 = np.sqrt(np.diag(K_new))[:, np.newaxis]
norm2 = np.sqrt(np.diag(K_new))
K = K_new
return K
def multilayer_arc_cosine(X1, X2, order=1, depth=3):
"""Convenience function for deep arc-cosine kernel."""
return arc_cosine_kernel(X1, X2, order=order, depth=depth)
Theoretical Properties
Positive Definiteness
Theorem: Arc-cosine kernels are positive definite for all .
Proof: They arise as inner products of random features with Gaussian weights.
Universal Approximation
The composed kernel becomes increasingly discriminative:
- As , kernel becomes a delta function
- Finite depth gives tradeoff between smoothness and discrimination
Eigenvalue Decay
Eigenvalues of arc-cosine kernel matrices decay polynomially:
where depends on input dimension and order.
Comparison with Neural Networks
| Property | Arc-Cosine Kernel | Neural Network |
|---|---|---|
| Features | Infinite | Finite width |
| Weights | Integrated out | Learned |
| Training | Kernel methods | Backpropagation |
| Depth effect | Composition | Layer stacking |
Key Difference
Arc-cosine kernels correspond to random neural networks where weights are not learned, just integrated over.
Applications
- Deep kernel SVM: Use composed kernel in SVM
- Feature analysis: Study representations without training
- Initialization theory: Understanding random networks
- Kernel design: Principled construction of deep kernels
Connection to NTK
Arc-cosine kernels are related to but different from Neural Tangent Kernels:
- Arc-cosine: Dot product of hidden representations
- NTK: Dot product of gradients
At infinite width, both converge to deterministic kernels.
Citation
@inproceedings{cho2009kernel,
title={Kernel methods for deep learning},
author={Cho, Youngmin and Saul, Lawrence K},
booktitle={Advances in Neural Information Processing Systems},
volume={22},
year={2009}
}
Further Reading
- Neal, R. (1996). Priors for infinite networks
- Williams, C. K. I. (1997). Computing with infinite networks
- Jacot, A., et al. (2018). Neural tangent kernel