LINEAR ALGEBRA (Part-1) - Scalars, Vectors, Matrices and Tensors

LINEAR ALGEBRA (Part-1)

Scalars, Vectors, Matrices and Tensors

Scalars

Scalars are a single number. like 5 or 8 or 9 etc.
you can say age=23 here 23 is a scalar value.

Vectors

Vectors are a series/array of elements. They are represented between a square bracket with spaces.
Like below.
ages=[
  23
  25
  33
  54
]
Here,
[
  23
  25
  33
  54
]
is a Column Vector of ages. The Row Vector of ages will look like ages = [23 25 33 54] each element of a vector can be represented by a subscript number like ages1=23 or ages3=33 etc. the numbers of a vector do not have to be of same thing like.
box=[
  2
  4
  8
  "wood"
]
here the box vector represents,
box1 = height = 2 inch
box2 = width = 4 inch
box3 = weight = 8 gram
box4 = made of = wood

Matrix

Matrix is a 2D array of elements.
Like below.
box=[
  2  3  2  4
  4  4  5  2
  8  12  500  8
  "wood"  "wood"  "iron"  "wood"
]
here box matrix represents 4 vector/boxes.
box1=[
  2
  4
  8
  "wood"
]
box2=[
  3
  4
  12
  "wood"
]
box3=[
  2
  5
  500
  "iron"
]
box4=[
  4
  2
  8
  "wood"
]
this is a 4X4 matrix as 4 vectors each has 4 values.

Matrix Transpose

Lets represent a 3X2 matrix.
Like below.
A=[
  A11  A12
  A21  A22
  A31  A32
]
so the transpose of A matrix will be
A=[
  A11  A21A31
  A12  A22A32
]
Transpose of a 3X2 matrix will be 2X3 matrix.

Tensors

More then 2D array of elements are called Tensors.
Like below.
box = [
[
  2  3  2  4
  4  4  5  2
  8  12  500  8
  "wood"  "wood"  "iron"  "wood"
],
[
  2  3  2  4
  4  4  5  2
  8  12  500  8
  "wood"  "wood"  "iron"  "wood"
]
]

SOURCE

Deep Learning (Ian Goodfellow, Yoshua Bengio, Aaron Courville)

মন্তব্যসমূহ

এই ব্লগটি থেকে জনপ্রিয় পোস্টগুলি

LINEAR ALGEBRA (Part-2) - Multiplying Matrices

What Is derivative? (Part - 1)