# Visual Representation of Matrix and Vector Operations and implementations in NumPy, Torch, and TensorFlow

September 23, 2020 • By Balakrishna Kumar

# 3. Array Initialization ~ 1-D, 2-D, 3-D

### Scalar and 1-D Array Scalar, 1-D, 2-D arrays

### 2-D Vector Array 2-D arrays

# 4. Generating Data

### Scalar and 1-D Array Zeros and Ones Diagonal & Same element fill

### Draw random samples from the Normal distribution Normal Dist’n Bell Curve Samples were drawn from Normal Dist’n

### Draw samples from the uniform distribution Uniform Dist’n Curve Samples were drawn from Uniform Dist’n

# 5. Vector Arrangements Zeros and Ones

# 7. Math Operations Sum and Subtract operations multiply and divide operations

# 8. Dot Product Dot Product

# 9. Matrix Multiplication Matrix Multiplication

# 10. Indexing and Slicing (2-D) Indexing and Slicing (2-D)

# 11. Indexing and Slicing (2-D — Matrix) Indexing and Slicing (2-D — Matrix)

# 12. Reshaping and Transpose axes Reshaping and Transpose axes

# 13. Concatenation Concatenation

# 14. Summing across axes Summing across axes

# 15. Mean across axes Mean across axes

# 16. Dimension Expansion & moving axes Dimension Expansion & moving axes

# 17. Max (Min) and Argmax  Max for axis=0 Max for axis=1

# 18. Slicing and Indexing (3-D Matrix) 3x3 Matrix and its indices Upper-Left & Lower-Right Middle Elements & Inverse Middle Element

### Torch Implementation:

Due to visualization constraints, I skipped the operations on the higher dimension parts.

I hope I was able to provide some visual understanding to some of the fundamental operations along with your choice of deep learning framework and I will add more detailed operations shortly.

Check out the Notebooks that contains the entire code implementation and feel free to break it.

Complete Code Implementation is available at,

Until then, see you next time.