D O W IDE AND D EEP N ETWORKS
L EARN THE S AME
T HINGS ?
U NCOVERING
H OW N EURAL N ETWORK R EPRESENTATIONS V ARY WITH W IDTH AND D EPTH Anonymous authors
Paper under double-blind review
A BSTRACT
A key factor in the success of deep neural networks is the ability to scale models to improve performance by varying the architecture depth and width.
This simple property of neural network design has resulted in highly effective architectures for a variety of tasks.
Nevertheless, there is limited understanding of effects of depth and width on the learned representations .
In this paper, we study this fundamental question.
We begin by investigating how varying depth and width affects model hidden representations, ﬁnding a characteristic block structure in the hidden representations of larger capacity (wider or deeper) models.
We demonstrate that this block structure arises when model capacity is large relative to the size of the training set, and is indicative of the underlying layers preserving and propagating the dominant principal component of their representations.
This discovery has important ramiﬁcations for features learned by different models, namely, representations outside the block structure are often similar across architectures with varying widths and depths, but the block structure is unique to each model.
We analyze the output predictions of different model architectures, ﬁnding that even when the overall accuracy is similar, wide and deep models exhibit distinctive error patterns and variations across classes.
I NTRODUCTION
Deep neural network architectures are typically tailored to available computational resources by scaling their width and/or depth.
Remarkably, this simple approach to model scaling can result in state-of-the-art networks for both high- and low-resource regimes (Tan & Le, 2019).
However, despite the ubiquity of varying depth and width, there is limited understanding of how varying these properties affects the ﬁnal model beyond its performance.
Investigating this fundamental question is critical, especially with the continually increasing compute resources devoted to designing and training new network architectures.
More concretely, we can ask, how do depth and width affect the ﬁnal learned representations?
Do these different model architectures also learn different intermediate (hidden layer) features?
Are there discernible differences in the outputs?
In this paper, we study these core questions, through detailed analysis of a family of ResNet models with varying depths and widths trained on CIFAR-
(Krizhevsky et al., 2009), CIFAR-100 and ImageNet (Deng et al., 2009).
We show that depth/width variations result in distinctive characteristics in the model internal representations, with resulting consequences for representations and outputs across different model initializations and architectures.
Speciﬁcally, our contributions are as follows:
• We apply CKA (centered kernel alignment) to measure the similarity of the hidden representations of different neural network architectures, ﬁnding that representations in wide or deep models exhibit a characteristic structure, which we term the block structure .
We study how the block structure varies across different training runs, and uncover a connection between block structure and model overparametrization — block structure primarily appears in overparameterized models.
• Through further analysis, we ﬁnd that the block structure corresponds to hidden representations having a single principal component that explains the majority of the variance in the representa- tion, which is preserved and propagated through the corresponding layers.
We show that some hidden layers exhibiting the block structure can be pruned with minimal impact on performance.
• With this insight on the hidden representational structures within a single network, we turn to comparing representations across different architectures, ﬁnding that models without the block structure show reasonable representation similarity in corresponding layers, but block structure representations are unique to each model.
Finally, we look at how different depths and widths affect model outputs.
We ﬁnd that wide and deep models make systematically different mistakes at the level of individual examples.
Specifically, on ImageNet, even when these networks achieve similar overall accuracy, wide networks perform slightly better on classes reﬂecting scenes, whereas deep networks are slightly more accurate on consumer goods.
R ELATED W ORK
Neural network models of different depth and width have been studied through the lens of universal approximation theorems (Cybenko, 1989; Hornik, 1991; Pinkus, 1999; Lu et al., 2017; Hanin & Sellke, 2017; Lin & Jegelka, 2018) and functional expressivity (Telgarsky, 2015; Raghu et al., 2017b).
However, this line of work only shows that such networks can be constructed, and provides neither a guarantee of learnability nor a characterization of their performance when trained on ﬁnite datasets.
Other work has studied the behavior of neural networks in the inﬁnite width limit by relating architectures to their corresponding kernels (Matthews et al., 2018; Lee et al., 2018; Jacot et al., 2018), but substantial differences exist between behavior in this inﬁnite width limit and the behavior of ﬁnite-width networks (Novak et al., 2018; Wei et al., 2019;
Chizat et al., 2019; Lewkowycz et al., 2020).
In contrast to this body of theoretical work, we attempt to develop empirical understanding of the behavior of practical, ﬁnite-width neural network architectures after training on real-world data.
Previous empirical work has studied the effects of width and depth upon model accuracy in the context of convolutional neural network architecture design, ﬁnding that optimal accuracy is typically achieved by balancing width and depth (Zagoruyko & Komodakis, 2016; Tan & Le, 2019).
Further study of accuracy and error sets have been conducted in (Hacohen & Weinshall, 2020) (error sets over training), and (Hooker et al., 2019) (error after pruning).
Other work has demonstrated that it is often possible for narrower or shallower neural networks to attain similar accuracy to larger networks when the smaller networks are trained to mimic the larger networks’ predictions (Ba & Caruana, 2014; Romero et al., 2015).
We instead seek to study the impact of width and depth on network internal representations and (per-example) outputs, by applying techniques for measuring similarity of neural network hidden representations (Kornblith et al., 2019;
Raghu et al., 2017a; Morcos et al., 2018).
These techniques have been very successful in analyzing deep learning, from properties of neural network training (Gotmare et al., 2018; Neyshabur et al., 2020), objectives (Resnick et al., 2019; Thompson et al., 2019; Hermann & Lampinen, 2020), and dynamics (Maheswaranathan et al., 2019) to revealing hidden linguistic structure in large language models (Bau et al., 2019; Kudugunta et al., 2019; Wu et al., 2019; 2020) to applications in neuroscience (Shi et al., 2019; Li et al., 2019;
Merel et al., 2019; Zhang & Bellec, 2020) and medicine (Raghu et al., 2019).
E XPERIMENTAL S ETUP AND B ACKGROUND
Our goal is to understand the effects of depth and width on the function learned by the underlying neural network, in a setting representative of the high performance models used in practice.
Reﬂecting this, our experimental setup consists of a family of ResNets (He et al., 2016; Zagoruyko & Komodakis, 2016) trained on standard image classiﬁcation datasets CIFAR-10, CIFAR-100 and
ImageNet.
For standard CIFAR ResNet architectures, the network’s layers are evenly divided between three stages (feature map sizes), with numbers of channels increasing by a factor of two from one stage to the next.
We adjust the network’s width and depth by increasing the number of channels and layers respectively in each stage, following Zagoruyko & Komodakis (2016).
For ImageNet ResNets,
ResNet-50 and ResNet-101 architectures differ only by the number of layers in the third ( 14 × 14 ) stage.
Thus, for experiments on ImageNet, we scale only the width or depth of layers in this stage.
More details on training parameters, as well as the accuracies of all investigated models, can be found in Appendix B.
We observe that increasing depth and/or width indeed yields better-performing models.
However, we will show in the following sections how they exhibit characteristic differences in internal representations and outputs, beyond their comparable accuracies.
3. R EPRESENTATIONAL S IMILARITY M EASURES
Neural network hidden representations are challenging to analyze for several reasons including (i) their large size; (ii) their distributed nature, where important features in a layer may rely on multiple neurons; and (iii) lack of alignment between neurons in different layers.
Centered kernel alignment (CKA) (Kornblith et al., 2019; Cortes et al., 2012) addresses these challenges, providing a robust way to quantitatively study neural network representations by computing the similarity between pairs of activation matrices. Speciﬁcally, we use linear CKA, which Kornblith et al. (2019) have previously studied and validated for this purpose. Kornblith et al.
(2019) show that, when measured between layers of architecturally identical networks trained from different random initializations, linear CKA reliably identiﬁes architecturally corresponding layers, whereas other proposed ways of measuring similarity of neural network representations do not. Let X ∈ R m × p 1 and Y ∈ R m × p 2 contain representations of two layers, one with p 1 neurons and another p 2 neurons, to the same set of m examples. The elements of the Gram matrices K = XX T and L =
Y Y T reﬂect the similarities between pairs of examples according to the representations contained in X and Y .
Let H
=
I n − 1 n 11 T be the centering matrix.
Then K (cid:48)
=
HKH and L (cid:48)
=
HLH reﬂect the similarity matrices with their column and row means subtracted.
HSIC measures the similarity of these reshaped similarity matrices by reshaping them to vectors and taking the dot product between these vectors, HSIC 0 ( K , L ) =
vec( K (cid:48) ) · vec( L (cid:48) ) /
( m − 1) 2 .
HSIC is invariant to orthogonal transformations of the representations and, by extension, to permutation of neurons, but it is not invariant to isotropic scaling of the original representations.
CKA further normalizes HSIC to produce a similarity index between 0 and 1 that is invariant to isotropic scaling,
[Equation]
To reduce memory consumption, we compute linear CKA as a function of average HSIC scores computed over k minibatches:
[Equation] where X i ∈ R n × p 1 and Y i ∈ R n × p 2 are now matrices containing activations of the i th minibatch of n examples sampled without replacement.
In place of HSIC 0 , which is a biased estimator of HSIC, we use an unbiased estimator of HSIC (Song et al., 2012) so that the value of CKA is independent of the batch size:
[Equation]
where ˜K and ˜L are obtained by setting the diagonal entries of similarity matrices K and L to zero.
This approach of estimating HSIC based on minibatches is equivalent to the bagging block HSIC approach of Yamada et al.
When averaged over enough epochs, this minibatch estimator converges to the same value as if the entire dataset were considered as a single minibatch, as proven in Appendix A.
We use minibatches of size n = 256 obtained by iterating over the test datasettimes, sampling without replacement within each time.
D EPTH , W IDTH AND M ODEL I NTERNAL R EPRESENTATIONS
We begin our study by investigating how the depth and width of a model architecture affects its internal representation structure.
How do representations evolve through the hidden layers in different architectures?
How similar are different hidden layer representations to each other?
To answer these questions, we use the CKA representation similarity measure outlined in Section 3.1.
We ﬁnd that as networks become wider and/or deeper, their representations show a characteristic block structure : many (almost) consecutive hidden layers that have highly similar representations.
By training with reduced dataset size, we pinpoint a connection between block structure and model overparametrization — block structure emerges in models that have large capacity relative to the training dataset [Figure]
4. I NTERNAL R EPRESENTATIONS AND THE B LOCK S TRUCTURE
[Figure] In Figure 1, we show the results of training ResNets of varying depths (top row) and widths (bottom row) on CIFAR-10.
For each ResNet, we use CKA to compute the representation similarity of all pairs of layers within the same model.
Note that the total number of layers is much greater than the stated depth of the ResNet, as the latter only accounts for the convolutional layers in the network
but we include all intermediate representations.
We can visualize the result as a heatmap, with the x and y axes representing the layers of the network, going from the input layer to the output layer.
The heatmaps start off as showing a checkerboard-like representation similarity structure, which arises because representations after residual connections are more similar to other post-residual representations than representations inside ResNet blocks.
As the model gets wider or deeper, we see the emergence of a distinctive block structure — a considerable range of hidden layers that have very high representation similarity (seen as a yellow square on the heatmap).
This block structure mostly appears in the later layers (the last two stages) of the network.
We observe similar results in networks without residual connections (Appendix Figure C.1).
Block structure across random seeds: In Appendix Figure D.1, we plot CKA heatmaps across multiple random seeds of a deep network and a wide network.
We observe that while the exact size and position of the block structure can vary, it is present across all training runs. [Figure]
4. T HE B LOCK S TRUCTURE AND M ODEL O VERPARAMETRIZATION
Having observed that the block structure emerges as models get deeper and/or wider (Figure 1) [Figure] we next study whether block structure is a result of this increase in model capacity — namely, is block structure connected to the absolute model size
[Figure]
or to the size of the model relative to the size of the training data?
Commonly used neural networks have many more parameters than there are examples in their training sets.
However, even within this overparameterized regime, larger networks frequently achieve higher performance on held out data (Zagoruyko & Komodakis, 2016; Tan & Le, 2019).
Thus, to explore the connection between relative model capacity and the block structure, we ﬁx a model architecture, but decrease the training dataset size, which serves to inﬂate the relative model capacity.
The results of this experiment with varying network widths are shown in Figure 2, while the corresponding plot with varying network depths (which supports the same conclusions) can be found in Appendix Figure D.2.
Each column of Figure 2 shows the internal representation structure of a ﬁxed architecture as the amount of training data is reduced, and we can clearly see the emergence of the block structure in narrower (lower capacity) networks as less training data is used.
Refer to Figures D.3 and D.4 in the Appendix for a similar set of experiments on CIFAR-100.
Together, these observations indicate that block structure in the internal representations arises in models that are heavily overparameterized relative to the training dataset.
P ROBING THE B LOCK S TRUCTURE
In the previous section, we show that wide and/or deep neural networks exhibit a block structure in the CKA heatmaps of their internal representations, and that this block structure arises from the large capacity of the models in relation to the learned task.
While this latter result provides some insight into the block structure, there remains a key open question, which this section seeks to answer: what is happening to the neural network representations as they propagate through the block structure? [Figure] i
[Figure] Through further analysis [Figure] we show that the block structure arises from the preservation and propagation of the ﬁrst principal component of its constituent layer representations.
Additional experiments with linear probes (Alain & Bengio, 2016) further support this conclusion and show that some layers that make up the block structure can be removed with minimal performance loss
[Figure]
5. T HE B LOCK S TRUCTURE AND
T HE F IRST P RINCIPAL C OMPONENT
For centered matrices of activations X ∈ R n × p 1 , Y ∈ R n × p 2 , linear CKA may be written as:
[Equation]
where u iX ∈ R n and u iY ∈ R
n are the i th normalized principal components of X and Y and λ iX and λ i Y are the corresponding squared singular values (Kornblith et al., 2019).
As the fraction of the variance explained by the ﬁrst principal components approaches 1, CKA reﬂects the squared alignment between these components (cid:104) u
1 X , u 1 Y (cid:105) 2 .
We ﬁnd that, in networks with a visible block structure, the ﬁrst principal component explains a large fraction of the variance, whereas in networks with no visible block structure, it does not (Appendix Figure D.5), suggesting that the block structure reﬂects the behavior of the ﬁrst principal component of the representations.
Figure 3 explores this relationship between the block structure and the ﬁrst principal components of the corresponding layer representations, demonstrated on a deep network (left group) and a wide network (right group).
By comparing the variance explained by the ﬁrst principal component (bottom left) to the location of the block structure (top right)
we observe that layers belonging to the block structure have a highly dominant ﬁrst principal component.
Cosine similarity of the ﬁrst principal components across all pairs of layers (top left) also shows a similarity structure resembling the block structure (top right), further demonstrating that the principal component is preserved throughout the block structure.
Finally, removing the ﬁrst principal component from the representations nearly eliminates the block structure from the CKA heatmaps (bottom right).
A full picture of how this process impacts models of increasing depth and width can be found in Appendix Figure D.6.
Together these results demonstrate that the block structure arises from preserving and propagating the ﬁrst principal component across its constituent layers.
[Figure] i [Figure]
[Figure] Although layers inside the block structure have representations with high CKA and similar ﬁrst principal components, each layer nonetheless computes a nonlinear transformation of its input. Appendix Figure D.7 shows that the sparsity of ReLU activations inside and outside of the block structure is similar. Thus, ReLU activations in the block structure are sometimes in the linear regime and sometimes in the saturating regime, just like activations elsewhere in the network
[Figure]
With the insight that the block structure is preserving key components of the representations, we next investigate how these preserved representations impact task performance throughout the network, and whether the block structure can be collapsed in a way that minimally affects performance.
In Figure 4, we train a linear probe (Alain & Bengio, 2016) for each layer of the network, which maps from the layer representation to the output classes.
In models without the block structure (ﬁrst 2 panes), we see a monotonic increase in accuracy throughout the network, but in models with the block structure (last 2 panes), linear probe accuracy shows little improvement inside the block structure.
Comparing the accuracies of probes for layers pre- and post-residual connections, we ﬁnd that these connections play an important role in preserving representations in the block structure.
Informed by these results, we proceed to pruning blocks one-by-one from the end of each residual stage, while keeping the residual connections intact, and ﬁnd that there is little impact on test accuracy when blocks are dropped from the middle stage (Figure 5), unlike what happens in models without block structure.
When compared across different seeds, the magnitude of the drop in accuracy appears to be connected to the size and the clarity of the block structure present.
This result suggests that block structure could be an indication of redundant modules in model design, and that the similarity of its constituent layer representations could be leveraged for model compression.
D EPTH AND W IDTH E FFECTS ON R EPRESENTATIONS A CROSS M ODELS
The results of the previous sections help characterize effects of varying depth and width on a (single) model’s internal representations, speciﬁcally, the emergence of the block structure with increased capacity, and its impacts on how representations are propagated through the network.
With these insights, we next look at how depth and width affect the hidden representations across models.
Concretely, are learned representations similar across models of different architectures and different random initializations?
How is this affected as model capacity is changed?
We begin by studying the variations in representations across different training runs of the same model architecture.
Figure 6 illustrates CKA heatmaps for a smaller model (left), wide model (mid- [Figure] dle) and deep model (right), trained from random initializations.
The smaller model does not have the block structure, and representations across seeds (off diagonal plots) exhibit the same grid-like similarity structure as within a single model.
The wide and deep models show block structure in all their seeds (as seen in plots along the diagonal), and comparisons across seeds (off-diagonal plots) show that while layers not in the block structure exhibit some similarity, the block structure representations are highly dissimilar across models.
Appendix Figure E.1 shows results of comparing CKA across different architectures.
Wide and deep models without the block structure do exhibit representation similarity with each other, with corresponding layers broadly being of the same proportional depth in the model.
However, similar to what we observe in Figure 6, the block structure representations remain unique to each model.
D EPTH , W IDTH AND E FFECTS ON M ODEL P REDICTIONS
To conclude our investigation on the effects of depth and width, we turn to understanding how the characteristic properties of internal representations discussed in the previous sections inﬂuence the outputs of the model.
How diverse are the predictions of different architectures?
Are there examples that wide networks are more likely to do well on compared to deep networks, and vice versa?
By training populations of networks on CIFAR-10 and ImageNet, we ﬁnd that there is considerable diversity in output predictions at the individual example level, and broadly, architectures that are more similar in structure have more similar output predictions.
On ImageNet we also ﬁnd that there are statistically signiﬁcant differences in class-level error rates between wide and deep models, with the former exhibiting a small advantage in identifying classes corresponding to scenes over objects.
Figure 7a compares per-example accuracy for groups of 100 architecturally identical deep models (ResNet-62) and wide models (ResNet-14 (2 × )), all trained from different random initializations on
CIFAR-10.
Although the average accuracy of these groups is statistically indistinguishable, they tend to make different errors, and differences between groups are substantially larger than expected by chance (Figure 7b).
Examples of images with large accuracy differences are shown in Appendix
Figure F.1, while Appendix Figures F.2 and F.3 further explore patterns of accuracy for networks of different depths and widths, respectively.
As the architecture becomes wider or deeper, accuracy on many examples increases, and the effect is most pronounced for examples where smaller networks were often but not always correct.
At the same time, there are examples that larger networks are less likely to get right than smaller networks.
We show similar results for ImageNet networks in
Appendix Figure F.4.
We next ask whether wide and deep ImageNet models have systematic differences in accuracy at the class level.
As shown in Figure 7c, there are small but statistically signiﬁcant differences in accuracy for 419 / 1000 classes ( p < 0 .
05 , Welch’s t -test), accounting for 11% of the variance in the differences in example-level accuracy (see Appendix F.3).
Three of the top 5 classes that are more likely to be correctly classiﬁed by wide models reﬂect scenes rather than objects (seashore, library, bookshop).
Indeed, the wide architecture is signiﬁcantly more accurate on the 68 ImageNet classes descending from “structure” or “geological formation” ( 74 . 9% ± 0 .
vs. 74 .
6% ± 0 .
06 , p = 6 × 10 − 5 , Welch’s t-test).
Looking at synsets containing > 50 ImageNet classes, the deep architecture is signiﬁcantly more accurate on the 62 classes descending from “consumer goods” ( 72 . 4% ± 0 .
07 vs. 72 .
1% ± 0 .
06 , p = 0 .
001 ; Table F.2).
In other parts of the hierarchy, differences are smaller; both models achieve 81.6% accuracy on the 118 dog classes ( p = 0 . 48 ).
C ONCLUSION
In this work, we study the effects of width and depth on neural network representations.
Through experiments on CIFAR-10, CIFAR-100 and ImageNet, we have demonstrated that as either width or depth increases relative to the size of the dataset, analysis of hidden representations reveals the emergence of a characteristic block structure that reﬂects the similarity of a dominant ﬁrst principal component, propagated across many network hidden layers.
Further analysis ﬁnds that while the block structure is unique to each model, other learned features are shared across different initializations and architectures, particularly across relative depths of the network.
Despite these similarities in representational properties and performance of wide and deep networks, we nonetheless observe that width and depth have different effects on network predictions at the example and class levels.
There remain interesting open questions on how the block structure arises through training, and using the insights on network depth and width to inform optimal task-speciﬁc model design.
Appendix A C ONVERGENCE OF M INIBATCH HSIC
Proposition 1.
Let K ∈ R m × m and L ∈
R m ×
m be two kernel matrices constructed by applying kernel functions k and l respectively to all pairs of examples in a dataset D .
Form c random partitionings p of D into m/n minibatches b of size n , and let ˜ K b,p ∈ R n × n and ˜ L b,p ∈ R n × n be kernel matrices constructed by applying kernels k and l to all pairs of examples within each minibatch.
Deﬁne U
= HSIC 1 ( K , L ) , the value of HSIC 1 applied to the full dataset, and ˜ U
p = nm (cid:80) m/nb =1 HSIC 1 ( K b,p , L b,p ) , the average value of HSIC 1 over the minibatches in partitioning (epoch) p .
Then 1 c (cid:80) cp
=1 ˜ U
p P −→ U 0 as c → ∞ .
Proof.
Let i m 4 be the set of all 4-tuples of indices between 1 and m where each index occurs exactly once.
As proven in Theorem 3 of Song et al.
(2012), U 0 is a U-statistic:
[Equation]
where K ( i,j,q,r ) =
( K i,j , K i,q , K i,r , K j,q , K j,r , K q,r ) and the kernel of the U-statistic h is deﬁned in Song et al.
Let δ bS be 1 if the 4-tuple of dataset indices S is selected in minibatch b andotherwise.
Then:
[Equation]
Taking the expectation with respect to δ , and noting that δ is independent of h ( K S , L S ) ,
[Equation]
By symmetry, E δ (cid:2) δ bS (cid:3) is the same for all example and batch indices.
Speciﬁcally, there are n ! /
( n − 4)!
4-tuples that can be formed from each batch and m ! /
( m − 4)!
4-tuples that can be formed from the entire dataset, so the probability that a given 4-tuple is in a given batch is E δ (cid:2) δ bS (cid:3) =
( n ! / ( n − 4)!)
/ ( m ! / ( m − 4)!) .
Thus:
[Equation]
The minibatch indicators δ bS are either 0 or 1, so their variances and covariances are bounded, and the weighted sum in Eq.
6 has ﬁnite variance.
Thus, by the law of large numbers, 1 c (cid:80) cp
=1 ˜ U
p P −→ Uas p → ∞ .
B T RAINING D ETAILS
Our CIFAR-10 and CIFAR-100 networks follow the same architecture as He et al.
Zagoruyko & Komodakis (2016).
We train a set of models where we ﬁx the width multiplier of deep networks to 1 and experiment with models of depths 32, 44, 56, 110, 164.
On CIFAR-100, the block structure only appears at a greater depth so we also include depths 218 and 224 in our investigation.
For wide networks, we examine width multipliers of 1, 2, 4, 8 and 10 and depths of 14, 20, 26, and 38.
We use SGD with momentum of 0.9, together with a cosine decay learning rate schedule and batch size of 128, to train each model for 300 epochs.
Models are trained with standard CIFAR-10 data augmentation comprising random ﬂips and translations of up to 4 pixels.
Each depth and width conﬁguration is trained with 10 different seeds for CKA analysis, andseeds for model predictions comparison.
On ImageNet, we start with the ResNet-50 architecture and increase depth or width in the third stage only, following the scaling approach of (He et al., 2016).
We train for 120 epochs using SGD with momentum of 0.9 and a cosine decay learning rate schedule at a batch size of 256.
We use 100 seeds for model prediction comparison.
For experiments with reduced dataset size, we subsample the training data from the original CIFAR training set by the corresponding proportion, keeping the number of samples for each class the same.
All CKA results are then computed based on the full CIFAR test set.
[Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
C B LOCK S TRUCTURE IN A D IFFERENT A RCHITECTURE
[Figure]
D P ROBING THE B LOCK S TRUCTURE
[Figure]
[Figure]
[Figure] E R EPRESENTATIONS A CROSS M ODELS [Figure] F E XAMPLE - AND C LASS -L EVEL A CCURACY D IFFERENCES F. E FFECT OF V ARYING W IDTH AND D EPTH ON CIFAR-10 P REDICTIONS
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
F.
F. E FFECT S IZES FOR C LASS -L EVEL E FFECTS
We measure how much of the difference between the example-level predictions of the wide and deep ImageNet ResNets in Section 7 could be explained by the classes to which they belonged by ﬁtting a set of three models.
Model A attempts to model whether each prediction was correct or incorrect as a linear combination factors corresponding to the example ID and whether the prediction came from a wide or deep model ( statsmodels formula y ˜ C(example_id) + C(wide_or_deep) ).
Model B includes a factor corresponding to the example ID as well as factors corresponding to the interaction between the class ID and the type of model the prediction came from ( statsmodels formula y ˜ C(example_id) + C(wide_or_deep) * C(class_id) ).
Model C includes the interaction between the example ID and the type of model, and corresponds to simply measuring the average accuracy separately for both types of models ( statsmodels formula y ˜ C(example_id)
* C(wide_or_deep) ).
Note that model C is nested inside model
B, which is nested inside model A.
We seek to measure how much of the variability in predictions that can be explained by model C but not model A can be explained by model
B. We ﬁt these models with logistic regression and measure the residual variance Var Q = (cid:80) ni
=
( y i − π i ) 2 /n , where n is the number of examples × the number of models, y i is either 1 or 0 depending on whether the CNN’s prediction was correct or incorrect, and π i is the output probability from logistic regression model Q .
We then compute the squared differences between y and the predictions of the logistic regression model:
[Equation]
This approach is analogous to the pseudo- R 2 of Efron (1978).
Finally, we can compare the AIC values of the logistic regression models, shown in the table below.
Because the models are nested GLMs, we can also test for statistical signiﬁcance using a χ 2 test, which is highly signiﬁcant for each pair of nested models.
We do not report p-values because they are 0 to within machine precision.
[Table] [Table]