Understand Tensors and Matrices for Machine Learning Deep Learning

This is a part of a paid introductory End-to-End Machine Learning Course 2 in newsletter form delivered into your inbox. Subscribe at uniqtech.substack.com

A machine learning bootcamp course in your inbox. Free as a part of your paid premium newsletter subscription. This article is cross-posted from our substack to Medium.

Data Structures, Data Types, Datasets

Cracking the Coding Interview, the bible for technical interviews at Google, Facebook, Microsoft, drills students on data structures and algorithms. Knowledge of data structures like tree, queue, array, each pro and cons make engineers efficient and effective. The one deep learning and machine learning data structure to know is tensor. Tensorflow, Google’s deep learning library is named after tensors. Pytorch has torch.tensor “a multi-dimensional matrix containing elements of a single data type.”

Tensors are also used in Physics, relativity. But here we are using a different flavor of tensor. Trivia: CPU stands for central processing unit. A TPU by Google is a tensor processing unit. It specializes in tensor math and performance!

Introduction to Tensors

Tensor is just a multi-dimensional matrix. A tensor is usually a matrix of dimension 3 or higher.

Scalar 1, a vector also known as a list or array [1,2,3], a two by two matrix [[1,2],[3,4]] , tensor [ [[1,2],[3,4]], [[5,6],[7,8]] ]. A vector contains a bunch of scalars. A matrix contains a bunch of vectors. A tensor contains a bunch of matrices.