Matrices and vectors Machine Learning Andrew Ng Matrix: - - PowerPoint PPT Presentation

matrices and vectors
SMART_READER_LITE
LIVE PREVIEW

Matrices and vectors Machine Learning Andrew Ng Matrix: - - PowerPoint PPT Presentation

Linear Algebra review (op3onal) Matrices and vectors Machine Learning Andrew Ng Matrix: Rectangular array of numbers: Dimension of matrix: number of


slide-1
SLIDE 1

Andrew ¡Ng ¡

Linear ¡Algebra ¡ review ¡(op3onal) ¡

Matrices ¡and ¡ vectors ¡

Machine ¡Learning ¡

slide-2
SLIDE 2

Andrew ¡Ng ¡

Dimension ¡of ¡matrix: ¡number ¡of ¡rows ¡x ¡number ¡of ¡columns ¡ Matrix: ¡Rectangular ¡array ¡of ¡numbers: ¡

slide-3
SLIDE 3

Andrew ¡Ng ¡

Matrix ¡Elements ¡(entries ¡of ¡matrix) ¡

“ ¡ ¡, ¡ ¡ ¡entry” ¡in ¡the ¡ ¡ ¡ ¡ ¡ ¡ ¡row, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡column. ¡

slide-4
SLIDE 4

Andrew ¡Ng ¡

Vector: ¡An ¡n ¡x ¡1 ¡matrix. ¡ 1-­‑indexed ¡vs ¡0-­‑indexed: ¡ element ¡

slide-5
SLIDE 5

Andrew ¡Ng ¡

Linear ¡Algebra ¡ review ¡(op3onal) ¡

Addi3on ¡and ¡scalar ¡ mul3plica3on ¡

Machine ¡Learning ¡

slide-6
SLIDE 6

Andrew ¡Ng ¡

Matrix ¡Addi4on ¡

slide-7
SLIDE 7

Andrew ¡Ng ¡

Scalar ¡Mul4plica4on ¡

slide-8
SLIDE 8

Andrew ¡Ng ¡

Combina4on ¡of ¡Operands ¡

slide-9
SLIDE 9

Andrew ¡Ng ¡

Linear ¡Algebra ¡ review ¡(op3onal) ¡

Matrix-­‑vector ¡ mul3plica3on ¡

Machine ¡Learning ¡

slide-10
SLIDE 10

Andrew ¡Ng ¡

Example ¡

slide-11
SLIDE 11

Andrew ¡Ng ¡

Details: ¡

m ¡x ¡n ¡matrix ¡ (m ¡rows, ¡ n ¡columns) ¡ n ¡x ¡1 ¡matrix ¡ (n-­‑dimensional ¡ vector) ¡ m-­‑dimensional ¡ vector ¡

To ¡get ¡ ¡ ¡ ¡ ¡, ¡mul3ply ¡ ¡ ¡ ¡’s ¡ ¡ ¡ ¡ ¡ ¡ ¡row ¡with ¡elements ¡

  • f ¡vector ¡ ¡ ¡, ¡and ¡add ¡them ¡up. ¡
slide-12
SLIDE 12

Andrew ¡Ng ¡

Example ¡

slide-13
SLIDE 13

Andrew ¡Ng ¡

House ¡sizes: ¡

slide-14
SLIDE 14

Andrew ¡Ng ¡

Linear ¡Algebra ¡ review ¡(op3onal) ¡

Matrix-­‑matrix ¡ mul3plica3on ¡

Machine ¡Learning ¡

slide-15
SLIDE 15

Andrew ¡Ng ¡

Example ¡

slide-16
SLIDE 16

Andrew ¡Ng ¡

Details: ¡

m ¡x ¡n ¡matrix ¡ (m ¡rows, ¡ n ¡columns) ¡ n ¡x ¡o ¡matrix ¡ (n ¡rows, ¡

  • ¡columns) ¡

m ¡x ¡o ¡ matrix ¡

The ¡ ¡ ¡ ¡ ¡ ¡ ¡column ¡of ¡the ¡matrix ¡ ¡ ¡ ¡ ¡ ¡is ¡obtained ¡by ¡mul3plying ¡ ¡ ¡ ¡ ¡with ¡the ¡ ¡ ¡ ¡ ¡ ¡ ¡column ¡of ¡ ¡ ¡ ¡ ¡. ¡(for ¡ ¡ ¡ ¡= ¡1,2,…,o) ¡

slide-17
SLIDE 17

Andrew ¡Ng ¡

Example ¡

2 7

7

slide-18
SLIDE 18

Andrew ¡Ng ¡

House ¡sizes: ¡ Matrix ¡ Matrix ¡ Have ¡3 ¡compe3ng ¡hypotheses: ¡

  • 1. ¡
  • 2. ¡
  • 3. ¡
slide-19
SLIDE 19

Andrew ¡Ng ¡

Linear ¡Algebra ¡ review ¡(op3onal) ¡

Matrix ¡mul3plica3on ¡ proper3es ¡

Machine ¡Learning ¡

slide-20
SLIDE 20

Andrew ¡Ng ¡

Let ¡ ¡ ¡ ¡ ¡and ¡ ¡ ¡ ¡ ¡be ¡matrices. ¡Then ¡in ¡general, ¡ (not ¡commuta3ve.) ¡ E.g. ¡

slide-21
SLIDE 21

Andrew ¡Ng ¡

Let ¡ Let ¡ Compute ¡ Compute ¡

slide-22
SLIDE 22

Andrew ¡Ng ¡

Iden4ty ¡Matrix ¡ For ¡any ¡matrix ¡ ¡ ¡ ¡, ¡ Denoted ¡ ¡ ¡ ¡ ¡(or ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡). ¡ Examples ¡of ¡iden3ty ¡matrices: ¡

2 ¡x ¡2 ¡ 3 ¡x ¡3 ¡ 4 ¡x ¡4 ¡

slide-23
SLIDE 23

Andrew ¡Ng ¡

Linear ¡Algebra ¡ review ¡(op3onal) ¡

Inverse ¡and ¡ transpose ¡

Machine ¡Learning ¡

slide-24
SLIDE 24

Andrew ¡Ng ¡

Not ¡all ¡numbers ¡have ¡an ¡inverse. ¡ Matrix ¡inverse: ¡ If ¡A ¡is ¡an ¡m ¡x ¡m ¡matrix, ¡and ¡if ¡it ¡has ¡an ¡inverse, ¡ Matrices ¡that ¡don’t ¡have ¡an ¡inverse ¡are ¡“singular” ¡or ¡“degenerate” ¡

slide-25
SLIDE 25

Andrew ¡Ng ¡

Matrix ¡Transpose ¡ Example: ¡ Let ¡ ¡ ¡ ¡ ¡be ¡an ¡m ¡x ¡n ¡matrix, ¡and ¡let ¡ ¡ Then ¡ ¡ ¡ ¡ ¡is ¡an ¡n ¡x ¡m ¡matrix, ¡and ¡