12.2 Convex Learning Problems 133 A possible solution to this problem is to add another constraint on the hypothesis class. In addition to the convexity requirement, we require that H will be bounded; namely, we assume that for some predefined scalar B, every hypothesis w ∈ H satisfies w ≤ B. Boundedness and convexity alone are still not sufficient for ensuring that the problem is learnable, as the following example demonstrates. Example 12.9. As in Example 12.8, consider a regression problem with the squared loss. However, this time let H = {w : |w| ≤ 1} ⊂ R be a bounded hypothesis class. It is easy to verify that H is convex. The argument will be the same as in Example 12.8, except that now the two distributions, D1, D2 will be supported on z1 = (1/µ, 0) and z2 = (1, −1). If the algorithm A returns wˆ < −1/2 upon receiving m examples of the second type, then we will set the distribution to be D1 and have that L D1 (wˆ ) − min L D1 (w) ≥ µ(wˆ /µ)2 − L D1 (0) ≥ 1/(4µ) − (1 − µ) > . w Similarly, if wˆ ≥ −1/2 we will set the distribution to be D2 and have that L D2 (wˆ ) − min L D2 (w) ≥ ( − 1/2 + 1)2 − 0 > . w This example shows that we need additional assumptions on the learning prob- lem, and this time the solution is in Lipschitzness or smoothness of the loss function. This motivates a definition of two families of learning problems, convex-Lipschitz- bounded and convex-smooth-bounded, which are defined later. 12.2.2 Convex-Lipschitz/Smooth-Bounded Learning Problems Definition 12.12 (Convex-Lipschitz-Bounded Learning Problem). A learning prob- lem, (H, Z , ), is called Convex-Lipschitz-Bounded, with parameters ρ, B if the following holds: The hypothesis class H is a convex set and for all w ∈ H we have w ≤ B. For all z ∈ Z , the loss function, (·, z), is a convex and ρ-Lipschitz function. Example 12.10. Let X = {x ∈ Rd : x ≤ ρ} and Y = R. Let H = {w ∈ Rd : w ≤ B} and let the loss function be (w, (x, y)) = | w, x − y|. This corresponds to a regression problem with the absolute-value loss, where we assume that the instances are in a ball of radius ρ and we restrict the hypotheses to be homogenous linear functions defined by a vector w whose norm is bounded by B. Then, the resulting problem is Convex-Lipschitz-Bounded with parameters ρ, B. Definition 12.13 (Convex-Smooth-Bounded Learning Problem). A learning prob- lem, (H, Z , ), is called Convex-Smooth-Bounded, with parameters β, B if the following holds: The hypothesis class H is a convex set and for all w ∈ H we have w ≤ B. For all z ∈ Z , the loss function, (·, z), is a convex, nonnegative, and β-smooth function.
134 Convex Learning Problems Note that we also required that the loss function is nonnegative. This is needed to ensure that the loss function is self-bounded, as described in the previous section. Example 12.11. Let X = {x ∈ Rd : x ≤ β/2} and Y = R. Let H = {w ∈ Rd : w ≤ B} and let the loss function be (w, (x, y)) = ( w, x − y)2. This corresponds to a regres- sion problem with the squared loss, where we assume that the instances are in a ball of radius β/2 and we restrict the hypotheses to be homogenous linear functions defined by a vector w whose norm is bounded by B. Then, the resulting problem is Convex-Smooth-Bounded with parameters β, B. We claim that these two families of learning problems are learnable. That is, the properties of convexity, boundedness, and Lipschitzness or smoothness of the loss function are sufficient for learnability. We will prove this claim in the next chapters by introducing algorithms that learn these problems successfully. 12.3 SURROGATE LOSS FUNCTIONS As mentioned, and as we will see in the next chapters, convex problems can be learned effficiently. However, in many cases, the natural loss function is not convex and, in particular, implementing the ERM rule is hard. As an example, consider the problem of learning the hypothesis class of halfspaces with respect to the 0−1 loss. That is, 0−1(w, (x, y)) = 1[y=sign( w,x )] = 1[y w,x ≤0]. This loss function is not convex with respect to w and indeed, when trying to min- imize the empirical risk with respect to this loss function we might encounter local minima (see Exercise 12.1). Furthermore, as discussed in Chapter 8, solving the ERM problem with respect to the 0−1 loss in the unrealizable case is known to be NP-hard. To circumvent the hardness result, one popular approach is to upper bound the nonconvex loss function by a convex surrogate loss function. As its name indicates, the requirements from a convex surrogate loss are as follows: 1. It should be convex. 2. It should upper bound the original loss. For example, in the context of learning halfspaces, we can define the so-called hinge loss as a convex surrogate for the 0−1 loss, as follows: hinge(w, (x, y)) d=ef max{0, 1 − y w, x }. Clearly, for all w and all (x, y), 0−1(w, (x, y)) ≤ hinge(w, (x, y)). In addition, the convexity of the hinge loss follows directly from Claim 12.5. Hence, the hinge loss satisfies the requirements of a convex surrogate loss function for the zero-one loss. An illustration of the functions 0−1 and hinge is given in the following.
12.4 Summary 135 hinge 0−1 1 1 y 〈w, x〉 Once we have defined the surrogate convex loss, we can learn the problem with respect to it. The generalization requirement from a hinge loss learner will have the form L hinge ( A(S)) ≤ min L hinge (w) + , D D w∈H where L hinge (w) = E(x,y)∼D [ hinge(w, (x, y))]. Using the surrogate property, we can D lower bound the left-hand side by LD0−1(A(S)), which yields LD0−1( A(S)) ≤ min L hDinge(w) + . w∈H We can further rewrite the upper bound as follows: L 0−1 ( A(S)) ≤ min L 0D−1(w) + min L Dhinge(w) − min L 0D−1(w) +. D w∈H w∈H w∈H That is, the 0−1 error of the learned predictor is upper bounded by three terms: Approximation error: This is the term minw∈H L0D−1(w), which measures how well the hypothesis class performs on the distribution. We already elaborated on this error term in Chapter 5. Estimation error: This is the error that results from the fact that we only receive a training set and do not observe the distribution D. We already elaborated on this error term in Chapter 5. Optimization error: This is the term minw∈H L hinge (w) − minw∈H L 0−1 (w) that D D measures the difference between the approximation error with respect to the surrogate loss and the approximation error with respect to the original loss. The optimization error is a result of our inability to minimize the training loss with respect to the original loss. The size of this error depends on the specific distribution of the data and on the specific surrogate loss we are using. 12.4 SUMMARY We introduced two families of learning problems: convex-Lipschitz-bounded and convex-smooth-bounded. In the next two chapters we will describe two generic
136 Convex Learning Problems learning algorithms for these families. We also introduced the notion of convex surrogate loss function, which enables us also to utilize the convex machinery for nonconvex problems. 12.5 BIBLIOGRAPHIC REMARKS There are several excellent books on convex analysis and optimization (Boyd & Vandenberghe 2004, Borwein & Lewis 2006, Bertsekas 1999, Hiriart-Urruty & Lemaréchal 1993). Regarding learning problems, the family of convex-Lipschitz- bounded problems was first studied by Zinkevich (2003) in the context of online learning and by Shalev-Shwartz, Shamir, Sridharan, and Srebro ((2009)) in the context of PAC learning. 12.6 EXERCISES 12.1 Construct an example showing that the 0−1 loss function may suffer from local minima; namely, construct a training sample S ∈ (X × {±1})m (say, for X = R2), for which there exist a vector w and some > 0 such that 1. For any w such that w − w ≤ we have L S(w) ≤ L S (w ) (where the loss here is the 0−1 loss). This means that w is a local minimum of L S. 2. There exists some w∗ such that L S(w∗) < L S(w). This means that w is not a global minimum of L S . 12.2 Consider the learning problem of logistic regression: Let H = X = {x ∈ Rd : x ≤ B}, for some scalar B > 0, let Y = {±1}, and let the loss function be defined as (w, (x, y)) = log (1 + exp ( − y w, x )). Show that the resulting learning prob- lem is both convex-Lipschitz-bounded and convex-smooth-bounded. Specify the parameters of Lipschitzness and smoothness. 12.3 Consider the problem of learning halfspaces with the hinge loss. We limit our domain to the Euclidean ball with radius R. That is, X = {x : x 2 ≤ R}. The label set is Y = {±1} and the loss function is defined by (w, (x, y)) = max{0, 1 − y w, x }. We already know that the loss function is convex. Show that it is R-Lipschitz. 12.4 (*) Convex-Lipschitz-Boundedness Is Not Sufficient for Computational Efficiency: In the next chapter we show that from the statistical perspective, all convex- Lipschitz-bounded problems are learnable (in the agnostic PAC model). However, our main motivation to learn such problems resulted from the computational per- spective – convex optimization is often efficiently solvable. Yet the goal of this exercise is to show that convexity alone is not sufficient for efficiency. We show that even for the case d = 1, there is a convex-Lipschitz-bounded problem which cannot be learned by any computable learner. Let the hypothesis class be H = [0, 1] and let the example domain, Z , be the set of all Turing machines. Define the loss function as follows. For every Turing machine T ∈ Z , let (0, T ) = 1 if T halts on the input 0 and (0, T ) = 0 if T doesn’t halt on the input 0. Similarly, let (1, T ) = 0 if T halts on the input 0 and (1, T ) = 1 if T doesn’t halt on the input 0. Finally, for h ∈ (0, 1), let (h, T ) = h (0, T ) + (1 − h) (1, T ). 1. Show that the resulting learning problem is convex-Lipschitz-bounded. 2. Show that no computable algorithm can learn the problem.
13 Regularization and Stability In the previous chapter we introduced the families of convex-Lipschitz-bounded and convex-smooth-bounded learning problems. In this section we show that all learning problems in these two families are learnable. For some learning problems of this type it is possible to show that uniform convergence holds; hence they are learnable using the ERM rule. However, this is not true for all learning problems of this type. Yet, we will introduce another learning rule and will show that it learns all convex-Lipschitz-bounded and convex-smooth-bounded learning problems. The new learning paradigm we introduce in this chapter is called Regularized Loss Minimization, or RLM for short. In RLM we minimize the sum of the empirical risk and a regularization function. Intuitively, the regularization function measures the complexity of hypotheses. Indeed, one interpretation of the regularization func- tion is the structural risk minimization paradigm we discussed in Chapter 7. Another view of regularization is as a stabilizer of the learning algorithm. An algorithm is considered stable if a slight change of its input does not change its output much. We will formally define the notion of stability (what we mean by “slight change of input” and by “does not change much the output”) and prove its close relation to learnabil- ity. Finally, we will show that using the squared 2 norm as a regularization function stabilizes all convex-Lipschitz or convex-smooth learning problems. Hence, RLM can be used as a general learning rule for these families of learning problems. 13.1 REGULARIZED LOSS MINIMIZATION Regularized Loss Minimization (RLM) is a learning rule in which we jointly min- imize the empirical risk and a regularization function. Formally, a regularization function is a mapping R : Rd → R, and the regularized loss minimization rule outputs a hypothesis in argmin L S(w) + R(w) . (13.1) w Regularized loss minimization shares similarities with minimum description length algorithms and structural risk minimization (see Chapter 7). Intuitively, the “com- plexity” of hypotheses is measured by the value of the regularization function, and 137
138 Regularization and Stability the algorithm balances between low empirical risk and “simpler,” or “less complex,” hypotheses. There are many possible regularization functions one can use, reflecting some prior belief about the problem (similarly to the description language in Minimum Description Length). Throughout this section we will focus on one of the most sim- ple regularization functions: R(w) = λ w 2, where λ > 0 is a scalar and the norm is the 2 norm, w = d wi2. This yields the learning rule: i =1 A(S) = argmin L S(w) + λ w 2 . (13.2) w This type of regularization function is often called Tikhonov regularization. As mentioned before, one interpretation of Equation (13.2) is using structural risk minimization, where the norm of w is a measure of its “complexity.” Recall that in the previous chapter we introduced the notion of bounded hypothesis classes. Therefore, we can define a sequence of hypothesis classes, H1 ⊂ H2 ⊂ H3 . . ., where Hi = {w : w 2 ≤ i }. If the sample complexity of each Hi depends on i then the RLM rule is similar to the SRM rule for this sequence of nested classes. A different interpretation of regularization is as a stabilizer. In the next section we define the notion of stability and prove that stable learning rules do not overfit. But first, let us demonstrate the RLM rule for linear regression with the squared loss. 13.1.1 Ridge Regression Applying the RLM rule with Tikhonov regularization to linear regression with the squared loss, we obtain the following learning rule: 1 m 1 m ( argmin λ w 2 + w, xi − yi )2 . (13.3) 2 2 w∈Rd i =1 Performing linear regression using Equation (13.3) is called ridge regression. To solve Equation (13.3) we compare the gradient of the objective to zero and obtain the set of linear equations (2λm I + A)w = b, where I is the identity matrix and A, b are as defined in Equation (9.6), namely, m m (13.4) A = xi xi and b = yi xi . i =1 i =1 Since A is a positive semidefinite matrix, the matrix 2λm I + A has all its eigenvalues bounded below by 2λm. Hence, this matrix is invertible and the solution to ridge regression becomes w = (2λm I + A)−1 b. (13.5) In the next section we formally show how regularization stabilizes the algorithm and prevents overfitting. In particular, the analysis presented in the next sections (particularly, Corollary 13.11) will yield:
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416