Table of Contents:

  1. Installation
  2. Version Check
  3. Array Initialization ~ 1-D, 2-D, 3-D
  4. Generating Data
  5. Vector Arrangements
  6. Data-Type — Conversions
  7. Math Operations
  8. Dot Product
  9. Matrix Multiplication
  10. Indexing and Slicing (2-D)
  11. Indexing and Slicing (2-D — Matrix)
  12. Reshaping and Transpose axes
  13. Concatenation
  14. Summing across axes
  15. Mean across axes
  16. Dimension Expansion & moving axes.
  17. Max (Min) and Argmax
  18. Slicing and Indexing (3-D Matrix)



1. Introduction



2. Version Check



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

Scalar and 1-D Array

Scalar, 1-D, 2-D arrays

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



2-D Vector Array

2-D arrays

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



4. Generating Data

Scalar and 1-D Array

Zeros and Ones

Diagonal & Same element fill

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:




Draw random samples from the Normal distribution

Normal Dist’n Bell Curve

Samples were drawn from Normal Dist’n

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:




Draw samples from the uniform distribution

Uniform Dist’n Curve

Samples were drawn from Uniform Dist’n

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



5. Vector Arrangements

Zeros and Ones

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



6. Data-Type — Conversions

uint8/16/32/64 ← → float8/16/32/64

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



7. Math Operations

Sum and Subtract operations

multiply and divide operations

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



8. Dot Product

Dot Product

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



9. Matrix Multiplication

Matrix Multiplication

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



10. Indexing and Slicing (2-D)

Indexing and Slicing (2-D)

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



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

Indexing and Slicing (2-D — Matrix)

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



12. Reshaping and Transpose axes

Reshaping and Transpose axes

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



13. Concatenation

Concatenation

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



14. Summing across axes

Summing across axes

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



15. Mean across axes

Mean across axes

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



16. Dimension Expansion & moving axes

Dimension Expansion & moving axes

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



17. Max (Min) and Argmax


Max for axis=0

Max for axis=1

Numpy Implementation:



TensorFlow Implementation:



Torch Implementation:



18. Slicing and Indexing (3-D Matrix)

3x3 Matrix and its indices

Upper-Left & Lower-Right

Middle Elements & Inverse Middle Element

Numpy Implementation:



TensorFlow Implementation:



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,

  1. Google Colab
  2. Kaggle

Until then, see you next time.