ECE 417 Lecture 2: Metric (=Norm) Learning

Slides:



Advertisements
Similar presentations
Clustering.
Advertisements

CS 450: COMPUTER GRAPHICS LINEAR ALGEBRA REVIEW SPRING 2015 DR. MICHAEL J. REALE.
C&O 355 Mathematical Programming Fall 2010 Lecture 9
Face Recognition and Biometric Systems Eigenfaces (2)
CLUSTERING PROXIMITY MEASURES
Distance metric learning, with application to clustering with side-information Eric P. Xing, Andrew Y. Ng, Michael I. Jordan and Stuart Russell University.
Introduction to Bioinformatics
Chapter 4.1 Mathematical Concepts
Regressions and approximation Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
L16: Micro-array analysis Dimension reduction Unsupervised clustering.
MA5242 Wavelets Lecture 2 Euclidean and Unitary Spaces Wayne M. Lawton Department of Mathematics National University of Singapore 2 Science Drive 2 Singapore.
Distance Measures Tan et al. From Chapter 2.
Cluster Analysis (1).
Lecture 2: Geometry vs Linear Algebra Points-Vectors and Distance-Norm Shang-Hua Teng.
Statistical Analysis of Microarray Data
Distance Measures Tan et al. From Chapter 2. Similarity and Dissimilarity Similarity –Numerical measure of how alike two data objects are. –Is higher.
COSC 4335 DM: Preprocessing Techniques
Today Wrap up of probability Vectors, Matrices. Calculus
University of Texas at Austin CS395T - Advanced Image Synthesis Spring 2006 Don Fussell Orthogonal Functions and Fourier Series.
Length and Dot Product in R n Notes: is called a unit vector. Notes: The length of a vector is also called its norm. Chapter 5 Inner Product Spaces.
Little Linear Algebra Contents: Linear vector spaces Matrices Special Matrices Matrix & vector Norms.
Inner Product Spaces Euclidean n-space: Euclidean n-space: vector lengthdot productEuclidean n-space R n was defined to be the set of all ordered.
Distance Metric Measures the dissimilarity between two data points. A metric is a fctn, d, of 2 points X and Y, such that d(X, Y) is positive definite:
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Orthogonal Functions and Fourier Series.
Chapter 3 Vectors in n-space Norm, Dot Product, and Distance in n-space Orthogonality.
Numerical Computation Lecture 9: Vector Norms and Matrix Condition Numbers United International College.
Main Menu Salas, Hille, Etgen Calculus: One and Several Variables Copyright 2003 © John Wiley & Sons, Inc. All rights reserved. Chapter 12: Vectors Cartesian.
Chapter 2: Getting to Know Your Data
Chap. 5 Inner Product Spaces 5.1 Length and Dot Product in R n 5.2 Inner Product Spaces 5.3 Orthonormal Bases: Gram-Schmidt Process 5.4 Mathematical Models.
A rule that combines two vectors to produce a scalar.
Chapter 4 Euclidean n-Space Linear Transformations from to Properties of Linear Transformations to Linear Transformations and Polynomials.
Matrix Notation for Representing Vectors
CIS 530 Lecture 2 From frequency to meaning: vector space models of semantics.
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Data Mining: Data Lecture Notes for Chapter 2 Introduction to Data Mining by Tan, Steinbach,
A Bijection between the d-dimensional simplices with all distances in {1,2} and the partitions of d+1 16/02/ Sascha Kurz.
Chapter 1.8 Absolute Value and Inequalities. Recall from Chapter R that the absolute value of a number a, written |a|, gives the distance from a to 0.
MAT 4725 Numerical Analysis Section 7.1 Part I Norms of Vectors and Matrices
Distance/Similarity Functions for Pattern Recognition J.-S. Roger Jang ( 張智星 ) CS Dept., Tsing Hua Univ., Taiwan
1 Objective To provide background material in support of topics in Digital Image Processing that are based on matrices and/or vectors. Review Matrices.
Lecture 11 Inner Product Spaces Last Time Change of Basis (Cont.) Length and Dot Product in R n Inner Product Spaces Elementary Linear Algebra R. Larsen.
EE611 Deterministic Systems Vector Spaces and Basis Changes Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Distance and Similarity Measures
ECE 417 Lecture 1: Multimedia Signal Processing
Chapter 1 Linear Equations and Vectors
Chapter 2 Planes and Lines
Chapter 2: Getting to Know Your Data
Lecture 2-2 Data Exploration: Understanding Data
Clustering Algorithms
Copyright © Cengage Learning. All rights reserved.
Matrices and Vectors Review Objective
Lecture Notes for Chapter 2 Introduction to Data Mining
Similarity and Dissimilarity
Dot Products and projections
Lecture 03: Linear Algebra
School of Computer Science & Engineering
ECE 417 Lecture 4: Multivariate Gaussians
Derivative of scalar forms
CT-321 Digital Signal Processing
From frequency to meaning: vector space models of semantics
Copyright © Cengage Learning. All rights reserved.
Objective To provide background material in support of topics in Digital Image Processing that are based on matrices and/or vectors.
Linear Algebra Lecture 38.
Lecture 2: Geometry vs Linear Algebra Points-Vectors and Distance-Norm
Maths for Signals and Systems Linear Algebra in Engineering Lectures 13 – 14, Tuesday 8th November 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR)
Numerical Analysis Lecture 2.
Unit 1 Representing Real Numbers
Group 9 – Data Mining: Data
Linear Equations and Vectors
POD Simplify.
Data Mining: Concepts and Techniques — Chapter 2 —
Presentation transcript:

