38
Computational and Statistical Learning Theory TTIC 31120 Prof. Nati Srebro Lecture 18: Neural Networks Course Summary

Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Embed Size (px)

Citation preview

Page 1: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Computational and StatisticalLearning Theory

TTIC 31120

Prof. Nati Srebro

Lecture 18:Neural NetworksCourse Summary

Page 2: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Linear Learning

• Perceptron (gradient based) update:𝑤 𝑖 += 𝑦𝑥[𝑖]

• Biological analogy: single neuron• Stimuli reinforce synaptic connections

𝑥[1]

𝑥[2]

𝑥[3]

𝑥[𝑑]

ℎ𝑤 𝑥 = 𝑠𝑖𝑔𝑛(𝑤 𝑖 𝑥 𝑖 + 𝑤 0 )

𝑤[0]⋯

𝑥 0 = 1

Page 3: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can we represent with a single Linear Unit?

• AND (conjunctions):

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 − 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(−𝑥 1 − 𝑥 3 − 𝑥 5 + 2)

• OR (disjunctions):• 𝑥 2 ∨ 𝑥 3 ∨ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 + 2)

• XOR (parities):• 𝑥 1 ⊕ 𝑥 2 = ? ? ?

Page 4: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can we represent with a single Linear Unit?

• AND (conjunctions):

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 − 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(−𝑥 1 − 𝑥 3 − 𝑥 5 + 2)

• OR (disjunctions):• 𝑥 2 ∨ 𝑥 3 ∨ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 + 2)

• XOR (parities):• 𝑥 1 ⊕ 𝑥 2 = ? ? ?

𝑥[1]

𝑥[2]

𝑦 = 𝑥 1 ∧ 𝑥[2]

Page 5: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can we represent with a single Linear Unit?

• AND (conjunctions):

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 − 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(−𝑥 1 − 𝑥 3 − 𝑥 5 + 2)

• OR (disjunctions):• 𝑥 2 ∨ 𝑥 3 ∨ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 + 2)

• XOR (parities):• 𝑥 1 ⊕ 𝑥 2 = ? ? ?

𝑥[1]

𝑥[2]

𝑦 = 𝑥 1 ∧ 𝑥[2]

𝑦 = 𝑥 1 ∨ 𝑥[2]

Page 6: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can we represent with a single Linear Unit?

• AND (conjunctions):

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 − 𝑥 5 − 2)

• 𝑥 2 ∧ 𝑥 3 ∧ 𝑥 5 = 𝑠𝑖𝑔𝑛(−𝑥 1 − 𝑥 3 − 𝑥 5 + 2)

• OR (disjunctions):• 𝑥 2 ∨ 𝑥 3 ∨ 𝑥 5 = 𝑠𝑖𝑔𝑛(𝑥 1 + 𝑥 3 + 𝑥 5 + 2)

• XOR (parities):• 𝑥 1 ⊕ 𝑥 2 = ? ? ?

𝑥[1]

𝑥[2]

𝑦 = 𝑥 1 ∧ 𝑥[2]

𝑦 = 𝑥 1 ∨ 𝑥[2]

𝑦 = 𝑥 1 ⊕ 𝑥[2]

Page 7: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Combining Linear Units

1

-1

-1

1

1

1

-1

-1

1

𝑧 1 = 𝑠𝑖𝑔𝑛(𝑥 1 − 𝑥 2 − 1)

𝑧 2 = 𝑠𝑖𝑔𝑛(−𝑥 1 + 𝑥 2 − 1)

ℎ 𝑥 = 𝑠𝑖𝑔𝑛(𝑧 1 + 𝑧 2 + 1)

𝑥[1]

𝑥[2]

Claim: ℎ 𝑥 = 𝑥 1 ⊕ 𝑥[2]

Page 8: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Feed-Forward Neural Networks(The Multilayer Perceptron)

𝑣1

𝑣2

𝑣3

𝑣𝑑𝑢

𝑣

𝑧 𝑖 = 𝑠𝑖𝑔𝑛 ∑𝑤 𝑗, 𝑖 𝑥 𝑗

ℎ 𝑥 = 𝑠𝑖𝑔𝑛 ∑𝑤 𝑖 𝑧 𝑖

