TensorFlow is an open source library created by Google that is used in developing systems using machine learning technology. This library includes the implementation of many powerful algorithms designed to solve common problems of machine learning, among which are pattern recognition and decision making.

This material is devoted to the basics of TensorFlow and is intended for readers who know nothing about this library.
TensorFlow: Modern Machine Learning Library
The TensorFlow project was transferred to Google as an open source in 2015. Its predecessor was the project DistBelief, the years of experience gained in the course of working with which were reflected in TensorFlow.
')
The developers of the TensorFlow library sought to ensure that it would be flexible, efficient, expandable, portable. As a result, it can be used in a variety of computing environments - from those formed by mobile devices to environments represented by huge clusters. The library allows you to quickly prepare for the actual work of the trained model, which eliminates the need to create specific implementations of models for production goals.
The TensorFlow library, on the one hand, attracts the attention of the open-source community and is open to innovation, and on the other hand, it is supported by a large corporation. This allows us to say that she has every chance of stable development.
This library, thanks to the joint efforts of all those who work on it, is suitable for solving problems of very different scales. From those that arise in front of an independent developer, to those that stand in front of startups, and even in front of large companies like Google. From the moment this library became open source, from November 2015, it has become one of the most interesting machine learning libraries. It is increasingly used in research, in the development of real-world applications, and in training.
TensorFlow is constantly improving, it is constantly being supplied with something new, optimizing. In addition, the community formed around this library is growing.
About TensorFlow name
Tensor (tensor) is a standard way to present data in deep learning systems. Tensors are multidimensional arrays, an extension of two-dimensional tables (matrices) to represent data that has higher dimensions. Simply put, a tensor is an n-dimensional matrix.
In general, if you are used to working with matrices, tensors can be imagined just as you imagine matrices.
Let's start by installing TensorFlow.
Install TensorFlow
If you start with a clean installation of Python (you probably installed Python specifically for the purpose of learning TensorFlow), to install TensorFlow you just need to use
pip
:
pip install tensorflow
This approach is simple, but it has some unpleasant features. They consist in the fact that when installing TensorFlow, instead of the already installed packages, certain versions of the dependency packages of this library will be installed.
If you are using an existing Python installation for other purposes, this method is not recommended. One way to install TensorFlow with a circumvention of the above feature is to use a virtual environment that is managed by the
virtualenv
utility. Perhaps you already have this utility installed, perhaps not. If it is not installed, you can install it as follows:
pip install virtualenv
Here you can find details about
virtualenv
.
In order to install TensorFlow in a virtual environment, you first need to create such an environment. We are going to place it in the
~/envs
, but you can choose another, more suitable folder for you:
cd ~ mkdir envs virtualenv ~/envs/tensorflow
Above, we created a virtual
tensorflow
environment in the
~/envs
(it is represented by the
~/envs/tensorflow
). In order to activate this environment, use the following command:
source ~/envs/tensorflow/bin/activate
After this, the command line prompt should change, indicating the activated virtual environment:
(tensorflow)
Now you can install TensorFlow in a virtual environment using
pip
:
(tensorflow) pip install tensorflow
Such an installation will not affect other packages installed on the computer.
To exit the virtual environment, you can use the following command:
(tensorflow) deactivate
After that, the command line prompt takes the usual form.
Until recently, TensorFlow was very difficult to use in the Windows environment. However, after the release of TensorFlow 0.12, specific problems in this area are no longer observed. Namely, to install the CPU version of TensorFlow under Windows, it is enough to run the following command:
pip install tensorflow
And to install the GPU version - the following:
pip install tensorflow-gpu
When installing such a version of TensorFlow, it is assumed that you already have CUDA 8.
Now the TensorFlow library is installed on your computer, which means it's time to work with it. Let's start, as is usually the case when learning new technologies, with “Hello World!”.
Dear readers! This material is a translation of the beginning of
this publication on the basics of TensorFlow. What do you think, is it worth translating it further?
