Category: Tutorials

  • Machine Learning and Deep Learning

    Artificial Intelligence is one of the most popular trends of recent times. Machine learning and deep learning constitute artificial intelligence. The Venn diagram shown below explains the relationship of machine learning and deep learning −

    Venn Diagram

    Machine Learning

    Machine learning is the art of science of getting computers to act as per the algorithms designed and programmed. Many researchers think machine learning is the best way to make progress towards human-level AI. Machine learning includes the following types of patterns

    • Supervised learning pattern
    • Unsupervised learning pattern
    Ezoic

    Deep Learning

    Deep learning is a subfield of machine learning where concerned algorithms are inspired by the structure and function of the brain called artificial neural networks.

    All the value today of deep learning is through supervised learning or learning from labelled data and algorithms.

    Each algorithm in deep learning goes through the same process. It includes a hierarchy of nonlinear transformation of input that can be used to generate a statistical model as output.

    Consider the following steps that define the Machine Learning process

    • Identifies relevant data sets and prepares them for analysis.
    • Chooses the type of algorithm to use
    • Builds an analytical model based on the algorithm used.
    • Trains the model on test data sets, revising it as needed.
    • Runs the model to generate test scores.

    Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your career.

    Difference between Machine Learning and Deep learning

    In this section, we will learn about the difference between Machine Learning and Deep Learning.

    Amount of data

    Machine learning works with large amounts of data. It is useful for small amounts of data too. Deep learning on the other hand works efficiently if the amount of data increases rapidly. The following diagram shows the working of machine learning and deep learning with the amount of data −

    Amount of Data

    Hardware Dependencies

    Deep learning algorithms are designed to heavily depend on high-end machines unlike the traditional machine learning algorithms. Deep learning algorithms perform a number of matrix multiplication operations, which require a large amount of hardware support.

    Feature Engineering

    Feature engineering is the process of putting domain knowledge into specified features to reduce the complexity of data and make patterns that are visible to learning algorithms it works.

    Example − Traditional machine learning patterns focus on pixels and other attributes needed for feature engineering process. Deep learning algorithms focus on high-level features from data. It reduces the task of developing new feature extractor of every new problem.

    Problem Solving Approach

    The traditional machine learning algorithms follow a standard procedure to solve the problem. It breaks the problem into parts, solve each one of them and combine them to get the required result. Deep learning focusses in solving the problem from end to end instead of breaking them into divisions.

    Execution Time

    Execution time is the amount of time required to train an algorithm. Deep learning requires a lot of time to train as it includes a lot of parameters which takes a longer time than usual. Machine learning algorithm comparatively requires less execution time.

    Interpretability

    Interpretability is the major factor for comparison of machine learning and deep learning algorithms. The main reason is that deep learning is still given a second thought before its usage in industry.

    Ezoic

    Applications of Machine Learning and Deep Learning

    In this section, we will learn about the different applications of Machine Learning and Deep Learning.

    • Computer vision which is used for facial recognition and attendance mark through fingerprints or vehicle identification through number plate.
    • Information Retrieval from search engines like text search for image search.
    • Automated email marketing with specified target identification.
    • Medical diagnosis of cancer tumors or anomaly identification of any chronic disease.
    • Natural language processing for applications like photo tagging. The best example to explain this scenario is used in Facebook.
    • Online Advertising.

    Future Trends

    • With the increasing trend of using data science and machine learning in the industry, it will become important for each organization to inculcate machine learning in their businesses.
    • Deep learning is gaining more importance than machine learning. Deep learning is proving to be one of the best techniques in state-of-art performance.
    • Machine learning and deep learning will prove beneficial in research and academics field.

    Conclusion

    In this article, we had an overview of machine learning and deep learning with illustrations and differences also focusing on future trends. Many of AI applications utilize machine learning algorithms primarily to drive self-service, increase agent productivity and workflows more reliable. Machine learning and deep learning algorithms include an exciting prospect for many businesses and industry leaders.

  • Mathematical Foundations

    It is important to understand mathematical concepts needed for TensorFlow before creating the basic application in TensorFlow. Mathematics is considered as the heart of any machine learning algorithm. It is with the help of core concepts of Mathematics, a solution for specific machine learning algorithm is defined.

    Vector

    An array of numbers, which is either continuous or discrete, is defined as a vector. Machine learning algorithms deal with fixed length vectors for better output generation.

    Machine learning algorithms deal with multidimensional data so vectors play a crucial role.

    Vector

    The pictorial representation of vector model is as shown below −

    Vector Model

    Scalar

    Scalar can be defined as one-dimensional vector. Scalars are those, which include only magnitude and no direction. With scalars, we are only concerned with the magnitude.

    Examples of scalar include weight and height parameters of children.

    Matrix

    Matrix can be defined as multi-dimensional arrays, which are arranged in the format of rows and columns. The size of matrix is defined by row length and column length. Following figure shows the representation of any specified matrix.

    Multi Dimensional Arrays

    Consider the matrix with “m” rows and “n” columns as mentioned above, the matrix representation will be specified as “m*n matrix” which defined the length of matrix as well.

    Mathematical Computations

    In this section, we will learn about the different Mathematical Computations in TensorFlow.

    Addition of matrices

    Addition of two or more matrices is possible if the matrices are of the same dimension. The addition implies addition of each element as per the given position.

    Consider the following example to understand how addition of matrices works −

    Example:A=[1324]B=[5768]thenA+B=[1+53+72+64+8]=[610812]Example:A=[1234]B=[5678]thenA+B=[1+52+63+74+8]=[681012]

    Subtraction of matrices

    The subtraction of matrices operates in similar fashion like the addition of two matrices. The user can subtract two matrices provided the dimensions are equal.

    Example:A−[1324]B−[5768]thenA−B−[1−53−72−64−8]−[−4−4−4−4]Example:A−[1234]B−[5678]thenA−B−[1−52−63−74−8]−[−4−4−4−4]

    Multiplication of matrices

    For two matrices A m*n and B p*q to be multipliable, n should be equal to p. The resulting matrix is −

    C m*q

    A=[1324]B=[5768]A=[1234]B=[5678]

    c11=[12][57]=1×5+2×7=19c12=[12][68]=1×6+2×8=22c11=[12][57]=1×5+2×7=19c12=[12][68]=1×6+2×8=22

    c21=[34][57]=3×5+4×7=43c22=[34][68]=3×6+4×8=50c21=[34][57]=3×5+4×7=43c22=[34][68]=3×6+4×8=50

    C=[c11c21c12c22]=[19432250]C=[c11c12c21c22]=[19224350]

    Transpose of matrix

    The transpose of a matrix A, m*n is generally represented by AT (transpose) n*m and is obtained by transposing the column vectors as row vectors.

    Example:A=[1324]thenAT[1234]Example:A=[1234]thenAT[1324]

    Dot product of vectors

    Any vector of dimension n can be represented as a matrix v = R^n*1.

    v1=⎡⎣⎢⎢⎢⎢⎢⎢⎢⎢v11v12⋅⋅⋅v1n⎤⎦⎥⎥⎥⎥⎥⎥⎥⎥v2=⎡⎣⎢⎢⎢⎢⎢⎢⎢⎢v21v22⋅⋅⋅v2n⎤⎦⎥⎥⎥⎥⎥⎥⎥⎥v1=[v11v12⋅⋅⋅v1n]v2=[v21v22⋅⋅⋅v2n]

    The dot product of two vectors is the sum of the product of corresponding components − Components along the same dimension and can be expressed as

    v1⋅v2=vT1v2=vT2v1=v11v21+v12v22+⋅⋅+v1nv2n=∑k=1nv1kv2kv1⋅v2=v1Tv2=v2Tv1=v11v21+v12v22+⋅⋅+v1nv2n=∑k=1nv1kv2k

    The example of dot product of vectors is mentioned below −

    Example:v1=⎡⎣⎢123⎤⎦⎥v2=⎡⎣⎢35−1⎤⎦⎥v1⋅v2=vT1v2=1×3+2×5−3×1=10

  • Understanding Artificial Intelligence

    Artificial Intelligence includes the simulation process of human intelligence by machines and special computer systems. The examples of artificial intelligence include learning, reasoning and self-correction. Applications of AI include speech recognition, expert systems, and image recognition and machine vision.

    Machine learning is the branch of artificial intelligence, which deals with systems and algorithms that can learn any new data and data patterns.

    Let us focus on the Venn diagram mentioned below for understanding machine learning and deep learning concepts.

    Venn diagram

    Machine learning includes a section of machine learning and deep learning is a part of machine learning. The ability of program which follows machine learning concepts is to improve its performance of observed data. The main motive of data transformation is to improve its knowledge in order to achieve better results in the future, provide output closer to the desired output for that particular system. Machine learning includes “pattern recognition” which includes the ability to recognize the patterns in data.

    The patterns should be trained to show the output in desirable manner.

    Machine learning can be trained in two different ways −

    • Supervised training
    • Unsupervised training

    Supervised Learning

    Supervised learning or supervised training includes a procedure where the training set is given as input to the system wherein, each example is labeled with a desired output value. The training in this type is performed using minimization of a particular loss function, which represents the output error with respect to the desired output system.

    After completion of training, the accuracy of each model is measured with respect to disjoint examples from training set, also called the validation set.

    Supervised Learning

    The best example to illustrate “Supervised learning” is with a bunch of photos given with information included in them. Here, the user can train a model to recognize new photos.

    Unsupervised Learning

    In unsupervised learning or unsupervised training, include training examples, which are not labeled by the system to which class they belong. The system looks for the data, which share common characteristics, and changes them based on internal knowledge features.This type of learning algorithms are basically used in clustering problems.

    The best example to illustrate “Unsupervised learning” is with a bunch of photos with no information included and user trains model with classification and clustering. This type of training algorithm works with assumptions as no information is given.

    Unsupervised Learning
  • Installation

    To install TensorFlow, it is important to have “Python” installed in your system. Python version 3.4+ is considered the best to start with TensorFlow installation.

    Consider the following steps to install TensorFlow in Windows operating system.

    Step 1 − Verify the python version being installed.

    Python Version Installed

    Step 2 − A user can pick up any mechanism to install TensorFlow in the system. We recommend “pip” and “Anaconda”. Pip is a command used for executing and installing modules in Python.

    Before we install TensorFlow, we need to install Anaconda framework in our system.

    Install Anaconda

    After successful installation, check in command prompt through “conda” command. The execution of command is displayed below −

    Conda Command Execution

    Step 3 − Execute the following command to initialize the installation of TensorFlow −

    conda create --name tensorflow python = 3.5
    
    Installation of TensorFlow

    It downloads the necessary packages needed for TensorFlow setup.

    Step 4 − After successful environmental setup, it is important to activate TensorFlow module.

    activate tensorflow
    
    Environmental Setup

    Step 5 − Use pip to install “Tensorflow” in the system. The command used for installation is mentioned as below −

    pip install tensorflow
    

    And,

    pip install tensorflow-gpu
    
    Pip To Install
    Pip To Install TensorFlow

    After successful installation, it is important to know the sample program execution of TensorFlow.

    Following example helps us understand the basic program creation “Hello World” in TensorFlow.

    Hello World Example

    The code for first program implementation is mentioned below −

    >> activate tensorflow
    >> python (activating python shell)
    >> import tensorflow as tf
    >> hello = tf.constant(‘Hello, Tensorflow!’)
    >> sess = tf.Session()
    >> print(sess.run(hello))

  • Introduction

    TensorFlow is a software library or framework, designed by the Google team to implement machine learning and deep learning concepts in the easiest manner. It combines the computational algebra of optimization techniques for easy calculation of many mathematical expressions.

    The official website of TensorFlow is mentioned below −

    www.tensorflow.org

    TensorFlow Home Page

    Let us now consider the following important features of TensorFlow −

    • It includes a feature of that defines, optimizes and calculates mathematical expressions easily with the help of multi-dimensional arrays called tensors.
    • It includes a programming support of deep neural networks and machine learning techniques.
    • It includes a high scalable feature of computation with various data sets.
    • TensorFlow uses GPU computing, automating management. It also includes a unique feature of optimization of same memory and the data used.

    Why is TensorFlow So Popular?

    TensorFlow is well-documented and includes plenty of machine learning libraries. It offers a few important functionalities and methods for the same.

    TensorFlow is also called a “Google” product. It includes a variety of machine learning and deep learning algorithms. TensorFlow can train and run deep neural networks for handwritten digit classification, image recognition, word embedding and creation of various sequence models.

  • TensorFlow Tutorial

    TensorFlow is an open source machine learning framework for all developers. It is used for implementing machine learning and deep learning applications. To develop and research on fascinating ideas on artificial intelligence, Google team created TensorFlow. TensorFlow is designed in Python programming language, hence it is considered an easy to understand framework.

    Audience

    This tutorial has been prepared for python developers who focus on research and development with various machine learning and deep learning algorithms. The aim of this tutorial is to describe all TensorFlow objects and methods.

    Prerequisites

    Before proceeding with this tutorial, you need to have a basic knowledge of any Python programming language. Knowledge of artificial intelligence concepts will be a plus point.