𝑥[1]

𝑥[2]

𝑥[3]

𝑥[𝑑]

Page 9: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Feed-Forward Neural Networks(The Multilayer Perceptron)

𝑣1

𝑣2

𝑣3

𝑣𝑑𝑢

𝑣

𝑣𝑜𝑢𝑡

Architecture:

• Directed Acyclic Graph G(V,E). Units (neurons) indexed by vertices in V.

• “Input Units” 𝑣1…𝑣𝑑 ∈ 𝑉, with no incoming edges and 𝑜 𝑣𝑖 = 𝑥[𝑖]

• “Output Unit” 𝑣𝑜𝑢𝑡 ∈ 𝑉, ℎ𝑤 𝑥 = 𝑜 𝑣𝑜𝑢𝑡

• “Activation Function” 𝜎:ℝ → ℝ. E.g. 𝜎 𝑧 = 𝑠𝑖𝑔𝑛 𝑧 or 𝜎 𝑧 =

Parameters:

• Weight 𝑤[𝑢 → 𝑣] for each edge 𝑢 → 𝑣 ∈ 𝐸

𝑎[𝑣] =

𝑢→𝑣∈𝐸

𝑤[𝑢 → 𝑣] 𝑜[𝑢]

𝑜 𝑣 = 𝜎( 𝑎 𝑣 )

𝑥[1]

𝑥[2]

𝑥[3]

𝑥[𝑑]

ℎ𝐺 𝑉,𝐸 ,𝜎,𝑤 𝑥

Page 10: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Feed-Forward Neural Networksas a Hypothesis Class

• Hypothesis class specified by:(ie we typically decide on this in advance)• Graph G(V,E)

• V includes input, output and “hidden” nodes• Activation function 𝜎

e.g. sign 𝑧 , tanh(𝑧), sigmoid 𝑧 =1

1+𝑒−𝑧

• Hypothesis specified by: (ie we need to learn)• Weights 𝑤, with weight 𝑤[𝑢 → 𝑣] for each edge 𝑢 → 𝑣 ∈ 𝐸

ℋ𝐺 𝑉,𝐸 ,𝜎 = ℎ𝐺 𝑉,𝐸 ,𝜎,𝑤 | 𝑤: 𝐸 → ℝ

• Issues:• Expressive power: What can we represent/approximate with ℋ𝐺 𝑉,𝐸 ,𝜎?

approximation error• Statistical issues: Sample complexity of learning 𝑤

estimation error• Computational issues: Can we learn efficiently and how?

optimization error

Architecture

Page 11: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Sample Complexity of NN

• #params = |𝐸| (number of weights we need to learn)

• More formally: 𝑉𝐶𝑑𝑖𝑚 ℋ𝐺 𝑉,𝐸 ,𝑠𝑖𝑔𝑛 = 𝑂( 𝐸 log 𝐸 )

• Other activation functions?

• 𝑉𝐶𝑑𝑖𝑚 ℋ𝐺(𝑉,𝐸),sin = ∞ even with single unit and single real-valued input

• For 𝜎 𝑧 = 𝑠𝑖𝑔𝑚𝑜𝑖𝑑 𝑧 =1

1+𝑒−𝑧:

Ω 𝐸 2 ≤ 𝑉𝐶𝑑𝑖𝑚(ℋ𝐺 𝑉,𝐸 ,sigmoid) ≤ 𝑂( 𝐸 4)

• For piecewise linear, e.g. 𝑟𝑎𝑚𝑝 𝑧 = 𝑐𝑙𝑖𝑝 −1,1 (𝑧) or 𝑅𝑒𝐿𝑈 𝑧 = max 0, 𝑧 :

Ω 𝐸 2 ≤ 𝑉𝐶𝑑𝑖𝑚(ℋ𝐺 𝑉,𝐸 ,𝜎) ≤ 𝑂( 𝐸 2)

• With finite precision:

𝑉𝐶𝑑𝑖𝑚 ℋ𝐺 𝑉,𝐸 ,𝜎 ≤ log ℋ𝐺 𝑉,𝐸 ,𝜎 ≤ 𝐸 ⋅ #𝑏𝑖𝑡𝑠

