45
Francesco Cocina University of Zurich A brief sketch of Machine Learning Rome, 26th March 2018

Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Francesco Cocina University of Zurich

A brief sketch of Machine Learning

Rome, 26th March 2018

Page 2: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Outline

● Machine Learning (ML)

○ Introduction

○ Types of ML

■ Supervised

■ Unsupervised

■ Reinforcement Learning

○ Visualization: Dimensionality Reduction

● Deep Learning

● Packages and Research

2

Page 3: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Machine Learning

3

Page 4: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Learning a representation that maps inputs to outputs without being explicitly programmed.

Estimation of Dependencies Based on Empirical Data

(V. Vapnik 1983)

Learning requires to infer a functional or statistical relationship between variables when we only observe noisy samples.

The problem without additional assumptions is ill-defined since many different functions might be compatible with noisy observations.We, therefore, require that our inference has to “work” on future data (generalization).

What does it mean?

4

Page 5: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Lots of fields involved

MachineLearning

ComputerScience

Statistics

Engineering(Pattern

Recognition)

Information Theory

Statistical learning theory

Neuro-informatics

ArtificialIntelligence Data Mining

5

Page 6: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Types of Machine learning

● Data: N measurements of D features

collected in the design matrix X

● Target vectors y :

● Known [supervised learning]

● Unknown [unsupervised learning]

● Time-delayed, to be discovered by

performing actions [reinforcement learning]

● Learning the representation y = f(x) and use it to

make predictions/decisions

6

Page 7: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

● Data as pairs of feature and given response variables [training set]

yi an index/label [classification] or a continuous variable [regression]

● Define a function class with parameters w to be learned

● Once the model is trained, performance in predicting correct values are evaluated

on a set of unlabeled data [test set]

● Three different approaches for modeling the function class:

○ Discriminant function

○ Probabilistic models: Generative or discriminative

Supervised Learning

7

Page 8: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

● Finding decision surfaces/boundaries.

● Non linear activation function f

[Generalized Linear Models]

Supervised Learning. Classification

● f(.) labels or posterior probabilities

● Decision surfaces are hyperplanes

where y is constant

● Nonlinear features transformation

using basis functions ϕ(x)

8

Page 9: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Discriminative functions

● Perceptron algorithm (Rosenblatt ‘59)

● Perceptron Criterion: Error function

● Stochastic Gradient Descent, learning step:

● Direct assignment of x to a specific class

Page 10: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Discriminative functions

● Perceptron algorithm (Rosenblatt ‘59)

● Perceptron Criterion: Error function

● Stochastic Gradient Descent, learning step:

● Direct assignment of x to a specific class

● Most popular approach involves the margin maximization [Support vector machines]

Page 11: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Probabilistic approach. Discriminative models

● modeled directly. Models can be

○ Parametric with parameters optimization during training.

○ Non parametric

● Inference stage before decision: i.e determining

● Why do we want the posterior distribution? E.g.

○ Rejection criterion determination

○ Combining different models

11

Page 12: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Discriminative models. Logistic regression

● Likelihood function of Bernoulli variables

● Cross Entropy Error function minimization

● Posterior probability as logistic sigmoid function

● Prone to overfitting if training data are linearly separable.

○ Prior and MAP for w (Bayesian approach)

○ Regularization term for the error function

Page 13: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Probabilistic approach. Generative models

● Modelling class conditional densities and prior

probabilities, i.e

● Generating synthetic data point by sampling

● Allow to estimate marginal densities of data (outliers

detection)

❏ Most demanding, lots of training samples needed.

❏ Efforts no needed if we want just predictions (little

effect of conditional densities)

13

Page 14: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

● MAP as decision rule Naive Bayes classifier

● Gaussian ,

● Multinomial

Generative models. Naive Bayes classifiers● Conditional independence given the class, Naive Bayes model

● Spam filtering application: x text mail [bag-of-words],

pki word i probability in each class (spam/ham)14

Page 15: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Probabilistic Graphical Models● Joint probabilities as diagrammatic models (visualization, insights, inference algorithms)

Bayesian Networks

15

Page 16: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Original image

Probabilistic Graphical Models● Joint probabilities as diagrammatic models (visualization, insights, inference algorithms)

Bayes naive model

Bayesian Networks

● No assumptions about causality: undirected graphs and distribution as product of maximal cliques

Markov Random Fields

Potential functions

Denoising application

Corrupted (10%)16

Page 17: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Original image

Probabilistic Graphical Models● Joint probabilities as diagrammatic models (visualization, insights, inference algorithms)

Bayes naive model

Bayesian Networks

● No assumptions about causality: undirected graphs and distribution as product of maximal cliques

Markov Random Fields

Potential functions

Denoising application

Restored (96%)17

Page 18: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Probabilistic graphical models. Sequential models● Noisy observations xi of a latent variable z

● Main inference tasks:

○ Prediction

○ Filtering

● Gaussian variables ➪ Kalman Filters

○ Application: motion tracking

Sensor

Transition

● z a discrete value ➪ Hidden Markov Models

○ Application: Speech recognition

Page 19: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

19

Page 20: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Graph distance based. Involves spectrum estimation of the Laplacian.

Unsupervised learning. ClusteringK-Means

Spectral clustering

DBSCAN

Gaussian Mixture models

Density-based. Based on the fixed radius Nearest Neighbours tree (frNN).

Minimizing

Fuzzy/soft/probabilistic. Data from a mixture of K Gaussians.Estimation of the posterior distribution.

20

Page 21: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

21

Page 22: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Markov Decision Processes

