### Constraining neural networks

Fully-connected layers with arbitrary connectivity are commonly used in neural networks (both feed-forward and recurrent), but is the full power of an unconstrained, all-to-all connectivity matrix really needed for the network to perform well? A lot of empirical evidence suggests that trained neural networks are highly compressible, suggesting that unconstrained connectivity may not be necessary. If we are going to do away with unconstrained connectivity matrices, what should we replace them with? Here are a few recent suggestions from the literature (you can check out the original papers for detailed performance comparisons, but the basic message is that these methods reduce computational or memory requirements of neural networks, or improve their training, with minimal performance loss):

**1)** Instead of an unconstrained, arbitrary matrix , Yang et al. (2014) suggest matrices of the following form (called the adaptive fastfood transform):

(*)

where , , are diagonal matrices, is a random permutation matrix, and is the Hadamard matrix. Here and are fixed, so one only learns the diagonal matrices , , . This decomposition has parameters and requires operations to compute, as opposed to the much less efficient parameters and operations required for an unconstrained matrix. The particular matrix structure in (*) was introduced by Le et al. (2013) in earlier work, but in their case , , were set randomly and left untrained. In that work, they showed that feature maps computed using this random non-adaptive transformation correspond to the Gaussian RBF kernel in expectation, or more precisely where the features are with as in (*).

**2)** Moczulski et al. (2015) propose connectivity matrices of the following form:

(**)

where and are diagonal matrices and is the discrete Fourier transform matrix. This has parameters and requires operations to compute, which is an improvement over the parameters and operations required to compute a fully-connected unconstrained linear layer (with identical input and output dimensions, ), assuming of course is not . In the real version they ultimately prefer, is replaced by the discrete cosine transform matrix (of type II) .

A justifiable worry at this point is whether we are losing a lot of expressive power when we constrain our connectivity matrices in this way. The authors mention a theoretical guarantee assuring that almost all matrices can be factored as with diagonal and circulant, and this is precisely in the form (**) above. However, I’m not sure how useful this guarantee is, because is in this result, hence we lose our computational savings in this limit.

**3)** A very nice idea has recently been proposed for constraining the connectivity of a recurrent neural network: Arjovsky et al. (2015) propose constraining the connectivity to be unitary (orthogonal in the real case). The advantage of a unitary connectivity matrix is that it exactly preserves the norm of a vector it is applied to, hence avoiding the vanishing or exploding gradient problems in recurrent neural network training. What particular unitary structure should we choose for the connectivity matrix? They suggest the following structure:

(***)

where , , are diagonal matrices, , are reflection matrices, is a permutation matrix and is the discrete Fourier transform matrix. The authors mention that this particular structure was based on trial and error essentially. It is important to note that all the matrices in (***), except for the permutation matrix, have complex-valued entries.

In summary, constraints are generally useful for reducing the complexity of neural networks (think convnets), making training easier and more efficient, and making the models more interpretable. However, finding the right set of constraints to impose on neural networks is not always easy: imposing too many constraints or the wrong set of constraints might unnecessarily limit the representational power of the network, imposing too few constraints might reduce the benefits that would otherwise be obtained with the right set of constraints.