TensorFlow is an open source machine learning framework. It is used for implementing machine learning and deep learning applications. TensorFlow is designed in Python programming language so it is easy to understand and learn. TensorFlow is designed by Google which is well-documented and includes plenty of machine learning libraries.
Following are the important features of TensorFlow:
● TensorFlow defines, optimizes and calculates mathematical expressions easily with the help of multi-dimensional arrays called tensors
● It includes a high scalable feature of computation with various data sets.
● TensorFlow includes a programming support of deep neural networks and machine learning techniques.
● TensorFlow uses GPU computing, automating management.
● It also includes a unique feature of optimization of same memory and the data used.
Tensors are used as the basic data structures in TensorFlow language. Tensors represent the connecting edges in any flow diagram called the Data Flow Graph. Tensors are defined as multidimensional array or list.
Following parameters can be used to identify Tensors:
● Rank - Unit of dimensional described within tensor is called rank. Rank identifies the number of dimensions of the tensor.
● Shape - The number of rows and columns together define the shape of Tensor.
● Type - Type describes the data type assigned to Tensor's elements.
TensorFlow includes various dimensions. Following are the dimensions:
● One dimensional Tensor - it is an array structure which includes values of the same data type. Below is the sample snippet:
>>> import numpy as np >>> tensor_1d_arr = np.array([1.4, 1, 54.0, 2.29]) >>> print tensor_1d_arr
● Two dimensional Tensors - Sequence of arrays are used for creating two dimensional tensors. Below is the sample snippet:
>>> import numpy as np >>> tensor_2d_arr = np.array([(1,2,3,4),(4,5,6,7)]) >>> print tensor_2d_arr
Following function converts a numpy array to tensor in TensorFlow:
tf.convert_to_tensor(tensor1d, dtype = tf.float64)
Tensorflow has built in function that can normalize the data before feeding into the algorithm: batch_norm_with_global_normalization()
Batch normalization is useful as it normalizes (adjusts) all the inputs before sending it to the subsequent layer.
Tensorflow Estimator is a high-level API that reduces the code writing when training a TensorFlow model. Estimators are very flexible, allowing you to override the default behavior if you have specific requirements for your model.
In tensorflow ROC AUC Score measures the overall performance for a full range of threshold levels.
tflearn.objectives.roc_auc_score (y_pred, y_true)