SlideShare a Scribd company logo
DLT UNIT-3
1 (a) What is the Anatomy of a neural network? Explain building
blocks of deep learning?
Training a neural network revolves around
the following objects:
 Layers, which are combined into a network (or model)
 The input data and corresponding targets
 The loss function, which defines the feedback signal used for
learning
 The optimizer, which determines how learning proceeds
Layers: the building blocks of DL
A layer is a data-processing module that takes as
input tensors and that outputs tensors.
 Different layers are appropriate for different types of data
processing.
 Dense layers for 2D tensors (samples, features) - simple vector
data
 RNNs (or LSTMs) for 3D tensors (samples, time-steps, features)
- sequence data
 CNNs for 4D tensors (samples, height, width, colour_depth) -
image data
 We can think of layers as the LEGO bricks of deep learning.
 Building deep-learning models in Keras is done by clipping
together compatible layers to form useful data-transformation
pipelines.
 In Keras, the layers we add to our models are dynamically built
to match the shape of the incoming layer.
from keras import models
from keras import layers
model = models.Sequential()
model.add(layers.Dense(32, input_shape=(784,)))
model.add(layers.Dense(32))
 The second layer didn’t receive an input shape argument - instead,
it automatically inferred its input shape as being the output shape
of the layer that came before
1(b) List the key features of Keras? Write two options for
running Keras.
Keras is an open-source deep learning framework that is known for its
user-friendliness and versatility. It's built on top of other deep learning
libraries like TensorFlow and Theano, which allows users to easily
create and train neural networks. Here are some key features of Keras:
1. User-Friendly: Keras is designed to be user-friendly and easy
to use. Its high-level API makes it accessible to both beginners
and experienced machine learning practitioners.
2. Modularity: Keras is built with a modular architecture. It
allows users to construct neural networks by stacking layers,
making it easy to design complex network architectures.
3. Support for Multiple Backends: Keras originally supported
multiple backends like TensorFlow, Theano, and Microsoft
Cognitive Toolkit (CNTK). However, since TensorFlow 2.0,
Keras has been integrated as the official high-level API of
TensorFlow, making TensorFlow the default backend.
4. Extensibility: Keras is highly extensible, allowing users to
define custom layers, loss functions, and metrics. This makes it
suitable for research and experimentation.
5. Pre-trained Models: Keras provides access to popular pre-
trained models for tasks like image classification, object
detection, and natural language processing through its
applications module. These pre-trained models can be fine-
tuned for specific tasks.
6. GPU Support: Keras leverages the computational power of
GPUs, which significantly accelerates the training of deep
neural networks.
7. Visualization Tools: Keras includes tools for visualizing model
architectures, training history, and more, making it easier to
understand and debug neural networks.
8. Callback System: Keras offers a callback system that allows
users to specify functions to be executed at various stages during
training. This can be used for tasks like model checkpointing,
early stopping, and custom logging.
9. Integration with Data Libraries: Keras seamlessly integrates
with popular data manipulation libraries like NumPy and data
preprocessing libraries like TensorFlow Data Validation
(TFDV) and TensorFlow Data Validation (TFDV).
Two options for running Keras are:
1. TensorFlow with Keras: As of TensorFlow 2.0 and later,
Keras is included as the official high-level API of TensorFlow.
You can use Keras by simply importing it from TensorFlow and
building your models using the Keras API. For example:
2. Stand-alone Keras with TensorFlow Backend: Before
TensorFlow 2.0, Keras was often used as a standalone library
with TensorFlow as a backend. You can install and use
standalone Keras by installing the Keras package and
configuring it to use TensorFlow as the backend. Here's how
you can do it:
 Install Keras: pip install keras
 Configure Keras to use TensorFlow backend:

3. You can then build and train your models using the standalone
Keras API as you would with TensorFlow.
Note that, as of TensorFlow 2.0, it's recommended to use Keras
through TensorFlow due to its seamless integration and the fact that
Keras is now the official high-level API of TensorFlow.
2 (a) How to set up the deep learning workstations?
Explain with example.
2 (b) What is hypothesis space and explain the
functionalities of Loss functions and Optimizers?
Hypothesis Space: The hypothesis space, often referred to as the
hypothesis class or model space, is a fundamental concept in machine
learning and statistical modeling. It represents the set of all possible
models or functions that a machine learning algorithm can use to
make predictions or approximate a target variable. In simpler terms,
it's the space of all possible solutions that the algorithm considers
when trying to learn from data.
The hypothesis space depends on the choice of machine learning
algorithm and the model architecture. For example:
 In linear regression, the hypothesis space includes all possible
