0% found this document useful (0 votes)
29 views95 pages

AI ML Introduction1A

Uploaded by

jiriraymond65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views95 pages

AI ML Introduction1A

Uploaded by

jiriraymond65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 95

Artificial Intelligence /

Machine Learning
WHAT IS AI?

Bellman, 1978

“The automation of activities that we associate with human thinking,


activities such as decision making, problem solving, learning”
Intelligence
The ability to process information, and make some informed future
decisions, or predictions

The field of AI is the ability of computers to be intelligent


AI is a discipline
The branch of Computer Science that deals with the creation of
intelligent agents, which are systems that can reason and learn and act
autonomously

• AI is the theory and development of computer systems able to


perform tasks normally requiring human intelligence.

• Development of machines that think and act like humans


Machine Learning
• Machine Learning, a subset of AI, is a program or system that trains a
model on input data.

• The trained model can make useful predictions from new or never
before seen data drawn from the same one used to train the model.

• ML gives the computer the ability to learn without explicitly being


programmed
Deep Learning
Deep Learning uses Artificial Neural Networks, allowing them to
process more complex patterns than traditional machine learning
Artificial Neural Networks are inspired by the human brain.
Artificial Neural Networks
Artificial Neural Networks
Computer Brain
Processing units 1CPU, 109 transistors 1011 neurons

Storage capacity 109B RAM,1012B 1011 neurons, 1014


non-volatile memory synapses

Processing speed 10-8 second 10-3 second

Bandwidth 109 bits/sec 1014 bits/sec


Artificial Neural Networks
Made up of a lot of interconnected nodes or neurons that can learn to
perform tasks by processing data and making prediction
Deep Learning
Deep Learning models have many layers of neurons

This allows them to learn more complex patterns than traditional


machine learning models
Deep Learning
Neural Networks can use both labelled and unlabelled data

This is called semi-supervised learning

In DL the model is trained in a small amount of labelled data


and a large amount of unlabelled data
Deep Learning
The labelled data helps the NN to learn the basic concepts of the task

The unlabelled data helps the NN to generalise to new examples


Generative AI
Generative AI is a subset of Deep Learning

uses Artificial Neural Networks


can process both labelled and unlabelled data
using – supervised
- unsupervised
- semi-supervised methods
Generative AI
Large Language Models
Large Language Models are also a subset of Deep Learning
Deep Learning Model Types
1. Discriminative
Used to classify or predict
Typically trained on labelled dataset
Learns the relationship between the features of the data points and the
labels
Deep Learning Model Types
2. Generative
Generates new data that is similar to data it was trained on
Understands the distribution of the data and how likely a given example
is
Predicts next word in a sequence
Deep Learning Model Types
Predictive and Generative AI
What is Generative AI
What is Generative AI
A type of AI that creates new content based on what it has learned from
existing content

The process of learning from existing content is called training and results
in the creation of a statistical model

When given a prompt, GenAI uses this statistical model to predict what an
expected response might be

This generates new content


Generative Language Models
Generative Language Models learn about patterns in a language
through training data

Then given some text, they can predict what comes next

These are pattern matching systems


Artificial Intelligence
AI involves machines that can perform tasks that are characteristic of
human intelligence.

Machine learning is simply a way of achieving AI.

Deep learning is one of many approaches to machine learning


Artificial Intelligence
• AI is a computer algorithm which exhibits intelligence through decision
making

• ML is an AI algorithm which allows system to learn from data

• DL is a ML algorithm that uses deep(more than one layer) neural


networks to analyze data and provide output accordingly

• DL uses neural networks that have a large number of “hidden” layers to


identify features.
Types of AI
Two main types of AI:
1. Based on Functionality
a) Reactive Machines
b) Limited Theory
c) Theory of mind
d) Self-Aware AI
2. Based on Capabilities
a) Artificial Narrow Intelligence (ANI)
b) Artificial General Intelligence (AGI)
c) Artificial Super Intelligence (ASI)
What is an AI algorithm?
AI algorithms are a set of instructions or rules that enable machines to
learn, analyze data and make decisions based on that knowledge.
These algorithms can perform tasks that would typically require human
intelligence, such as
recognizing patterns,
understanding natural language,
problem-solving and
decision-making.
AI algorithms
It is important in any discussion of AI algorithms to also underscore the
value of the using the right data
Not so much the amount of data in the training of algorithms.
Applications
Input Output Applicatio
email spam?(1/0) Spam filtering
audio text Speech recognition
Shona Tonga Machine translation
Advert, user information click (0/1) Online advertising
Image, radar information position of other cars Self-driving car
Image of tyre defect? Visual inspection
Applications
Applications
Applications
Machine Learning
• Machine learning is divided into
• Supervised learning,
• Unsupervised learning,
• Reinforcement learning.

