F ROM H ARD TO S OFT : U NDERSTANDING D EEP N ETWORK N ONLINEARITIES VIA V ECTOR Q UANTIZATION AND S TATISTICAL I NFERENCE
A BSTRACT
Nonlinearity is crucial to the performance of a deep (neural) network (DN).
To date there has been little progress understanding the menagerie of available nonlinearities, but recently progress has been made on understanding the r ˆ ole played by piecewise afﬁne and convex nonlinearities like the ReLU and absolute value activation functions and max-pooling.
In particular, DN layers constructed from these operations can be interpreted as max-afﬁne spline operators (MASOs) that have an elegant link to vector quantization (VQ) and K -means.
While this is good theoretical progress, the entire MASO approach is predicated on the requirement that the nonlinearities be piecewise afﬁne and convex, which precludes important activation functions like the sigmoid, hyperbolic tangent, and softmax.
This paper extends the MASO framework to these and an inﬁnitely large class of new nonlinearities by linking deterministic MASOs with probabilistic Gaussian Mixture Models (GMMs).
We show that, under a GMM, piecewise afﬁne, convex nonlinearities like ReLU, absolute value, and max-pooling can be interpreted as solutions to certain natural “hard” VQ inference problems, while sigmoid, hyperbolic tangent, and softmax can be interpreted as solutions to corresponding “soft”
VQ inference problems.
We further extend the framework by hybridizing the hard and soft VQ optimizations to create a β -VQ inference that interpolates between hard, soft, and linear VQ inference.
A prime example of a β -VQ DN nonlinearity is the swish nonlinearity, which offers state-of-the-art performance in a range of computer vision tasks but was developed ad hoc by experimentation.
Finally, we validate
with experiments an important assertion of our theory, namely that DN performance can be signiﬁcantly improved by enforcing orthogonality in its linear ﬁlters
I NTRODUCTION
Deep (neural) networks (DNs) have recently come to the fore in a wide range of machine learning tasks, from regression to classiﬁcation and beyond.
A DN is typically constructed by composing a large number of linear/afﬁne transformations interspersed with up/down-sampling operations and simple scalar nonlinearities such as the ReLU, absolute value, sigmoid, hyperbolic tangent, etc.
Goodfellow et al. (2016).
Scalar nonlinearities are crucial to a DN’s performance.
Indeed, without nonlinearity, the entire network would collapse to a simple afﬁne transformation.
But to date there has been little progress understanding and unifying the menagerie of nonlinearities, with few reasons to choose one over another other than intuition or experimentation.
Recently, progress has been made on understanding the rˆole played by piecewise afﬁne and convex nonlinearities like the ReLU, leaky ReLU, and absolute value activations and downsampling operations like max-, average-, and channel-pooling Balestriero & Baraniuk (2018a;b).
In particular, these operations can be interpreted as max-afﬁne spline operators (MASOs) Magnani & Boyd (2009); Hannah & Dunson (2013) that enable a DN to ﬁnd a locally optimized piecewise afﬁne approximation to the prediction operator given training data.
A spline-based prediction is made in two steps.
First, given an input signal x , we determine which region of the spline’s partition of the domain (the input signal space) it falls into.
Second, we apply to x the ﬁxed (in this case afﬁne) function that is assigned to that partition region to obtain the prediction (cid:98) y
= f ( x ) .
The key result of Balestriero & Baraniuk (2018a;b) is any DN layer constructed from a combination of linear and piecewise afﬁne and convex is a MASO , and hence the entire DN is merely a composition of MASOs.
MASOs have the attractive property that their partition of the signal space (the collection of multidimensional “knots”) is completely determined by their afﬁne parameters (slopes and offsets).
This provides an elegant link to vector quantization (VQ) and K -means clustering .
That is, during learning, a DN implicitly constructs a hierarchical VQ of the training data that is then used for splinebased prediction.
This is good progress for DNs based on ReLU, absolute value, and max-pooling, but what about DNs based on classical, high-performing nonlinearities that are neither piecewise afﬁne nor convex like the sigmoid, hyperbolic tangent, and softmax or fresh nonlinearities like the swish Ramachandran et al.
(2017) that has been shown to outperform others on a range of tasks?
Contributions.
In this paper, we address this gap in the DN theory by developing a new framework that uniﬁes a wide range of DN nonlinearities and inspires and supports the development of new ones.
The key idea is to leverage the yinyang relationship between deterministic VQ/ K -means and probabilistic Gaussian Mixture Models (GMMs) Biernacki et al.
Under a GMM, piecewise afﬁne, convex nonlinearities like ReLU and absolute value can be interpreted as solutions to certain natural hard inference problems, while sigmoid and hyperbolic tangent can be interpreted as solutions to corresponding soft inference problems.
We summarize our primary contributions as follows:
Contribution 1: We leverage the well-understood relationship between VQ, K -means, and GMMs to propose the Soft MASO (SMASO) model, a probabilistic GMM that extends the concept of a deterministic MASO DN layer.
Under the SMASO model, hard maximum a posteriori (MAP) inference of the VQ parameters corresponds to conventional deterministic MASO DN operations that involve piecewise afﬁne and convex functions, such as fully connected and convolution matrix multiplication; ReLU, leaky-ReLU, and absolute value activation; and max-, average-, and channelpooling.
These operations assign the layer’s input signal (feature map) to the VQ partition region corresponding to the closest centroid in terms of the Euclidean distance,
Contribution 2 : A hard VQ inference contains no information regarding the conﬁdence of the VQ region selection, which is related to the distance from the input signal to the region boundary.
In response, we develop a method for soft MAP inference of the VQ parameters based on the probability that the layer input belongs to a given VQ region.
Switching from hard to soft VQ inference recovers several classical and powerful nonlinearities and provides an avenue to derive completely new ones.
We illustrate by showing that the soft versions of ReLU and max-pooling are the sigmoid gated linear unit and softmax pooling, respectively.
We also ﬁnd a home for the sigmoid, hyperbolic tangent, and softmax in the framework as a new kind of DN layer where the MASO output is the VQ probability.
Contribution 3: We generalize hard and soft VQ to what we call β -VQ inference , where β ∈ (0 , 1) is a free and learnable parameter.
This parameter interpolates the VQ from linear ( β → 0 ), to probabilistic SMASO ( β = 0 . 5 ), to deterministic MASO ( β → 1 ).
We show that the β -VQ version of the hard ReLU activation is the swish nonlinearity, which offers state-of-the-art performance in a range of computer vision tasks but was developed ad hoc through experimentation Ramachandran et al.
Contribution 4: Seen through the MASO lens, current DNs solve a simplistic per-unit (per-neuron), independent VQ optimization problem at each layer.
In response, we extend the SMASO GMM to a factorial GMM that that supports jointly optimal VQ across all units in a layer.
Since the factorial aspect of the new model would make na¨ıve VQ inference exponentially computationally complex, we develop a simple sufﬁcient condition under which a we can achieve efﬁcient, tractable, jointly optimal VQ inference.
The condition is that the linear “ﬁlters” feeding into any nonlinearity should be orthogonal .
We propose two simple strategies to learn approximately and truly orthogonal weights and show on three different datasets that both offer signiﬁcant improvements in classiﬁcation per- formance.
Since orthogonalization can be applied to an arbitrary DN, this result and our theoretical understanding are of independent interest.
This paper is organized as follows.
After reviewing the theory of MASOs and VQ for DNs in
Section 2, we formulate the GMM-based extension to SMASOs in Section 3.
Section 4 develops the hybrid β -VQ inference with a special case study on the swish nonlinearity.
Section 5 extends the
SMASO to a factorial GMM and shows the power of DN orthogonalization.
We wrap up in Sectionwith directions for future research.
Proofs of the various results appear in several appendices in the
Supplementary Material.
B ACKGROUND ON M AX -A FFINE S PLINES AND D EEP N ETWORKS
We ﬁrst brieﬂy review max-afﬁne spline operators (MASOs) in the context of understanding the inner workings of DNs Balestriero & Baraniuk (2018a;b).
A MASO is an operator S
[ A, B ] : R D
→ R K that maps an input vector of length D into an output vector of length K by concatenating
K independent max-afﬁne splines Magnani & Boyd (2009); Hannah & Dunson (2013), with each spline formed from R piecewise afﬁne and convex mappings.
The MASO parameters consist of the “slopes” A ∈ R K × R × D and the “offsets/biases” B ∈ R K × R .
See Appendix A for the precise deﬁnition.
Given the input x ∈ R D and parameters A, B , a MASO produces the output z ∈ R K via
[Equation]
where [ z ] k denotes the k th dimension of z .
The three subscripts of the slopes tensor [ A ] k,r,d correspond to output k , partition region r , and input signal index d .
The two subscripts of the offsets/biases tensor [ B ] k,r correspond to output k and partition region r .
An important consequence of (1) is that a MASO is completely determined by its slope and offset parameters without needing to specify the partition of the input space (the “knots” when D = 1 ).
Indeed, solving (1) automatically computes an optimized partition of the input space R D that is equivalent to a vector quantization (VQ) Nasrabadi & King (1988); Gersho & Gray (2012).
We can make the VQ aspect explicit by rewriting (1) in terms of the Hard-VQ (HVQ) matrix
T H ∈
R K × R .
that contains K stacked one-hot row vectors, each with the one-hot position at index [ t ] k ∈ { 1 , . .
, R } corresponding to the arg max over r = 1 , . . .
, R of (1).
Given the HVQ matrix, (or equivalently, a region of the input space), the input-output mapping is afﬁne and fully determined by
[Equation]
We retrieve (1) from (2) by noting that [ t ] k = arg max r =1 ,...,R ( (cid:104)
[ A ] k,r, · , x (cid:105) + [ B ] k
[Equation]
The key background result for this paper is that the layers of a very large class of DN are MASOs.
Hence, such a DN is a composition of MASOs, where each layer MASO has as input the feature map z
( (cid:96) − 1) ∈
R D ( (cid:96) − 1) and produces z ( (cid:96) )
∈ R D ( (cid:96) ) , with (cid:96) corresponding to the layer.
Each MASO has thus speciﬁc parameters A ( (cid:96) )
, B ( (cid:96) ) .
Theorem 1.
Any DN layer comprising a linear operator (e.g., fully connected or convolution) composed with a convex and piecewise afﬁne operator (such as a ReLU, leaky-ReLU, or absolute value activation; max/average/channel-pooling; maxout; all with or without skip connections) is a MASO
Balestriero & Baraniuk (2018a;b).
Appendix A provides the parameters A ( (cid:96) ) , B ( (cid:96) ) for the MASO corresponding to the (cid:96) th layer of any
DN constructed from linear plus piecewise afﬁne and convex components.
Given this connection, we will identify z ( (cid:96) − 1) above as the input (feature map) to the MASO DN layer and z ( (cid:96) ) as the output (feature map).
We also identify [ z ( (cid:96) ) ]
k in (1) and (2) as the output of the k th unit (aka neuron) of the (cid:96) th layer.
MASOs for higher-dimensional tensor inputs/outputs are easily developed by ﬂattening.
M AX -A FFINE S PLINES MEET G AUSSIAN M IXTURE M ODELS
The MASO/HVQ connection provides deep insights into how a DN clusters and organizes signals layer by layer in a hierarchical fashion Balestriero & Baraniuk (2018a;b).
However, the entire ap- proach requires that the nonlinearities be piecewise afﬁne and convex, which precludes important activation functions like the sigmoid, hyperbolic tangent, and softmax.
The goal of this paper is to extend the MASO analysis framework of Section 2 to these and an inﬁnitely large class of other nonlinearities by linking deterministic MASOs with probabilistic Gaussian Mixture Models (GMMs).
3. F ROM MASO TO GMM VIA K -M EANS
For now, we focus on a single unit k from layer (cid:96) of a MASO DN, which contains both linear and nonlinear operators; we generalize below in Section 5.
The key to the MASO mechanism lies in the VQ variables [ t ( (cid:96) ) ]
k ∀ k , since they fully determine the output via (2).
For a special choice of bias, the VQ variable computation is equivalent to the K -means algorithm Balestriero & Baraniuk (2018a;b).
Proposition 1.
Given − 12 (cid:13)(cid:13)(cid:2)
A ( (cid:96) ) (cid:3) k,r, · (cid:13)(cid:13) 2 = (cid:2) B ( (cid:96) ) (cid:3) k,r , the MASO VQ partition corresponds to a Kmeans clustering 1 with centroids (cid:2)
A ( (cid:96) ) (cid:3) k,r, · computed via [ (cid:99) t ( (cid:96) ) ]
k =arg min r =1 ,...,R (cid:13)(cid:13)(cid:2)
A ( (cid:96) ) (cid:3) k,r, · − z ( (cid:96) − 1) (cid:13)(cid:13) 2 .
For example, consider a layer (cid:96) using a ReLU activation function.
Unit k of that layer partitions its input space using a K -means model with R ( (cid:96) )
= 2 centroids: the origin of the input space and the unit layer parameter [ A ( (cid:96) ) ]
k, 1 , · .
The input is mapped to the partition region corresponding to the closest centroid in terms of the Euclidean distance, and the corresponding afﬁne mapping for that region is used to project the input and produce the layer output as in (2).
We now leverage the well-known relationship between K -means and Gaussian Mixture Models (GMMs) Bishop (2006) to GMM-ize the deterministic VQ process of max-afﬁne splines.
As we will see, the constraint on the value of (cid:2) B ( (cid:96) ) (cid:3) k,r in Proposition 1 will be relaxed thanks to the
GMM’s ability to work with a nonuniform prior over the regions (in contrast to K -means).
To move from a deterministic MASO model to a probabilistic GMM, we reformulate the HVQ selection variable [ t ( (cid:96) ) ]
k as an unobserved categorical variable [ t ( (cid:96) ) ]
k ∼ C at ([ π ( (cid:96) ) ] k, · ) with parameter [ π ( (cid:96) ) ]
k, · ∈ (cid:52) R ( (cid:96) ) and (cid:52) R ( (cid:96) )
the simplex of dimension R ( (cid:96) ) .
Armed with this, we deﬁne the following generative model for the layer input z
( (cid:96) − 1) as a mixture of R ( (cid:96) )
Gaussians with mean [ A ( (cid:96) ) ] k,r, · ∈ R D ( (cid:96) − 1) and identical isotropic covariance with parameter
σ
[Equation]
with (cid:15) ∼ N (0 , Iσ 2 ) .
Note that this GMM generates an independent vector input z
( (cid:96) − 1) for every unit k = 1 , . . .
, D ( (cid:96) ) in layer (cid:96) .
For reasons that will become clear below in Section 3.3, we will refer to the GMM model (3) as the Soft MASO (SMASO) model.
We develop a joint, factorial model for the entire MASO layer (and not just one unit) in Section 5.
3. H ARD VQ I NFERENCE
Given the GMM (3) and an input z
( (cid:96) − 1) , we can compute a hard inference of the optimal VQ selection variable [ t ( (cid:96) ) ]
k via the maximum a posteriori (MAP) principle
[Equation]
The following result is proved in Appendix E.1.
Theorem 2.
Given a GMM with parameters σ 2 =
and [ π ( (cid:96) ) ]
k,t =
[Equation]
t = 1 , . . .
, R ( (cid:96) ) , the MAP inference of the latent selection variable [ (cid:99) t ( (cid:96) ) ]
k given in (4) can be computed via the MASO HVQ (1)
[Equation]
The optimal HVQ selection matrix is given by [ (cid:100) T ( (cid:96) )
H ] k,r = 1 (cid:0) r =
[ (cid:99) t ( (cid:96) ) ]
k (cid:1) .
Note in Theorem 2 that the bias constraint of Proposition 1 (which can be interpreted as imposing a uniform prior [ π ( (cid:96) ) ]
k, · ) is completely relaxed.
HVQ inference of the selection matrix sheds light on some of the drawbacks that affect any DN employing piecewise afﬁne, convex activation functions.
First, during gradient-based learning, the gradient will propagate back only through the activated VQ regions that correspond to the few 1-hot entries in T ( (cid:96) )
H .
The parameters of other regions will not be updated; this is known as the “dying neurons phenomenon” Trottier et al.
(2017); Agarap (2018).
Second, the overall MASO mapping is continuous but not differentiable, which leads to unexpected gradient jumps during learning.
Third, the HVQ inference contains no information regarding the conﬁdence of the VQ region selection, which is related to the distance of the query point to the region boundary.
As we will now see, this extra information can be very useful and gives rise to a range of classical and new activation functions.
3. S OFT VQ I NFERENCE
We can overcome many of the limitations of HVQ inference in DNs by replacing the 1-hot entries of the HVQ selection matrix with the probability that the layer input belongs to a given VQ region
[Equation]
which follows from the simple structure of the GMM.
This corresponds to a soft inference of the categorical variable [ t ( (cid:96) ) ]
k .
Note that T ( (cid:96) )
S → T ( (cid:96) )
H as the noise variance in (3) → 0 .
Given the SVQ selection matrix, the MASO output is still computed via (2).
The SVQ matrix can be computed indirectly from an entropy-penalized MASO optimization; the following is reproved in Appendix E. for completeness.
Proposition 2.
The entries of the SVQ selection matrix [ (cid:100) T (
[Equation]
) S ] k, · from (6) solve the following entropypenalized maximization, where H ( · ) is the Shannon entropy
[Equation]
Proposition 2, which was ﬁrst established in Manning & Klein (2003); Mount (2011), uniﬁes HVQ and SVQ in a single optimization problem.
The transition from HVQ (5) to SVQ (7) is obtained simply by adding the entropy regularization H ( t ) .
Notice that removing the Entropy regularization from (7) leads to the same VQ as (5).
We summarize this ﬁnding in Table.
3. S OFT VQ MASO N ONLINEARITIES
Remarkably, switching from HVQ to SVQ MASO inference recovers several classical and powerful nonlinearities and provides an avenue to derive completely new ones.
Given a set of MASO parameters A ( (cid:96) ) , B ( (cid:96) ) for calculating the layer- (cid:96) output of a DN via (1), we can derive two distinctly different DNs: one based on the HVQ inference of (5) and one based on the SVQ inference of (6).
The following results are proved in Appendix E.5.
Proposition 3.
The MASO parameters A ( (cid:96) ) , B ( (cid:96) ) that induce the ReLU activation under HVQ induce the sigmoid gated linear unit Elfwing et al.
(2018) under SVQ.
Proposition 4.
The MASO parameters A ( (cid:96) ) , B ( (cid:96) ) that induce the max-pooling nonlinearity under
HVQ induce softmax-pooling Boureau et al.
(2010) under SVQ.
Appendix C discusses how the GMM and SVQ formulations shed new light on the impact of parameter initialization in DC learning plus how these formulations can be extended further.
[Table] [Table]
3. A DDITIONAL N ONLINEARITIES AS S OFT DN L AYERS
Changing viewpoint slightly, we can also derive classical nonlinearities like the sigmoid, tanh
[Table]
and softmax Goodfellow et al. (2016) from the soft inference perspective.
Consider a new soft DN layer whose unit output [ z ( (cid:96) ) ]
k is not the piecewise afﬁne spline of (2) but rather the probability [ z ( (cid:96) ) ]
k = p ([ t ( (cid:96) ) ]
k = 1 | z ( (cid:96) − 1) ) that the input z
( (cid:96) ) falls into each VQ region.
The following propositions are proved in Appendix E.6.
Proposition 5.
The MASO parameters A ( (cid:96) ) , B ( (cid:96) ) that induce the ReLU activation under HVQ induce the sigmoid activation in the corresponding soft DN layer.
A similar train of thought recovers the softmax nonlinearity typically used at the DN output for classiﬁcation problems.
Proposition 6.
The MASO parameters A ( (cid:96) ) , B ( (cid:96) ) that induce a fully-connected-pooling layer under
HVQ (with output dimension D ( L ) equal to the number of classes C ) induce the softmax nonlinearity in the corresponding soft DN layer.
H YBRID H ARD /S OFT I NFERENCE VIA E NTROPY R EGULARIZATION
Combining (5) and (6) yields a hybrid optimization for a new β -VQ that recovers hard, soft, and linear VQ inference as special cases
[Equation]
with the new hyper-parameter [ β ( (cid:96) ) ]
k ∈ (0 , 1) .
The β -VQ obtained from the above optimization problem utilizes [ β ( (cid:96) ) ]
k to balance the impact of the regularization term (introduced in the SVQ derivation (7)), allowing to recover and interpolate the VQ between linear, soft and hard (see Table. 1).
The following is proved in Appendix E.3.
Theorem 3.
The unique global optimum of (8) is given by
[Equation]
[Equation]
The β -VQ covers all of the theory developed above as special cases: β = 1 yields HVQ, β =yields SVQ, and β = 0 yields a linear MASO with [ (cid:100) T ( (cid:96) ) 0 ] k,r = 1 R ( (cid:96) ) .
See Figure 1 for examples of how the β parameter interacts with three example activation functions.
Note also the attractive property that (9) is differentiable with respect to [ β ( (cid:96) ) ] k .
The β -VQ supports the development of new, high-performance DN nonlinearities.
For example, the swish activation σ swish ( u ) =
σ sig ([ η ( (cid:96) ) ]
k u ) u extends the sigmoid gated linear unit Elfwing et al.
(2018) with the learnable parameter [ η ( (cid:96) ) ]
k Ramachandran et al.
Numerous experimental studies have shown that DNs equipped with a learned swish activation signiﬁcantly outperform those with more classical activations like ReLU and sigmoid.
Proposition 7.
The MASO A ( (cid:96) ) , B ( (cid:96) ) parameters that induce the ReLU nonlinearity under HVQ induce the swish nonlinearity under β -VQ, with [ η ( (cid:96)
[Equation]
Table 1 summarizes some of the many nonlinearities that are within reach of the β -VQ.
O PTIMAL J OINT VQ I NFERENCE VIA O RTHOGONALIZATION
The GMM (3) models the impact of only a single layer unit on the layer- (cid:96) input z ( (cid:96) − 1) .
We can easily extend this model to a factorial model for z ( (cid:96) − 1) that enables all D ( (cid:96) ) units at layer (cid:96) to combine their syntheses:
[Equation]
(10) with (cid:15) ∼ N (0 , Iσ 2 ) .
This new model is a mixture of R ( (cid:96) )
Gaussians with means [ A ( (cid:96) ) ] k,r, · ∈
R D ( (cid:96) − 1) and identical isotropic covariances with variance σ 2 .
The factorial aspect of the model means that the number of possible combinations of the t ( (cid:96) ) values grow exponentially with the number of units.
Hence, inferring the latent variables t ( (cid:96) ) quickly becomes intractable.
However, we can break this combinatorial barrier and achieve efﬁcient, tractable VQ inference by constraining the MASO slope parameters
A ( (cid:96) ) to be orthogonal
[Equation]
Orthogonality is achieved in a fully connected layer (multiplication by the dense matrix W ( (cid:96) ) composed with activation or pooling) when the rows of W ( (cid:96) ) are orthogonal.
Orthogonality is achieved in a convolution layer (multiplication by the convolution matrix C ( (cid:96) ) composed with activation or pooling) when the rows of C ( (cid:96) ) are either non-overlapping or properly apodized; see Appendix E. for the details plus the proof of the following result.
Theorem 4.
If the slope parameters A ( (cid:96) ) of a MASO are orthogonal in the sense of (11), then the random variables [ t ( (cid:96) ) ]
1 | z ( (cid:96) − 1) , . . .
, [ t ( (cid:96) ) ] 1 | z ( (cid:96) − 1) of the model (10) are independent and hence p (cid:0)
[ t ( (cid:96) ) ] 1 , . . .
, [ t ( (cid:96) ) ]
D ( (cid:96) )
| z ( (cid:96) − 1) (cid:1) =
(cid:81) D ( (cid:96) )
k =1 p (cid:0) [ t ( (cid:96)
[Table]
In an orthogonal, factorial MASO, optimal inference can be performed independently per factor, as opposed to jointly over all of the factors.
Orthogonality renders the joint MAP inference of the factorial model’s VQs tractable.
The following result is proved in Appendix E.4.
Practically, this not only lowers the computational complexity tremendously but also imparts the beneﬁt of “uncorrelated unit ﬁring,” which has been shown to be advantageous in DNs Srivastava et al.
Beyond the scope of this paper, such an orthogonalization strategy can also be applied to more general factorial models such as factorial GMMs Zemel (1994); Ghahramani (1995) and factorial HMMs Ghahramani & Jordan (1996).
[Table]
Corollary 1.
When the conditions of Theorem 4 are fulﬁlled
[Table]
the joint MAP estimate for the VQs of the factorial model (10)
[Equation]
(12) and thus can be computed with linear complexity in the number of units.
The advantages of orthogonal or near-orthogonal ﬁlters have been explored empirically in various settings, from GANs Brock et al.
(2016) to RNNs Huang et al.
(2017), typically demonstrating improved performance.
Table 2 tabulates the results of a simple conﬁrmation experiment with the largeCNN architecture described in Appendix D. We added to the standard cross-entropy loss a term λ (cid:80) k (cid:80) k (cid:48)
(cid:54) =
k (cid:80) r,r (cid:48) (cid:104)
[ A ( (cid:96) ) ] k,r, · , [ A ( (cid:96) ) ]
k (cid:48) ,r (cid:48) , · (cid:105) 2 that penalizes non-orthogonality (recall (11)).
We did not cross-validate the penalty coefﬁcient λ
but instead set it equal to 1.
The tabulated results show clearly that favoring orthogonal ﬁlters improves accuracy across both different datasets and different learning settings.
Since the orthogonality penalty does not guarantee true orthogonality but simply favors it, we performed one additional experiment where we reparametrized the fully-connected and convolution matrices using the Gram-Schmidt (GS) process Daniel et al.
(1976) so that they were truly orthogonal.
Thanks to the differentiability of all of the operations involved in the GS process, we can backpropagate the loss to the orthogonalized ﬁlters in order to update them in learning.
We also used the swish activation, which we showed to be a β -VQ nonlinearity in Section 4.
Since the GS process adds signiﬁcant computational overhead to the learning algorithm, we conducted only one experiment on the largest dataset (CIFAR100).
The exactly orthogonalized largeCNN achieved a classiﬁcation accuracy of 61 . 2% , which is a major improvement over all of the results in the bottom (CIFAR100) cell of Table 2.
This indicates that there are good reasons to try to improve on the simple orthogonality-penalty-based approach.
F UTURE W ORK
Our development of the SMASO model opens the door to several new research questions.
First, we have merely scratched the surface in the exploration of new nonlinear activation functions and pooling operators based on the SVQ and β -VQ.
For example, the soft- or β -VQ versions of leakyReLU, absolute value, and other piecewise afﬁne and convex nonlinearities could outperform the new swish nonlinearity.
Second, replacing the entropy penalty in the (7) and (8) with a different penalty will create entirely new classes of nonlinearities that inherit the rich analytical properties of MASO DNs.
Third, orthogonal DN ﬁlters will enable new analysis techniques and DN probing methods, since from a signal processing point of view problems such as denoising, reconstruction, compression have been extensively studied in terms of orthogonal ﬁlters.
This work was partially supported by NSF grants IIS-17-30574 and IIS-18-38177, AFOSR grant FA9550-18-1-0478, ARO grant W911NF-15-1-0316, ONR grants N00014-17-1-2551 and N00014-18-12571, DARPA grant
G001534-7500, and a DOD Vannevar Bush Faculty Fellowship (NSSEFF) grant N00014-18-1-2047.
S UPPLEMENTARY M ATERIALS A B ACKGROUND
A Deep Network (DN) is an operator
f Θ : R D
→ R C that maps an input signal x ∈ R D to an output prediction y ∈ R C .
All current DNs can be written as a composition of L intermediate mappings called layers
[Equation]
(13) where Θ = (cid:110) θ (1) , . .
, θ ( L ) (cid:111) is the collection of the network’s parameters from each layer.
The DN layer at level (cid:96) is an operator f ( (cid:96) )
θ ( (cid:96) ) that takes as input the vector-valued signal z ( (cid:96) − 1) ( x ) ∈ R D ( (cid:96) − 1) and produces the vector-valued output z ( (cid:96) )
( x ) ∈ R D ( (cid:96) ) with D ( L ) =
C .
The signals z ( (cid:96) )
( x ) , (cid:96) > 1 are typically called feature maps an the input is denoted as z (0) ( x ) = x .
For concreteness, we will focus here on processing multichannel images x but adjusting the appropriate dimensionalities can be used to adapt our results.
We will use two equivalent representations for the signal and feature maps, one based on tensors and one based on ﬂattened vectors.
In the tensor representation, z ( (cid:96) ) contains C ( (cid:96) ) channels of size (cid:16) I ( (cid:96) )
× J ( (cid:96) ) (cid:17) pixels.
In the vector representation, [ z ( (cid:96) )
( x )] k represents the entry of the k th dimension of the ﬂattened, vector version z ( (cid:96) )
( x ) of z ( (cid:96) ) ( x ) .
Hence, D ( (cid:96) )
=
C ( (cid:96) ) I ( (cid:96) )
J ( (cid:96) ) , C ( L ) =
C , I ( L ) = 1 , and J ( L )
= 1 .
For conciseness we will often denote z ( (cid:96) )
( x ) as z ( (cid:96) ) .
When using nonlinearities and pooling which are piecewise afﬁne and convex, the layers and whole DN fall under the analysis of max-afﬁne spline operators (MASOs) developed in Balestriero & Baraniuk (2018a).
In this framework, a max-afﬁne spline operator with parameters
A ( (cid:96) )
∈ R D ( (cid:96) )
× R × D
( (cid:96)
[Equation]
1) and B ( (cid:96) )
∈ R D ( (cid:96) )
× R is deﬁned as
[Equation]
Any DN layer made of convex and piecewise afﬁne nonlinearities or pooling can be rewritten exactly as a MASO.
Hence, such operators take place of the layer mappings of (13) We ﬁrst proceed by modifying (14) to highlight the internal inference problem.
We ﬁrst introduce the VQ -matrix T ( (cid:96) )
∈ R D ( (cid:96) )
× R which will be used to make the mapping region speciﬁc, as in
[Equation]
effectively making A ( (cid:96) )
[ T ( (cid:96) ) ] a matrix of shape ( D ( (cid:96) ) , D ( (cid:96) − 1) ) and B ( (cid:96) )
[ T ( (cid:96) ) ] a vector of length D ( (cid:96) ) .
Hence the VQ-matrix is used to combined the per region parameters.
In a standard MASO, each row of T ( (cid:96) ) is a onehot vector at position corresponding to the region in which the input falls into.
Due to the one-hot encoding present in T ( (cid:96) )
we refer to this inference as a hard-VQ.
Proposition 8.
For a MASO, the VQ-matrix is denoted as T ( (cid:96) )
H and is obtained via the internal maximization process of (14).
It corresponds to the (hard-)VQ of the input.
Once computed the output is a simple afﬁne transform of the input as
[Equation]
with [ T ( (cid:96) )
H ] k,r = 1 { r =argmax r =1 ,...,R (cid:104)
[ A (
[Table] [Table]
[Table]
,. , z (
[Table]
1) (cid:105) +[ B ( (cid:96) ) ] k,r } .
The VQ matrix T ( (cid:96) )
H always belongs to the set of all matrices with different one-hot positions (from 1 to
R ) for each of the output dimensions k
= 1 , . .
, D ( (cid:96) ) .
We denote this VQ-matrix space as T ( (cid:96) )
H =
{ [ a 1 , . .
. , a D ( (cid:96) ) ]
T , a k ∈ { e 1 , . . .
, e R }} with e r = δ r , dim ( e r ) =
R .
B O RTHOGONAL F ILTERS D ETAILS
The developed results on orthogonality induce orthogonality of the case of fully-connected layers.
For the case on convolutional layer it implies orthogonality as well as non overlapping patches.
This is not practical as it considerably reduces the spatial dimensions making very deep network unsuitable.
As such we now propose a brief approximation result.
Due to the speciﬁcity of the convolution operator we are able to provide a tractable inference coupled with an apodization scheme.
To demonstrate this, we ﬁrst highlight that any input can be represented as a direct sum of its apodized patches.
Then, we see that ﬁltering apodized patches with a ﬁlter is equivalent to convolving the input with apodized ﬁlters.
We ﬁrst need to introduce the patch notation.
We deﬁne a patch P [ z ( (cid:96) − 1) ]
( p i , p j ) ∈ { 1 , . . .
, I ( (cid:96) ) } × { 1 , . . .
, J ( (cid:96) ) } as the slice of the input with indices c = 1 , . .
, K ( (cid:96) ) , i = (all channels) and ( i, j ) ∈ { p i , . . .
, p i + I ( (cid:96) )
C } × { p i , . . .
, p i + J ( (cid:96) ) C } , hence a patch starting at position ( p i , p j ) and of same shape as the ﬁlters.
Apodizing a signal in general corresponds to applying an apodization function (or windowing func- tion)Weisstein (2002) h onto it via an Hadamard product.
Let deﬁne the 2 D apodized functions h : Ω( I ( (cid:96) )
C , J ( (cid:96) ) C )
→ R + with Ω( I ( (cid:96) )
C , J ( (cid:96) ) C )
= { 1 , . . .
, I ( (cid:96) )
C }×{ 1 , . . .
, J ( (cid:96) ) C } and where we remind that ( I ( (cid:96) ) C , J ( (cid:96) )
C ) is the spatial shape of the convolutional ﬁlters.
Given a function h such that (cid:80) u ∈ Ω( I ( (cid:96) )
C ,J ( (cid:96) ) C )
h ( u )
= 1 one can represent an input by summing the apodized patches as in
[Equation] [Equation]
The above highlights the ability to treat an input via its collection of patches with the condition to apply the deﬁned apodization function.
With the above
[Equation]
we can demonstrate how minimizing the per patch reconstruction loss leads to minimizing the overall input modeling
[Equation]
which represents the internal modeling of the factorial model applied across ﬁlters and patches.
As a result
[Equation]
when performing the per position minimization one minimizes an upper bound which ultimately reaches the global minimum as
[Equation]
C I NTERPRETATION : I NITIALIZATION AND I NPUT S PACE P ARTITIONING
The GMM formulation and related inference also allows interpretation of the internal layer parameters.
First we demonstrate how the region prior π ( (cid:96) ) is affected by the layer parameters especially at initialization.
Then we highlight how our result allows to generalize the input space partitioning results from Balestriero & Baraniuk (2018b;a).
Region Prior.
The region prior of the GMM-MASO model [ π ( (cid:96) ) ] k,.
(recall Thm. 2) depends on the bias and norm of the layer weight as [ π ( (cid:96) )
] k,.
∝ e [ B ( (cid:96) ) ] k,r + 12 (cid:107) [ A ( (cid:96) ) ] k,r,.
(cid:107) 2 .
We can study how this region prior looks like at initialization.
At initialization, common practice uses [ B ( (cid:96) ) ] k,r = 0 , ∀ k, r and [ A ( (cid:96) ) ] k,r,d ∼ N (0 , ( v ( (cid:96) ) ) 2 ) .
This bias initialization leads to a cluster prior probability proportional to the norm of the weights.
For example, the case of absolute value leads to E ( (cid:107)
[ A ( (cid:96) ) ] k, 1 ,.
(cid:107) 2 ) =
E ( (cid:107) [ A ( (cid:96) ) ] k, 2 ,.
(cid:107) 2 ) and thus uniform prior as E ([ π ( (cid:96) ) ]
k,. )
=
(0 . 5 , 0 . 5) T for any initialization standard deviation v ( (cid:96) ) .
On the other hand, ReLU has always (cid:107)
[ A ( (cid:96) ) ] k, 2 ,.
(cid:107) 2 = 0 and E (cid:16) (cid:107)
[ A ( (cid:96) ) ] k,r,.
(cid:107) 2 (cid:17) =
D ( (cid:96) )
( v ( (cid:96) ) ) 2 .
If one uses Xavier initialization Glorot &
Bengio (2010) then D ( (cid:96) )
( v ( (cid:96) ) ) 2 =
and we thus have as prior probability [ π ( (cid:96) ) ]
k,.
≈ (0 . 62 , 0 . 38) T .
THe latter slightly favors the inactive state of the ReLU and thus sparser activations.
In general, the smaller v ( (cid:96) ) is, the more the region prior will favor inactive state of the ReLU.
Input Space Partitioning.
We now generalize the ability to study the input space partitioning which was before limited to the special case of [ B ( (cid:96) ) ] k,r = − 12 (cid:107) [ A ( (cid:96) ) ] k,r,.
(cid:107) 2 (recall Prop. 1).
Studying the input space partition is crucial as the MASO property implies that for each input region, an observation is transformed via a simple linear transformation.
However, deriving insights on that is the actual partition is cumbersome as analytical formula are impractical and one thus has to probe the input space and record the observed VQ for each point to estimate the input space partitioning.
We are now able to derive some clear links between the
MASO partition and standard models which will allows much more efﬁcient computation of the input space partitions.
Corollary 2.
A MASO with arbitrary parameters [ A ( (cid:96) ) ] k,r,. , [ B ( (cid:96) ) ]
k,r has an input space partitioning being the same as a GMM with parameters from Thm. 2.
This augments previous study of the MASO input space partitioning only related to k-mean (recall Prop. 1) which required speciﬁc bias values.
D D EEP N ETWORK T OPOLOGIES AND D ATASETS
We ﬁrst present the topologies used in the experiments except for the notation ResNetD-W which is the standard wide ResNet based topology with depth D and width W .
We thus have the following network architectures for smallCNN and largeCNN:
[Table]
Conv2DLayer
[Table]
where the Conv2DLayer(layers[-1],192,3,pad=’valid’) denotes a standard 2D convolution withﬁlters of spatial size (3 , 3) and with valid padding (no padding)
[Table]
E P ROOFS E. T HEOREM
Proof.
The log-probability of the model corresponds to
[Equation]
= arg max r
[Equation]
− log
[Equation]
= arg max r
[Equation]
= arg max r
[Equation]
We also remind the reader that arg max r p ( z (
[Equation]
− 1)
| r ) p ( r ) =
arg max r log( p ( z ( (cid:96) − 1)
| r ) p ( r )) .
Based on the above it is straightforward to derive (5) from the above.
E. E NTROPY R EGULARIZED O PTIMIZATION
Proof.
We are interested into the following optimization problem:
[Equation]
We now use the KKT and Lagrange multiplier to optimize the new loss function (per k ) including the equality constraint
[Equation]
Due to the strong duality we can directly optimize the primal and dual problems and solve jointly all the partial derivatives to 0 .
We thus obtain by denoting A r :=
[ − 1 2 σ 2 (cid:107) z
( (cid:96) − 1) − µ r (cid:107) 2 + log( π r )]
[Equation]
we can now set the derivatives to 0 and see that this leads to [ u ] p =
e A p − 1+ λ , ∀ p .
We can now sum over p to obtain
[Equation]
which leads to λ
= − log( (cid:80) p
[Equation]
p
[Equation]
Plugging this back into the above equation we obtain
[Equation]
E. T HEOREM
For the proof of Theorem 3 please refer to the proof in E.2 by applying the convex combination with coefﬁcients β .
E. T HEOREM
Proof.
The proof to demonstrate this inference and VQ equality is essentially the same as the one of GMM-MASO (E.1) with addition of the following ﬁrst step:
[Equation]
[ W
[Equation] [Equation]
for any conﬁguration r ∈ { 1 , . . .
, R ( (cid:96) )
} D ( (cid:96) ) .
Using the same results we can re-write the independent joint optimization as multiple independent optimization problems.
E. P ROPOSITION S 3 AND
For Proposition 4 using the developed formula one can extend the following proof for max-pooling
[Equation]
Proof.
[Equation]
with 1 for the ﬁrst region exponential as
[Equation]
demonstrating the case where ReLU activation and convolution was the internal layer conﬁguration for illustrative purposes.
E. P ROPOSITION S 5 ANDProof.
[Equation]
= σ sigmoid ([ u ( (cid:96) ) ] k )
[Equation]
While this is direct for sigmoid DNs, the use of hyperbolic tangent requires to reparametrize the current and following layer weights and biases to represent the shifting scaling as in C ( (cid:96) ) :
= 2 C ( (cid:96) ) and C ( (cid:96) +1) :
= 2 C ( (cid:96) +1) , b ( (cid:96)
[Table]
) C :=
b ( (cid:96) +1) C − 1 with C replaced by W for fully connected operators.