SlideShare a Scribd company logo
By,
Anaswara K U
S-7
Integrated MSc CS(AI and ML)
1. Features
2. Keras layers
3. Components
4. Advantages and
Disadvantages
What is Deep Learning Framework?
Deep learning frameworks are software libraries or tools that provide building blocks,
abstraction, and functionalities for designing training and deploying model, this frameworks
simplify the processes of implementing complex mathematics operations required for neural
networks providing it structured environment for developing algorithm.
They simplify AI development by offering pre-built components and APIs, enabling developers to
focus on designing and training models.
Python Keras module for advanced python programming
What is Keras?
Keras is a popular high-level deep learning API written in
Python that runs on top of lower-level deep learning
frameworks like TensorFlow. It provides a user-friendly,
modular interface for building and training neural networks.
High-level API(frontend) & Low-level API(backend)
A high level API provides simplified user
friendly way to perform tasks without
requiring knowledge of the complex,
underlying details. It abstracts away
much of the complexity, allowing you to
focus on your main goals, such as
building and training machine learning
models.
A low-level API provides exposes the
core components and functions that
interact directly with the system or
perform the underlying computations.
This type of API requires more detailed
knowledge of the inner workings but
offers much more flexibility and control.
Features of keras
● Simple – but not simplistic. Keras reduces developer cognitive load to free you to
focus on the parts of the problem that really matter.
● Flexible – Keras adopts the principle of progressive disclosure of complexity:
simple workflows should be quick and easy, while arbitrarily advanced workflows
should be possible via a clear path that builds upon what you've already learned.
● Powerful – Keras provides industry-strength performance and scalability: it is
used by organizations including NASA, YouTube, or Waymo.
Features of keras
● Keras prioritises developer experience.
● Keras is broadly adopted in the industry and among the research community.
● Keras models are easy to turn models into products.
● Support multiple backend engines and does not lock you into one ecosystem.
● Keras has strong multi GPU support and distributed training support.
Types of keras models
Sequential Model
● The Sequential model is the simplest type of
model in Keras. It allows you to build a
neural network by stacking layers on top of
each other in a linear (sequential) fashion.
Functional API
● The Functional API in Keras provides a
more flexible way to build models.
● It allows for defining complex architectures,
including models with multiple inputs and
outputs, shared layers, and non-linear data
flows (such as residual connections or
multi-branch networks).
Example: keras sequential
import keras
from keras import layers
model = keras.Sequential()
model.add(layers.Dense(2, activation="relu"))
model.add(layers.Dense(3, activation="relu"))
model.add(layers.Dense(4
Example: Keras Functional API
from keras.models import Model
from keras.layers import Input
from keras.layers import Dense
visible = Input(shape=(2,))
hidden = Dense(2)(visible)
model = Model(inputs=visible, outputs=hidden)
Model subclassing, where you implement everything from scratch on your own. Use this if you have
complex, out-of-the-box research use cases.
Keras Layers
Layers are the basic building blocks of neural networks in Keras. A
layer consists of a tensor-in tensor-out computation function (the
layer's call method) and some state, held in TensorFlow variables (the
layer's weights).
1. Core Layers:
○ Input Layer: Defines the input shape of the neural network.
○ Dense Layer: Fully connected layer, where each neuron is connected to every neuron in the previous layer
○ Activation Layers: Apply activation functions to introduce non-linearity.
○ Dropout Layer: Prevents overfitting by randomly setting a fraction of input units to zero.
○ Flatten Layer: Reshapes multi-dimensional input into a one-dimensional vector.
○ Reshape Layer: Reshapes the input tensor to a specified shape.
○ Permute Layer: Rearranges the dimensions of an input tensor.
○ RepeatVector Layer: Repeats the input along a new axis.
○ Lambda Layer: Applies an arbitrary function to the input.Masking Layer: Marks specific values in the input as
"masked" (ignored).
○ Embedding Layer: Converts categorical data into dense vectors.
2. Convolution Layers
● Conv1D, Conv2D, Conv3D: Perform convolution operations on 1D, 2D, or 3D input data.
● Useful for tasks such as image classification, video analysis, and time series prediction.
● Conv2DTranspose, Conv3DTranspose: Perform transposed convolutions, often used in
generative models and image segmentation.
● SeparableConv2D, DepthwiseConv2D: Efficient convolutions by splitting the convolution
operation into multiple parts, reducing computation costs.
3. Pooling Layers:
● MaxPooling2D: Downsamples input images by taking the maximum value in each pooling region.
● MaxPooling3D: Downsamples volumetric data by taking the maximum value in each pooling region.
● AveragePooling2D: Downsamples input images by taking the average value in each pooling region.
● AveragePooling3D: Downsamples volumetric data by taking the average value in each pooling region.
● GlobalMaxPooling2D: Downsamples input images to a single value by taking the maximum value across all spatial
dimensions
● GlobalMaxPooling3D: Downsamples volumetric data to a single value by taking the maximum value across all spatial
dimensions.
● GlobalAveragePooling2D: Downsamples input images to a single value by taking the average value across all spatial
dimensions.
● GlobalAveragePooling3D: Downsamples volumetric data to a single value by taking the average value across all
spatial dimensions.
1. Modularity
Keras is modular. It considers a model in the form of a graph or a sequence. Keras allows you to save the
model you are working on. Keras provides a save() method to save the current model. You can even use
the model in the future.
2. Large Dataset
Keras contains a large pre-defined dataset. It provides you a variety of datasets. You can use this dataset
to be directly importing and loading it.
3. Train from NumPy Data
Keras uses the NumPy array to train and evaluate the model. It makes use of the fit() method.
The fit() method fits the model to the training data. This training process may take some time.
fit() method had three arguments batch_size, validation_data and epochs.
4. Evaluation and Prediction
Keras has evaluate() and predict() methods. These methods can use the dataset of NumPy.
After testing the data, the evaluation of the result is done. These methods are used to evaluate
our models.
5. Pre-trained Models in Keras
Keras contains a number of pre-trained models. These models can be imported from keras.applications.
These models are useful for feature extraction and fine-tuning. Keras.application is a module that contains
weights for image classification like VGG16, VGG19, Xception, etc.
6. Encoding in Keras
Karas allows you encoding feature. There is one_hot() function in Keras that enables encoding. It helps
you to encode integers in one step. It also enables you to tokenize the data. This function filters out the
white spaces, make the text to lower case, and filter out the punctuations.
7. Layers in Keras
There are numerous layers and parameters in Keras. All Keras layers have a number of methods in them.
These layers are useful to construct, train, configure the data. The dense layer is beneficial to implement
operations.
What is keras layers?
Keras layers are the building blocks used in designing and implementing
neural networks. These layers analyze the structure of input data, perform
transformations like convolution, pooling, and dense connections, and are
combined to create neural network architectures for various machine
learning tasks. Keras provides a wide variety of standard layers to handle
different types of input data and neural network architectures.
Types of Keras Layers
1. Convolutional Layers
This layer is mainly used in case of Image processing or Video processing
tasks for spatial convolution over images or sequences. The functionality of
the convolution layer is to apply the specified filters for input image to
generate feature maps.
Types of Keras layers
2. Pooling Layers
Pooling layer is used to reduce the dimensions of the feature map from the previous layer
before passing it to next layer in-order to make the computation faster and prevent overfitting.
Two main types of pooling layer are max pooling layer and average pooling layer.
● Max pooling layer takes the maximum of the input region. If we consider a 2×2 matrix
it is replaced by single value which is maximum among the four values.
● Similarly Average pooling layer takes the average of all the input values. If we
consider a 2×2 matrix it is replaced by a single value which is average of all the four
values.
Types of Keras layers
3. Dense Layer
● A fully connected neural network layer.
● Each neuron in the layer is connected to every neuron in the previous layer.
● Used for both input and output layers.
● Often used in the final layers of a network to make predictions.
keras.layers.Dense(units, activation=None, ...)
● units: Number of neurons in the layer.
● activation: Activation function (e.g., 'relu', 'sigmoid', 'softmax').
Types of Keras layers
4. Flatten Layer:
● Converts a multi-dimensional input (e.g., from a convolutional layer) into a 1D array.
● Useful when transitioning from convolutional layers to dense layers.
● The primary purpose of the Flatten layer is to transform the output of previous layers (like convolutional
layers) into a format that is compatible with the dense layers that follow.
● For example, convolutional layers output a 3D tensor (height, width, and number of channels), but a dense
layer requires a 1D vector as input. The Flatten layer reshapes the multi-dimensional data into a single long
vector.
● Although the Flatten layer does not perform any learning or modification of weights, it preserves the order of
the features while converting the multi-dimensional data into a 1D array. This allows the model to maintain
the spatial and hierarchical information extracted by previous layers.
keras.layers.Flatten()
Types of Keras layers
5. Dropout Layer:
● A regularization technique that randomly sets a fraction of input units to zero
at each update during training.
● Helps prevent overfitting by ensuring the network does not rely too heavily
on any one feature.
keras.layers.Dropout(rate)
rate: Fraction of the input units to drop (e.g., 0.5 means 50% of inputs will be set to zero).
Types of Keras layers
6. Activation Layer:
● Applies an activation function to the input.
● Can be a separate layer, but often specified directly within other layers (like Dense).
● keras.layers.Activation(activation)
● activation: The activation function to apply (e.g., 'relu', 'tanh', 'sigmoid').
Python Keras module for advanced python programming
Advantages of Keras
● User-friendly:
○ Keras has a simple, intuitive API that makes it easy to build and train deep learning models.
○ It abstracts away many of the complexities of TensorFlow, making it a good choice for
beginners.
● Fast Prototyping:
○ Keras allows for quick experimentation and iteration.
○ You can build complex models with just a few lines of code. Multiple
● Backend Support:
○ Keras can run on top of different backend engines like TensorFlow, Theano, and CNTK.
○ This provides flexibility and allows you to choose the backend that best suits your needs.
● Wide Adoption:
○ Keras is widely adopted by the community and industry, which means there are
abundant resources, tutorials, and support available.
● Model Deployment:
○ Keras models can be easily deployed to various platforms, including web browsers,
mobile devices, and embedded systems.
● Less Flexibility: While Keras' simplicity is a strength, it can also be a limitation. For
advanced users, the high-level abstractions might hide some of the lower-level details,
making it challenging to customize or implement certain complex operations.
● Performance Overhead: For very large and complex models, the abstraction layer in Keras
can introduce some performance overhead compared to using TensorFlow directly.
● Debugging: While Keras' error messages have improved, they can sometimes be less
informative compared to TensorFlow. This can make debugging more challenging in certain
cases.
● Limited Features: Compared to TensorFlow, Keras may have fewer advanced features and
functionalities, especially for research-oriented tasks.
Disadvantages of Keras
Thank You

More Related Content

Similar to Python Keras module for advanced python programming (20)

Keras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learningKeras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learning
Dr. Ananth Krishnamoorthy
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with Examples
Felipe
 
keras_tutorial.pdf
keras_tutorial.pdfkeras_tutorial.pdf
keras_tutorial.pdf
Lê Duy Tân
 
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.jsTensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
Stijn Decubber
 
python_libraries_for_artificial_intelligence.pptx
python_libraries_for_artificial_intelligence.pptxpython_libraries_for_artificial_intelligence.pptx
python_libraries_for_artificial_intelligence.pptx
salehaalsaleh602
 
Machine Learning Toolssssssssssssss.pptx
Machine Learning Toolssssssssssssss.pptxMachine Learning Toolssssssssssssss.pptx
Machine Learning Toolssssssssssssss.pptx
salehaalsaleh602
 
Getting started with neural networks (NNs)
Getting started with neural networks (NNs)Getting started with neural networks (NNs)
Getting started with neural networks (NNs)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdfdfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
nguyenhoangy207
 
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptxDemystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
Anant Garg
 
1645 goldenberg using our laptop
1645 goldenberg using our laptop1645 goldenberg using our laptop
1645 goldenberg using our laptop
Rising Media, Inc.
 
Transfer Learning
Transfer LearningTransfer Learning
Transfer Learning
Hichem Felouat
 
Keras_Core_introduction.pptx
Keras_Core_introduction.pptxKeras_Core_introduction.pptx
Keras_Core_introduction.pptx
GDSCBBIT
 
Keras and TensorFlow
Keras and TensorFlowKeras and TensorFlow
Keras and TensorFlow
NopphawanTamkuan
 
Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017
Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017
Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017
StampedeCon
 
unit-iii-deep-learningunit-iii-deep-learning.pdf
unit-iii-deep-learningunit-iii-deep-learning.pdfunit-iii-deep-learningunit-iii-deep-learning.pdf
unit-iii-deep-learningunit-iii-deep-learning.pdf
nandan543979
 
Automatic Attendace using convolutional neural network Face Recognition
Automatic Attendace using convolutional neural network Face RecognitionAutomatic Attendace using convolutional neural network Face Recognition
Automatic Attendace using convolutional neural network Face Recognition
vatsal199567
 
dl-unit-3 materialdl-unit-3 material.pdf
dl-unit-3 materialdl-unit-3 material.pdfdl-unit-3 materialdl-unit-3 material.pdf
dl-unit-3 materialdl-unit-3 material.pdf
nandan543979
 
Deep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlowDeep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlow
Oswald Campesato
 
Keras on tensorflow in R & Python
Keras on tensorflow in R & PythonKeras on tensorflow in R & Python
Keras on tensorflow in R & Python
Longhow Lam
 
Keras cheat sheet_python
Keras cheat sheet_pythonKeras cheat sheet_python
Keras cheat sheet_python
Coding Tonic
 
Keras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learningKeras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learning
Dr. Ananth Krishnamoorthy
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with Examples
Felipe
 
keras_tutorial.pdf
keras_tutorial.pdfkeras_tutorial.pdf
keras_tutorial.pdf
Lê Duy Tân
 
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.jsTensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
Stijn Decubber
 
python_libraries_for_artificial_intelligence.pptx
python_libraries_for_artificial_intelligence.pptxpython_libraries_for_artificial_intelligence.pptx
python_libraries_for_artificial_intelligence.pptx
salehaalsaleh602
 
Machine Learning Toolssssssssssssss.pptx
Machine Learning Toolssssssssssssss.pptxMachine Learning Toolssssssssssssss.pptx
Machine Learning Toolssssssssssssss.pptx
salehaalsaleh602
 
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdfdfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
nguyenhoangy207
 
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptxDemystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
Anant Garg
 
1645 goldenberg using our laptop
1645 goldenberg using our laptop1645 goldenberg using our laptop
1645 goldenberg using our laptop
Rising Media, Inc.
 
Keras_Core_introduction.pptx
Keras_Core_introduction.pptxKeras_Core_introduction.pptx
Keras_Core_introduction.pptx
GDSCBBIT
 
Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017
Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017
Getting Started with Keras and TensorFlow - StampedeCon AI Summit 2017
StampedeCon
 
unit-iii-deep-learningunit-iii-deep-learning.pdf
unit-iii-deep-learningunit-iii-deep-learning.pdfunit-iii-deep-learningunit-iii-deep-learning.pdf
unit-iii-deep-learningunit-iii-deep-learning.pdf
nandan543979
 
Automatic Attendace using convolutional neural network Face Recognition
Automatic Attendace using convolutional neural network Face RecognitionAutomatic Attendace using convolutional neural network Face Recognition
Automatic Attendace using convolutional neural network Face Recognition
vatsal199567
 
dl-unit-3 materialdl-unit-3 material.pdf
dl-unit-3 materialdl-unit-3 material.pdfdl-unit-3 materialdl-unit-3 material.pdf
dl-unit-3 materialdl-unit-3 material.pdf
nandan543979
 
Deep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlowDeep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlow
Oswald Campesato
 
Keras on tensorflow in R & Python
Keras on tensorflow in R & PythonKeras on tensorflow in R & Python
Keras on tensorflow in R & Python
Longhow Lam
 
Keras cheat sheet_python
Keras cheat sheet_pythonKeras cheat sheet_python
Keras cheat sheet_python
Coding Tonic
 

Recently uploaded (20)

apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays
 
Hypothesis Testing Training Material.pdf
Hypothesis Testing Training Material.pdfHypothesis Testing Training Material.pdf
Hypothesis Testing Training Material.pdf
AbdirahmanAli51
 
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
Eddie Lee
 
Part Departement Head Presentation for Business
Part Departement Head Presentation for BusinessPart Departement Head Presentation for Business
Part Departement Head Presentation for Business
Rizki229625
 
What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?
Amnic
 
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays
 
Report_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdfReport_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdf
OlhaTatokhina1
 
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays
 
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdfAG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
Anass Nabil
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays
 
Ch01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_SecuritCh01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_Securit
KawukiDerrick
 
Managed Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud ManManaged Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud Man
Opsio Cloud
 
Advanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdfAdvanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdf
leogoemmanguyenthao
 
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays
 
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays
 
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays
 
1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt
Wahajch
 
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays
 
Hypothesis Testing Training Material.pdf
Hypothesis Testing Training Material.pdfHypothesis Testing Training Material.pdf
Hypothesis Testing Training Material.pdf
AbdirahmanAli51
 
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
[Eddie Lee] Capstone Project - AI PM Bootcamp - DataFox.pdf
Eddie Lee
 
Part Departement Head Presentation for Business
Part Departement Head Presentation for BusinessPart Departement Head Presentation for Business
Part Departement Head Presentation for Business
Rizki229625
 
What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?
Amnic
 
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays
 
Report_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdfReport_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdf
OlhaTatokhina1
 
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays
 
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays New York 2025 - Open Source and disrupting the travel distribution ec...
apidays
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdfAG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
AG-FIRMA FINCOME ARTICLE AI AGENT RAG.pdf
Anass Nabil
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays
 
Ch01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_SecuritCh01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_Securit
KawukiDerrick
 
Managed Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud ManManaged Cloud services - Opsio Cloud Man
Managed Cloud services - Opsio Cloud Man
Opsio Cloud
 
Advanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdfAdvanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdf
leogoemmanguyenthao
 
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays
 
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays
 
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays
 
1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt1-2. Lab Introduction to Linux environment.ppt
1-2. Lab Introduction to Linux environment.ppt
Wahajch
 
Ad

Python Keras module for advanced python programming

  • 2. 1. Features 2. Keras layers 3. Components 4. Advantages and Disadvantages
  • 3. What is Deep Learning Framework? Deep learning frameworks are software libraries or tools that provide building blocks, abstraction, and functionalities for designing training and deploying model, this frameworks simplify the processes of implementing complex mathematics operations required for neural networks providing it structured environment for developing algorithm. They simplify AI development by offering pre-built components and APIs, enabling developers to focus on designing and training models.
  • 5. What is Keras? Keras is a popular high-level deep learning API written in Python that runs on top of lower-level deep learning frameworks like TensorFlow. It provides a user-friendly, modular interface for building and training neural networks.
  • 6. High-level API(frontend) & Low-level API(backend) A high level API provides simplified user friendly way to perform tasks without requiring knowledge of the complex, underlying details. It abstracts away much of the complexity, allowing you to focus on your main goals, such as building and training machine learning models. A low-level API provides exposes the core components and functions that interact directly with the system or perform the underlying computations. This type of API requires more detailed knowledge of the inner workings but offers much more flexibility and control.
  • 7. Features of keras ● Simple – but not simplistic. Keras reduces developer cognitive load to free you to focus on the parts of the problem that really matter. ● Flexible – Keras adopts the principle of progressive disclosure of complexity: simple workflows should be quick and easy, while arbitrarily advanced workflows should be possible via a clear path that builds upon what you've already learned. ● Powerful – Keras provides industry-strength performance and scalability: it is used by organizations including NASA, YouTube, or Waymo.
  • 8. Features of keras ● Keras prioritises developer experience. ● Keras is broadly adopted in the industry and among the research community. ● Keras models are easy to turn models into products. ● Support multiple backend engines and does not lock you into one ecosystem. ● Keras has strong multi GPU support and distributed training support.
  • 9. Types of keras models Sequential Model ● The Sequential model is the simplest type of model in Keras. It allows you to build a neural network by stacking layers on top of each other in a linear (sequential) fashion. Functional API ● The Functional API in Keras provides a more flexible way to build models. ● It allows for defining complex architectures, including models with multiple inputs and outputs, shared layers, and non-linear data flows (such as residual connections or multi-branch networks).
  • 10. Example: keras sequential import keras from keras import layers model = keras.Sequential() model.add(layers.Dense(2, activation="relu")) model.add(layers.Dense(3, activation="relu")) model.add(layers.Dense(4
  • 11. Example: Keras Functional API from keras.models import Model from keras.layers import Input from keras.layers import Dense visible = Input(shape=(2,)) hidden = Dense(2)(visible) model = Model(inputs=visible, outputs=hidden)
  • 12. Model subclassing, where you implement everything from scratch on your own. Use this if you have complex, out-of-the-box research use cases.
  • 13. Keras Layers Layers are the basic building blocks of neural networks in Keras. A layer consists of a tensor-in tensor-out computation function (the layer's call method) and some state, held in TensorFlow variables (the layer's weights).
  • 14. 1. Core Layers: ○ Input Layer: Defines the input shape of the neural network. ○ Dense Layer: Fully connected layer, where each neuron is connected to every neuron in the previous layer ○ Activation Layers: Apply activation functions to introduce non-linearity. ○ Dropout Layer: Prevents overfitting by randomly setting a fraction of input units to zero. ○ Flatten Layer: Reshapes multi-dimensional input into a one-dimensional vector. ○ Reshape Layer: Reshapes the input tensor to a specified shape. ○ Permute Layer: Rearranges the dimensions of an input tensor. ○ RepeatVector Layer: Repeats the input along a new axis. ○ Lambda Layer: Applies an arbitrary function to the input.Masking Layer: Marks specific values in the input as "masked" (ignored). ○ Embedding Layer: Converts categorical data into dense vectors.
  • 15. 2. Convolution Layers ● Conv1D, Conv2D, Conv3D: Perform convolution operations on 1D, 2D, or 3D input data. ● Useful for tasks such as image classification, video analysis, and time series prediction. ● Conv2DTranspose, Conv3DTranspose: Perform transposed convolutions, often used in generative models and image segmentation. ● SeparableConv2D, DepthwiseConv2D: Efficient convolutions by splitting the convolution operation into multiple parts, reducing computation costs.
  • 16. 3. Pooling Layers: ● MaxPooling2D: Downsamples input images by taking the maximum value in each pooling region. ● MaxPooling3D: Downsamples volumetric data by taking the maximum value in each pooling region. ● AveragePooling2D: Downsamples input images by taking the average value in each pooling region. ● AveragePooling3D: Downsamples volumetric data by taking the average value in each pooling region. ● GlobalMaxPooling2D: Downsamples input images to a single value by taking the maximum value across all spatial dimensions ● GlobalMaxPooling3D: Downsamples volumetric data to a single value by taking the maximum value across all spatial dimensions. ● GlobalAveragePooling2D: Downsamples input images to a single value by taking the average value across all spatial dimensions. ● GlobalAveragePooling3D: Downsamples volumetric data to a single value by taking the average value across all spatial dimensions.
  • 17. 1. Modularity Keras is modular. It considers a model in the form of a graph or a sequence. Keras allows you to save the model you are working on. Keras provides a save() method to save the current model. You can even use the model in the future. 2. Large Dataset Keras contains a large pre-defined dataset. It provides you a variety of datasets. You can use this dataset to be directly importing and loading it.
  • 18. 3. Train from NumPy Data Keras uses the NumPy array to train and evaluate the model. It makes use of the fit() method. The fit() method fits the model to the training data. This training process may take some time. fit() method had three arguments batch_size, validation_data and epochs. 4. Evaluation and Prediction Keras has evaluate() and predict() methods. These methods can use the dataset of NumPy. After testing the data, the evaluation of the result is done. These methods are used to evaluate our models.
  • 19. 5. Pre-trained Models in Keras Keras contains a number of pre-trained models. These models can be imported from keras.applications. These models are useful for feature extraction and fine-tuning. Keras.application is a module that contains weights for image classification like VGG16, VGG19, Xception, etc. 6. Encoding in Keras Karas allows you encoding feature. There is one_hot() function in Keras that enables encoding. It helps you to encode integers in one step. It also enables you to tokenize the data. This function filters out the white spaces, make the text to lower case, and filter out the punctuations. 7. Layers in Keras There are numerous layers and parameters in Keras. All Keras layers have a number of methods in them. These layers are useful to construct, train, configure the data. The dense layer is beneficial to implement operations.
  • 20. What is keras layers? Keras layers are the building blocks used in designing and implementing neural networks. These layers analyze the structure of input data, perform transformations like convolution, pooling, and dense connections, and are combined to create neural network architectures for various machine learning tasks. Keras provides a wide variety of standard layers to handle different types of input data and neural network architectures.
  • 21. Types of Keras Layers 1. Convolutional Layers This layer is mainly used in case of Image processing or Video processing tasks for spatial convolution over images or sequences. The functionality of the convolution layer is to apply the specified filters for input image to generate feature maps.
  • 22. Types of Keras layers 2. Pooling Layers Pooling layer is used to reduce the dimensions of the feature map from the previous layer before passing it to next layer in-order to make the computation faster and prevent overfitting. Two main types of pooling layer are max pooling layer and average pooling layer. ● Max pooling layer takes the maximum of the input region. If we consider a 2×2 matrix it is replaced by single value which is maximum among the four values. ● Similarly Average pooling layer takes the average of all the input values. If we consider a 2×2 matrix it is replaced by a single value which is average of all the four values.
  • 23. Types of Keras layers 3. Dense Layer ● A fully connected neural network layer. ● Each neuron in the layer is connected to every neuron in the previous layer. ● Used for both input and output layers. ● Often used in the final layers of a network to make predictions. keras.layers.Dense(units, activation=None, ...) ● units: Number of neurons in the layer. ● activation: Activation function (e.g., 'relu', 'sigmoid', 'softmax').
  • 24. Types of Keras layers 4. Flatten Layer: ● Converts a multi-dimensional input (e.g., from a convolutional layer) into a 1D array. ● Useful when transitioning from convolutional layers to dense layers. ● The primary purpose of the Flatten layer is to transform the output of previous layers (like convolutional layers) into a format that is compatible with the dense layers that follow. ● For example, convolutional layers output a 3D tensor (height, width, and number of channels), but a dense layer requires a 1D vector as input. The Flatten layer reshapes the multi-dimensional data into a single long vector. ● Although the Flatten layer does not perform any learning or modification of weights, it preserves the order of the features while converting the multi-dimensional data into a 1D array. This allows the model to maintain the spatial and hierarchical information extracted by previous layers. keras.layers.Flatten()
  • 25. Types of Keras layers 5. Dropout Layer: ● A regularization technique that randomly sets a fraction of input units to zero at each update during training. ● Helps prevent overfitting by ensuring the network does not rely too heavily on any one feature. keras.layers.Dropout(rate) rate: Fraction of the input units to drop (e.g., 0.5 means 50% of inputs will be set to zero).
  • 26. Types of Keras layers 6. Activation Layer: ● Applies an activation function to the input. ● Can be a separate layer, but often specified directly within other layers (like Dense). ● keras.layers.Activation(activation) ● activation: The activation function to apply (e.g., 'relu', 'tanh', 'sigmoid').
  • 28. Advantages of Keras ● User-friendly: ○ Keras has a simple, intuitive API that makes it easy to build and train deep learning models. ○ It abstracts away many of the complexities of TensorFlow, making it a good choice for beginners. ● Fast Prototyping: ○ Keras allows for quick experimentation and iteration. ○ You can build complex models with just a few lines of code. Multiple ● Backend Support: ○ Keras can run on top of different backend engines like TensorFlow, Theano, and CNTK. ○ This provides flexibility and allows you to choose the backend that best suits your needs.
  • 29. ● Wide Adoption: ○ Keras is widely adopted by the community and industry, which means there are abundant resources, tutorials, and support available. ● Model Deployment: ○ Keras models can be easily deployed to various platforms, including web browsers, mobile devices, and embedded systems.
  • 30. ● Less Flexibility: While Keras' simplicity is a strength, it can also be a limitation. For advanced users, the high-level abstractions might hide some of the lower-level details, making it challenging to customize or implement certain complex operations. ● Performance Overhead: For very large and complex models, the abstraction layer in Keras can introduce some performance overhead compared to using TensorFlow directly. ● Debugging: While Keras' error messages have improved, they can sometimes be less informative compared to TensorFlow. This can make debugging more challenging in certain cases. ● Limited Features: Compared to TensorFlow, Keras may have fewer advanced features and functionalities, especially for research-oriented tasks. Disadvantages of Keras