1
InterestingSoftwareTechnology

Getting started with TensorFlow, amazing basics

4 Mins read

TensorFlow is a scalable machine learning framework that can be used for training neural networks, regression and classification models. It has also been deployed for research into Vision and Speech tasks, as well as Natural Language Processing tasks. Let’s have a look at the basics for Tensorflow, we will look at basic terms and definitions in order to have an overview of machine learning.

What is a Tensor?


A Tensor is a mathematical object in the form of an n dimensional array. It is widely used in other areas like Machine Learning, which makes it an extremely useful tool for us in these areas. The basic operations that we can perform on the Tensor are addition, subtraction, multiplication, and division.

The elements of our Tensor will represent some data or information ranging from 0-1 or real numbers. This information can be anything – from images, to text etc.

What is TensorFlow?

  • A scalable machine learning framework that can be used for neural networks and other machine learning problems.
  • Used by Google to provide the open source engine behind some of their most important projects such as AlphaGo Zero in order to better train their AI systems.

TensorFlow, a high-level library that allows users to develop and deploy performing machine learning models, was released in 2015. It has since become the de facto framework for machine learning practitioners as well as a research tool for academic institutions and companies.

  1. How many models can I train with TensorFlow?
  2. How do I use TensorFlow with my computer or mobile device?
  3. How do we specify the inputs and outputs of the model?

How many models can I train with TensorFlow?

If a single machine can run the model and evaluate the results, then a “single model” would be enough to answer the question / perform the task.

If a model needs to be scaled out and not just locally, then “multiple models” (or thousands in some cases) may be required for the task at hand.

How do I use TensorFlow with my computer or mobile device?


Usually, we don’t want to actually run the models because running a model on every CPU can be very computationally intensive. So we would like to deploy models on a server and let them run in the cloud. That is how TensorFlow can scale out multiple models.

Additionally, tensorflow can run on javascript using tensorflow.js, allowing you to use it in your browser.

There is also a set of tools for mobile devices, allowing you to run Tensorflow on your smartphone or tablet.

How do we specify the inputs and outputs of the model?


We want to define the inputs and outputs of our model using four pieces of information:

  • The size of each input (or label) attribute. These are also known as feature dimensions and can also be called as “features” or “featuresets”.
  • The shape of each input/label feature at each location.
  • The type of the input/label feature. These are also known as scalars or integers.
  • The shape of the output values. We usually have tensors that have dimensionality, with each value having shape from a single list of tensors (which can be tensors themselves).

What is the TensorFlow model?

  • It’s a data flow graph (DFG) which describes how inputs and outputs between different nodes are being computed by our neural network model.
  • It’s a graph in which both input and output data is flowing from one node to another in order to compute the gradients that will be used for training the network.

What is a computational graph?

  • A computational graph, sometimes referred to as a dataflow graph (DFG), is an abstract representation of a computation. It consists of vertices or nodes connected by edges (also called arcs).
  • Nodes represent computation and edges represent the flow of data between nodes.

Can you use a pre-trained model

  • Yes. TensorFlow has many models, including the ResNet-50 model for image recognition, available for you to use out of the box. Here are other models you can have a look at.
  • A pre-trained model should be “trained” by a system and then “deployed” so that it can be used.
  • Usually, we don’t want to actually run the models because running a model on every CPU can be very computationally intensive. So we would like to deploy models on a server and let them run in the cloud. That is how TensorFlow can scale out multiple models.

How does TensorFlow work?

  • TensorFlow can run in two different modes: “local” and “remote”. In local mode, we have a single machine that is running both the backend (i.e. the engine that is actually running / executing the model) and the frontend (i.e. the user code). Before we use TensorFlow in a remote mode, we need to first deploy it on our servers in order to train our models and then deploy them wherever we want them to be executed (which could be on other servers or devices).

What resources can I use to learn?

Conclusion


Machine learning and AI have become increasingly more important in our everyday lives. We can now rely on Artificial Intelligence to help us with a variety of tasks, from improving our internet search results to understanding what is happening in our images, videos and text.
We need to embrace the latest advancements in this field in order to develop new business models, services and tools which will help us improve our quality of life.

Interesting read how quickly will AI replace software programmers in future.

Don’t miss amazing tips!

1
Related posts
How ToProgrammingSoftwareTechnology

How to configure Apache Airflow on MacOS locally

4 Mins read
Table of contents0.1 Creating the project folder and the virtual environment0.2 Installing0.3 Running airflow0.4 Starting the webflow server0.5 Starting the scheduler0.6 Running…
Code ChallengesHow ToProgrammingSoftware

How To Implement Merge Sort and Quick Sort Algorithms In Python 3

3 Mins read
Table of contents0.1 Merge Sort0.2 Quick Sort0.3 Conclusion1 Don’t miss amazing tips! Let’s have a look at how to how to implement…
How ToProgrammingSoftware

How to link flutter with firebase email password authentication

11 Mins read
Table of contents0.1 firebase email password authentication output flow0.2 Creating our email password authentication on flutter0.3 Step 10.4 Setting up firebase and…

Leave a Reply

Your email address will not be published. Required fields are marked *

72 − = 71