Reader small image

You're reading from  Automated Machine Learning with AutoKeras

Product typeBook
Published inMay 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800567641
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Luis Sobrecueva
Luis Sobrecueva
author image
Luis Sobrecueva

Luis Sobrecueva is a senior software engineer and ML/DL practitioner currently working at Cabify. He has been a contributor to the OpenAI project as well as one of the contributors to the AutoKeras project.
Read more about Luis Sobrecueva

Right arrow

Understanding tensors

In the MNIST example, the digit images were stored in NumPy matrices, also called tensors. These tensors are the basic data structures for machine learning models. Now that we know what fuels our models, let's dig deeper into understanding what tensors are and their different types.

What is a tensor?

A tensor is basically a multi-dimensional array of numbers, usually floating-point numbers of N dimensions (also called axes).

A tensor is defined by three key attributes: the number of axes or rank, the dimension of each axes or shape, and the type of data it contains. Let's explain them in detail:

  • Rank (axes number): This is also called a dimension in numpy nomenclature (ndim). For instance, a scalar (a single number) has no axes, a vector (a list of numbers) has one, a matrix (a list of vectors) has two, and a 3D tensor (a list of matrices) has three. Let's look at a practical example:
    >>> import numpy as np 
    >>>...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Automated Machine Learning with AutoKeras
Published in: May 2021Publisher: PacktISBN-13: 9781800567641

Author (1)

author image
Luis Sobrecueva

Luis Sobrecueva is a senior software engineer and ML/DL practitioner currently working at Cabify. He has been a contributor to the OpenAI project as well as one of the contributors to the AutoKeras project.
Read more about Luis Sobrecueva