linear functions of the input features.
 In decision tree algorithms, the hypothesis space includes all
possible binary decision trees that can be constructed from the
features.
 In neural networks, the hypothesis space consists of all possible
network architectures with varying numbers of layers and
neurons in each layer.
The goal of training a machine learning model is to search within this
hypothesis space to find the best model that fits the given data and
generalizes well to unseen data. This search is guided by a
combination of loss functions and optimizers.
Loss Functions: A loss function, also known as a cost function or
objective function, quantifies how well a machine learning model's
predictions match the actual target values in the training data. It
essentially measures the "loss" or error between the predicted values
and the true values. The choice of a loss function depends on the type
of machine learning task you're working on:
1. Regression Tasks: In regression problems where the goal is to
predict a continuous value (e.g., predicting house prices),
common loss functions include mean squared error (MSE) and
mean absolute error (MAE). MSE penalizes larger errors more
heavily, while MAE treats all errors equally.
2. Classification Tasks: In classification problems where the goal
is to assign data points to discrete classes or categories (e.g.,
image classification), common loss functions include cross-
entropy loss (log loss) for binary or multi-class classification.
3. Custom Loss Functions: In some cases, you might need to
design custom loss functions to address specific requirements or
challenges in your problem domain.
The optimizer's role is to minimize the loss function by adjusting the
model's parameters during the training process.
Optimizers: Optimizers are algorithms or methods used to update the
model's parameters (e.g., weights and biases in a neural network) in
order to minimize the loss function. They determine how the model
should adjust its parameters to make its predictions more accurate.
Common optimizers include:
1. Gradient Descent: Gradient descent is a fundamental
optimization algorithm that iteratively updates model parameters
in the direction of the steepest decrease in the loss function.
Variants of gradient descent include stochastic gradient descent
(SGD), mini-batch gradient descent, and more advanced
algorithms like Adam and RMSprop.
2. Adaptive Learning Rate Methods: These optimizers
automatically adjust the learning rate during training to speed up
convergence. Examples include Adam, RMSprop, and Adagrad.
3. Constrained Optimization Methods: In some cases,
optimization may need to adhere to certain constraints, such as
L1 or L2 regularization. Algorithms like L-BFGS and Conjugate
Gradient can be used for constrained optimization.
4. Evolutionary Algorithms: In some cases, optimization
problems are solved using evolutionary algorithms like genetic
algorithms and particle swarm optimization.
The choice of optimizer can significantly impact the training speed
and final performance of a machine learning model. It's often
necessary to experiment with different optimizers and
hyperparameters to find the best combination for a specific problem.
DLT  UNIT-3.docx

More Related Content

Similar to DLT UNIT-3.docx

Deep Learning Demystified
Deep Learning DemystifiedDeep Learning Demystified
Deep Learning Demystified
Affine Analytics
 
chapter 5 Objectdesign.ppt
chapter 5 Objectdesign.pptchapter 5 Objectdesign.ppt
chapter 5 Objectdesign.ppt
TemesgenAzezew
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx
SaloniMalhotra23
 
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
sunmitraeducation
 
Keras and TensorFlow
Keras and TensorFlowKeras and TensorFlow
Keras and TensorFlow
NopphawanTamkuan
 
136 latest dot net interview questions
136  latest dot net interview questions136  latest dot net interview questions
136 latest dot net interview questions
sandi4204
 
Keras: Deep Learning Library for Python
Keras: Deep Learning Library for PythonKeras: Deep Learning Library for Python
Keras: Deep Learning Library for Python
Rafi Khan
 
Start machine learning in 5 simple steps
Start machine learning in 5 simple stepsStart machine learning in 5 simple steps
Start machine learning in 5 simple steps
Renjith M P
 
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate HelpdeskDeep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Saurabh Saxena
 
Tensor flow
Tensor flowTensor flow
Tensor flow
Nikhil Krishna Nair
 
Data structure introduction
Data structure introductionData structure introduction
Data structure introduction
NavneetSandhu0
 
Introduction to Tensor Flow-v1.pptx
Introduction to Tensor Flow-v1.pptxIntroduction to Tensor Flow-v1.pptx
Introduction to Tensor Flow-v1.pptx
Janagi Raman S
 
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and TensorfowAaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
AminaRepo
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
Fwdays
 
Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...
Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...
Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...
IRJET Journal
 
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
Big Data Spain
 