• Bottom line: |𝑬| (number of weights) controls sample complexity

Page 12: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can Feed-Forward Networks Represent?

• Any function over 𝒳 = ±1 𝑑

• With a single hidden layer, using DNF (hidden layer does AND, output does OR)• 𝑉 = 2𝑑, 𝐸 = 𝑑2𝑑

• Like representing the truth table directly…

• Universal Representation Theorem: Any continuous functions 𝑓: 0,1 𝑑 → ℝ can be approximated to within any 𝜖 by a feed-forward network with sigmoidal (or almost any other) activation and a single hidden layer.• Size of layer exponential in d

• Compare: With a large enough #params (large enough #features, small enough margin) even a linear model can approximate any continuous function arbitrary well (e.g. using Gaussian kernel)

Page 13: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can SMALL Networks Represent?

• Intersection of halfspaces• Using single hidden layer

• Union of intersection of halfspaces (and also sorting, more fun stuff, …)• Using two hidden layers

Page 14: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can SMALL Networks Represent?

• Intersection of halfspaces• Using single hidden layer

• Union of intersection of halfspaces (and also sorting, more fun stuff, …)• Using two hidden layers

• Functions representable by a small logical circuit• Implement AND using single unit, negation by reversing weight

• Functions that depend on lower level features

Page 15: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Neural Nets as Feature Learning

• Can think of hidden layer as “features” 𝜙(𝑥), then a linear predictor based on ⟨𝑤, 𝜙⟩

• “Feature Engineering” approach: design 𝜙(⋅) based on domain knowledge

• “Deep Learning” approach: learn features from data

• Multilayer networks: more and more complex features

𝑣1

𝑣2

𝑣3

𝜙 1

𝜙 𝑘

𝑥[1]

𝑥[2]

𝑥[𝑑]

𝑣𝑜𝑢𝑡⋯

Page 16: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Multi-Layer Feature Learning

Page 17: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

More knowledge or more learning

Expert knowledge:full specific knowledge

Expert Systems(no data at all)

no free lunch

more data

Use expert knowledge to construct 𝜙 𝑥 or 𝐾(𝑥, 𝑥′), then use, eg SVM, on 𝜙(𝑥)

“Deep Learning”:use very simple raw

features as input, learn good features

using deep neural net

Page 18: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

What can SMALL Networks Represent?

• Union of intersection of halfspaces (and also sorting, more fun stuff, …)

• Functions that depend on lower level linear features

• Functions representable by small logical circuits

• Everything we want:computable in time 𝑇computable using depth 𝑂(𝑇) circuit with 𝑂(𝑇) gates per layercomputable with depth 𝑂(𝑇) net with 𝑂(𝑇) nodes per layer and 𝑂(1) fan-in

𝑓 𝑓 𝑐𝑜𝑚𝑝𝑢𝑡𝑎𝑏𝑙𝑒 𝑖𝑛 𝑡𝑖𝑚𝑒 𝑇 } ⊆ ℋ𝐺(𝑉,𝐸),𝜎 with 𝐸 = 𝑂 𝑇2

Universal Learning: learn any 𝑓 computable in time 𝑇 with 𝑝𝑜𝑙𝑦(𝑇) samples

