Artifical Intellegence
Artifical Intellegence
• If this value is less than the value currently stored replace this stored value by the new one that
has been calculated.
• If a new value has been stored enter the sequence of nodes used to obtain this value
Dijkstra’s algorithm
A* algorithm
• One of the disadvantages of Dijktra is that it has to visit every node
before it completes its job
• A* algorithm is based on Dijkstra, but adds an extra heuristic (h) value
– an ‘intelligent guess’ on how far we have to go to reach the
destination most efficiently.
• The use of heuristics means that we can find the shortest path between
two points much quicker than if we investigated EVERY pathway before
finding the shortest path
• The A* algorithm is a slight variation of Dijkstra’s algorithm which
makes use of heuristics to increase the algorithm’s effeciency
A* Algorithm
How can an Algorithm use heuristics?
Consider the following graph
Just like the previous graphs we have seen, the distances
between each node are clearly shown here
But what is also shown is the straight line distance from each
node to the destination node
A* Algorithm
• This additional information is what enables
A* algorithm to make use of heuristic
because this algorithm (as it visits each
node ) works out not only the distance
from start, but also the shortest possible to
the end node
• by considering both when comparing
possible pathways , we can often disregard
certain pathways because a node ‘s
shortest possible distance to the end node ,
may already be further than another path
A* Algorith
• Use the A* algorithm to work out the short route from A to F
1 create a queue of all nodes with starting at the front and add to
each their distance from the starting node, heuristic distance to the
end node
2 Remove the front node and add to the visited list along with its
distance from the start node
5 Repeat the steps above until all the nodes have been visited
( moved to the front and dropped down to the visited list)
A* Algorithm Use the A* algorithm to work out the short route from A to F
A B C D E F
G=0 G=∞ G=∞ G=∞ G=∞ G=∞
H=80 H=90 H=70 H=50 H=20 H=0
F=80 F=∞ F=∞ F=∞ F=∞ F=∞
C B D E F
G=25 G=210 G=∞ G=∞ G=∞
H=70 H=90 H=50 H=20 H=0
F=95 F=300 F=∞ F=∞ F=∞
B D E F
G=210 G=76 G=201 G=∞
H=90 H=50 H=20 H=0
F=300 F=126 F=221 F=∞
D E B F
G=76 G=201 G=210 G=∞
H=50 H=20 H=90 H=0
F=126 F=221 F=300 F=∞
D E B F
G=76 G=201 G=210 G=∞
H=50 H=20 H=90 H=0
F=126 F=221 F=300 F=∞
E B F
G=201 G=210 G=383 A=0 C=25 D=75 E=201 F=383
H=20 H=90 H=0
F=221 F=300 F=383
B F 386 is longer
G=210 G=383 so F remain
H=90 H=0
F=300 F=383
Artificial Intelligence (AI)
• shows the link between artificial intelligence (AI), machine learning and deep
learning.
• Deep learning is a subset of machine learning, which is itself a subset of AI.
Artificial intelligence,
machine
learning and deep learning
Artificial Intelligence (AI)
• shows the link between artificial intelligence (AI), machine learning and deep
learning.
• Deep learning is a subset of machine learning, which is itself a subset of AI.
Artificial Intelligence
• AI can be thought of as a machine with cognitive abilities such as problem solving and learning from
examples.
• All of these can be measured against human benchmarks such as reasoning, speech and sight.
• AI is often split into three categories.
• 1 Narrow AI is when a machine has superior performance to a human when doing one specific task.
• 2 General AI is when a machine is similar in its performance to a human in any intellectual task.
• 3 Strong AI is when a machine has superior performance to a human in many tasks
Artificial intelligence,
machine
learning and deep learning
Artificial Intelligence (AI)
• shows the link between artificial intelligence (AI), machine learning and deep
learning.
• Deep learning is a subset of machine learning, which is itself a subset of AI.
Artificial Intelligence
• AI can be thought of as a machine with cognitive abilities such as problem solving and learning from
examples.
• All of these can be measured against human benchmarks such as reasoning, speech and sight.
• AI is often split into three categories.
• 1 Narrow AI is when a machine has superior performance to a human when doing one specific task.
• 2 General AI is when a machine is similar in its performance to a human in any intellectual task.
• 3 Strong AI is when a machine has superior performance to a human in many tasks
Machine learning
• Machine learning is a subset of AI, in which the algorithms are
‘trained’ and learn from their past experiences and examples.
• The system can make predictions or even take decisions based on
previous scenarios.
• They can offer fast and accurate outcomes due to very powerful
processing capability
• One of the key factors is the ability to manage and analyse
considerable volumes of complex data
Machine learning
A good example is a search engine
The search engine will learn from its past performance, meaning its ability to carry out searches becomes
more sophisticated and accurate.
Labelled and unlabelled data
• Labelled data – data where we know the target answer and the data object is fully recognized
• Unlabelled data – data where objects are undefined and need to be manually recognised.
• Now, suppose you want to automatically count the types of birds seen in a bird sanctuary.
• The proposed system will consider bird features such as shape of beak, colour of feathers, body size, and so
on.
• This requires the use of labelled data to allow the birds to be recognised by the system
Labelled and unlabelled data
• Machine learning recognises the birds as labelled data, allowing it to be
trained.
• Once trained, it is able to recognise each type of bird from the original
data set.
• Algorithms are used to analyse the incoming data (by comparing it to bird
features already recognised by the model) and to learn from this data.
• Informed decisions are then made based on what it has learned.
• Thus, in this example, it is able to recognise new data and produce an
output automatically showing how many of each type of bird was
detected.
Types of machine learning
• There are a number of different types of
machine learning, including
supervised,
unsupervised learning,
reinforcement and
semi-supervised (active).
Supervised learning
• Systems are able to identify hidden patterns from the input data provided;
• they are not trained using the ‘right’ answer.
• By making data more readable and more organised, patterns, similarities
and anomalies will become evident (unsupervised learning makes use of
density estimation and k-mean clustering; in other words, it classifies
unlabelled real data).
• Algorithms evaluate the data to find any hidden patterns or structures
within the data set.
• An example is used in product marketing: a group of individuals with
similar purchasing behaviour are regarded as a single unit for promotions.
Reinforcement learning