TensorFlow.pptx
TensorFlow.pptxTensorFlow.pptx
TensorFlow.pptx
Jayesh Patil
 
Training course lect1
Training course lect1Training course lect1
Training course lect1
Noor Dhiya
 
Stock Market Prediction Using ANN
Stock Market Prediction Using ANNStock Market Prediction Using ANN
Stock Market Prediction Using ANN
Krishna Mohan Mishra
 
The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5
The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5
The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5
Robert Grossman
 

Similar to DLT UNIT-3.docx (20)

Deep Learning Demystified
Deep Learning DemystifiedDeep Learning Demystified
Deep Learning Demystified
 
chapter 5 Objectdesign.ppt
chapter 5 Objectdesign.pptchapter 5 Objectdesign.ppt
chapter 5 Objectdesign.ppt
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx
 
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
 
Keras and TensorFlow
Keras and TensorFlowKeras and TensorFlow
Keras and TensorFlow
 
136 latest dot net interview questions
136  latest dot net interview questions136  latest dot net interview questions
136 latest dot net interview questions
 
Keras: Deep Learning Library for Python
Keras: Deep Learning Library for PythonKeras: Deep Learning Library for Python
Keras: Deep Learning Library for Python
 
Start machine learning in 5 simple steps
Start machine learning in 5 simple stepsStart machine learning in 5 simple steps
Start machine learning in 5 simple steps
 
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate HelpdeskDeep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
 
Tensor flow
Tensor flowTensor flow
Tensor flow
 
Data structure introduction
Data structure introductionData structure introduction
Data structure introduction
 
Introduction to Tensor Flow-v1.pptx
Introduction to Tensor Flow-v1.pptxIntroduction to Tensor Flow-v1.pptx
Introduction to Tensor Flow-v1.pptx
 
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and TensorfowAaa ped-23-Artificial Neural Network: Keras and Tensorfow
Aaa ped-23-Artificial Neural Network: Keras and Tensorfow
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
 
Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...
Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...
Metaphorical Analysis of diseases in Tomato leaves using Deep Learning Algori...
 
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
 
TensorFlow.pptx
TensorFlow.pptxTensorFlow.pptx
TensorFlow.pptx
 
Training course lect1
Training course lect1Training course lect1
Training course lect1
 
Stock Market Prediction Using ANN
Stock Market Prediction Using ANNStock Market Prediction Using ANN
Stock Market Prediction Using ANN
 
The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5
The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5
The Impact of Cloud Computing on Predictive Analytics 7-29-09 v5
 

Recently uploaded

Youtube Transcript Sumariser- application of API
Youtube Transcript Sumariser- application of APIYoutube Transcript Sumariser- application of API
Youtube Transcript Sumariser- application of API
AnamikaRani12
 
02 - Method Statement for Concrete pouring.docx
02 - Method Statement for Concrete pouring.docx02 - Method Statement for Concrete pouring.docx
02 - Method Statement for Concrete pouring.docx
RAHEEL KHALID
 
Machine Learning_SVM_KNN_K-MEANSModule 2.pdf
Machine Learning_SVM_KNN_K-MEANSModule 2.pdfMachine Learning_SVM_KNN_K-MEANSModule 2.pdf
Machine Learning_SVM_KNN_K-MEANSModule 2.pdf
Dr. Shivashankar
 
Sea Wave Energy - Renewable Energy Resources
Sea Wave Energy - Renewable Energy ResourcesSea Wave Energy - Renewable Energy Resources
Sea Wave Energy - Renewable Energy Resources
21h16charis
 
R18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdf
R18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdfR18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdf
R18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdf
bibej11828
 
Predicting damage in notched functionally graded materials plates thr...
Predicting  damage  in  notched  functionally  graded  materials  plates  thr...Predicting  damage  in  notched  functionally  graded  materials  plates  thr...
Predicting damage in notched functionally graded materials plates thr...
Barhm Mohamad
 
III B.TECH CSE_flutter Lab manual (1).docx
III B.TECH CSE_flutter Lab manual (1).docxIII B.TECH CSE_flutter Lab manual (1).docx
III B.TECH CSE_flutter Lab manual (1).docx
divijareddy0502
 
CATIA V5 Automation VB script.........pdf
CATIA V5 Automation VB script.........pdfCATIA V5 Automation VB script.........pdf
CATIA V5 Automation VB script.........pdf
shahidad729
 
