The linear algebra that you will definitely learn at a science university is summarized in an easy-to-understand and logical manner. By the way, I implemented it in Python. Occasionally, it may be implemented in Julia. .. .. ・ Learn by running with Python! New Mathematics Textbook-Basic Knowledge Required for Machine Learning / Deep Learning- ・ World Standard MIT Textbook Strang Linear Algebra Introduction Understand linear algebra based on and implement it in python.
・ Jupyter Notebook ・ Language: Python3, Julia1.4
The linear combination is composed of ** scalar product ** and ** vector sum **. Let a and b be the two scalars, and v and w be the sum of the vectors.
Scalar product is
av,bw
What was hung like.
Vector sum is
v + w
What was added like. The combination of these two is called *** linear combination ***. Therefore,
av + bw
It is a shape like. By the way, since this has two terms, *** a two-dimensional surface is stretched ***. (If v = w>, it is different.)
Implemented in python
import numpy as np
#vector
v = np.array([1, 2, 3])
w = np.array([4, 5, 6])
#scalar
a = 2
b = 5
#Linear combination shape
linearcomb = a * v + b * w
print(linearcomb)
Implemented in julia
#vector
v = [1, 2, 3]
w = [4, 5, 6]
#scalar
a = 2
b = 5
linearcomb = a * v + b * w
print(linearcomb)
Both appear in the terminal as below
[22 29 36]
Recommended Posts