Unit 5 Machine Language
Unit 5 Machine Language
Machine learning is a sub field of Artificial Intelligence that provides computer the ability
to learn and improve its learning from experience without being written rules explicitly.
The machine start learning with observations or data, in order to look for patterns in data and
make better decisions in the future based on the examples that it has been provided.
Sandesh Shiwakoti-9815945474
Machine Learning and Artificial Intelligence
Artificial intelligence refers to a very large field of research that encompasses a number of
techniques aimed at developing computers that can learn and solve problems whereas machine
learning is the field of artificial intelligence concerned with learning from data on its own.
Artificial Intelligence
Machine Learning
Algorithms that can learn from data
Sandesh Shiwakoti-9815945474
Machine Learning Definition:
According to Tom Mitchell “ A computer program is set to learn from experience E with respect
to some class of tasks T and performance major P if its performance at tasks in T, as measured by
P improves with experience E.
Machine learning is the since of getting computers to act without being explicitly programmed,
but instead letting them learn a few tricks on their own(Danko Nikolic, Max-plank Institute)
Sandesh Shiwakoti-9815945474
The difference between traditional programming and machine learning
Sandesh Shiwakoti-9815945474
General Machine Learning agent framework or architecture
The following figure represents the general steps involved in machine learning agent. It learns
from Inputs and corrects its decision based on the feedback provided by critic.
Sandesh Shiwakoti-9815945474
It consists of the following components.
1. Learning element
2. Knowledge base
3. Performance element
4. Feedback element (critic)
5. Standard system
Learning element:
it receives and processes the input obtained from a person, from reference material like magazines,
journals etc. or from the environment at large.
Knowledge Base:
This is somewhat similar to the database. Initially it may contain some basic knowledge. Thereafter it
receives more knowledge which may be new and so be added as it is or it may place the existing knowledge.
Performance element:
It uses the updated knowledge base to perform some task or solves some problems and
produces the corresponding output.
Feedback element:
It receiving the two inputs, one from learning elements and one through standard system this is
to identify the differences between the two inputs. The feedback is used to determine what should be done in
Sandesh Shiwakoti-9815945474
order to produce the correct output.
Standard System:
It is a trained person or a computer program that is able to produce correct
output. In order to check whether the machine learning system has learned well, the same input
is given to the standard system. The output of a standard system and that of performance
element are given as input to the feedback element for the comparison. Standard system is also
called the idealized system.
Why Learning?
The strategies for learning can be classified according to the amount of inference to the system has to perform on its
training data. In increasing order we have :
The 3 broad categories of machine learning algorithms are :
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement learning Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Supervised learning
• Supervised learning is where you have input variables (x) and an output variable (Y) and you
use an algorithm to learn the mapping function from the input to the output. Y = f(X)
• when you have new input data (x) that you can predict the output variables (Y) for that data.
• It is called supervised learning because the process of an algorithm learning from the
training dataset can be thought of as a teacher supervising the learning process.
• We know the correct answers, the algorithm iteratively makes predictions on the training
data and is corrected by the teacher.
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Classification
Sandesh Shiwakoti-9815945474
Regression
Linear Classifiers: These separate data points using linear decision boundaries.
Support Vector Machines (SVM): Find the best hyperplane to separate classes.
Decision Trees: Hierarchical structures that split data based on features.
k-Nearest Neighbors (k-NN): Classify based on nearest neighbors.
Random Forests: Ensembles of decision trees.
Naïve bayes:
Regression Algorithms:
These predict continuous values. Key regression algorithms include:
•Medical Diagnosis:
•Problem: Classifying medical images or patient data as "diseased" or "healthy".
•Application: Doctors and healthcare systems use machine learning to diagnose diseases
such as cancer, diabetes, and heart conditions from medical imaging or patient data.
•Image Recognition:
•Problem: Classifying images into different categories, such as "cat", "dog", "car",
"person", etc.
•Application: Used in various applications, including social media tagging, autonomous
vehicles, and security systems.
Sandesh Shiwakoti-9815945474
•Sentiment Analysis:
•Document Classification:
• The goal for unsupervised learning is to model the underlying structure or distribution in
the data in order to learn more about the data.
• These are called unsupervised learning because unlike supervised learning above there is
no correct answers and there is no teacher.
• Algorithms are left to their own devises to discover and present the interesting structure
in the data.
Sandesh Shiwakoti-9815945474
Unsupervised learning in artificial intelligence is a type of machine learning that learns from
data without human supervision. Unlike supervised learning, unsupervised machine learning
models are given unlabeled data and allowed to discover patterns and insights without any
explicit guidance or instruction.
As the name suggests, unsupervised learning uses self-learning algorithms—they learn without
any labels or prior training. Instead, the model is given raw, unlabeled data and has to infer its
own rules and structure the information based on similarities, differences, and patterns without
explicit instructions on how to work with each piece of data.
Unsupervised learning algorithms are better suited for more complex processing tasks, such as
organizing large datasets into clusters.
Imagine that you have a large dataset about weather. An unsupervised learning algorithm will go
through the data and identify patterns in the data points. For instance, it might group data by
temperature or similar weather patterns.
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Unsupervised machine learning methods
In general, there are three types of unsupervised learning tasks: clustering, association rules, and dimensionality
reduction.
Clustering
Clustering is a technique for exploring raw, unlabeled data and breaking it down into groups (or clusters) based on
similarities or differences. It is used in a variety of applications, including customer segmentation, fraud detection,
and image analysis. Clustering algorithms split data into natural groups by finding similar structures or patterns in
uncategorized data.
Association
Association rule mining is a rule-based approach to reveal interesting relationships between data points in large
datasets. Unsupervised learning algorithms search for frequent if-then associations—also called rules—to discover
correlations and co-occurrences within the data and the different connections between data objects.
It is most commonly used to analyze retail baskets or transactional datasets to represent how often certain items
are purchased together. These algorithms uncover customer purchasing patterns and previously hidden
relationships between products that help inform recommendation engines or other cross-selling opportunities. You
might be most familiar with these rules from the “Frequently bought together” and “People who bought this item
also bought” sections on your favorite online retail shop.
Association rules are also often used to organize medical datasets for clinical diagnoses. Using unsupervised
machine learning and association rules can help doctors identify the probability of a specific diagnosis by comparing
relationships between symptoms from past patient cases.
Sandesh Shiwakoti-9815945474
Real-world unsupervised learning examples
Now that you understand the basics of how unsupervised learning works, let’s look at the most
common use cases helping businesses explore large volumes of data quickly.
Sandesh Shiwakoti-9815945474
•Fraud detection: Unsupervised learning is useful for anomaly detection, revealing
unusual data points in datasets. These insights can help uncover events or
behaviors that deviate from normal patterns in the data, revealing fraudulent
transactions or unusual behavior like bot activity.
•Natural language processing (NLP): Unsupervised learning is commonly used for
various NLP applications, such as categorizing articles in news sections, text
translation and classification, or speech recognition in conversational interfaces.
•Genetic research: Genetic clustering is another common unsupervised learning
example. Hierarchical clustering algorithms are often used to analyze DNA patterns
and reveal evolutionary relationships.
Unsupervised learning is well suited for tasks that require exploring large amounts
of unlabeled data. This approach makes it easier for businesses to gain insights
from data when no labels are present, helping them to understand the underlying
structure of a dataset and identify patterns and relationships between datasets
without the need for a human to teach them.
Sandesh Shiwakoti-9815945474
cheese
Bread Jam
Milk
Sugar
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Reinforcement learning
• Is learning behavior through trial-and-error interactions with a environment.
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Reinforcement learning (RL) is a machine learning (ML) technique that trains software to make
decisions to achieve the most optimal results. It mimics the trial-and-error learning process that
humans use to achieve their goals. Software actions that work towards your goal are reinforced,
while actions that detract from the goal are ignored.
benefits of reinforcement learning?
Excels in complex environments Optimizes for long-term goals Optimizes for long-term goals
Key concepts
In reinforcement learning, there are a few key concepts to familiarize yourself with:
•The agent is the ML algorithm (or the autonomous system)
•The environment is the adaptive problem space with attributes such as variables, boundary
values, rules, and valid actions
•The action is a step that the RL agent takes to navigate the environment
•The state is the environment at a given point in time
•The reward is the positive, negative, or zero value—in other words, the reward or
punishment—for taking an action
•The cumulative reward is the sum of allSandesh
rewards or the end value
Shiwakoti-9815945474
What are the types of reinforcement learning algorithms?
There are various algorithms used in reinforcement learning (RL)—such as Q-learning, policy gradient methods,
Monte Carlo methods, and temporal difference learning. Deep RL is the application of deep neural networks to
reinforcement learning. One example of a deep RL algorithm is Trust Region Policy Optimization (TRPO).
All these algorithms can be grouped into two broad categories.
Model-based RL
Model-based RL is typically used when environments are well-defined and unchanging and where real-world
environment testing is difficult.
The agent first builds an internal representation (model) of the environment. It uses this process to build this model:
1.It takes actions within the environment and notes the new state and reward value
2.It associates the action-state transition with the reward value.
Once the model is complete, the agent simulates action sequences based on the probability of optimal cumulative
rewards. It then further assigns values to the action sequences themselves. The agent thus develops different
strategies within the environment to achieve the desired end goal.
Example
Consider a robot learning to navigate a new building to reach a specific room. Initially, the robot explores freely and
builds an internal model (or map) of the building. For instance, it might learn that it encounters an elevator after
moving forward 10 meters from the main entrance. Once it builds the map, it can build a series of shortest-path
sequences between different locations it visits frequently in the building.
Sandesh Shiwakoti-9815945474
Model-free RL
Model-free RL is best to use when the environment is large, complex, and not easily describable.
It’s also ideal when the environment is unknown and changing, and environment-based testing
does not come with significant downsides.
The agent doesn’t build an internal model of the environment and its dynamics. Instead, it uses
a trial-and-error approach within the environment. It scores and notes state-action pairs—and
sequences of state-action pairs—to develop a policy.
Example
Consider a self-driving car that needs to navigate city traffic. Roads, traffic patterns, pedestrian
behavior, and countless other factors can make the environment highly dynamic and complex. AI
teams train the vehicle in a simulated environment in the initial stages. The vehicle takes actions
based on its current state and receives rewards or penalties.
Over time, by driving millions of miles in different virtual scenarios, the vehicle learns which
actions are best for each state without explicitly modeling the entire traffic dynamics. When
introduced in the real world, the vehicle uses the learned policy but continues to refine it with
new data. Sandesh Shiwakoti-9815945474
Different Approaches in Machine Learning
1. Supervised Learning:
•Definition: Learning from labeled data to make predictions or classify data.
•Examples: Linear regression, logistic regression, support vector machines (SVMs), neural
networks.
2. Unsupervised Learning:
•Definition: Learning from unlabeled data to find patterns or structure in the data.
•Examples: K-means clustering, principal component analysis (PCA), autoencoders, Hebbian
learning-based algorithms.
3. Reinforcement Learning:
•Definition: Learning by interacting with an environment to maximize cumulative reward.
•Examples: Q-learning, deep Q-networks (DQNs), policy gradient methods, genetic algorithms
for policy optimization.
Sandesh Shiwakoti-9815945474
Fundamental Concepts Used Across All Types of Learning
1. Statistical Models:
•Application in Supervised Learning: Used for making predictions and classifications (e.g., linear
regression, logistic regression).
•Application in Unsupervised Learning: Used for clustering and dimensionality reduction (e.g., K-
means, PCA).
•Application in Reinforcement Learning: Sometimes used for modeling environment dynamics
or value functions (e.g., Hidden Markov Models).
4. Genetic Algorithms:
•Application in Supervised Learning: Used for optimizing model parameters and feature
selection.
•Application in Unsupervised Learning: Applied to clustering problems and evolving data
structures.
•Application in Reinforcement Learning: Used for evolving policies and strategies (e.g.,
neuroevolution).
Sandesh Shiwakoti-9815945474
Statistical-based learning: Naïve Bayes Model
Statistical learning isn't a separate category, but rather a fundamental approach that underpins
many machine learning algorithms, especially supervised learning. It focuses on using statistical
methods to build models that can learn from data,
statistical learning is like the toolbox that provides the tools and techniques for various machine
learning algorithms, particularly in supervised and unsupervised settings.
statistical machine learning involves using statistical techniques to develop models that can
learn from data and make predictions or decisions.
You might have heard technical terms such as supervised, unsupervised, and semi-supervised
learning– they all rely on a solid statistical foundation.
In essence, statistical machine learning merges the computational efficiency and adaptability of
machine learning algorithms with statistical inference and modeling capabilities.
By employing statistical methods, we can extract significant patterns, relationships, and insights
from intricate datasets, thereby promoting the effectiveness of machine learning algorithms.
Sandesh Shiwakoti-9815945474
Naive Bayes is a probabilistic machine learning algorithm based on the Bayes Theorem, used in a wide
variety of classification tasks.
The Naïve Bayes classifier is a supervised machine learning algorithm used for classification
tasks, such as text classification. Here’s how it works:
1.Bayesian Statistics: Naïve Bayes is based on Bayes’ Theorem, which allows us to “invert”
conditional probabilities. It deals with sequential events, where additional information
impacts the initial probability. For instance, consider medical testing: if someone tests positive
for a disease, the prior probability is updated based on this new information.
2.Assumption of Independence: Naïve Bayes assumes that predictors
(features) are conditionally independent given the class. This simplifies the model but may
not always hold in practice.
3.Generative Learning: Naïve Bayes is part of the generative learning algorithms family.
Unlike discriminative classifiers (e.g., logistic regression), it doesn’t learn which features are
most important for differentiation.
4.Applications: It’s commonly used for text classification, where discrete data (like word
counts) are relevant
How Naive Bayes Algorithm Works? (with example and
full code) | ML+ (machinelearningplus.com) Sandesh Shiwakoti-9815945474 https://youtu.be/O2L2Uv9pdDA
Sample Email
Sandesh Shiwakoti-9815945474
Spam Message : 4
Normal Message: 8
Key Words inside Spam Message
Key Words inside normal message
Dear = 2 , Friend = 1, Lunch = 0, Money = 4
Dear = 8, Friend=5, lunch=3, money=1 , Total = 7
Total= 17 Probability of each words from spam message:
p(Dear | Spam) = 2/7 = 0.29
Probability of each words: P(Friend | Spam) = 1/7 = 0.14
p(Dear|Normal) = 8/17 = 0.47 p(Lunch | Spam) = 0
p(Friend|Normal) = 5/17 = 0.29 p(Money | Spam) = 4/7 = 0.57
p(Lunch | Normal) = 3/17 = 0.18
p(money | Normal) = 1/17 = 0.06
The initial guess that we observe a normal message is called a prior probability
P (S) = 4/12 = 0.33 Sandesh Shiwakoti-9815945474
.
Now we have got a message, which contains ‘Dear Friend’ . Let’s find whether the message
received is normal or spam.
Sandesh Shiwakoti-9815945474
Learning by genetic Algorithm: Genetic Algorithms (GA) were introduced by John Holland in 1975
You can simulate biological evolution process
Sandesh Shiwakoti-9815945474
It mimics Real biological evolution.
Solve large or complex problem
Focus on optimization
It reflects the process of natural process selection where the fittest individuals are
selected for reproduction in order to produce offspring of next generation.
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Initial Population:-
The process begins with a set of individuals which is called a population. Each
individual is a solution to the problem you want to solve. An individual is characterized by a
set of parameters known as Genes. Genes are joined into a string to form a
chromosome(solution).
Fitness Function:-
The fitness function determines how fit an individual is ( the ability of an
individual to compete with other individuals). It gives a fitness score to each individual. The
probability that an individual will be selected for reproduction is based on its fitness socre.
Selection:-
This is a method providing the performance to the individuals with good fitness
score and allows them to pass their genes to the successive generation. The concept related
to genetic algorithms in computer science, where individuals with higher fitness scores (i.e.,
those who perform better in a given task or environment) are more likely to pass their genes
on to the next generation. Techniques like round wheel tournament selection and rank
selection are used to choose the parents forShiwakoti-9815945474
Sandesh the next generation.
Mutation:-
It’s defined as a small random tweak in the chromosome to get a new solution. The
purpose of mutation is to maintain and introduce diversity in the genetic population and to
explore new areas of the search space. The key idea is to insert random genes in offspring to
maintain the diversity in the population to avoide the premature convergence.
Ex: 0 0 1 1 0 1 0 0 1 0 0 1
Before mutation After mutation
Crossover:-
In genetic algorithms, crossover, also known as recombination, is a genetic operator used
to combine the genetic information of two parents to generate new offspring. It’s one way to
stochastically generate new solutions from an existing population.
Ex: consider the crossover point to be 3 as shown below.
A1 0 0 0 0 0 0
A2 1 1 1 1 1 1
[ The population has converge i.e., if there is not much diversity left in the population or if a
satisfactory fitness level has been reached.]
Sandesh Shiwakoti-9815945474
Maximize the function f(x) = x2
Soln
1. Select encoding technique:-
Using 5 bit binary integers, numbers between 0 (00000) to 31 ( 11111) can be obtained.
you have total 8 items with different weight. Now you want to choose maximum number of items withing 5 kg.
To solve this you have to make combination of items with different weight.
let’s say for three items, you would have total 7 combination, for 5 items total 32 combination= 0.000003
for 10 items total 1024 combination=0.000807, 20 items = 1048576 = 1 sec, 77 items = 5 billions years
Sandesh Shiwakoti-9815945474
Example problem and solution using Genetic Algorithms
Given a target string, the goal is to produce target string starting from a random string
of the same length. In the following implementation, following analogies are made –
•Characters A-Z, a-z, 0-9, and other special symbols are considered as genes
Sandesh Shiwakoti-9815945474
•Dendrites − They are tree-like branches, responsible for receiving the
information from other neurons it is connected to. In other sense, we can
say that they are like the ears of neuron.
•Soma − It is the cell body of the neuron and is responsible for processing of
information, they have received from dendrites.
•Axon − It is just like a cable through which neurons send the information.
•Synapses − It is the connection between the axon and other neuron
dendrites.
Sandesh Shiwakoti-9815945474
Difference between Biological Neural Networks Vs Artificial Neural Networks (ANN)
Learning they can tolerate ambiguity very precise structures and formatted data
Storage Stores the information in the synapsis Stores the information in continuous memory
102 to 104 nodes(mainly depends on type of
size Approx 1011 Neurons and 1015 interconnection
application and network design
Sandesh Shiwakoti-9815945474
Mathematical Model of AAN
Artificial Neural Networks (ANNs) are inspired by the structure and function of the brain.
They use a mathematical model to process information through interconnected nodes,
called artificial neurons.
•An artificial neuron receives input signals (x_1, x_2, ..., x_n) from other neurons.
•Each input is multiplied by a weight (w_1, w_2, ..., w_n) representing the connection strength.
•These weighted inputs are summed (Σ) along with a bias (b) term.
•An activation function (f) is applied to the summed value to introduce non-linearity and
determine the output (y) of the neuron.
Mathematical Notation:
y = f(Σ(w_i * x_i) + b)
f: Activation function (e.g., sigmoid, tanh, ReLU) w_i: Weights for each input x_i: Input signals
Σ: Summation function b: Bias term
Sandesh Shiwakoti-9815945474
y: Output of the neuron
Network Architecture
•Neurons are organized in layers: input layer, hidden layers, and output layer.
•The input layer receives raw data.
•Hidden layers process information through multiple activation functions.
•The output layer produces the final results.
Learning Process
For linear activation functions, the output activity is proportional to the total weighted output.
g(x) = kx+c, Where k and x are constant
For threshold activation functions, the output are set at one of two levels, depending on whether
the total input is greater than or less than some threshold value.
g(x) = 1 if x>=k
= 0 if x<0
For sigmoid activation functions, the output varies continuously but not linearly as the input
changes. Sigmoid units bear a greater resemblance to real neurons than do linear or threshold
units. It has advantage of differentiable.
G(x) = 1/(1+e-x) Sandesh Shiwakoti-9815945474
Types of Artificial Neural Network:
Sandesh Shiwakoti-9815945474
Feedback(Recurrent) Networks:-
Feedback networks can have signals traveling in both directions by introducing
loops in the network. Feedback networks are very powerful and can get extremely complicated.
Feedback networks are dynamic; their ‘state’ is changing continuously until they reach an
equilibrium point. They remain at the equilibrium point until the input changes and a new
equilibrium needs to be found. Feedback architectures are also referred to as interactive or
recurrent.
Sandesh Shiwakoti-9815945474
There are 2 types of feed forward neural networks:
Sandesh Shiwakoti-9815945474
Application of Artificial Neural Network:-
•Facial Recognition: Recognizing and verifying individual faces for security and
authentication purposes.
•Speech Recognition: Converting spoken language into text (e.g., virtual assistants like Siri
and Alexa).
•Character Recognition: It can extract character form an image.
•Stock Market Prediction: Analyzing historical data to predict future stock prices.
. Recommendation Systems: Suggesting movies, music, and other content based on user
preferences (e.g., Netflix and Spotify recommendations).
Learning by Training ANN:-
In AI, learning by training refers specifically to how AI models improve their
abilities. It's essentially the process of an AI system "learning by doing" tasks with data, similar to
how a student learns through practice. Here's a breakdown:
Data Feeding: The core of training involves feeding the AI system massive amounts of data
relevant to the task it needs to learn. This data can be text, images, code, or any format that
holds information the AI can process. Sandesh Shiwakoti-9815945474
•Pattern Recognition: The AI system analyzes the data to identify patterns and relationships
within it. This is similar to how humans learn by observing and making connections between
things they experience. For example, an image recognition AI might analyze millions of labeled
images to understand the patterns that differentiate a cat from a dog.
•Model Adjustments: Based on the analysis of the data, the AI model itself is adjusted and
refined. This can be done through various algorithms, but the basic idea is that the AI "learns
from its mistakes" on the training data. It adjusts its internal parameters to improve its ability to
identify patterns and make accurate predictions on new, unseen data.
Training is an iterative process. The AI is fed data, analyzes it, adjusts its model, and then repeats
the process with potentially new data. The more data and the more iterations of this process, the
better the AI model becomes at the specific task it's trained for.
Here's an analogy: Imagine training a dog to fetch. You throw the ball repeatedly (data feeding),
the dog observes its throws and tries to catch it (pattern recognition), and you correct its
mistakes and praise its successes (model adjustments). Over time, through this "learning by
doing" with data, the dog becomes better at fetching.
AI training is crucial because it allows AI models to perform tasks that would be impossible for
them to do without prior exposure to vast amounts
Sandesh of data and the ability to learn from it.
Shiwakoti-9815945474
Neural Network Learning Rules
Sandesh Shiwakoti-9815945474
Hebbian Learning:-
Hebbian learning is a general principle that states that the synaptic efficiency between two
neurons should increase if the 2 neurons are simultaneously active, and decrease if not.
In 1949 Donald Herb proposed one of the key ideas in biological learning commonly known as
Heb’s law states that if neurons i is near enough to excite neurons j and repeatedly participates in
its activation the synaptic connection between these two neurons is strengthened and neuron j
becomes more sensitive to stimuli from neurons i.
2. If two neurons on either side of a connection are activated asynchronously, then the
weight of that connection is decrease.
Hebb’s Law provides the basis of learning without a teacher. Learning here is a local
phenomenon occurring without feedback from
Sandesh the environment.
Shiwakoti-9815945474
Hebbian Learning Rule Algorithm :
Sandesh Shiwakoti-9815945474
Perceptron Learning :
It was originally developed by Frank Rosenblatt in the late 1950s. Training patterns
are presented to the network’s inputs; the output is computed. Then the connection weights wj
are modified by amount that is proportional to the product of the difference between the actual
output, y, and the desired output, d, and the input pattern, x. The summarized algorithm is give
below.
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Back-propagation Learning:-
It is a supervised learning Method, and is an implementation of the Delta rule. It
requires a teacher that knows, or can calculate, the desired output for any given input. It is most
useful for feed-forward networks. The term is an abbreviation for “backwards propagation of
errors”. Backpropagation requires that the activation function used by the artificial neurons is
differentiable.
Backpropagation networks are necessarily multiplayer perceptions (usually with one input, one
hidden, and one output layer) . In order for the hidden layer to serve any useful function,
multilayer networks must have non-linear activation functions for the multiple layers: a
multilayer network using only linear activation functions is equivalent to some single layer, linear
network.
Input: D training data set and their associated class label l= learning rate(normally 0.0-1.0)
Output: a trained neural network.
Method:
Step1: initialize all weights and bias in network.
Step2: while termination condition is not satisfied .
For each training tuple x in D
Sandesh Shiwakoti-9815945474
2.1 calculate output: For input layer For hidden layer and output layer
Sandesh Shiwakoti-9815945474
Sandesh Shiwakoti-9815945474
Deep Learning:
Deep learning is a subset of machine learning that uses multi-layered neural networks, called
deep neural networks, to simulate the complex decision-making power of the human brain.
Imagine teaching a computer to recognize cats: instead of telling it to look for whiskers, ears,
and a tail, you show it thousands of pictures of cats. The computer finds the common
patterns all by itself and learns how to identify a cat. This is the essence of deep learning.
In technical terms, deep learning uses something called "neural networks," which are
inspired by the human brain. These networks consist of layers of interconnected nodes that
process information. The more layers, the "deeper" the network, allowing it to learn more
complex features and perform more sophisticated tasks.
A CNN is a multilayer neural network that was biologically inspired by the animal
visual cortex. The architecture is particularly useful in image-processing applications.
The first CNN was created by Yann LeCun; at the time, the architecture focused on
handwritten character recognition, such as postal code interpretation. As a deep
network, early layers recognize features (such as edges), and later layers recombine
these features into higher-level attributes of the input.
Sandesh Shiwakoti-9815945474
CNN architecture
Convolutional Neural Network consists of multiple layers like the input layer,
Convolutional layer, Pooling layer, and fully connected layers.
The Convolutional layer applies filters to the input image to extract features, the
Pooling layer down samples the image to reduce computation, and the fully connected
layer makes the final prediction. The network learns the optimal filters through
backpropagation and gradient descent.
1.Sequence Processing:
1. RNNs are particularly well-suited for tasks where the order of data is important, such as
time series analysis, natural language processing (NLP), and speech recognition.
2.Memory:
1. RNNs maintain a hidden state that acts as a memory of previous inputs, which is updated
as new inputs are received. This allows RNNs to retain information over time, making
them capable of understanding context and temporal dependencies.
3.Recurrent Connections:
1. The recurrent connections in an RNN allow the output from the previous step to be used
as an input to the current step, providing the network with a form of memory.
Applications:
•Natural Language Processing (NLP): Text generation, language modeling, machine
translation, sentiment analysis.
•Time Series Prediction: Stock market prediction, weather forecasting.
•Speech Recognition: Transcribing spoken words into text.
•Video Analysis: Activity recognition inSandesh
videos.Shiwakoti-9815945474
Generative Adversarial Networks (GANs):
GANs are the creative minds of deep learning. They specialize in generating new data, like
images, videos, or even text. Here's the twist: GANs involve two neural networks locked in an
adversarial competition. One network (the generator) tries to create new, realistic data, while
the other network (the discriminator) tries to distinguish the generated data from real data. This
competition pushes both networks to improve, ultimately leading to the generation of highly
realistic and creative outputs. Imagine a GAN as a team of rival artists, constantly pushing each
other to create better and more innovative works.
Architecture of GANs
Sandesh Shiwakoti-9815945474
Generator Model:-
A key element responsible for creating fresh, accurate data in a Generative
Adversarial Network (GAN) is the generator model. The generator takes random noise
as input and converts it into complex data samples, such text or images. It is commonly
depicted as a deep neural network.
The generator’s ability to generate high-quality, varied samples that can fool the
discriminator is what makes it successful.
Discriminator Model:-
An artificial neural network called a discriminator model is used in
Generative Adversarial Networks (GANs) to differentiate between generated and actual
input. By evaluating input samples and allocating probability of authenticity, the
discriminator functions as a binary classifier.
Over time, the discriminator learns to differentiate between genuine data from the
dataset and artificial samples created by the generator. This allows it to progressively
hone its parameters and increase its level of proficiency.
Sandesh Shiwakoti-9815945474