Bell Crank Lever.pptxDesign of Bell Crank Lever
Bell Crank Lever.pptxDesign of Bell Crank LeverBell Crank Lever.pptxDesign of Bell Crank Lever
Bell Crank Lever.pptxDesign of Bell Crank Lever
ssuser110cda
 
THERMAL POWER PLANT its applications and advantages
THERMAL POWER PLANT its applications and advantagesTHERMAL POWER PLANT its applications and advantages
THERMAL POWER PLANT its applications and advantages
VikramSingh6251
 
07 - Method Statement for Plastering Works.pdf
07 - Method Statement for Plastering Works.pdf07 - Method Statement for Plastering Works.pdf
07 - Method Statement for Plastering Works.pdf
RAHEEL KHALID
 
Machine Learning- Perceptron_Backpropogation_Module 3.pdf
Machine Learning- Perceptron_Backpropogation_Module 3.pdfMachine Learning- Perceptron_Backpropogation_Module 3.pdf
Machine Learning- Perceptron_Backpropogation_Module 3.pdf
Dr. Shivashankar
 
Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...
Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...
Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...
IJAEMSJORNAL
 
RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...
RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...
RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...
Kiran Kumar Manigam
 
Design and Engineering Module 1 power point
Design and Engineering Module 1 power pointDesign and Engineering Module 1 power point
Design and Engineering Module 1 power point
ssuser76af31
 
Gen AI with LLM for construction technology
Gen AI with LLM for construction technologyGen AI with LLM for construction technology
Gen AI with LLM for construction technology
Tae wook kang
 
VEMC: Trusted Leader in Engineering Solutions
VEMC: Trusted Leader in Engineering SolutionsVEMC: Trusted Leader in Engineering Solutions
VEMC: Trusted Leader in Engineering Solutions
VijayEngineeringandM1
 
Driving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
Driving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxxDriving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
Driving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
Tamara Johnson
 
HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.
HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.
HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.
NoeAranel
 
Aiml ppt pdf.pdf on music recommendation system
Aiml ppt pdf.pdf on music recommendation systemAiml ppt pdf.pdf on music recommendation system
Aiml ppt pdf.pdf on music recommendation system
UdhavGupta6
 

Recently uploaded (20)

Youtube Transcript Sumariser- application of API
Youtube Transcript Sumariser- application of APIYoutube Transcript Sumariser- application of API
Youtube Transcript Sumariser- application of API
 
02 - Method Statement for Concrete pouring.docx
02 - Method Statement for Concrete pouring.docx02 - Method Statement for Concrete pouring.docx
02 - Method Statement for Concrete pouring.docx
 
Machine Learning_SVM_KNN_K-MEANSModule 2.pdf
Machine Learning_SVM_KNN_K-MEANSModule 2.pdfMachine Learning_SVM_KNN_K-MEANSModule 2.pdf
Machine Learning_SVM_KNN_K-MEANSModule 2.pdf
 
Sea Wave Energy - Renewable Energy Resources
Sea Wave Energy - Renewable Energy ResourcesSea Wave Energy - Renewable Energy Resources
Sea Wave Energy - Renewable Energy Resources
 
R18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdf
R18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdfR18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdf
R18B.Tech.OpenElectivesWEF2021_22AdmittedBatch1.pdf
 
Predicting damage in notched functionally graded materials plates thr...
Predicting  damage  in  notched  functionally  graded  materials  plates  thr...Predicting  damage  in  notched  functionally  graded  materials  plates  thr...
Predicting damage in notched functionally graded materials plates thr...
 
III B.TECH CSE_flutter Lab manual (1).docx
III B.TECH CSE_flutter Lab manual (1).docxIII B.TECH CSE_flutter Lab manual (1).docx
III B.TECH CSE_flutter Lab manual (1).docx
 
CATIA V5 Automation VB script.........pdf
CATIA V5 Automation VB script.........pdfCATIA V5 Automation VB script.........pdf
CATIA V5 Automation VB script.........pdf
 
Bell Crank Lever.pptxDesign of Bell Crank Lever
Bell Crank Lever.pptxDesign of Bell Crank LeverBell Crank Lever.pptxDesign of Bell Crank Lever
Bell Crank Lever.pptxDesign of Bell Crank Lever
 