• Deep neural networks contribute to each of these areas


Machine Learning
In supervised learning, the algorithm is trained on labelled data, where
the desired output is known.

In unsupervised learning, the algorithm is trained on unlabelled data,


where the desired output is unknown.

In reinforcement learning, the algorithm learns by trial and error,


receiving feedback in the form of rewards or punishments.
Deep Learning
Types of AI algorithms
• 1. Supervised learning algorithms.
• the algorithm learns from a labelled data set, where the input data is
associated with the correct output.
• This approach is used for tasks such as classification and regression
problems such as linear regression, time-series regression and logistic
regression.
• Supervised learning is used in various applications, such as image
classification, speech recognition and sentiment analysis.
• Examples of supervised learning algorithms include decision trees,
support vector machines and neural networks
Types of AI algorithms
1. Supervised learning algorithms.
Types of AI algorithms
1. Supervised learning algorithms.
which means the training data has already been tagged with the
answers.

Solve non-numeric classification problems

and numeric regression problems.


Regression
Regression
predict a number
infinitely many possible outputs
Regression
Age and height of people
Classification
Classification
Prostate cancer
Malignant or benign tumour
What is the difference between classification and regression in AI?
Types of AI algorithms
1. Supervised learning algorithms.

- Implies that the data is already labelled

- Learning from past examples to predict future values

- Learn from being given the right answers


Regression and Classification problems
Regression and Classification problems
• a) This regression model takes a vector of numbers that characterize a
property and predicts its price.

• b) This multivariate regression model takes the structure of a


chemical molecule and predicts its melting and boiling points.

• c) This binary classification model takes a restaurant review and


classifies it as either positive or negative.
Regression and Classification problems
Regression and Classification problems
• d) This multiclass classification problem assigns a snippet of audio to
one of N genres.
• e) A second multiclass classification problem in which the model
classifies an image according to which of N possible objects that it
might contain.
Types of AI algorithms
2. Unsupervised learning algorithms.
In unsupervised learning, an area that is evolving quickly due in part to new generative
AI techniques,
Good for reducing dimensionality
Explores the data’s patterns and structure
the algorithm learns from an unlabelled data set by identifying
patterns,
groups of data
detecting outliers
correlations or
clusters within the data.
No indication of the malignant and benign

just asked to find something interesting from the data

No supervisor,

just asking the algorithm to detect any structures or patterns in the


data
e.g. clustering
Types of AI algorithms
2. Unsupervised learning algorithms.
e.g. Google News
Types of AI algorithms
2. Unsupervised learning algorithms.
Types of AI algorithms
2. Unsupervised learning algorithms.
Clustering takes a group of unlabeled data and tries to put them into
different clusters, depending on the parameters, e.g. preferences
• Unsupervised Learning data comes with input x without the output
label y
• Clustering – groups similar data together
• Anomaly detection – used to detect unusual events, unusual data
ppoints
• Dimensionality Reduction – compresses the data to a fewer points
than the original
Types of AI algorithms
2. Unsupervised learning algorithms.
• Constructing a model from input data without corresponding output
labels;
• the absence of output labels means there can be no “supervision.”
• rather than learning a mapping from input to output, the goal is to
describe or understand the structure of the data.
• the data may have very different characteristics;
• it may be discrete or continuous, low-dimensional or high-
dimensional, and of constant or variable length
Unsupervised learning algorithms
• the goal is to describe or understand
the structure of the data
Types of AI algorithms
2. Unsupervised learning algorithms.
Types of AI algorithms
2. Unsupervised learning algorithms.
Unsupervised problems are all about looking at raw data and seeing if it
naturally falls into groups
Unsupervised learning algorithms
Generative models
learn to synthesize new data examples that are statistically indistinguishable
from the training data
a) explicitly describe the probability distribution over the input domain,
new examples are generated by sampling from this distribution
b) learn a mechanism that generates new examples
can synthesize examples that are extremely plausible but distinct from the
training examples
have been particularly successfulat generating images and text
Unsupervised learning algorithms
Generative models
particularly successful at generating images

two images were generated from a model trained on pictures of cats