• Compare: to get “universal approximation” with linear models / kernels, margin must shrink (and #features must grow) exponentially

Page 19: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Optimization𝐸𝑅𝑀 𝑆 = argmin

𝑤𝐿𝑆 𝑓𝑤

• Highly non-convex problem, even if 𝑙𝑜𝑠𝑠 and activation 𝜎 are convex

Page 20: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

𝐸𝑅𝑀 𝑆 = argmin𝑤

𝐿𝑆 𝑓𝑤

• NP-Hard even with single hidden layer, three hidden units,inputs in ±1 𝑛, and 𝜎 𝑧 = 𝑠𝑖𝑔𝑛(𝑧)

𝑉𝑛 = {input units 𝑣1, … , 𝑣𝑛} ∪ {hidden units 𝑢1, 𝑢2, 𝑢3} ∪ {output unit 𝑣𝑜𝑢𝑡}𝐸𝑛 = 𝑣𝑖 → 𝑢𝑗 𝑖 = 1. . 𝑛, 𝑗 = 1. . 3 ∪ 𝑢𝑗 → 𝑣𝑜𝑢𝑡 𝑗 = 1. . 3

argmin𝑤

𝐿𝑆01(𝑓𝐺𝑛(𝑉𝑛,𝐸𝑛),𝑠𝑖𝑔𝑛,𝑤) NP-Hard

If 𝑁𝑃 ≠ 𝑅𝑃, not efficiently agnostically properly PAC learnable

(not surprising: not efficiently agnostically PAC learnable even with no hidden units)

• NP-Hard, even if realizable, i.e.:

NP-Hard to decide whether ∃𝑤𝐿𝑆01 𝑓𝐺𝑛(𝑉𝑛,𝐸𝑛),𝑠𝑖𝑔𝑛,𝑤 = 0

If 𝑁𝑃 ≠ 𝑅𝑃, not efficiently properly PAC learnable

argmin𝑤

𝐿𝑆ℎ𝑖𝑛𝑔𝑒

(𝑓𝐺𝑛(𝑉𝑛,𝐸𝑛),𝑠𝑖𝑔𝑛,𝑤) NP-Hard

If 𝑁𝑃 ≠ 𝑅𝑃, not eff. agnostically properly PAC learnable w.r.t. hinge loss

Page 21: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Complexity of Learning Neural Nets

• Highly non-convex problem

• Hard to properly PAC learn, even with d=1 hidden layer and k=3 hidden units

• Not surprising: if we could learn poly-size neural networks, we could learn hypothesis class of all poly-time functions

𝐺𝑛,𝑑,𝑘 = graph with 𝑛 inputs, 𝑑 hidden layers, 𝑘 units in each layer𝑇𝐼𝑀𝐸 𝑇(𝑛) ⊆ ℋ𝐺𝑛,𝑑=𝑂 𝑇 𝑛 ,𝑘=𝑂(𝑇 𝑛 ),𝜎

• Conclusion: If crypto possible, no algorithm for PAC learning ℋ𝐺 𝑉,𝐸 ,𝜎 in

time 𝑝𝑜𝑙𝑦 𝐸

• Discrete cube root hard no efficient PAC learning of ℋ𝐺𝑛,𝑑=𝑂 log 𝑛 ,𝑘=𝑂 𝑛

• RSAT no efficient PAC learning of ℋ𝐺𝑛,𝑑=1,𝑘=𝜔 1

• Still open: efficiently improperly learn network with constant number of hidden units.

Page 22: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Choose your universal learner:

Short Programs

• Universal• Captures anything we want

with reasonable sample complexity

• NP-hard to learn

• Hard to optimize in practice• No practical local search• Highly non-continuous,

disconnected discrete space• Not much success

Deep Networks

• Universal• Captures anything we want

with reasonable sample complexity

• NP-hard to learn

• Often easy to optimize• Continuous• Amenable to local search,

stochastic local search• Lots of empirical success

Page 23: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

So how do we learn?

𝐸𝑅𝑀 𝑆 = argmin𝑤

𝐿𝑆 ℎ𝐺 𝑉,𝐸 ,𝜎,𝑤

• Stochastic gradient descent:

𝑤(𝑡+1) ← 𝑤 𝑡 − 𝜂𝑡𝛻𝑤𝑙𝑜𝑠𝑠 ℎ𝐺 𝑉,𝐸 ,𝜎,𝑤 𝑡 𝑥 , 𝑦

for random 𝑥, 𝑦 ∈ 𝑆

(yes, even though its not convex)

• How do we efficiently calculate 𝛻𝑤𝑙𝑜𝑠𝑠(ℎ𝑤 𝑥 , 𝑦)?

Page 24: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Back-Propagation• Efficient calculation of 𝛻𝑤𝑙𝑜𝑠𝑠(ℎ𝑤 𝑥 , 𝑦) using chain rule

• Forward propagation: calculate activations 𝑎[𝑣] and outputs 𝑜[𝑣]

• Backward propagation: calculate 𝛿𝑣 ≝𝜕𝑙𝑜𝑠𝑠 ℎ𝑤 𝑥 ,𝑦

𝜕𝑜𝑣

• Output: 𝜕𝑙𝑜𝑠𝑠

𝜕𝑤 𝑢→𝑣= 𝛿 𝑣 𝜎′ 𝑎 𝑣 𝑜 𝑢

• I.e. 𝑤 𝑢 → 𝑣 −= 𝜂 𝛿 𝑣 𝜎′(𝑎 𝑣 ) 𝑜[𝑢]

𝑣1

𝑣2

𝑣3

𝑣𝑑𝑢

𝑣

𝑣𝑜𝑢𝑡

𝑎[𝑣] =

𝑢→𝑣∈𝐸

𝑤[𝑢 → 𝑣] 𝑜[𝑢]

𝑜 𝑣 = 𝜎( 𝑎 𝑣 )

𝑥[1]

𝑥[2]

𝑥[3]

𝑥[𝑑]

𝛿 𝑣𝑜𝑢𝑡 = 𝑙𝑜𝑠𝑠′(𝑜 𝑣𝑜𝑢𝑡 , 𝑦)

𝛿 𝑢 =

𝑢→𝑣

𝑤 𝑢 → 𝑣 𝛿 𝑣 𝜎′ 𝑎 𝑣

Page 25: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

History of Neural Networks

• 1940s-70s:• Inspired by learning in the brain, and as a model for the brain (Pitts,

Hebb, and others)• Various models, directed and undirected, different activation and

learning rules• Perceptron Rule (Rosenblatt), Problem of XOR, Multilayer perceptron

(Minksy and Papert)• Backpropagation (Werbos 1975)

• 1980s-early 1990s:• Practical Back-prop (Rumelhart, Hinton et al 1986) and SGD (Bottou)• Relationship to distributed computing; “Connectionism”• Initial empirical success

• 1990s-2000s:• Lost favor to implicit linear methods: SVM, Boosting

• 2010s:• Computational advances allow training HUGE networks• …and also a few new tricks• Empirical success and renewed interest (Ng, LeCun, Hinton)

Page 26: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Neural Networks: Current Trends

• Very large architectures:#weights ≈ #samples ≈ 107 ~ 109

• SGD training on GPUs• Optimization technology: momentum, quasi-2nd order• What stayed constant since the 50s: training runtime is about

10-14 days

• Use different activation functions:• Hinge-like activation: 𝑅𝑒𝐿𝑈 𝑧 = max(𝑧, 0)• Max (instead of summation) in some layers

• “Drop-out” regularization• Each SGD iteration, ignore random subset of edges (pretend

they are not in the model))• Implicit regularization, not yet fully understood

