Tensorflow

TensorFlow from Google is an open source library that primarily focuses on deep learning. It uses computational data-flow graphs to represent complicated neural-network architecture. The nodes in the graph denote mathematical computations, also called ops (operations), whereas the edges denote the data tensors transferred between them. Also, the relevant gradients are stored at each node of the computational graph, and during back propagation these are combined to get the gradients with respect to each weight. Tensors are multi-dimensional data arrays used by TensorFlow.

Common Deep-Learning Packages The common deep-learning packages are as follows:

 • Torch – A scientific computing framework with underlying C implementation and LuaJIT as the scripting language. Initial release of Torch was in 2002. Operating systems on which Torch works are Linux, Android, Mac OS X, and iOS. Reputed organizations such as Facebook AI Research and IBM use Torch. Torch can utilize GPU for fast computation.

 • Theano – Is a deep-learning package in Python that is primarily used for computationally intensive research-oriented activities. It is tightly integrated with Numpy array and has efficient symbolic differentiators. It also provides transparent use of GPU for much faster computation. 

• Caffe – Deep-learning framework developed by Berkeley AI Research (BAIR). Speed makes Caffe perfect for research experiments and industry deployment. Caffe implementation can use GPU very efficiently. 

• CuDNN – CuDNN stands for CUDA Deep Neural Network library. It provides a library of primitives for GPU implementation of deep neural networks.

 • TensorFlow – Open source deep-learning framework from Google inspired by Theano. TensorFlow is slowly becoming the preferred library for deep learning in research-oriented work as well as for production implementation. Also for distributed production implementation over the cloud, TensorFlow is becoming the go-to library.

 • MxNet – Open source deep-learning framework that can scale to multiple GPUs and machines. Supported by major cloud providers such as AWS and Azure. Popular machine-learning library GraphLab has good deep-learning implementation using MxNet.

 • deeplearning4j – Open source distributed deep-learning framework for Java virtual machines.

 TensorFlow Installation

TensorFlow can be installed with ease in Linux-, Mac OS–, and Windows-based machines. It is always preferable to create separate environments for TensorFlow. One of the things to note is that TensorFlow installation in Windows requires your Python version to be greater than or equal to 3.5. Such limitations don’t exist for Linux-based machines, or for Mac OS, for that matter. The details of installation for Windowsbased machines are documented well on the official website for TensorFlow: 

 https://www.tensorflow.org/install/install_windows. 

The installation links for Linux-based machines and Mac OS are:

 https://www.tensorflow.org/install/install_linux

 https://www.tensorflow.org/install/install_mac

*TensorFlow Basics for Development*


TensorFlow has its own format of commands to define and manipulate tensors. Also, TensorFlow executes the computational graphs within activated sessions.


Examples:

// import tensorflow and numpy libraries.


 _import tensorflow as tf_ 

_import numpy as np_ 


// Activate a TensorFlow Interactive Session


 _tf.InteractiveSession()_ 


// Define tensor


 _a = tf.zeros((2,2));_

 _b = tf.ones((2,2))_ 


// Sum the Elements of the Matrix (2D Tensor) Across the Horizontal Axis


 _tf.reduce_sum(b,reduction_indices = 1).eval()_ 


--- output ---


array([ 2.,   2.], dtype=float32)

Comments

Popular Posts