Beruflich Dokumente
Kultur Dokumente
source
What about images?
Input: 100x100x3 pixels
Output: Cat
! (#)
! (%)
! (&)
! (')
!(#, %)
ReLU
ReLU
ReLU
ReLU
ReLU
Input Layers of computation Output
Credit: Krähenbühl
Model: Deep Neural Network
!(#, %)
ReLU
ReLU
ReLU
ReLU
ReLU
Input Layers of computation Output
Credit: Krähenbühl
Model: Deep Neural Network
ReLU
ReLU
ReLU
ReLU
ReLU
Input Layers of computation Output
Credit: Krähenbühl
Training Model Weights
Input Data ! ()) Model f Output Label ( ())
Credit: Krähenbühl
Training Model Weights
Credit: Krähenbühl
Training Model Weights
Provide signal to
improve
Credit: Krähenbühl
Loss Functions
Credit: Krähenbühl
Loss Functions
Provide signal to
improve
Credit: Krähenbühl
Loss Functions
Credit: Krähenbühl
Loss Functions
Credit: Krähenbühl
Loss Functions
Credit: Krähenbühl
Loss Functions
Credit: Krähenbühl
Loss Functions
Credit: Krähenbühl
Labels and Losses
Labels
Credit: source
Types of Labels
data
Image Word
2D/3D Pose Estimation
Credit: Krähenbühl
Regression Loss
Loss
• Continuous label ) (')
• Continuous network output )( (')
• Loss
Credit: Krähenbühl
Regression Loss
Loss
• Continuous label ) (')
• Continuous network output )( (')
• Loss
• L1 / MAE
• L2 / MSE / Least Squares
Credit: Krähenbühl
Regression Loss
Data " (#) !(", %) Output '* (#) Label ' (#)
Loss
• Continuous label ' (#)
• Continuous network output '* (#)
• Loss
• L1 / MAE ! " # ,% − ' #
# # +
• L2 / MSE / Least Squares ! " , % − ' +
Credit: Krähenbühl
Types of Labels
continuous/discrete
continuous discrete
pac-man
blinky
cherry
strawberry
… …
Credit: Krähenbühl
Multi-class Classification via Regression
(#)
• Discrete label !
(#)
• Continuous network output !
%
0. pac-man
1. blinky
2. cherry
3. strawberry
Credit: Krähenbühl
Multi-class Classification via Regression
(#)
• Discrete label !
(#)
• Continuous network output !
%
0. pac-man
1. blinky
2. cherry
3. strawberry
Credit: Krähenbühl
Multi-class Classification via Regression
(#)
• Discrete label !
(#)
• Continuous network output !
%
0. pac-man
1. blinky
&(', )) 1. blinky
2. cherry
3. strawberry
Credit: Krähenbühl
Multi-class Classification via Regression
(#)
✗
• Discrete label !
✗
(#)
✗
• Continuous network output !
%
0. pac-man
1. blinky
&(', )) 1. blinky
2. cherry
3. strawberry
Credit: Krähenbühl
Multi-class Classification via Regression + 1-hot
(#)
• Discrete label !
(#)
• Continuous network output !
%
[1 0 0 0] pac-man
[0 1 0 0] blinky
&(', ))
[0 0 1 0] cherry
[0 0 0 1] strawberry
Credit: Krähenbühl
Multi-class Classification via Regression + 1-hot
(()
• Discrete label '
(()
• Continuous network output '
)
[1 0 0 0] pac-man
[0 1 0 0] blinky
!(#, %)
[0 0 1 0] cherry
[0 0 0 1] strawberry
Credit: Krähenbühl
✗
Multi-class Classification via Regression + 1-hot
(()
• Discrete label '
✗
(()
• Continuous network output '
)
✗
[1 0 0 0] pac-man
[0 1 0 0] blinky
!(#, %)
[0 0 1 0] cherry
[0 0 0 1] strawberry
Credit: Krähenbühl
Multi-class Classification
($)
• Discrete label "
• Regress to class probability & ' = " $
Credit: Krähenbühl
P(strawberry) = 0
Multi-class Classification – Softmax
• Probability
• Positive
• Sums to 1 P(pac-man)
P(blinky)
!(#, %)
P(cherry)
P(strawberry)
Credit: Krähenbühl
Multi-class Classification – Softmax
• Probability
• Positive z
• Sums to 1 10.18 P(pac-man)
12.91 P(blinky)
!(#, %)
-12.38 P(cherry)
18.19 P(strawberry)
Credit: Krähenbühl
Multi-class Classification – Softmax
• Probability
• Positive z
• Sums to 1 10.18 P(pac-man)
12.91 P(blinky)
!(#, %) exp norm
-12.38 P(cherry)
18.19 P(strawberry)
Credit: Krähenbühl
Multi-class Classification – Softmax
• Probability exp '(
! " =
• Positive ∑* exp '*
• Sums to 1
Credit: Krähenbühl
Multi-class Classification – Softmax
• Probability exp '(
! " =
• Positive ∑* exp '*
• Sums to 1
− log %(')
Credit: Krähenbühl
Multi-class Classification – Softmax Loss
P(pac-man)
P(blinky)
!(#, %)
P(cherry)
P(strawberry)
Credit: Krähenbühl
Multi-class Classification – Softmax Loss
P(pac-man)
P(blinky)
!(#, %)
P(cherry)
P(strawberry)
Credit: Krähenbühl
Multi-class Classification – Softmax Loss
P(pac-man)
P(blinky)
!(#, %)
P(cherry)
P(strawberry)
Credit: Krähenbühl
Multi-class Classification – Softmax Loss
− log %(')
Credit: Krähenbühl
Binary Classification – Sigmoid
• Probability 1
! "=0 =
• Positive 1 + exp(+)
• Sums to 1
1
! "=1 =
1 + exp(−+)
Credit: Krähenbühl
Binary Classification – Loss
• Maximum likelihood
• Minimize negative log-probability (NLL)
• Cross entropy
• Softmax-loss − log %(')
• log is numerically stable
Credit: Krähenbühl
Sigmoid is a special case of Softmax
• How?
Types of Labels
continuous/discrete
continuous discrete
After training
Embedding Learning: Triplet Loss
! − <$ ! − <$
! − >$ ! − >$
! − <$
! − >$
Types of Labels
continuous/discrete
continuous discrete