• Convolutional and Recurent Networks• Many edges share the same weight, #param << #edges

Page 27: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Theory of Neural Network Learning

• Expressive Power• Universal, all poly-time functions

• Capacity Control (Sample Complexity)• ∝ number of weights• regularization

• Optimization

?????

Not: “what about reality is captured by my NN architecture”

Rather: “what about reality makes it easy to optimize my NN”

“its easy to optimize my NN on real data, because real data has such and such properties”

Page 28: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Computational and Statistical Learning Theory

• Main Goals:• Strengthen understanding of learning. What effects how well

we can learn, and the required resources (data, computation) for learning? How should we think of and evaluate different learning approaches?

• Obtain formal and quantitative understanding of learning: Formalize learning, “no free lunch”, universal learning, computational limits on learning; Understand learning guarantees and bounds and what they tell us.

• Understand relationship between learning and optimization, and explore modern optimization techniques in the context of learning.

• Secondary Goal:• Learn techniques and develop skills for analyzing learning and

proving learning guarantees.

Page 29: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Data

System for Performing Task (e.g. Predictor)

• 99% of faces have two eyes

• People with beards buy less nail polish

• …

𝑅𝑜𝑡𝑎𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒 2

∝ 𝑎𝑣𝑔 𝑟𝑎𝑑𝑖𝑢𝑠 3

NP adj NPNP det Ndet ‘the’

Does smoking contribute to lung cancer?• Yes, with p-value = 10−72

How long ago did cats and dogs diverge?• About 55 MY, with 95%