● Modeling decision making:

○ A set of states X, A set of action A

○ Transition Probabilities

○ A reward function

● Choosing optimal policy π to maximize the

expected rewards [value function]

● Bellmann Theorem

○ A policy is optimal ⇔ it’s greedy with respect to its induced value function

22

Page 23: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Reinforcement Learning

● Exploration-Exploitation dilemma. Should we:

○ Explore: Gather more data to avoid missing

out large rewards

○ Exploit: Stick with our current knowledge

and built an optimal policy

● Data we get depends on our actions!

● Two basic approaches:

○ Model-Based RL. Learn the MDP

○ Model-free RL

Q-learning

Parametric Q-function23

Page 24: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Visualization. Dimensionality reduction

● Projecting data in a low-D space

● Identify the intrisic dimensionality and

preserving relevant structures

[manifold learning]

● Remove redundancies and noisy

features from the datasets

● Covariance based: e.g. PCA

● Distance preserving: e.g. Multidimensional

scaling

● Nonlinear techniques: e.g. Sammon Mapping,

Isomap24

Page 25: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Dimensionality reduction. t-SNE● Convert distances into conditional/joint probabilities (similarities)

○ Gaussian in the high dimensional space

○ t-Student in the low dimensional (heavy tails)

Van der Maaten L., Hinton G. Journal of Machine Learning. 2008. 25

● Variance in the high dimensional accounting for the local density

● Minimizing the Kullback-Leibler distance

Page 26: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

t-SNE. (Fashion) MNIST.

26

Page 27: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

t-SNE. (Fashion) MNIST.

27

Page 28: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Neural networksand Deep Learning

28

Page 29: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Neural Networks

● Rapidly becoming tools of pattern recognition● Starting point is Multilayer Perceptron/Feed forward networks

● h is the activation function○ ReLU○ Tanh○ Logistic

● Inspired by biological networks of neurons

Perceptron Multilayer Perceptron

29

Page 30: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Deep Neural Networks● “Deep” if more than 2 hidden layers

● Each hidden layer “learns“ a representation

● Training the network through backpropagation (aka chain rule for derivatives)

30

Page 31: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Main Architectures. Convolutional NN

● Inspired by Hubel and Wiesel’s work on early visual cortex

● Looking into the local properties of the data

● Max pooling layers for invariance to input translations

31

Page 32: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

● ImageNet competition

● 1.2 mln training images (1000 labels)

● 5 conv + 3 full connected layers

● Depth is important (drop 2% x layer)

● 60 mln parameters

AlexNet (Krizhevsky et al. 2011)

● Data augmentation

● Dropout: setting to zero the

output of each hidden neuron

with p=0.5 (essential but

expensive)

32

● 96 Conv kernels learned

● Top 48 (GPU1) color agnostic

● Down (GPU2) color specific

Page 33: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

● ImageNet competition

● 1.2 mln training images (1000 labels)

● 5 conv + 3 full connected layers

● Depth is important (drop 2% x layer)

● 60 mln parameters

AlexNet (Krizhevsky et al. 2011)

● Data augmentation

● Dropout: setting to zero the

output of each hidden neuron

with p=0.5 (essential but

expensive)

33

● 96 Conv kernels learned

● Top 48 (GPU1) color agnostic

● Down (GPU2) color specific

Page 34: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Going deeper

34

Page 35: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Going deeper

35

Page 36: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Other Architectures. Adversarial Generative Network

Goodfellow I., et al. Advances in neural information processing systems. 2014.

Page 37: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Other Architectures. Adversarial Generative Network

Goodfellow I., et al. Advances in neural information processing systems. 2014.

Page 38: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Neural Network Zoo

http://www.asimovinstitute.org/neural-network-zoo/ 38

Page 39: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

“Deep reinforcement learning”

● 49 Atari games. Pixels as unique input

Mnih at al. (DeepMind), Nature 2015 39

● Learning the Q-function!

● Outperformed human players in >75%

Page 40: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

“Deep reinforcement learning”

● 49 Atari games. Pixels as unique input

Mnih at al. (DeepMind), Nature 2015 40

● Learning the Q-function!

● Outperformed human players in >75%

Page 41: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

“Deep reinforcement learning”

Mnih at al. (DeepMind), Nature 2015 41

● t-SNE of the last hidden layer

after 2h of training in Space

Invaders

● High value function when

plenty of aliens or almost

completely defeated.

Page 42: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Packages

42

Page 43: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Packages Blogs

43

Page 44: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

ML @ ETH/UZH

● Institute of Machine Learning (D-INFK): 4 groups● Courses with tutorial and projects. Examples:

● Reinforcement Learning for Spacecraft Maneuvering using Optic Flow and Time-To-Contact

● Stochastic Calculus for Nonconvex Optimization.● Sleep pattern recognition from EEG/EMG.● Optimising Shared Mobility using Machine Learning

Machine LearningData MiningDeep LearningProbabilistic Artificial IntelligenceLearning and intelligent systemsComputational intelligence labStatistical learning theoryComputational statisticsA Mathematical Introduction to ML Approximation Algorithms

44

Page 45: Machine Learning A brief sketch of - Agenda (Indico) · MAP as decision rule Naive Bayes classifier Gaussian , Multinomial Generative models. Naive Bayes classifiers Conditional independence

Acknowledgements

● A. Polosa

● G. Cavoto

● A. Caflisch

● A. Vitalis

● Big-O & Caflisch groupPositions available for Deep Learning applications!http://www.biochem-caflisch.uzh.ch/

Thank you

for your attention45