Docsity

Neural Networks: Setting the Learning Rate and Preprocessing Data, Study notes of Artificial Intelligence

Partial preview of the text

Download Neural Networks: Setting the Learning Rate and Preprocessing Data and more Study notes Artificial Intelligence in PDF only on Docsity!

CS181 Lecture 7:

Neural Networks III: ModelSelection and Applications

Prof. David C. Parkes

Outline

  • Examples• Practical considerations
    • weight initialization, restart, early stopping

etc.

  • encoding input and output data– handling unbalanced data sets, missing

feature values

  • model selection (# of hidden units) through

cross-validation

  • Applications

two layer one layer

(Duda)

(Duda)

(Duda)

xor problem hidden unitfeature spacetraining error

(Duda

)

8

Practical Considerations

BP is convergent with small

enough

, but… local minima!

Local minimum

Global minimum

Comment: Setting initial

weights

Weight initialization

  • Small random values, close to zero
    • w

2

[-0.01, +0.01] typical

  • Provides diversity to updates on hidden

node weights:

-^

If all hidden units had same weights then BPwould do the same update on each one!

w

kj^

Ã

w

kj^

®

a

±j k

±k

= g’(in

) (yk

k^

  • a

)k

g’(in

) = ak

(1-ak

)k

in

k^

=

∑

wj

kj^

a

j

w

ji^

Ã

w

ji^

®

a

±i j

±j

= g’(in

) errj

j

err

=j

∑

k^

w

kj^

±k

Setting the Learning Rate

  • Something simple is usually sufficient• e.g., for

0.001}:– train until weights converge (or using

“early stopping”, see later in notes)

  • perhaps use random re-start– inspect the best training error
    • Select the largest learning rate that

provides low training error

Learning Rate

Average Error on TestSet

Average Number ofEpochs

22.7%

7576

22.7%

1814

22.7%

248

22.7%

35

25.6%

14

24.7%

51

Data Encoding

  • NNs designed for continuous

inputs/outputs

-^

How might you represent discrete inputsor outputs with more than two values?

-^

Principle:

Data with similar characteristics

be close together in input space, becauseNNs interpolate between data points

Different Kinds of Data

  • Categorical
    • E.g., Flower, Animal, Planet• E.g., True, False
      • Ordinal
        • E.g., movie ratings (*, **, ***, ****, *****)• Pixel levels (L, M, H)
          • Periodic
            • E.g., day of the week (M, T, …, Sa, Su)
              • Continuous
                • E.g., temperature (F), location (GPS)