THERMAL POWER PLANT its applications and advantages
THERMAL POWER PLANT its applications and advantagesTHERMAL POWER PLANT its applications and advantages
THERMAL POWER PLANT its applications and advantages
 
07 - Method Statement for Plastering Works.pdf
07 - Method Statement for Plastering Works.pdf07 - Method Statement for Plastering Works.pdf
07 - Method Statement for Plastering Works.pdf
 
Machine Learning- Perceptron_Backpropogation_Module 3.pdf
Machine Learning- Perceptron_Backpropogation_Module 3.pdfMachine Learning- Perceptron_Backpropogation_Module 3.pdf
Machine Learning- Perceptron_Backpropogation_Module 3.pdf
 
Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...
Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...
Agricultural Profitability through Resilience: Smallholder Farmers' Strategie...
 
RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...
RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...
RAILWAYS, a vital part of our infrastructure, play a crucial role in ensuring...
 
Design and Engineering Module 1 power point
Design and Engineering Module 1 power pointDesign and Engineering Module 1 power point
Design and Engineering Module 1 power point
 
Gen AI with LLM for construction technology
Gen AI with LLM for construction technologyGen AI with LLM for construction technology
Gen AI with LLM for construction technology
 
VEMC: Trusted Leader in Engineering Solutions
VEMC: Trusted Leader in Engineering SolutionsVEMC: Trusted Leader in Engineering Solutions
VEMC: Trusted Leader in Engineering Solutions
 
Driving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
Driving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxxDriving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
Driving Safety.pptxxxxxxxxxxxxxxxxxxxxxxxxxx
 
HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.
HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.
HSE-BMS-009 COSHH & MSDS.pptHSE-BMS-009 COSHH & MSDS.pptSE-BMS-009 COSHH & MSDS.
 
Aiml ppt pdf.pdf on music recommendation system
Aiml ppt pdf.pdf on music recommendation systemAiml ppt pdf.pdf on music recommendation system
Aiml ppt pdf.pdf on music recommendation system
 

