|
Algorithm 1 Weight learning. |
| 1: functionWeight Learning()
|
| 2:
|
| 3:
|
| 4:
|
| 5: for
do
|
| 6:
|
| 7: for
do
|
| 8:
|
▹ Remove from training set
|
| 9:
|
▹ Predict example with training set S
|
| 10:
|
▹ Insert in
|
| 11: end for
|
| 12:
|
▹ Compute loss
|
| 13:
|
▹ Compute gradient
|
| 14:
|
▹ Update weights vector
|
| 15: if
then
|
▹ Save best weight vector
|
| 16:
|
| 17:
|
| 18: end if
|
| 19: end for
|
| 20: return
|
| 21: end function
|