confidence interval [51,60]

“Machine Learning”: Use data and examples, instead of expert knowledge, to automatically create systems that perform complex tasks

Vapnik

Page 30: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Generic Learning

LearningAlgorithm

Examples of faces Face recognizer

Sample emails Spam detector

Spanish and English texts Translation system

Recorded transliterated audio Speech recognizer

Protein sequences and folds Protein fold predictor

Examples of bicycles Bike detectors

Page 31: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

The ability to learn grammars is hard-wired into the brain. It is not possible to “learn” linguistic

ability—rather, we are born with a brain apparatus specific to language representation.

There exists some “universal” learning algorithm that can learn anything: language,

vision, speech, etc. The brain is based on it, and we’re working on uncovering it. (Hint: the brain

uses neural networks)

There is no “free lunch”: no learning is possible without some prior assumption about the

structure of the problem (prior knowledge)

Noam Chomsky

Geoff Hinton

David Wolpert

Page 32: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Inductive Bias• “No Free Lunch”: no rule can learn anything, need some inductive bias

• In terms of learning rule: Some bias toward some hypothesis over others

• In terms of guarantee: Some assumption

• Encode as--

• Hypothesis class ℋ: “reality is reasonably well captured by some hypothesis from ℋ”

• Measure 𝑝(ℎ) (or continuous measure 𝑃, or measure over hypothesis classes):

• “reality is reasonably well captured by ℎ with high 𝑝(ℎ)”

• Complexity measure (≡ length of description in chosen description language) − log𝑝(ℎ)

Master learning rule: 𝐚𝐫𝐠𝐦𝐢𝐧𝑳𝑺(𝒉) , − 𝐥𝐨𝐠𝒑(𝒉)

• Our analysis focused on learning a “flat” hypothesis class ℋ

Usually actually part of some hierarchy ℋ(𝐵), which we can think of as level sets ℋ = ℎ − log 𝑝 ℎ ≤ 𝐵}

Page 33: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Uniform and Non-Uniform Learnability

• Definition: A hypothesis class ℋ is agnostically PAC-Learnable if there exists a

learning rule 𝐴 such that ∀𝜖, 𝛿 > 0, ∃𝑚 𝜖, 𝛿 , ∀𝒟, ∀𝒉, ∀𝑆∼𝒟𝑚 𝜖,𝛿𝛿 ,

𝐿𝒟 𝐴 𝑆 ≤ 𝐿𝒟 ℎ + 𝜖

• Definition: A hypothesis class ℋ is non-uniformly learnable if there exists a

learning rule 𝐴 such that ∀𝜖, 𝛿 > 0, ∀ℎ, ∃𝑚 𝜖, 𝛿, 𝒉 , ∀𝒟, ∀𝑆∼𝒟𝑚 𝜖,𝛿,𝒉𝛿 ,

𝐿𝒟 𝐴 𝑆 ≤ 𝐿𝒟 ℎ + 𝜖

• Definition: A hypothesis class ℋ is “consistently learnable” if there exists a

learning rule 𝐴 such that ∀𝜖, 𝛿 > 0, ∀ℎ ∀𝓓, ∃𝑚 𝜖, 𝛿, ℎ, 𝓓 , ∀𝑆∼𝒟𝑚 𝜖,𝛿,ℎ,𝓓𝛿 ,

𝐿𝒟 𝐴 𝑆 ≤ 𝐿𝒟 ℎ + 𝜖

Page 34: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Learning Theory vs “Classical” Statistical Analysis:What makes ML “special”?

• Scale, domain and emphasis of ML:

• Machine Learning as an engineering paradigm: performing a task vs obtaining understanding

• Emphasis on computational issues: without computational constraints, ML is trivial

• No need for sophisticated confidence measures: use validation

• Big Data?

Page 35: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Learning Theory vs “Classical” Statistical Analysis:An Overly Simplistic View

• Typical statistical analysis:

• Assume model 𝑃((𝑥, 𝑦)|𝜃)

• Estimate መ𝜃 from data, study how መ𝜃 → 𝜃

• Analysis often focused on asymptotic regime as 𝑚 → ∞ and 𝜖 = መ𝜃 − 𝜃 → 0