DLT UNIT-3.docx

  • 1. DLT UNIT-3 1 (a) What is the Anatomy of a neural network? Explain building blocks of deep learning? Training a neural network revolves around the following objects:  Layers, which are combined into a network (or model)  The input data and corresponding targets  The loss function, which defines the feedback signal used for learning  The optimizer, which determines how learning proceeds Layers: the building blocks of DL A layer is a data-processing module that takes as input tensors and that outputs tensors.  Different layers are appropriate for different types of data processing.  Dense layers for 2D tensors (samples, features) - simple vector data  RNNs (or LSTMs) for 3D tensors (samples, time-steps, features) - sequence data
  • 2.  CNNs for 4D tensors (samples, height, width, colour_depth) - image data  We can think of layers as the LEGO bricks of deep learning.  Building deep-learning models in Keras is done by clipping together compatible layers to form useful data-transformation pipelines.  In Keras, the layers we add to our models are dynamically built to match the shape of the incoming layer. from keras import models from keras import layers model = models.Sequential() model.add(layers.Dense(32, input_shape=(784,))) model.add(layers.Dense(32))  The second layer didn’t receive an input shape argument - instead, it automatically inferred its input shape as being the output shape of the layer that came before 1(b) List the key features of Keras? Write two options for running Keras. Keras is an open-source deep learning framework that is known for its user-friendliness and versatility. It's built on top of other deep learning libraries like TensorFlow and Theano, which allows users to easily create and train neural networks. Here are some key features of Keras: 1. User-Friendly: Keras is designed to be user-friendly and easy to use. Its high-level API makes it accessible to both beginners and experienced machine learning practitioners. 2. Modularity: Keras is built with a modular architecture. It allows users to construct neural networks by stacking layers, making it easy to design complex network architectures. 3. Support for Multiple Backends: Keras originally supported multiple backends like TensorFlow, Theano, and Microsoft Cognitive Toolkit (CNTK). However, since TensorFlow 2.0, Keras has been integrated as the official high-level API of TensorFlow, making TensorFlow the default backend.
  • 3. 4. Extensibility: Keras is highly extensible, allowing users to define custom layers, loss functions, and metrics. This makes it suitable for research and experimentation. 5. Pre-trained Models: Keras provides access to popular pre- trained models for tasks like image classification, object detection, and natural language processing through its applications module. These pre-trained models can be fine- tuned for specific tasks. 6. GPU Support: Keras leverages the computational power of GPUs, which significantly accelerates the training of deep neural networks. 7. Visualization Tools: Keras includes tools for visualizing model architectures, training history, and more, making it easier to understand and debug neural networks. 8. Callback System: Keras offers a callback system that allows users to specify functions to be executed at various stages during training. This can be used for tasks like model checkpointing, early stopping, and custom logging. 9. Integration with Data Libraries: Keras seamlessly integrates with popular data manipulation libraries like NumPy and data preprocessing libraries like TensorFlow Data Validation (TFDV) and TensorFlow Data Validation (TFDV). Two options for running Keras are: 1. TensorFlow with Keras: As of TensorFlow 2.0 and later, Keras is included as the official high-level API of TensorFlow. You can use Keras by simply importing it from TensorFlow and building your models using the Keras API. For example:
  • 4. 2. Stand-alone Keras with TensorFlow Backend: Before TensorFlow 2.0, Keras was often used as a standalone library with TensorFlow as a backend. You can install and use standalone Keras by installing the Keras package and configuring it to use TensorFlow as the backend. Here's how you can do it:  Install Keras: pip install keras  Configure Keras to use TensorFlow backend:  3. You can then build and train your models using the standalone Keras API as you would with TensorFlow. Note that, as of TensorFlow 2.0, it's recommended to use Keras through TensorFlow due to its seamless integration and the fact that Keras is now the official high-level API of TensorFlow.
  • 5. 2 (a) How to set up the deep learning workstations? Explain with example.
  • 6. 2 (b) What is hypothesis space and explain the functionalities of Loss functions and Optimizers? Hypothesis Space: The hypothesis space, often referred to as the hypothesis class or model space, is a fundamental concept in machine learning and statistical modeling. It represents the set of all possible
  • 7. models or functions that a machine learning algorithm can use to make predictions or approximate a target variable. In simpler terms, it's the space of all possible solutions that the algorithm considers when trying to learn from data. The hypothesis space depends on the choice of machine learning algorithm and the model architecture. For example:  In linear regression, the hypothesis space includes all possible linear functions of the input features.  In decision tree algorithms, the hypothesis space includes all possible binary decision trees that can be constructed from the features.  In neural networks, the hypothesis space consists of all possible network architectures with varying numbers of layers and neurons in each layer. The goal of training a machine learning model is to search within this hypothesis space to find the best model that fits the given data and generalizes well to unseen data. This search is guided by a combination of loss functions and optimizers. Loss Functions: A loss function, also known as a cost function or objective function, quantifies how well a machine learning model's predictions match the actual target values in the training data. It essentially measures the "loss" or error between the predicted values and the true values. The choice of a loss function depends on the type of machine learning task you're working on: 1. Regression Tasks: In regression problems where the goal is to predict a continuous value (e.g., predicting house prices), common loss functions include mean squared error (MSE) and mean absolute error (MAE). MSE penalizes larger errors more heavily, while MAE treats all errors equally. 2. Classification Tasks: In classification problems where the goal is to assign data points to discrete classes or categories (e.g., image classification), common loss functions include cross- entropy loss (log loss) for binary or multi-class classification.
  • 8. 3. Custom Loss Functions: In some cases, you might need to design custom loss functions to address specific requirements or challenges in your problem domain. The optimizer's role is to minimize the loss function by adjusting the model's parameters during the training process. Optimizers: Optimizers are algorithms or methods used to update the model's parameters (e.g., weights and biases in a neural network) in order to minimize the loss function. They determine how the model should adjust its parameters to make its predictions more accurate. Common optimizers include: 1. Gradient Descent: Gradient descent is a fundamental optimization algorithm that iteratively updates model parameters in the direction of the steepest decrease in the loss function. Variants of gradient descent include stochastic gradient descent (SGD), mini-batch gradient descent, and more advanced algorithms like Adam and RMSprop. 2. Adaptive Learning Rate Methods: These optimizers automatically adjust the learning rate during training to speed up convergence. Examples include Adam, RMSprop, and Adagrad. 3. Constrained Optimization Methods: In some cases, optimization may need to adhere to certain constraints, such as L1 or L2 regularization. Algorithms like L-BFGS and Conjugate Gradient can be used for constrained optimization. 4. Evolutionary Algorithms: In some cases, optimization problems are solved using evolutionary algorithms like genetic algorithms and particle swarm optimization. The choice of optimizer can significantly impact the training speed and final performance of a machine learning model. It's often necessary to experiment with different optimizers and hyperparameters to find the best combination for a specific problem.