Addition and Subtraction of Matrices

دوره: یادگیری عمیق با TensorFlow / فصل: Appendix Linear Algebra Fundamentals / درس 6

Addition and Subtraction of Matrices

توضیح مختصر

  • زمان مطالعه 0 دقیقه
  • سطح سخت

دانلود اپلیکیشن «زوم»

این درس را می‌توانید به بهترین شکل و با امکانات عالی در اپلیکیشن «زوم» بخوانید

دانلود اپلیکیشن «زوم»

فایل ویدیویی

متن انگلیسی درس

Similar to normal algebraic operations we can add and subtract matrices.

Let’s start with Ed.

This is an extremely easy operation.

There is only one condition the two matrices must have the same dimensions.

See we have the two matrices M1 and M2 and one has elements 5 12 6 and mine is 3 0 and 14 and M2 contains

9 8 7 and 1 3 and minus 5 as you can see they are both two by three matrices.

If I want to add that to all I need to do is add the corresponding entries one with the other.

The result is a new two by three Matrix.

For the element at position 1 1 we have 5 plus 9 for the element at position 1 2.

We have 12 plus 8 we continue adding them until position 2 3 or we’ve got 14 plus minus 5.

All we have left is to make the simple calculations and reach the solution.

14 20 13 on the first row.

Mine is 2 3 and 9 on the second and that’s the result.

Simple as that.

If I want to add the major C’s in Python I’d need to declare them and simply use a plus sign.

Now as you are aware subtraction is just a type of addition.

So same rules apply there.

Let’s have these two major C’s instead.

In order to find the difference between the two matrices we just need to calculate the differences between

each two corresponding elements.

Note that the two major C’s have the same dimensions once again this time two by two.

The final result is minus to 8 on the first row and five minus four on the second

in terms of coding.

Things are no different.

We declare the two matrices and find their difference.

OK great.

Finally I’ll give a different example.

So you can see that we can do the same with floats as well.

The two major cities are both three by two.

So they are compatible.

Here’s the result.

What about vectors since vectors are nothing more than one dimensional matrices.

Same rules apply.

Let’s take the vector one two three four or five and the vector.

Five four three two one and add them together with vectors.

We only care about the length the two vectors have the same length five.

So they’re compatible.

There is only one way to add them up first element with first element second element with second and

so on.

The result is a vector of length 5 where all entries are sixes.

What about the difference.

It is a vector of length 5 with elements minus 4 minus 2 0 2 and 4.

All right.

Let’s wrap it up here.

Please have a go at the practice problems after this lecture.

Thanks for watching.

مشارکت کنندگان در این صفحه

تا کنون فردی در بازسازی این صفحه مشارکت نداشته است.

🖊 شما نیز می‌توانید برای مشارکت در ترجمه‌ی این صفحه یا اصلاح متن انگلیسی، به این لینک مراجعه بفرمایید.