Tensorflow On Cloud: Shilpa Das
Tensorflow On Cloud: Shilpa Das
Shilpa Das
TensorFlow
• TensorFlow is an open-source framework for machine learning (ML)
and artificial intelligence (AI) that was developed by Google Brain. It
was designed to facilitate the development of machine learning
models, particularly deep learning models, by providing tools to easily
build, train, and deploy them across different platforms.
• High-Level APIs - It offers intuitive, high-level APIs for both beginners and
experts to create machine learning models.
• Multi-language Support - TensorFlow is primarily designed for Python, but it also provides
APIs for other languages like C++, Java, and JavaScript, making it accessible to developers with
different programming backgrounds.
• TensorFlow Serving and TensorFlow Model Optimization - TensorFlow includes tools for
serving machine learning models in production environments and optimizing them for
inference, allowing for lower latency and higher efficiency.
TensorFlow Workflow
• Building a machine learning model in TensorFlow typically involves the following steps:
• Step 1: Define the Model - Create a model by specifying the layers, activation functions, and output layers. Choose
an optimizer, loss function, and evaluation metric.
• Step 2: Prepare the Data - Load, preprocess, and split the dataset into training, validation, and test sets. Data
preprocessing might include normalization, reshaping, and encoding categorical variables.
• Step 3: Train the Model - Feed the training data into the model and perform forward and backward passes. Use
optimization algorithms such as stochastic gradient descent (SGD) or Adam to minimize the loss function.
• Step 4: Evaluate the Model - After training, evaluate the model’s performance on the validation and test sets to
assess its generalization ability.
• Step 5: Deploy the Model - Once the model is trained and evaluated, deploy it to a production environment using
TensorFlow Serving, TensorFlow Lite, or other deployment tools.
Key Components in TensorFlow
• Tensors: Tensors are the fundamental units of data in TensorFlow. They are
multi-dimensional arrays or matrices used for storing data. A tensor can have
one dimension (vector), two dimensions (matrix), or more dimensions.
• The second layer of TensorFlow contains kernel implementations for applications mostly
used in machine learning.
• The third layer of TensorFlow consists of distributed master and dataflow executors.
Distributed Master has the ability to distribute workloads to different devices on the
system. Whereas data flow executor performs the data flow graph optimally.
High-level Architecture in TensorFlow
• The next layer exposes all the functionalities in the form of API which
is implemented in C language. C language is chosen because it is fast,
reliable, and can run on any operating system.
• The fifth layer provides support for Python and C++ clients.
• Languages - TensorFlow can be used with Python, JavaScript, C++, and Java.
TensorFlow by Cloud Service Providers
• AWS TensorFlow Support - Amazon SageMaker, AWS Lambda