Unsupervised learning algorithms
Generative models
two images generated from a model trained on images of buildings.
Unsupervised learning algorithms
Generative models
Short story synthesized from a generative model of text data.

The model describes a probability distribution that assigns a probability


to every output string.

Sampling from the model creates strings that follow the statistics of the
training data but have never been seen before
Unsupervised learning algorithms
Generative models
can also synthesize data under the constraint that some outputs are
predetermined

conditional generation
e.g. image inpainting
text completion
Unsupervised learning algorithms
Generative models

In the original image there is obstruction by metal cables.


These undesirable regions are removed and
the generative model synthesizes a new image under the constraint that the remaining
pixels must stay the same.
Unsupervised learning algorithms
Generative models
I was a little nervous before my first lecture at the University of Zimbabwe. It seemed
like there were hundreds of students and they looked intimidating. I stepped up to
the lectern and was about to speak when something bizarre happened.
Suddenly, the room was filled with a deafening noise, like a giant roar. It was so loud
that I couldn’t hear anything else and I had to cover my ears. I could see the students
looking around, confused and frightened. Then, as quickly as it had started, the noise
stopped and the room was silent again. I stood there for a few moments, trying to
make sense of what had just happened. Then I realized that the students were all
staring at me, waiting for me to say something. I tried to think of something witty or
clever to say, but my mind was blank. So I just said, “Well, that was strange,’ and then
I started my lecture.
Unsupervised learning algorithms
Generative models
Latent variables
data can be lower dimensional than the raw number of observed
variables suggests
• the number of valid and meaningful English sentences is considerably
smaller than the number of strings created by drawing words at
random
• real-world images are a tiny subset of the images that can be created
by drawing random RGB values for every pixel
Unsupervised learning algorithms
Generative models
Latent variables
• leads to the idea that we can describe each data example using a
smaller number of underlying latent variables
• the role of deep learning is to describe the mapping between these
latent variables and the data
• latent variables typically have a simple probability distribution by design
• By sampling from this distribution and passing the result through the
deep learning model, we can create new samples
Unsupervised learning algorithms
Generative models
Latent variables
These models lead to new methods for manipulating real data.
Consider finding the latent variables that underpin two real examples.
We can interpolate between these examples by interpolating between
their latent representations
and mapping the intermediate positions back into the data space
Unsupervised learning algorithms
Image Interpolation
Unsupervised learning algorithms
Image Interpolation
In each row the left and right images are real
the three images in between represent a sequence of interpolations created
by a generative model.
The generative models that underpin these interpolations have learned that
all images can be created by a set of underlying latent variables.
By finding these variables for the two real images, interpolating their values,
and using these intermediate variables to create new images,
one can generate intermediate results that are both visually plausible and
mix the characteristics of the two original images
Types of AI algorithms
3 Reinforcement Learning
In the real world, have your deep learning model actually deployed
together with the data, out into reality,
Exploring, interacting with its environment,
Trying out different actions and different things in that environment, in
order to able to learn how to best perform any particular task

Typically we want this done without explicit human supervision


Types of AI algorithms
3 Reinforcement Learning
trains an actor or agent to respond to an environment in a way that
maximizes some value
usually by trial and error.
different from supervised and unsupervised learning, but is often
combined with them
has proven useful for training computers to play games and for training
robots to perform tasks.
Types of AI algorithms
3 Reinforcement Learning
Reinforcement Learning
The actions change the state of the system but not necessarily in a
deterministic way.
Taking an action can also produce rewards, and the goal of
reinforcement learningis for the agent to learn to choose actions that
lead to high rewards on average.
Reinforcement Learning
Complication
the reward may occur some time after the action is taken, so
associating a reward with an action is not straightforward

temporal credit assignment problem


Reinforcement Learning
As the agent learns, it must trade off exploration and exploitation of
what it already knows;
perhaps the agent has already learned how to receive modest rewards;
should it follow this strategy (exploit what it knows),
or should it try different actions to see if it can improve (explore other
opportunities)?
Reinforcement Learning
Playing Chase
the agent has a set of valid actions (chess moves) at any given time.
However, these actions change the state of the system in a non-deterministic way;
for any choice of action, the opposing player might respond with many different
moves.
we might set up a reward structure based on a) capturing pieces or b) just have a
single reward at the end of the game for winning.

In a) the temporal credit assignment problem is extreme;


