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

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 questionssandi4204
 
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
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
AliyanAbbas1
 

Similar to DLT UNIT-3.docx (20)

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
 
DSA 1- Introduction.pdf
DSA 1- Introduction.pdfDSA 1- Introduction.pdf
DSA 1- Introduction.pdf
 

Recently uploaded

Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 

Recently uploaded (20)

Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 

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.