• Typical statistical learning theory analysis (this course):

• Choose hypothesis class to compete with, don’t assume it

• Learn predictor from data, study how it competes with ℋ

• Since we don’t assume model, no true 𝜃 to approach

• Might even be improper: estimate doesn’t even correspond to any 𝜃

• Also, might not be identifiable

• Finite sample analysis: Since model wrong anyway, relevant regime often 𝜖 ≈ model error > 0

Page 36: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Example: Linear Regression• Classical statistical view of linear regression:

𝑦𝑖 = 𝑤∗, 𝑥𝑖 + 𝑣𝑖

• Goal:• Parameter error: ෝ𝑤 − 𝑤∗

2

• “De-noising”: 1

𝑚∑𝑖=1𝑚 ෝ𝑤, 𝑥𝑖 − 𝑤∗, 𝑥𝑖

2 = ෝ𝑤 − 𝑤∗ ⊤ Σ𝑋(ෝ𝑤 − 𝑤∗)

• Prediction: 𝔼 ෝ𝑤, 𝑥 − 𝑦 2 = 𝔼 ෝ𝑤, 𝑥 − ⟨𝑤∗, 𝑥⟩ 2 + 𝜎2

= ෝ𝑤 − 𝑤∗ ⊤Σ𝑋 ෝ𝑤 − 𝑤∗ + 𝜎2 →𝑑𝜎2

𝑚+ 𝜎2

• ML / This course:• Only assume there exists some 𝑤0 s.t. 𝔼 𝑤0, 𝑥 − 𝑦 2 ≤ 𝜎2

• Equivalently: 𝑦𝑖 = 𝑤0, 𝑥𝑖 + 𝑣𝑖 where 𝔼 𝑣𝑖2 ≤ 𝜎2, but not 𝑥 ⊥ 𝑣

𝔼 ෝ𝑤, 𝑥 − 𝑦 2 ≤ 𝜎2 + 𝑂𝑑

𝑚+

𝜎2𝑑

𝑚

𝑣𝑖 ∼ 𝒩(0, 𝜎2) independent of 𝑥𝑖

𝑣 , |𝑦| bounded with high probability Can avoid this term

Page 37: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

A Different Approach• Could take more probabilistic approach to machine learning, focusing on

probabilistic models for 𝑝(𝑦|𝑥; 𝜃) instead of hypothesis classes

• Likelihood − log 𝑝 𝑦1…𝑦𝑚 𝑥1…𝑥𝑚; 𝜃 = ∑𝑖 − log 𝑝 𝑦𝑖 ℎ𝜃 𝑥𝑖

• Bayesian: also assuming probabilistic prior 𝑝 𝜃

• Posterior: − log 𝑝 𝜃 𝑆 ∝ ∑𝑖 − log 𝑝 𝑦𝑖 ℎ𝜃 𝑥𝑖 + − log 𝑝 𝜃

• Many advantages: easier to discuss uncertainty in predictions, better interpretation of regularization parameter, often easier to combine models

• Analyze under probabilistic model: “Well specified”/Bayesian analysis typically tighter then our agnostic analysis, but assumptions much stronger

• Topic of a different class (that can also be called “Statistical Learning Theory”….)

𝑙𝑜𝑠𝑠 𝑦𝑖; ℎ𝜃 𝑥𝑖

Page 38: Computational and Statistical Learning Theoryttic.uchicago.edu/~nati/Teaching/TTIC31120/2016/Lecture...Feed-Forward Neural Networks (The Multilayer Perceptron) 1 2 3 â è ç Architecture:

Computational and Statistical Learning Theory

• Main Goals:• Strengthen understanding of learning. What effects how well

we can learn, and the required resources (data, computation) for learning? How should we think of and evaluate different learning approaches?

• Obtain formal and quantitative understanding of learning: Formalize learning, “no free lunch”, universal learning, computational limits on learning; Understand learning guarantees and bounds and what they tell us.

• Understand relationship between learning and optimization, and explore modern optimization techniques in the context of learning.

• Secondary Goal:• Learn techniques and develop skills for analyzing learning and

proving learning guarantees.