Unit-I (R20 Syllabus) Machine Learning Basics

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 50

BAPATLA ENGINEERING COLLEGE :: BAPATLA

(Autonomous)

Deep Learning (20EC705/JO3-D)


Deep Learning Frameworks
Books
Machine Learning Basics
Learning Algorithms

 A machine learning algorithm is an algorithm that is able to learn from data.

 Definition: A computer program is said to learn from experience E with respect to some class of tasks

T and performance measure P, if its performance at tasks in T, as measured by P, improves with

experience E.

 Task: A task is a specific problem or objective that the algorithm is designed to solve or perform.

 Performance Measure: A performance measure is a metric or evaluation criteria used to assess how

well a learning algorithm is performing on a specific task or dataset.

 Experience: An experience is the process of gaining knowledge and practical skills in the field of

machine learning and artificial intelligence, particularly in the context of designing, implementing, and

optimizing algorithms that enable computers to learn from data and make predictions or decisions.
Machine Learning Tasks
 The most common machine learning tasks are as follows:
 Classification: Classification involves categorizing data inputs into predefined classes or categories.
𝑛
Let us consider an example whose input vector𝑥 ∈ ℝ
Where𝑥𝑖is the features of a vector.
𝑓 : ℝ → { 1 ,2. .. , 𝑘 }
𝑛
 To solve this task, the learning algorithm is usually asked to produce a function
When𝑦 = 𝑓 ( 𝑥)
 Examples: Logistic Regression, Decision Trees, Support Vector Machines, and Neural Networks.
Applications include spam email detection, image classification, and sentiment analysis.
 Regression: It is a statistical technique used in data analysis and machine learning to model the
relationship between a dependent variable and one or more independent variables (also known as
predictors or features). The goal of regression analysis is to understand how changes in the independent
variables are associated with changes in the dependent variable.
Machine Learning Tasks
 The most common machine learning tasks are as follows:
 Transcription
 Machine translation
 Structured output
 Anomaly detection
 Synthesis and sampling
 Imputation of missing values
 Denoising
 Density estimation or probability mass function estimation:
Learning Models
 Supervised Learning Models: In supervised learning, models are trained on labeled data, where each
input is associated with a corresponding target or output. Common algorithms include linear regression,
decision trees, support vector machines, and deep neural networks. These models learn to map inputs to
outputs and can be used for tasks like classification and regression.
 Unsupervised Learning Models: Unsupervised learning models work with unlabeled data and aim to
discover patterns, structures, or relationships within the data. Clustering algorithms like k-means and
hierarchical clustering, as well as dimensionality reduction techniques like Principal Component
Analysis (PCA), are examples of unsupervised learning models.
 Reinforcement Learning Models: In reinforcement learning, agents learn to make sequential
decisions in an environment to maximize a reward signal. These models are used in applications such
as game playing, robotics, and autonomous systems. Popular reinforcement learning algorithms include
Q-learning and deep reinforcement learning algorithms like DQN and A3C.
Learning Models
 Semi-Supervised Learning Models: Semi-supervised learning combines elements of both supervised
and unsupervised learning. These models use a small amount of labeled data and a larger amount of
unlabeled data to improve learning performance.
 Self-Supervised Learning Models: Self-supervised learning is a type of unsupervised learning where
models generate their own labels from the data itself. For example, in natural language processing,
models might learn to predict missing words in a sentence or generate contextually relevant
representations of words or phrases.
 Transfer Learning Models: Transfer learning involves pre-training a model on one task or dataset and
then fine-tuning it for another related task. This approach can save time and resources when training
models and is commonly used in deep learning, such as with pre-trained convolutional neural networks
(CNNs) for image classification.
Learning Models
 Neural Network Architectures: Deep learning models, which are a subset of neural networks, have
gained prominence in recent years. These models consist of multiple layers of interconnected artificial
neurons and are particularly well-suited for tasks involving large amounts of data, such as image and
speech recognition. Popular architectures include convolutional neural networks (CNNs) for computer
vision and recurrent neural networks (RNNs) for sequence data.
Maximum Likelihood Estimation

 To obtain a more convenient but equivalent optimization problem, we observe that


taking the logarithm of the likelihood does not change its arg max but does
conveniently transform a product into a sum
Maximum Likelihood Estimation

 However, the arg max does not change when we rescale the cost function, we can divide by m to
obtain a version of the criterion that is expressed as an expectation with respect to the empirical
distribution defined by the training data

 One way to interpret maximum likelihood estimation is to view it as minimizing the dissimilarity
between the empirical distribution defined by the training set and the model distribution,
with the degree of dissimilarity between the two measured by the KL divergence. The KL
divergence is given by
Properties of Maximum Likelihood Estimation

 The true distribution pdata must lie within the model family pmodel(·; θ). Otherwise, no estimator can recover
pdata .
 The true distribution pdata must correspond to exactly one value of θ. Otherwise, maximum likelihood can
recover the correct pdata , but will not be able to determine which value of θ was used by the data generating
processing.
Building a Machine Learning Algorithm

 Building a machine learning algorithm involves several steps and considerations.


 Define the Problem
 Data Collection
 Data Preprocessing
 Feature Engineering
 Model Selection
 Model Training
 Model Evaluation
 Monitoring and Maintenance
 Documentation and Reporting
 Security
Feedforward Neural Network

Source: NPTEL IIT KGP


Multilayer Feedforward Network

Source: NPTEL IIT KGP


Back Propagation Algorithm

𝜂=𝑟𝑎𝑡𝑒𝑜𝑓 𝑐𝑜𝑛𝑣𝑒𝑟𝑔𝑒𝑛𝑐𝑒 𝑓𝑎𝑐𝑡𝑜𝑟

Source: NPTEL IIT KGP


Back Propagation Algorithm
Back Propagation Algorithm & Stochastic gradient decent

Source: NPTEL IIT KGP


Back Propagation Algorithm: Output Layer

Source: NPTEL IIT KGP


Back Propagation Algorithm: Output Layer

Source: NPTEL IIT KGP


Back Propagation Algorithm: Hidden Layer

Source: NPTEL IIT KGP


Back Propagation Algorithm: Hidden Layer

Source: NPTEL IIT KGP


Back Propagation Algorithm: Hidden Layer

Source: NPTEL IIT KGP


Multilayer Perceptron: Example

Source: NPTEL IIT KGP


Multilayer Perceptron: Example

Source: NPTEL IIT KGP


Back Propagation: Example

Source: NPTEL IIT KGP


Back Propagation: Example

Source: NPTEL IIT KGP


Back Propagation: Example

Source: NPTEL IIT KGP


Stochastic Gradient Descent
Animation
https://www.analyticsvidhya.com/blog/2021/07/understanding-the-what-and-why-of-gradient-descent/
The Curse of Dimensionality

 Many machine learning problems become exceedingly difficult when the number of dimensions in the data
is high. This phenomenon is known as the curse of dimensionality.
 Various key points that understand the curse of dimensionality is as follows:
 Increasing Dimensionality
 Data Sparsity
 Computational Complexity
 Overfitting
 Data Collection and Storage
 Curse Mitigation

You might also like