ECE 417 Lecture 2: Metric (=Norm) Learning Mark Hasegawa-Johnson 8/31/2017

Today’s Lecture Similarity and Dissimilarity of vectors: all you need is a norm Example: the Minkowski Norm (Lp norm) Cosine Similarity: you need a dot product Example: Diagonal Mahalanobis Distance What is Similarity? Metric Learning

Norm (or Metric, or Length) of a vector A norm is: Non-negative, 𝑥 ≥0 Positive definite, 𝑥 =0 iff 𝑥 = 0 Absolute homogeneous, 𝑎 𝑥 =|𝑎| 𝑥 Satisfies the triangle inequality, 𝑥 + 𝑦 ≤ 𝑥 + 𝑦 Notice that, from 3 and 4 together, we get 𝑥 − 𝑦 ≤ 𝑥 + 𝑦

Distance between two vectors The distance between two vectors is just the norm of their difference. Notice that, because of non-negativity, homogeneity, and triangle inequality, we can write that 0≤ 𝑥 − 𝑦 ≤ 𝑥 + 𝑦 And because of positive definiteness, we also know that 0= 𝑥 − 𝑦 only if 𝑥 = 𝑦 . And the maximum value of 𝑥 − 𝑦 is 𝑥 + 𝑦 achieved only if y is proportional to -x

Today’s Lecture Similarity and Dissimilarity of vectors: all you need is a norm Example: the Minkowski Norm (Lp norm) Cosine Similarity: you need a dot product Example: Diagonal Mahalanobis Distance What is Similarity? Metric Learning

Example: Euclidean (L2) Distance The Euclidean (L2) distance between two vectors is defined as 𝑥 − 𝑦 2 = | 𝑥 1 − 𝑦 1 | 2 +…+ | 𝑥 𝐷 − 𝑦 𝐷 | 2 Non-negative: well, obviously Positive definite: also obvious Absolute homogeneous: easy to show Triangle inequality: easy to show: square both sides of that equation 𝑥 − 𝑦 ≤ 𝑥 + 𝑦

Example: Euclidean (L2) Distance Here are the vectors 𝑥 , in 2-dimensional space, that have 𝑥 2 =1 Attribution: Gustavb, https://commons.wikimedia.org/wiki/File:Unit_circle.svg

Example: Minkowski (Lp) Norm The Minkowski (Lp) distance between two vectors is defined as 𝑥 − 𝑦 𝑝 = 𝑝 | 𝑥 1 − 𝑦 1 | 𝑝 +…+ | 𝑥 𝐷 − 𝑦 𝐷 | 𝑝 Non-negative: well, obviously Positive definite: also obvious Absolute homogeneous: easy to show Triangle inequality: easy to show for any particular positive integer value of p (just raise both sides of the equation 𝑥 − 𝑦 ≤ 𝑥 + 𝑦 to the power of p).

Example: Minkowski (Lp) Distance Here are the vectors 𝑥 , in 2-dimensional space, that have 𝑥 3/2 =1 Attribution: Krishnavedala, https://en.wikipedia.org/wiki/Lp_space#/media/File:Superellipse_rounded_diamond.svg

Example: Minkowski (Lp) Distance Here are the vectors 𝑥 , in 2-dimensional space, that have 𝑥 2/3 =1 Attribution: Joelholdsworth, https://commons.wikimedia.org/wiki/File:Astroid.svg

Manhattan Distance and L-infinity Distance The Manhattan (L1) distance is 𝑥 − 𝑦 1 = 𝑥 1 − 𝑦 1 +…+ 𝑥 𝐷 − 𝑦 𝐷 The L-infinity distance is 𝑥 − 𝑦 ∞ = lim 𝑝→∞ 𝑝 | 𝑥 1 − 𝑦 1 | 𝑝 +…+ 𝑥 𝐷 − 𝑦 𝐷 𝑝 = max 1≤𝑑≤𝐷 𝑥 𝑑 − 𝑦 𝑑 Attribution: Esmil, https://commons.wikimedia.org/wiki/File:Vector_norms.svg

Today’s Lecture Similarity and Dissimilarity of vectors: all you need is a norm Example: the Minkowski Norm (Lp norm) Cosine Similarity: you need a dot product Example: Diagonal Mahalanobis Distance What is Similarity? Metric Learning

