Sample Complexity of Neural Networks
VC dimension is a measure of hypothesis-class capacity based on shattering.
From Correct Predictions to Expressive Capacity
When studying a neural network as a binary classifier, it is not enough to ask whether the network classifies one particular dataset correctly. We also want to know how many different classification patterns the entire hypothesis class can express. VC dimension provides a way to describe this expressive capacity. The connection matters because the sample complexity of learning a binary-classifier hypothesis class depends on its VC dimension.
The central idea is to test a hypothesis class on finite sets of input points. If the class can realize every relevant binary labeling of a set, that set is shattered. The largest size of a set that can be shattered determines the VC dimension.
Counting Labelings with the Growth Function
To study a hypothesis class, temporarily choose a finite set C of input points. Each hypothesis in the class assigns binary labels to the points in C. The class may produce only some of the possible labelings, or it may produce many of them. The growth function records the largest number of distinct labelings that the class can produce on any set of m points.
A Two-Point Labeling Count
Consider a fixed set containing two input points. Suppose a hypothesis class produces the binary labelings 0,0; 0,1; 1,0; and 1,1 on that set. What does this tell us about the class on this particular set?
Choose the point set: Fix the same two input points while comparing the hypotheses.
List the realized labelings: The class produces four distinct binary labelings: 0,0; 0,1; 1,0; and 1,1.
Interpret the count: The class realizes every labeling shown for this two-point set, so this set is shattered in the example.
Relate the count to growth: The growth function considers the number of distinct labelings and takes the maximum over sets of the chosen size, rather than looking only at one selected set.
On this example set, four distinct binary labelings are available. The growth function is concerned with the largest such count over all sets of two points.
Shattering and VC Dimension
VC dimension is a measure of the capacity of a hypothesis class based on shattering. It asks how large a set of points can be shattered by the class, where shattering means that the class can realize the relevant binary labelings on that set.
The size of the shattered set is the key quantity. A class with a larger VC dimension can support complete labeling behavior on a larger set, so it has greater capacity in the VC-dimension sense. This is a statement about the entire hypothesis class, not merely about the performance of one selected hypothesis on one selected dataset.
The growth function and VC dimension describe related but different views. The growth function counts how many distinct labelings are available on sets of a chosen size, taking the maximum over those sets. VC dimension asks for the largest set size for which the class can realize every relevant binary labeling.
The Neural-Network Capacity Bound
Now specialize to the hypothesis class H_{V,E,sign}. This class uses the sign activation function, and its network graph has a single neuron in the output layer. For this specified class, the source result states that the VC dimension is O(|E| log(|E|)). Here, |E| is the number of parameters being learned in the network as described by the network graph.
The bound connects the network's learned parameters to its capacity. It is not a statement about every neural-network architecture. It is a theorem for the specified hypothesis class, the sign activation function, and the single-output-neuron setting. The logarithmic factor is part of the stated upper-bound form.
Why Capacity Changes Sample Needs
For binary-classifier hypothesis classes, the fundamental learning-theory connection is direct: sample complexity depends on VC dimension. Once the VC dimension of a neural-network hypothesis class is bounded, that bound becomes relevant when reasoning about how many training examples are required to learn the class.
A larger VC dimension means that the class can support complete binary-labeling behavior on a larger set of points. In this capacity sense, the learner is dealing with a richer hypothesis class. Therefore, VC dimension is the capacity measure used when connecting the class's expressive possibilities to the amount of data needed for learning.
When analyzing a neural-network learning problem, first identify the hypothesis class and its assumptions. Then connect its VC-dimension bound to sample complexity. Do not infer a sample requirement from the number of parameters alone without checking which VC-dimension result applies.
Common Reasoning Errors
Treating good performance on one dataset as a measurement of VC dimension.
VC dimension concerns how many binary labeling patterns the entire hypothesis class can realize across sets of points, not just one dataset's observed accuracy.
Fix:
Ask about the class's ability to shatter finite sets and realize their relevant binary labelings.Defining the growth function using only one fixed point set.
The growth function records the maximum number of distinct labelings over sets containing the chosen number of points.
Fix:
Count the distinct labelings for candidate sets of m points and take the maximum.Applying the stated neural-network bound without its conditions.
The source result is for the sign-activation class with a single neuron in the output layer.
Fix:
State the activation function, output-layer condition, and meaning of |E| before using the bound.Confusing VC dimension with the exact number of training examples in every learning problem.
The source establishes that sample complexity depends on VC dimension, but does not state one exact sample count for every setting.
Fix:
Use VC dimension as the capacity quantity that informs sample-complexity reasoning for binary-classifier hypothesis classes.
Check Your Understanding
A hypothesis class is tested on a finite set of input points. Explain the difference between the number of labelings realized on that particular set, the growth function for sets of that size, and the VC dimension of the class.
Hints
- The growth function compares possible point sets of the same size.
- VC dimension asks about the largest set on which every relevant binary labeling can be realized.
State the VC-dimension bound for H_{V,E,sign}, and list the architectural conditions that are part of the stated result.
Hints
- Include the sign activation function.
- Include the single-neuron output layer.
- Explain what |E| counts.
Key Takeaways
- VC dimension measures the capacity of a hypothesis class through shattering.
- The growth function gives the maximum number of distinct labelings that the class can produce on any set of m points.
- For the specified sign-activation neural-network class with one output neuron, the VC dimension is O(|E| log(|E|)), where |E| is the number of learned parameters described by the network graph.
- For binary classifiers, sample complexity depends on VC dimension, so a VC-dimension bound is relevant to reasoning about how much training data is needed.