Function Feature Learning of Neural Networks

1 INTRODUCTION . Neural networks have achieved remarkable empirical success in a wide range of machine learning tasks ( LeCun et al. , 1989 ; Krizhevsky et al. , 2012 ; He et al. , 2016 ) by finding a good local solution . How to better understand the characteristics of local solutions of neural networks remains an open problem . Recent evidence shows that identical neural networks trained with different initializations achieve nearly the same classification accuracy . Are these trained models ( local solutions ) equivalent ? ( Li et al. , 2016 ) claimed that neural networks converge to apparently distinct solutions in which it is difficult to find one-to-one mappings of neuron units . ( Raghu et al. , 2017 ; Morcos et al. , 2018 ; Kornblith et al. , 2019 ) concentrated on comparing representations of neural networks using the intermediate output of neural networks over a given dataset . These studies provide important insights into the understanding of similarity of neurons by probing and aligning the intermediate output ( or neuron activation ) representation of data points , but they do not focus on how to directly measure the similarity of function feature representations of neural networks using weights of networks . In this paper , we propose a Function Feature Learning ( FFL ) method to measure the similarity between different trained neural networks . Instead of using intermediate activation/response values of neural networks over a bunch of data points , FFL directly learns an effective weight feature representation from trained neural networks . To address the problem of random permutated weights ( Figure 1 ) , a chain alignment rule is introduced to eliminate permutation variables . The aligned weights are then learned to project into a function feature representation space by classifying different classes of local solutions . The learned function features can be used to describe the characteristics of local solutions . With FFL , one can validate some assumptions about the similarity of local solutions . Function feature learning is built upon data feature learning . Given a set of data points , data feature learning is to learn a function fi that can describe the underlying representations to measure data similarity . Similarly , given a set of data representation functions { fi } , function feature learning is to learn a function F that can measure the similarity of { fi } . Specifically , an identical neural network with different weights forms a family of functions { fi } that could cover different function types ( an identical neural network with different weights can be used as different function types for different learning tasks in practice ) . Function feature learning attempts to discover characteristics of functions and thus provides an effective metric for function similarity measure . In this paper , we propose to describe the function feature representation by using weights of neural networks instead of network structures because neural networks often share a common set of functional building blocks , e.g. , global/local linear units , activation units , and normalization units . Overall , we make four main contributions as follows . • We propose a Function Feature Learning ( FFL ) method to measure the similarity of identical neural networks trained from different initializations . FFL first addresses the random permutation of weights of neural networks by using a chain alignment rule and then projects the aligned weights into a common space . We find that there exist strong relations between different local solutions optimized by the Stochastic Gradient Descent ( SGD ) algorithm . • We investigate function feature representations of Multi-Layer Perceptron ( MLP ) , Convolutional Neural Network ( CNN ) , and Recurrent Neural Network ( RNN ) on the CIFAR-100 , NameData , and tiny ImageNet datasets . With the chain alignment rule , the proposed FFL approach achieves consistent high accuracy for three types of neural networks , which shows the effectiveness of FFL and the soundness of the aforementioned finding . • We investigate the chain based semantics and the results suggest that the semantics are hierarchical . The projection directions of all layers are arranged in order along with the depth of neural networks . In short , the semantics are presented in a bottom-up way . • We analyze several factors of neural networks and find that 1 ) adding more layers or changing the ReLU activation function into leaky ReLU has little impact on the structure of local solutions ; 2 ) changing plain networks into residual networks has some impact on local solutions ; 3 ) SGD often converges to a stable structure of local solutions while the Adam optimizer does not . Related Work . Neural networks are often regarded as black-boxes due to the non-convexity . To better understand these black-boxes , various approaches provide effective tools for visual interpretability of neural networks ( Simonyan et al. , 2013 ; Dosovitskiy & Brox , 2016 ; Zeiler & Fergus , 2014 ; Zhou et al. , 2015 ; Selvaraju et al. , 2016 ) . These approaches utilized gradient of the class scores with respect to input or de-convolution operations to visualize the attention activations at high-level semantics . Instead of building visual interpretability foundations between input and output , recent research ( Raghu et al. , 2017 ; Morcos et al. , 2018 ; Kornblith et al. , 2019 ) focused on representations of neural networks by exploiting intermediate activations/features to describe the similarity of neural networks . For example , SVCCA ( Raghu et al. , 2017 ) used singular value decomposition and canonical correlation analysis tools for network representations and similarity comparison of neural networks . After that , a projection weighted CCA approach was developed for better understanding similarity of neural networks . In ( Kornblith et al. , 2019 ) , a centered kernel alignment method was proposed to measure the relation between data representational similarity matrices . Our approach concentrates on the function/weight feature representation but not intermediate representations of data points , which is greatly different from these works . 2 PRELIMINARIES . In this section , we first introduce related notations and then describe the permutation problem of neural networks . 2.1 NOTATION . Let a L-layer neural network contain a series of stacked units { gl ( x ; Wl ) } L1 with global/local linear operations , where x ∈ Rn0 is input and Wl ∈ Rnl−1×nl denotes the weights of the l-th unit . nl denotes the number of neurons in the l-th layer . We formulate the stacked units as FL = σ ( gL ( σ ( gL−1 ( ... σ ( g1 ( x ; W1 ) ) ... ; WL−1 ) ) ; WL ) ) . FL is a family of functions that share an identical network structure and σ is an activation function . ( W1 , W2 , ... , WL−1 , WL ) determines the function representation of the neural network . We denote hl = σ ( gl ( ... σ ( g1 ( x ; W1 ) ) ... ; Wl ) ) as the l-th hidden vector , hl ∈ Rnl . When gl is a local linear/convolutional operation , FL represents a CNN . When gl is a global linear operation , FL represents an MLP . When { gl ( x ; Wl ) } L1 share weights , FL represents an RNN . Because a CNN can be regarded as a patch-based MLP and an RNN can be regarded as a variant version of MLP , we consider MLP for formulation . Besides , the term function , local solution , and trained model will be used synonymously for better understanding . 2.2 RANDOM PERMUTATION OF NEURAL NETWORKS . Neurons in the intermediate layers of neural networks ( termed intermediate neurons ) are often symmetric without any constraint . Neurons in the first and last layers ( side neurons ) are manually constrained by data and label structures , respectively . Under such constraints , permutating intermediate neurons and their corresponding weights could produce the same output , as mentioned in ( Li et al. , 2016 ) . We refer to them as neuron permutation and weight permutation . Permuting neurons and weights according to a certain rule could produce the same output . Because activation functions are often element based operations and do not have any impact on the permutation of neural networks , we consider a 4-layer linear MLP for simplification , as shown in Figure 1 ( a ) . The neural network takes x = ( x1 , x2 ) T as input and outputs y = ( y1 , y2 ) T . The network contains two intermediate hidden layers , denoted as h1 = ( 0.2 , 0.7 , 0.5 ) T and h2 = ( h12 , h 2 2 , h 3 2 ) T . The weights W1 and W2 are [ 0.8 , 0.9 ; 0.1 , 0.7 ; 0.8 , 0.2 ] T and [ 0.5 , 0.9 , 0.5 ; 0.3 , 0.1 , 0.4 ; 0.4 , 0.3 , 0.2 ] T ( MATLAB-like notation ) , respectively . Now we permutate the first and second neurons of h1 and permutate the corresponding columns of W1 and rows of W2 . We obtain h ′ 1 = ( 0.7 , 0.2 , 0.5 ) T and W ′ 1 = [ 0.1 , 0.7 ; 0.8 , 0.9 ; 0.8 , 0.2 ] T and W ′ 2 = [ 0.9 , 0.5 , 0.5 ; 0.1 , 0.3 , 0.4 ; 0.3 , 0.4 , 0.2 ] T , as shown in Figure 1 ( b ) . Given any input x , the output of these two functions ( a ) and ( b ) are equivalent because WT2 W T 1 x = ( W ′ 2 ) T ( W ′ 1 ) Tx . Neurons and weights are just like flexible nodes and wires that can be easily exchanged . Weight permutation ( blue and green wires are exchanged ) is exchanged in accord with neuron permutation . Due to neuron permutation and weight permutation , repeating the optimization procedure of identical neural networks would generate different permutations of equivalent local solutions even if we assume neural networks are convex . Therefore , it is important to align the weight permutation of neural networks before analyzing the similarity of local solutions of neural networks . 3 METHOD . In this section , we first provide a principle for validation foundation . We then introduce a rule for the alignment of neural networks . Finally , we propose to learn a function feature representation based on the aligned weights . 3.1 LEARNING TELLS THE TRUTH PRINCIPLE . In machine learning , an effective way to learn underlying patterns or rules is to exploit labeled data points to perform supervised learning . However , in some cases , it is difficult to know if a rule is true or an annotation approach is correct . To this , we introduce a Learning tells the truth principle . Suppose there exists a learning algorithm such that an assumptive rule learned from a training set can be also well-validated on a test set , then the rule holds . Learning tells the truth provides an assumption-learning-validation paradigm to validate some assumptions . The key point of this principle is to make reasonable assumptions , assign labels to a set of objects and find an effective learning algorithm . In this paper , the assumptions are that local solutions across different runs of an identical neural network converge to a similar local minimum under some conditions ( e.g. , different optimizers and different neural network structures ) . Based on the assumptions , an intuitive annotation way is to assign the same label to local solutions of a learning task in different runs . Different learning tasks produce different local solutions and their corresponding labels . We define them as local solution labels or classes . Under such an assumption , we can create a solution set that contains different solution classes by training different task data sets . We next try to find an effective learning algorithm such that the assumptive rule learned from the training set can be well-validated on the test set . We discuss this step in the next section .

Summary: This paper presents a method called ‘function feature learning’ which do not learn the data distribution but the parameters distribution of several neural networks types. The main idea is to generate many weights from different NNs trained with different random initializations for different subtasks and use them as training data for ‘function feature learning’. The experiments were done on three different datasets.