U NSUPERVISED L EARNING OF THE S ET OF L OCAL M AXIMA
Anonymous authors
Paper under double-blind review
A BSTRACT
This paper describes a new form of unsupervised learning, whose input is a set of unlabeled points that are assumed to be local maxima of an unknown value function v in an unknown subset of the vector space.
Two functions are learned: (i) a set indicator c , which is a binary classiﬁer, and (ii) a comparator function h that given two nearby samples, predicts which sample has the higher value of the unknown function v .
Loss terms are used to ensure that all training samples x are a local maxima of v , according to h and satisfy c ( x ) = 1 .
Therefore, c and h provide training signals to each other: a point x (cid:48) in the vicinity of x satisﬁes c ( x ) = − 1 or is deemed by h to be lower in value than x .
We present an algorithm, show an example where it is more efﬁcient to use local maxima as an indicator function than to employ conventional classiﬁcation, and derive a suitable generalization bound.
Our experiments show that the method is able to outperform one-class classiﬁcation algorithms in the task of anomaly detection and also provide an additional signal that is extracted in a completely unsupervised way.
I NTRODUCTION
...from so simple a beginning endless forms most beautiful and most wonderful have been, and are being, evolved.
(Darwin, 1859)
When we observe the natural world, we see the “most wonderful” forms.
We do not observe the even larger quantity of less spectacular forms and we cannot see those forms that are incompatible with existence.
In other words, each sample we observe is the result of optimizing some ﬁtness or value function under a set of constraints: the alternative, lower-value, samples are removed and the samples that do not satisfy the constraints are also missing.
The same principle also holds at the sub-cellular level.
For example, a gene can have many forms.
Some of them are completely synonymous, while others are viable alternatives.
The gene forms that become most frequent are those which are not only viable, but which also minimize the energetic cost of their expression (Farkas et al., 2018).
For example, the genes that encode proteins comprised of amino acids of higher availability or that require lower expression levels to achieve the same outcome have an advantage.
One can expect to observe most often the gene variants that: (i) adhere to a set of unknown constraints (“viable genes”), and (ii) optimize an unknown value function that includes energetic efﬁciency considerations.
The same idea, of mixing constraints with optimality, also holds for man-made objects.
Consider, for example, the set of houses in a given neighborhood.
Each architect optimizes the ﬁnal built form to cope with various aspects, such as the maximal residential ﬂoor area, site accessibility, parking considerations, the energy efﬁciency of the built product, etc.
What architects ﬁnd most challenging, is that this optimization process needs to correspond to a comprehensive set of state and city regulations that regard, for example, the proximity of the built mass of the house to the lot’s boundaries, or the compliance of the egress sizes with current ﬁre codes.
In another instance, consider the weights of multiple neural networks trained to minimize the same loss on the same training data, each using a different random initialization.
Considering the weights of each trained neural network as a single vector in a sample domain, also ﬁts into the framework of local optimality under constraints.
By the nature of the problem, the obtained weights are the local optimum of some loss optimization process.
In addition, the weights are sometimes subject to constraints, e.g., by using weight normalization.
The task tackled in this paper is learning the value function and the constraints, by observing only the local maxima of the value function among points that satisfy the constraints.
This is an unsupervised problem: no labels are given in addition to the samples.
The closest computational problem in the literature is one-class classiﬁcation (Moya et al., 1993), where one learns a classiﬁer c in order to model a set of unlabeled training samples, all from a single class.
In our formulation, two functions are learned: a classiﬁer and a separate value function.
Splitting the modeling task between the two, a simpler classiﬁer can be used (we prove this for a speciﬁc case) and we also observe improved empirical performance.
In addition, we show that the value function, which is trained with different losses and structure from those of the classiﬁer, models a different aspect of the training set.
For example, if the samples are images from a certain class, the classiﬁer would capture class membership and the value function would encode image quality.
The emergence of a quality model makes sense, since the training images are often homogeneous in their quality.
The classiﬁer c and the value function v provide training signals to each other, in an unsupervised setting, somewhat similar to the way adversarial training is done in GANs (Goodfellow et al., 2014), although the situation between c and v is not adversarial.
Instead, both work collaboratively to minimize similar loss functions.
Let S be the set of unlabeled training samples from a space X .
Every x ∈ S satisﬁes c ( x ) = 1 for a classiﬁer c : X → {± 1 } that models the adherence to the set of constraints (satisﬁes or not).
Alternatively, we can think of c as a class membership function that speciﬁes, if a given input is within the class or not.
In addition, we also consider a value function v , and for every point x (cid:48) , such that (cid:107) x (cid:48) − x (cid:107) ≤ (cid:15) , for a sufﬁciently small (cid:15) > 0 , we have: v ( x (cid:48) )
< v ( x ) .
This structure leads to a co-training of v and c , such that every point x (cid:48) in the vicinity of x can be used either to apply the constraint v ( x (cid:48) )
<
v ( x ) on v , or as a negative training sample for c .
Which constraint to apply, depends on the other function: if c ( x (cid:48) )
= 1 , then the ﬁrst constraint applies; if v ( x (cid:48) ) ≥ v ( x ) , then x (cid:48) is a negative sample for c .
Since the only information we have on v pertains to its local maxima, we can only recover it up to an unknown monotonic transformation.
We therefore do not learn it directly and instead learn a comparator function h , which given two inputs, returns an indication which input has the higher value in v .
An alternative view of the learning problem we introduce considers the value function v (or equivalently h ) as part of a density estimation problem, and not as part of a multi-network game.
In this view, c is the characteristic function (of belonging to the support) and h is the comparator of the probability density function (PDF).
R ELATED W ORK
The input to our method is a set of unlabeled points.
The goal is to model this set.
This form of input is shared with the family of methods called one-class classiﬁcation.
The main application of these methods is anomaly detection, i.e., identifying an outlier, given a set of mostly normal (the opposite of abnormal) samples (Chandola et al., 2009).
The literature on one class classiﬁcation can be roughly divided into three parts.
The ﬁrst includes the classical methods, mostly kernel-base methods, which were applying regularization in order to model the in-class samples in a tight way (Sch¨olkopf et al., 2001).
The second group of methods, which follow the advent of neural representation learning, employ classical one-class methods to representations that are learned in an unsupervised way (Hawkins et al., 2002; Sakurada & Yairi, 2014; Xia et al., 2015; Xu et al., 2015; Erfani et al., 2016), e.g., by using autoencoders.
Lastly, a few methods have attempted to apply a suitable one-class loss, in order to learn a neural network-based representation from scratch (Ruff et al., 2018).
Despite having the same structure of the input (an unlabeled training set), our method stands out of the one-class classiﬁcation and anomaly detection methods we are aware of, by optimizing a speciﬁc model that disentangles two aspects of the data: one aspect is captured by a class membership function, similar to many one-class approaches; the other aspect compares pairs of samples.
This dual modeling captures the notion that the samples are not nearly random samples from some class, but also the local maximum optimum in this class.
While “the local maxima optima of in-class points” is a class by itself, a classiﬁer-based modeling of this class would require a higher complexity than a model that relies on the structure of the class as pertaining to local maxima, as is proved, for one example, in Sec.
A.
In addition to the characterization as local maxima, the factorization between the constraints and the values also assists modeling.
This is reminiscent of many other cases in machine learning, where a divide and conquer approach reduces complexity.
For example, using prior knowledge on the structure of the problem, helps to reduce the complexity in hierarchical models, such as LDA (Blei et al., 2003).
While we use the term “value function”, and this function is learned, we do not operate in a reinforcement learning setting, where the term value is often used.
Speciﬁcally, our problem is not inverse reinforcement learning (Ng & Russell, 2000) and we do not have actions, rewards, or policies.
M ETHOD
Recall that S is the set of unlabeled training samples, and that we learn seek two functions c and v such that for all x ∈ S it holds that: (i) c ( x ) = 1 , and (ii) x is a local maxima of v .
For every monotonic function f , the setting we deﬁne cannot distinguish between v , and f ◦ v .
This ambiguity is eliminated, if we replace v by a binary function
h that satisﬁes h ( x , x (cid:48) )
= 1 if v ( x ) ≥ v ( x (cid:48) )
and h ( x , x (cid:48) )
= − 1 otherwise.
We found that training h in lieu of v is considerably more stable.
Note that we do not enforce transitivity, when training h , and, therefore, h can be such that no underlying v exists.
3. T RAINING c AND h
When training c , the training samples in S =
{ x i } mi =1 are positive examples.
Without additional constraints, the recovery of c is an ill-posed problem.
For example, Ruff et al.
(2018) add an additional constraint on the compactness of the representation space.
Here, we rely on the ability to generate hard negative points 1 .
There are two generators G c and G h , each dedicated to generating negative training points to either c or h , as described in Sec.
3.2 below.
The two generators are conditioned on a positive point x ∈ S and each generates one negative point per each x : x (cid:48)
=
G c ( x ) and x (cid:48)(cid:48) =
G h ( x ) .
The constraints on the negative points are achieved by multiplying two losses: one pushing c ( x (cid:48) ) to be negative, and the other pushing h ( x (cid:48)(cid:48) , x ) to be negative.
Let (cid:96) ( p, y ) :
= − 12 (( y +1) log( p )+(1 − y ) log(1 − p )) be the binary cross entropy loss for y ∈ {± 1 } .
c and h are implemented as neural networks trained to minimize the following losses, respectively:
[Equation]
The ﬁrst sum in L C ensures that c classiﬁes all positive points as positive.
The second sum links the outcome of h and c for points generated by G c .
It is given as a multiplication of two losses.
This multiplication encourages c to focus on the cases where h predicts with a higher probability that the point G c ( x ) is more valued than x .
The loss L H is mostly similar.
It ensures that h has positive values when the two inputs are the same, at least at the training points.
In addition, it ensures that for the generated negative points x (cid:48) , h ( x (cid:48) , x ) is − 1 , especially when c ( x (cid:48) ) is high.
One can alternatively use a symmetric
L H , by including an additional term
S
( c ( G h ( x )) ,
( h ( x , G h ( x )) , 1) .
This, in our experiments, leads to very similar results, and we opt for the slightly simpler version.
points trade- epochs.
3. N EGATIVE P OINT G ENERATION
We train two generators, G c and G h , to produce hard negative samples for the training of c and h , respectively.
The two generators both receive a point x ∈ S as input, and generate another point in the same space X .
They are constructed using an encoder-decoder architecture, see Sec.
3.4 for the exact speciﬁcations.
When training G c , the loss −L C is minimized.
In other words, G c ﬁnds, in an adversarial way, points x (cid:48) , that maximize the error of c (the ﬁrst term of L C does not involve G c and does not contribute, when training G c ).
G h minimizes during training the loss λm (cid:80) x ∈ S || x − G h
( x ) || − L H , for some parameter λ .
Here, in addition to the adversarial term, we add a term that encourages G h ( x ) to be in the vicinity of x .
This is added, since the purpose of h is to compare nearby points, allowing for the recovery of points that are local maxima optima.
In all our experiments we set λ = 1 .
The need for two generators, instead of just one, is veriﬁed in our ablation analysis, presented in
Sec. 4.
One may wonder why two are needed.
One reason stems from the difference in the training loss: h is learned locally, while c can be applied anywhere.
In addition, c and h are challenged by different points, depending on their current state during training.
By the structure of the generators, they only produce one point per input x , which is not enough to challenge both c and h .
3. T RAINING P ROCEDURE
The training procedure follows the simple interleaving scheme presented in Alg.
We train the networks in turns: G c and then c , followed by G h and then h .
Since the datasets in our experiments are relatively small, each turn is done using all mini-batches of the training dataset S .
The ADAM optimization scheme is used with mini-batches of size 32.
The training procedure has self regularization properties.
For example, assuming that G h ( x ) (cid:54) =
x ,
L H as a function of h , has a trivial global minima.
This solution is to assign h ( x (cid:48) , x ) to 1 iff x (cid:48)
=
x .
However, for this speciﬁc h , the only way for G h to maximize L H is to rely on c and h being smooth and to select points x (cid:48)
=
G h ( x ) that converge to x , at least for some points in x ∈ S .
In this case, both (cid:96) ( c ( G h ( x )) , − 1) and (cid:96) ( h ( G h ( x ) , x ) , − 1) will become high, since c ( x (cid:48) )
≈ 1 and h ( x (cid:48) , x ) ≈ 1 .
3. A RCHITECTURE
In the image experiments (MNIST, CIFAR10 and GTSRB), the neural networks G h and G c employ the DCGAN architecture of Radford et al. (2015).
This architecture consists of an encoder-decoder type structure, where both the encoder and the decoder have ﬁve blocks.
Each encoder (resp. decoder) block consists of a 2-strided convolution (resp.
deconvolution) followed by a batch norm layer, and a ReLU activation.
The ﬁfth decoder block consists of a 2-strided convolution followed by a tanh activation instead.
c and h ’s architectures consist of four blocks of the same structure as for the encoder.
This is followed by a sigmoid activation.
For the Cancer Genome Atlas experiment, each encoder (resp. decoder) block consists of a fully connected (FC) layer, a batch norm layer and a Leaky Relay activation (slope of 0.2).
Two blocks are used for the encoder and decoder.
The encoder’s ﬁrst FC layer reduces the dimension to 512 and the second to 256.
The decoder is built to mirror this.
c and h consist of two blocks, where the ﬁrst
FC layer reduces the dimension to 512 and the second to 1.
This is followed by a sigmoid activation.
3. A NALYSIS
In Appendix A, We show an example in which modeling using local-maxima-points is an efﬁcient way to model, in comparison to the conventional classiﬁcation-based approach.
We then extend the framework of spectral-norm bounds, which were derived in the context of classiﬁcation, to the case of unsupervised learning using local maxima.
E XPERIMENTS
Since we share the same form of input with one-class classiﬁcation, we conduct experiments using one-class classiﬁcation benchmarks.
These experiments both help to understand the power of our model in capturing a given set of samples, as well as study the properties of the two underlying functions c and h .
Following acceptable benchmarks in the ﬁeld, speciﬁcally the experiments done by Ruff et al.
(2018), we consider single classes out of multiclass benchmarks, as the basis of one-class problems.
For example, in MNIST, the set S is taken to be the set of all training images of a particular digit.
When applying our method, we train h and c on this set.
To clarify: there are no negative samples during training.
Post training, we evaluate both c and h on the one class classiﬁcation task: positive points are now the MNIST test images of the same digit used for training, and negative points are the test images of all other digits.
This is repeated ten times, for digits 0–9.
In order to evaluate h , which is a binary function, we provide it with two replicas of the test point.
The classiﬁcation ability is evaluated as the AUC obtained on this classiﬁcation task.
The same experiment was conducted for CIFAR-10 where instead of digits we consider the ten different class labels.
The results are reported in Tab. 1, which also states the literature baseline values reported by Ruff et al.
As can be seen, for both CIFAR-10 and MNIST, c strongly captures classmembership, outperforming the baseline results in most cases.
h is less correlated with class membership, resulting in much lower mean AUC values and higher standard deviations.
However, it should not come as a surprise that h does contain such information.
Indeed, the difference in shape (single input vs. two inputs) between c and h makes them different but not independent.
c , as a classiﬁer, strongly captures class membership.
We can expect h , which compares two samples, to capture relative properties.
In addition, h , due to the way negative samples are collected, is expected to model local changes, at a ﬁner resolution than c .
Since it is natural to expect that the samples in the training set would provide images that locally maximize some clarity score, among all local perturbations, one can expect quality to be captured by h .
To test this hypothesis, we considered positive points to be test points of the relevant one-class, and negative points to be points with varying degree of Gaussian noise added to them.
We then measure using AUC, the ability to distinguish between these two classes.
As can be seen in Fig.
1, h is much better at identifying noisy images than c , for all noise levels.
This property is class independent, and in Fig.
2 (Appendix C), we repeat the experiment for all test images (not just from the one class used during training), observing the same phenomenon.
We employ CIFAR also to perform an ablation analysis comparing the baseline method’s c and h with four alternatives: (i) training c without training h , employing only G c ; (ii) training h and G h without training c nor G c ; (iii) training both h and c but using only the G c generator for both; and (iv) training both h and c but using only the G h generator for both.
The results, which can be seen in Tab. 2, indicate that the complete method is superior to the variants, since it outperform these in the vast majority of the experiments.
Next, we evaluate our method on data from the German Trafﬁc Sign Recognition (GTSRB) Benchmark of Houben et al.
The dataset contains 43 classes, from which one class (stop signs, class #15) was used by Ruff et al.
(2018) to demonstrate one-class classiﬁcation where the negative class is the class of adversarial samples (presumably based on a classiﬁer trained on all 43 classes).
[Table] [Table]
We were not able to obtain these samples by the time of the submission.
Instead, We employ the sign data in order to evaluate three other one-class tasks: (i) the conventional task, in which a class is compared to images out of all other 42 classes; (ii) class image vs. noise image, as above, using
Gaussian noise with a ﬁxed noise level of σ = 0 .
2 ; (iii) same as (ii) only that after training on one class, we evaluate on images from all classes.
The results are presented, for the ﬁrst 20 classes of GTSRB, in Tab. 3.
The reported results are an average over 10 random runs.
On the conventional one-class task (i), both our c and h neural networks outperform the baseline Deep-SVDD method, with c performing better than h , as in the
MNIST and CIFAR experiments.
Also following the same pattern as before, the results indicate that h captures image noise better than both c and Deep-SVDD, for both the test images of the training class and the test images from all 43 classes.
In order to explore the possibility of using the method out of the context of one-class experiments and for scientiﬁc data analysis, we downloaded samples from the Cancer Genome Atlas ( https:
CIFAR
[Figure]
MNIST
[Figure] [Figure]
[Figure]
(Cat) (2) (3)
[Figure]
(Dog) (4) (5) (Frog) (Horse) (6) (7) (Ship
[Figure]
(Truck) (8) (9)
//cancergenome.nih.gov/ ).
The data contains mRNA expression levels for over 22, genes, measured from the blood of 9,492 cancer patients.
For most of the patients, there is also survival data in days.
We split the data to 90% train and 10% test.
We run our method on the entire train data and try to measure whether the functions recovered are correlated with the survival data on the test data.
While, as mentioned in Sec. 1, the gene expression optimizes a ﬁtness function, and one can claim that gene expressions that are less ﬁt, indicate an expected shortening in longevity, this argument is speculative.
Nevertheless, since survival is the only regression signal we have, we focus on this experiment.
We compare ﬁve methods: (i) the h we recover, (ii) the c we recover, (iii) the h we recover, when learning only h and not c , (iv) the c we recover, when learning only c and not h , (v) the ﬁrst PCA of the expression data, (vi) the classiﬁer of DeepSVDD.
The latter is used as baseline due to the shared form of input with our method.
However, we do not perform an anomaly detection experiment.
In the simplest experiment, we treat h as a unary function by replicating the single input, as done above.
We call this the standard correlation experiment.
However, h was trained in order to compare two local points and we, therefore, design the local correlation protocol.
First, we identify for each test datapoint, the closest test point.
We then measure the difference in the target value (the patient’s survival) between the two datapoints, the difference in value for unary functions (e.g., for c or for the ﬁrst PCA), or h computed for the two datapoints.
This way vectors of the length of the number of test data points are obtained.
We use the Pearson correlation between these vectors and the associated p-values as the test statistic.
The results are reported in Tab. 4.
As can be seen, the standard correlation is low for all methods.
However, for local correlation, which is what h is trained to recover, the h obtained when learning both h and c is considerably more correlated than the other options, obtaining a signiﬁcant p-value of 0.021.
Interestingly, the ability to carve out parts of the space with c , when learning h seems signiﬁcant and learning h without c results in a much reduced correlation.
[Table] [Table]
D ISCUSSION
The current machine learning literature focuses on models that are smooth almost everywhere.
The label of a sample is implicitly assumed as likely to be the same as those of the nearby samples.
In contrast to this curve-based world view, we focus on the cusps.
This novel world view could be beneﬁcial also in supervised learning, e.g., in the modeling of sparse events.
Our model recovers two functions: c and h , which are different in form.
This difference may be further utilized to allow them to play different roles post learning.
Consider, e.g., the problem of drug design, in which one is given a library of drugs.
The constraint function c can be used, post training, to ﬁlter a large collection of molecules, eliminating toxic or unstable ones.
The value function h can be used as a local optimization score in order to search locally for a better molecule.
A A NALYSIS
We show an example in which modeling using local-maxima-points is an efﬁcient way to model, in comparison to the conventional classiﬁcation-based approach.
We then extend the framework of spectral-norm bounds, which were derived in the context of classiﬁcation, to the case of unsupervised learning using local maxima.
A. M ODELING USING arg max v IS BENEFICIAL
While modeling with a classiﬁer c is commonplace, modeling a set S = { x i } mi =1 as the local maxima of a function is much less conventional.
Next, we will argue that at least in some situations, it may be advantageous.
We compare the complexity of a ReLU neural network W 2 φ ( W 1 x + b ) modeling a set S
= { x i } mi = of m real numbers as either a classiﬁer or as maxima of a value function.
Here, W 1 and W 2 are linear transformations, b is a vector and φ ( u 1 , . . .
, u n ) :
= (max(0 , u 1 ) , . .
. , max(0 , u n )) is the
ReLU activation function, for u 1 , . .
. , u n ∈ R and n ∈ N .
We denote by c S : R → {± 1 } the function that satisﬁes, c S ( x ) =
if and only if x ∈ S .
For this purpose, we take any distribution D over [ x 1 − 1 , x m + 1] that has positive probability for sampling from S .
Formally, D is a mixture distribution that samples at probability q > 0 from Dand probability 1 − q from D 1 , where D 0 is a distribution supported by S and D 1 is a distribution supported by the segment [ x 1 − 1 , x m + 1] .
The task is to achieves error ≤ (cid:15) in approximating c S .
The error of a function c : R → R is measured by 1 1 x ∼ D [ c ( x ) (cid:54) =
c S ( x )] , which is the probability of c incorrectly labeling a random number x ∼ D .
We show that there is a ReLU neural network v ( x ) =
W 2 φ ( W 1 x + b ) with 2 m neurons, such that, the set of local maxima of v is S .
In particular, we have: E x ∼ D 1 1 [ c v ( x ) (cid:54) =
c S ( x )]
= 0 .
Here, c v : R → {± 1 } , that satisﬁes, c v ( x ) = 1 if and only if x is a local maxima of v .
Additionally, we show that any such v has at least 2 m − 1 hidden neurons.
On the other hand, we show that for any distribution D (with the speciﬁcations above), any classiﬁcation neural network c ( x ) =
W 2 φ ( W 1 x + b ) that has error E x ∼ D 1 1 [ c ( x ) (cid:54) =
c S ( x )] ≤ (cid:15) has at least 3 m hidden neurons.
Theorem 1.
Let S
= { x i } mi =1 ⊂ R be any set of points such that x i <
x
i +1 for all i ∈ { 1 , . . .
, m − 1 } .
We deﬁne c S : R → {± 1 } to be the function, such that c S ( x ) = 1 if and only if x ∈ S .
Then,
There is a ReLU neural network v : R → R of the form v ( x ) =
W 2 φ ( W 1 x + b ) with 2 m hidden neurons such that the set of local maximum points of v is S .
Any ReLU neural network v : R → R of the form v ( x )
=
W 2 φ ( W 1 x + b ) such that any x ∈ S is a local maxima of v has at least
2 m − 1 neurons.
Let D = q · D 0 ∪ (1 − q ) · D 1 be a distribution that samples at probability q > 0 from
D 0 and probability 1 − q from D 1 , where D 0 is a any distribution supported by S and Dis a any distribution supported by the segment [ x 1 − 1 , x m + 1] .
Then, for a small enough (cid:15) > 0 , every ReLU neural network c : R → R of the form c ( x ) =
W 2 φ ( W 1 x + b ) , such that E x ∼ D 1 1 [ c ( x ) (cid:54) =
c S ( x )] ≤ (cid:15) has at least 3 m hidden neurons.
Proof.
We begin by proving (1).
We construct v as follows:
• ∀ x ∈
−∞ , x 1 ] : v ( x ) = x − x 1 + 1 .
• ∀ i ∈ { 1 , . .
, m − 1 } :
∀ x ∈ [ x i , x i + x i +1] : v ( x ) = − 2 x
i +1 − x i ( x − x i )
+ 1 .
• ∀ i ∈ { 1 , . .
, m − 1 } : ∀ x ∈ [ x i + x i +1, x i +1 ] : v ( x ) =
1 x i +1 − x i ( x − x i +1 )
+ 1 .
• ∀ x ∈ [ x m , ∞ ) : v ( x ) = x m − x + 1 .
we consider that v is a piece-wise linear function with 2 m linear pieces and arg max v = S .
By
Thm. 2.2 in Arora et al.
(2018), this function can be represented as a ReLU neural network of the form v ( x ) =
W 2 φ ( W 1 x + b ) , that has 2 m hidden neurons.
Next, we prove (2).
Let v : R → R be a function of the form v ( x ) =
W 2 φ ( W 1 x + b ) , such that each x ∈ S is a local maxima of it.
First, by Thm. 2.1 in Arora et al.
(2018), v is a piece-wise linear function.
We claim that v has at least two linear pieces between each consecutive points x i and x i +1 , for i ∈ { 1 , . . .
, m − 1 } .
Assume the contrary, i.e., there is an index i ∈ { 1 , . . .
, m − 1 } , such that, v has only one piece between x i and x i +1 .
If v ( x i ) = v ( x i +1 ) , then, v is constant between x i and x i +1 , and therefore, x i and x
i +1 are not local maximas of v , in contradiction.
If v ( x i ) < v ( x i +1 ) , then, because v is linear between x i and x i +1 , for every point x ∈ ( x i , x i +1 ) , we have v ( x i ) <
v ( x ) , in contradiction to the assumption that x i is a local maxima of v .
If v ( x i ) > v ( x i +1 ) , then, because v is linear between x i and x i +1 , for every point x ∈ ( x i , x i +1 ) , we have v ( x i +1 ) <
v ( x ) , in contradiction to the assumption that x i +1 is a local maxima of v .
We conclude that v has at least two linear pieces between the points x i and x i +1 , for all i ∈ { 1 , . . .
, m − 1 } .
Therefore, v has at least 2 m pieces.
By Thm. 2.2 in Arora et al.
(2018), v has at least 2 m − 1 hidden neurons.
Next, we prove (3) (2).
We denote x 0 = x 1 − 1 and x m +1 =
x m + 1 .
Let P D
[ x i ] be the probability of sampling x
i from D 0 .
Since D 0 is supported by S , we have: q · P D
[ x i ] > 0 .
We deﬁne α :=
q min i ∈{ 1 ,...,m } P D
[ x i ] .
In addition, D 1 is a continuous distribution supported by the closed segment [ x 1 − 1 , x m + 1] .
Thus, by Weierestrass’ extreme value theorem, the probability density function P D 1 [ x ] of D 1 that is a continuous function, obtains its extreme values within the segment.
In addition, since D 1 is supported by [ x 1 − 1 , x m + 1] , we have: P D 1 [ x ] > 0 for all x ∈ [ x 1 − 1 , x m + 1] .
By combining the above two statements, we conclude that there is a point x ∗ ∈ [ x 1 − 1 , x m + 1] such that P D 1 [ x ] ≥ P D 1 [ x ∗ ] > 0 for every x ∈ [ x 1 − 1 , x m + 1] .
We denote by β := (1 − q ) min i ∈{ 0 ,...,m } P D 1 [ x ∈ ( x i , x i +1 )] > 0 .
Since we are interested in proving the claim for a small enough (cid:15) > 0 , we can simply assume that (cid:15) < min( α, β ) and c : R → R a ReLU neural network of the form c ( x ) =
W 2 φ ( W 1 x + b ) .
We have:
[Equation]
Assume by contradiction that: c ( x i ) (cid:54) =
c S ( x i ) .
Then, E x ∼ D 1 1 [ c ( x ) (cid:54) =
c S ( x )] ≥ α > (cid:15) in contradiction.
Therefore, c ( x i ) =
c S ( x i ) = 1 for every x i ∈ S .
We also have:
[Equation]
Assume by contradiction that there is i ∈ { 1 , . . .
, m − 1 } , such that the set E i = { x ∈ ( x i , x i +1 )
| c ( x ) = 0 } is ﬁnite.
Then,
[Equation]
in contradiction.
Let i ∈ { 1 , . . .
, m − 1 } , a i and b i be two points such that x i < a i < b i < x i + and c ( a i )
=
c ( b i ) = 0 .
Since c is a continuous function and piece-wise linear and the four points ( x i , 1) , ( a, 0) , ( b, 0) , ( x i +1 , 1) are not co-linear, we conclude that c has at least three linear pieces in the segment [ x i , x i +1 ] .
Similarly, c has at least two linear pieces in each of the segments [ x 1 − 1 , x 1 ] and [ x m , x m +1] .
We conclude that c has at least 3 m +1 pieces.
By Thm. 2.2 in Arora et al.
(2018), c has at least 3 m hidden neurons.
In the above theorem we showed that there exists a ReLU neural network v ( x ) =
W 2 φ ( W 1 x + b ) with 2 m hidden neurons that captures the set S as its local maximas.
Furthermore, we note that the set of functions that satisfy these conditions (i.e., shallow ReLU neural networks with 2 m hidden neurons that capture the set S ) is relatively limited.
For instance, any such v behaves as a piecewise linear function between any x i and x i +1 with only two linear pieces.
Therefore, any such v is uniquely determined by the set S up to some freedom in the selection of the linear pieces between x i and x i +1 in S .
On the other hand, a shallow ReLU neural network v ( x ) =
W 2 φ ( W 1 x + b ) with more than 2 m hidden neurons is capable of having more than two linear pieces between any x i and x i +1 .
A. A G ENERALIZATION B OUND
The following lemma provides a generalization bound that expresses the generalization of learning c along with v h .
In the following generalization bound, we assume there is an arbitrary distribution D of positive samples.
In addition, we parameterize the class, V = { v θ : R d → R | θ ∈ Θ } , of value functions by vectors of parameters θ ∈ Θ and the class, C = { sign ◦ f ω : R d → {± 1 } | ω ∈ Ω } , of classiﬁers by ω ∈ Ω .
We upper bound the probability of a mistake done by any classiﬁer c ω ∈ C and value function v θ ∈ V on a random sample x ∼ D .
In this case, v θ and c ω mistake if x is not a local maxima of v θ or classiﬁed as negative by c ω .
The upper bound is decomposed into the sum of the average error of c ω and v θ on a dataset S i.i.d ∼ D m and a regularization term.
See Appendix B for the exact formulation and the proof.
Lemma 1 (Informal) .
Let V
= { v θ : R d → R | θ ∈ Θ } be a class of value functions and
C = { sign ◦ f ω : R d → {± 1 } | ω ∈ Ω } a class of classiﬁers.
Assume that v θ and f ω are ReLU neural networks of ﬁxed architectures, with parameters θ and ω (resp.).
Let C ( g ) is the spectral complexity of the neural network g and N (cid:15) ( x ) :
= { u ∈ R d | (cid:107)
u − x (cid:107) 2 ≤ (cid:15) } an (cid:15) -neighborhood of x .
Let D be a distribution of positive examples.
With probability at least 1 − δ over the selection of the data S
= { x i } mi =1 i.i.d ∼ D m , for every v θ ∈ V and c ω ∈ C , we have:
[Equation]
The above lemma shows that the probability of x ∼ D to be a local maxima of v θ and classiﬁed as a positive example by c ω , is at most the sum of the probability of x ∈ S to be a local maxima of v θ and classiﬁed as a positive example by c ω and a penalty term.
The penalty in this case is of the form O (cid:18)(cid:113)
[Equation]
, where m is the number of examples in the dataset and
C ( v θ )
+ C ( f ω ) is the sum of the spectral norms of v θ and f ω .
This suggests a tradeoff between the sum of the spectral complexities of v θ and f ω and the ability to generalize.
The bound is similar asymptotically to the bounds of Neyshabur et al.
and Bartlett et al.
for (multi-class) supervised classiﬁcation.
In their bound, the penalty term is of the form O (cid:18)(cid:113) C ( f )+log ( mδ ) m (cid:19) , where the (multi-class) classiﬁer is of the form c ( x ) =
arg max i ∈{ 1 ,...,t } f ( x ) i , for a neural network f : R d → R t .
Our analysis focused on the value v θ and not on the comparator h .
However, the complexities of the two are expected to be similar, since a value function can be converted to a comparator by employing h ( x 1 , x 2 )
=
sign( v θ ( x 1 ) − v θ ( x 2 )) .
B G ENERALIZATION B OUND
In this section, we build upon the theory presented by Neyshabur et al.
and provide a generalization bound that expresses the guarantees of learning c , along with v for a speciﬁc setting.
Before we introduce the generalization bound, we introduce the necessary terminology and setup.
We assume that the sampling space is a ball of radius B , i.e., X = X B,d := { x ∈
R d | || x
|| 2 ≤ B } .
Each value function v θ ∈ V is a ReLU neural network of the form v θ ( x ) =
W r φ ( W r − 1 φ ( . . .
φ ( W 1 x )) , where, W i ∈ R d i × d i +1 for i ∈ { 1 , . . .
, r } such that d r +1 :
= 1 and d 1 := d .
In addition, φ ( x ) = (max(0 , x 1 ) , . . . , max(0 , x n )) is the ReLU activation function extended to all n ∈ N and x ∈ R n .
We denote, θ =
( W 1 , . . .
, W r ) .
The set C consists of classiﬁers c ω :
= sign ◦ f ω such that each function f ω : R d → R is a ReLU neural network of the form f ω ( x ) =
U s φ ( U s − 1 φ ( . . .
φ ( U 1 x )) , where, U i ∈ R
d (cid:48)
i × d (cid:48)
i +1 for i ∈ { 1 , . . .
, s } such that e
s +1 :
= 1 and d (cid:48) 1 := d .
We denote ω
=
( U 1 , . . .
, U s ) .
Additionally, we denote, q 1 := max { d i } r
+1 i
= and q 2 :
= max { d (cid:48)
i } s +
i =1 .
The spectral complexity of a ReLU neural network g β = V k φ ( V k − 1 φ ( . . .
φ ( V 1 x )) with parameters β
= ( V 1 , . . .
, V k ) is deﬁned as follows:
[Equation]
For two distributions P and Q over a set X , we denote the KL-divergence between them by,
D KL ( Q || P ) :=
E x ∼ Q [log( Q ( x ) /P
( x ))] .
For two functions function f, g : R → R , we denote the asymptotic symbols: g ( x ) =
O ( f ( x )) to specify that g ( x ) ≤ c · f ( x ) , for some constant c > 0 .
We denote by 1 1 [ x ] the indicator, if a boolean x ∈ { true , false } is true or false.
We deﬁne a margin loss (cid:96)
γ 1 ,γ 2 : X × Ω × Θ → R of the form:
[Equation]
where, γ 1 , γ 2 > 0 are ﬁxed margins and N (cid:15)
( x ) := { u |
|| u − x || 2 ≤ (cid:15) } is the (cid:15) -neighborhood of x , for a ﬁxed (cid:15) > 0 .
In this model, the margins serve as parameters that dictate the amount of tolerance in classifying an example as positive.
Similar to the standard learning framework, for a ﬁxed distribution D over X , the goal of a learning procedure is to return (given some input) ω
and θ that minimize the following generalization risk function:
[Equation]
The learning process has no direct access to the distribution D .
Instead, it is provided with a set of m i.i.d samples from D , S
=
{ x i } mi =1 i.i.d ∼ D m .
In order to estimate the generalization risk, the empirical risk function is used during training:
[Equation]
The following lemma provides a generalization bound that expresses the generalization of learning c along with h .
Lemma 2.
Let X := X B,n , V and C be as above.
Let D be a distribution of positive examples.
With probability at least 1 − δ over the selection of the data S
= { x i } mi =1 i.i.d ∼ D m , for every v θ ∈ V and c ω ∈ C , we have:
[Equation]
m  
[Equation]
B. P ROOF OF L EM .
All over the proofs, we will make use of two generic classes of functions G =
{ g θ : X → R 2 | θ ∈ Θ } and H = { h ω :
X → R 2 | ω ∈ Ω } .
For simplicity, we denote the indices of g θ ( x ) and h ω ( x ) by − 1 and 1 (instead of 1 and 2 ).
Given a target function y : X → {± 1 } and two functions g θ : X → R 2 and h ω : X → R 2 , we denote the loss of them with respect to a sample x by:
[Equation]
The generalization risk:
[Equation]
And the empirical risk:
[Equation]
We modify the proof of Lem.
1 in Neyshabur et al.
(2018), such that it will ﬁt our purposes.
Lemma 3.
Let y :
X → {± 1 } be a target function.
Let G =
{ g θ : X → R 2 | θ ∈ Θ } and
H =
{ h ω :
X → R 2 | ω ∈ Ω } be two classes class of functions (not necessarily neural networks).
Let P 1 and P 2 be any two distributions on the parameters Θ and Ω (resp.)
that are independent of the training data.
Then, for any γ 1 , γ 2 , δ > 0 , with probability ≥ 1 − δ over the training set of size m , for any two posterior distributions q θ and q ω over Θ and Ω (resp.), such that P θ
[Equation]
,ω
[Equation] [Equation]
x
[Equation]
| ∞ ≤
[Equation]
4 and | h
[Equation]
( x
[Equation]
| ∞ ≤
[Equation]
2 4 ] ≥ 12 , we have:
[Equation]
Proof.
Let S γ 1 ,γ 2 θ,ω ⊂
Θ × Ω be a set with the following properties:
[Equation]
We construct a distribution ˜ Q over Θ × Ω , with probability density function:
[Equation]
otherwise
[Equation]
Here, Z is a normalizing constant.
By the assumption in the lemma, Z = P [( θ (cid:48) , ω
[Equation]
∈ S γ 1 ,γ 2 θ,ω ] ≥
[Equation]
By the deﬁnition of ˜ Q
[Equation]
we have:
[Equation]
Therefore,
[Equation] [Equation]
and also,
[Equation] [Equation]
Since this equation holds uniformly for all x ∈ X
[Equation]
we have:
[Equation] [Equation]
Now using the above inequalities together with Eq.
6 in Mcallester (2003), with probability 1 − δ over the training set we have:
[Equation]
where the last inequality follows from the following observation.
Let S c denote the complement set of S γ 1 ,
[Equation]
[Equation]
,ω and ˜ q c denote the density function q :=
q θ × q ω restricted to S c and normalized.
In addition, we denote p :=
P 1 × P 2 .
Then,
[Equation]
) where H ( Z ) = − Z log Z − (1 − Z ) log(1 − Z ) ≤ 1 is the binary entropy function.
Since the
KL-divergence is always positive, we get,
[Equation]
Since P 1 × P 2 are q θ × q ω are independent joint distributions, we have: D KL ( q θ × q ω || P 1 × P 2 ) =
D KL ( q θ || P 1 ) + D KL ( q ω
|| P 2 ) .
Lemma 4.
Let V
=
{ v θ : X → [0 , 1] | θ ∈ Θ } be a class of value functions v θ ( x ) ∈ [0 , 1] and C
= { c ω = sign ◦ f ω | f ω :
X → R , ω ∈ Ω } a class of classiﬁers (not necessarily neural networks).
We deﬁne two classes of functions G = { g θ = (max u ∈ N (cid:15) ( x ) v θ ( u ) , v θ ( x )) | θ ∈ Θ } and
H =
{ h ω =
(0 , f ω ( x )) | ω ∈ Ω } .
Then,
[Equation]
max
[Equation]
x
[Equation]
x
[Equation]
|
[Equation]
γ
[Equation]
4 and max x ∈ X
[Equation]
where, θ (cid:48) ∼ q θ and ω (cid:48) ∼ q ω .
Proof.
We would like to prove that max x ∈ X | g θ (cid:48)
( x ) − g θ ( x ) | ∞ ≤ γ 1 4 if max x ∈ X | v θ (cid:48)
( x ) − v θ ( x ) | ≤ γ4 and | h ω (cid:48)
( x ) − h ω ( x ) | ∞ ≤ γ 2 4 if | f ω (cid:48)
( x ) − f ω ( x ) | ≤ γ 2 4 .
Since θ (cid:48) and ω (cid:48) are independent, it will prove the desired inequality.
First, we consider that:
[Equation] [Equation]
With no loss of generality, we assume that max u ∈ N (cid:15) ( x ) v θ (cid:48)
( x ) ≥ max u ∈ N (cid:15) ( x ) v θ ( x ) and denote x ∗ =
arg max u ∈ N (cid:15) ( x ) v θ (cid:48)
( x ) .
Therefore, we have:
[Equation]
Next, we consider that:
[Equation] [Equation]
Lemma 5.
Let V
=
{ v θ : X → [0 , 1] | θ ∈ Θ } be a class of value functions v θ ( x ) ∈ [0 , 1] and C
= { c ω = sign ◦ f ω | f ω :
X → R , ω ∈ Ω } a class of classiﬁers (not necessarily neural networks).
Let P 1 and P 2 be any two distributions over the parameters Θ and Ω (resp.)
that are independent of the training data.
Then, for any γ 1 , γ 2 , δ > 0 , with probability ≥ 1 − δ over the training set of size m , for any two posterior distributions q θ and q ω over Θ and Ω (resp.), such that P
[Equation]
∼ q θ [ | v θ
[Equation]
( x ) − v θ ( x ) | ≤
[Equation]
1 4 ] ≥ 1 √ 2 and P ω (cid:48) ∼ q ω [ | f ω
[Equation]
( x ) − f ω
[Equation]
x ) | ≤
[Equation]
4 ] ≥ 1 √ 2 , we have:
[Equation]
and
[Equation]
Proof.
Let G and H be as in Lem.
By Lem.
4 and our assumption,
[Equation]
θ
[Equation]
ω
[Equation]
We note that all of the samples in D are positive.
Therefore, by Lem. 3, with probability at least 1 − δ , we have:
[Equation]
g
[Equation]
x i
[Equation]
1] or and h
[Equation]
x i
[Equation] [Equation]
By the deﬁnition of g θ : g θ ( x )[ − 1] = max u ∈ N (cid:15) ( x ) v θ ( u ) , g θ ( x )[1] = v θ ( x ) .
In addition, by the deﬁnition of h ω : h ω ( x )[ − 1] = 0 and h ω ( x )[1] = f ω ( x ) .
Therefore, we can rephrase Eq.
31 as follows:
[Equation]
Proof of Lem.
We apply Lem.
5 with priors P 1 , P 2 and posteriors q θ , q ω , distributions similar the proof of Thm.
1 in (Neyshabur et al., 2018).
In their proof, they show that for their selection of prior and posterior distributions: (1) P θ (cid:48) ∼ q θ (cid:2) max x ∈ X | v θ ( x ) − v θ ( x ) | < γ 1 4 (cid:3) ≥ 12 holds and (2) D KL ( q θ || P ) =
O ( dr 2 B 2 q log( rq ) C
( θ )
/γ 21 ) .
By taking γ 1 to be half of the value the use and therefore, σ (from their proof) to be half of the value they use as well, we obtain P θ (cid:48) ∼ q θ (cid:104) max x ∈ X | v θ ( x ) − v θ ( x ) | < γ 1 / 2 4 (cid:105) ≥ 1 √ 2 and D KL ( q θ || P ) =
O ( dr 2 B 2 q log( rq ) C
( θ ) /γ 21 ) .
We select P 2 and q ω in a similar fashion.
In particular, we can replace the penalty term in Lem.
5 as follows:
[Equation]
m 
[Equation]
C A DDITIONAL F IGURES
CIFARMNIST (Airplane) (Automobile) (0) (1) (Bird) (Cat) (2) (3) (Deer) (Dog) (4) (5) (Frog) (Horse) (6) (7) (Ship) (Truck) (8) (9)