Dot product defines a norm The dot product between two real-valued vectors is symmetric and linear, so: 𝑥 − 𝑦 𝑇 𝑥 − 𝑦 = 𝑥 𝑇 𝑥 −2 𝑦 𝑇 𝑥 + 𝑦 𝑇 𝑦 (for complex-valued vectors, things are a bit more complicated, but not too much). Dot product is always positive definite: 𝑥 − 𝑦 𝑇 𝑥 − 𝑦 ≥0 𝑥 − 𝑦 𝑇 𝑥 − 𝑦 =0 only if 𝑥 = 𝑦 So a dot product defines a norm: 𝑥 − 𝑦 2 = 𝑥 − 𝑦 𝑇 𝑥 − 𝑦 𝑥 − 𝑦 2 = 𝑥 2 −2 𝑦 𝑇 𝑥 + 𝑦 2

Cosine The cosine of the angle between two vectors is cos ( 𝑥 , 𝑦 ) = 𝑦 𝑇 𝑥 𝑥 𝑦 Attribution: CSTAR, https://commons.wikimedia.org/wiki/File:Inner-product-angle.png

Today’s Lecture Similarity and Dissimilarity of vectors: all you need is a norm Example: the Minkowski Norm (Lp norm) Cosine Similarity: you need a dot product Example: Diagonal Mahalanobis Distance What is Similarity? Metric Learning

Example: Euclidean distance The Euclidean dot product is: 𝑦 𝑇 𝑥 = 𝑥 1 𝑦 1 +…+ 𝑥 𝐷 𝑦 𝐷 The Euclidean distance is: 𝑥 − 𝑦 2 = ( 𝑥 1 −𝑦 1 ) 2 +…+ 𝑥 𝐷 − 𝑦 𝐷 2 = 𝑥 1 2 −2 𝑥 1 𝑦 1 + 𝑦 1 2 +…+ 𝑥 𝐷 2 −2 𝑥 𝐷 𝑦 𝐷 + 𝑦 𝐷 2 = 𝑥 2 + 𝑦 2 −2( 𝑥 1 𝑦 1 +…+ 𝑥 𝐷 𝑦 𝐷 )

Example: Mahalanobis Distance Suppose that Σ is a diagonal matrix, Σ= 𝜎 1 2 0 0 0 … 0 0 0 𝜎 𝐷 2 , Σ −1 = 1 𝜎 1 2 0 0 0 … 0 0 0 1 𝜎 𝐷 2 The Mahalanobis dot product is then defined as: 𝑦 𝑇 Σ −1 𝑥 = 𝑥 1 𝑦 1 𝜎 1 2 + …+ 𝑥 𝐷 𝑦 𝐷 𝜎 𝐷 2 The squared Mahalonobis distance is: 𝑑 𝑚 2 𝑥,𝑦 =( 𝑥 − 𝑦 ) 𝑇 Σ −1 ( 𝑥 − 𝑦 )= ( 𝑥 1 − 𝑦 1 ) 2 𝜎 1 2 + …+ ( 𝑥 𝐷 − 𝑦 𝐷 ) 2 𝜎 𝐷 2

Example: Mahalanobis Distance Attribution: Piotrg, https://commons.wikimedia.org/wiki/File:MahalanobisDist1.png

Today’s Lecture Similarity and Dissimilarity of vectors: all you need is a norm Example: the Minkowski Norm (Lp norm) Cosine Similarity: you need a dot product Example: Diagonal Mahalanobis Distance What is Similarity? Metric Learning

What is similarity?

What is similarity? Typical Ocean Roundness Peach Ocean at Sunset Redness

Today’s Lecture Similarity and Dissimilarity of vectors: all you need is a norm Example: the Minkowski Norm (Lp norm) Cosine Similarity: you need a dot product Example: Diagonal Mahalanobis Distance What is Similarity? Metric Learning

Metric Learning The goal: learn a function f(x,y) such that, if the user says y1 is more like x and y2 is less like x, then f(x,y1) < f(x,y2)

Mahalanobis Distance Learning The goal is just to learn the parameters Σ so that ( 𝑥 − 𝑦 ) 𝑇 Σ −1 ( 𝑥 − 𝑦 )= ( 𝑥 1 − 𝑦 1 ) 2 𝜎 1 2 + …+ ( 𝑥 𝐷 − 𝑦 𝐷 ) 2 𝜎 𝐷 2 accurately describes the perceived distance between x and y.

𝑥 − 𝑦 𝑇 𝑊 𝑥 − 𝑦 = 𝑤 1 𝑥 1 − 𝑦 1 2 +…+ 𝑤 𝐷 ( 𝑥 𝐷 − 𝑦 𝐷 ) 2 Sample problem Suppose your expriments show that people completely ignore dimension i. What should be the learned parameter 𝜎 𝑖 2 ? Suppose that dimension j is more important than dimension k. Should you have 𝜎 𝑗 2 < 𝜎 𝑘 2 , or 𝜎 𝑗 2 > 𝜎 𝑘 2 ? Suppose that, instead of the normal Mahalanobis distance definition, you read a paper that does distance learning with 𝑥 − 𝑦 𝑇 𝑊 𝑥 − 𝑦 = 𝑤 1 𝑥 1 − 𝑦 1 2 +…+ 𝑤 𝐷 ( 𝑥 𝐷 − 𝑦 𝐷 ) 2 What’s the relationship between the parameters 𝑤 𝑗 and 𝜎 𝑗 2 ?