the system must learn which of the many moves it made were instrumental to
success or failure.
Reinforcement Learning
Reinforcement Learning
Policy networks for reinforcement learning.
One way to incorporate deep neural networks into reinforcement
learning is to use them to define a mapping
from the state (position on chessboard)
to the actions (possible moves).
This mapping is known as a policy.
Types of AI algorithms
Notation
Types of AI Algorithms
AI algorithms can be broadly classified as:
1. Classification Algorithms
a) Naïve Bays
b) Decision Tree
c) Random Forest
d) Support Vector Machines
e) K Nearest Neibours
2. Regression Algorithms
a) Linear Regression
b) Logistic Regression
c) Multivariate Regression
d) Multiple Regression Algorithm
3. Clustering Algorithms
a) K-Means Clustering
b) Expectation Maximisation Algorithm
c) Hierarchical Clustering Algorithm
Types of AI Algorithms
Naïve Bays
Naive Bayes algorithm works on Bayes theorem and takes a probabilistic
approach
The algorithm has a set of prior probabilities for each class.
Once data is fed, the algorithm updates these probabilities to form
posterior probability.
This comes useful when you need to predict whether the input belongs
to a given list of classes or not.
The Naive Bayes algorithm is used in sentiment analysis,
recommendation, spam filtering, etc.
Types of AI Algorithms
Decision tree
• a non-parametric supervised learning method used for
both classification and regression.
• goal is to create a model that predicts the value of a target variable
by learning simple decision rules inferred from the data features.
• Decision trees are easy to interpret and cheap to deploy, but
computationally expensive to train and prone to overfitting.
Types of AI Algorithms
Random forest
• produces an ensemble of randomized decision trees, and is used for
both classification and regression.
• aggregated ensemble either combines the votes modally or averages
the probabilities from the decision trees
Types of AI Algorithms
Support vector machines (SVM)
• a kind of parametric classification model,
• a geometric way of separating and classifying two label classes.
• In the simplest case an SVM finds the straight line that best separates
the two groups of points on a plane.
• In more complicated cases, the points can be projected into a higher-
dimensional space and the SVM finds the plane or hyperplane that best
separates the classes.
• The projection is called a kernel, and the process is called the kernel
trick.
K – Nearest Neighbours
• KNN algorithm uses a bunch of data points segregated into classes to
predict the class of a new sample data point.
• Some of the applications of KNN is finance, medicine, such as bank
customer profiling, credit rating, etc.
• There are various advantages to using KNN such as easy to implement
and understand, also it is very simple and intuitive.
Types of AI Algorithms
Linear regression (least squares regression)
• the simplest supervised machine learning algorithm for predicting
numeric values.
• The assumption is that the objective function is linearly correlated
with the independent variables.
Types of AI Algorithms
Gradient descent
• Optimization methods for machine learning, including neural
networks, typically use some form of gradient descent algorithm to
drive the back propagation
• often with a mechanism to help avoid becoming stuck in local minima
Types of AI Algorithms
Logistic regression
• a method for solving categorical classification problems that uses
linear regression inside a sigmoid function, which compresses the
values to a range of 0 to 1 and gives a probability.
• Classification algorithm that find solutions to supervised learning
problems that ask for a choice (or determination of probability)
between two or more classes.
Types of AI Algorithms
K-means clustering
• attempts to divide n observations into k clusters using the Euclidean
distance metric, with the objective of minimizing the variance (sum of
squares) within each cluster.
• an unsupervised method of vector quantization, and is useful for
feature learning, and for providing a starting point for other
algorithms.
• relatively efficient, but doesn’t guarantee global convergence.
• assumes spherical clusters that are separable so that the mean
converges towards the cluster center,
Types of AI Algorithms
Expectation Maximisation Algorithm
• It is based on Gaussian distribution
• Data is pictured into a Gaussian distribution model to solve the problem.
• After assigning a probability, a point sample is calculated based on
expectation and maximization equations.
• The Expectation-Maximisation (EM) algorithm is used in those places
where there is a need to find a local maximum likelihood parameters of a
statistical model.
• It is also used in the places wherein the equations cannot be solved
directly.
Types of AI Algorithms
Principal component analysis (PCA)
• a statistical procedure that uses an orthogonal transformation to
convert a set of observations of possibly correlated numeric variables
into a set of values of linearly uncorrelated variables called principal
components.
• can be accomplished by eigenvalue decomposition of a data
covariance (or correlation) matrix, or singular value decomposition
(SVD) of a data matrix, usually after a normalization step applied to
the initial data.

You might also like