0% found this document useful (0 votes)
3 views

Introduction to Prolog-Unit3

The document provides an introduction to Prolog and machine learning, detailing the structure of Prolog terms and the principles of reinforcement learning. It explains the elements of reinforcement learning, its applications, advantages, and disadvantages compared to supervised learning. The content emphasizes the decision-making aspect of reinforcement learning and its potential in complex problem-solving scenarios.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Introduction to Prolog-Unit3

The document provides an introduction to Prolog and machine learning, detailing the structure of Prolog terms and the principles of reinforcement learning. It explains the elements of reinforcement learning, its applications, advantages, and disadvantages compared to supervised learning. The content emphasizes the decision-making aspect of reinforcement learning and its potential in complex problem-solving scenarios.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Introduction to Prolog

All Prolog data structures are called terms. A term is either: A constant, A variable .
Complete Syntax of Terms

Term

Constant Compound Term Variable


Names an individual Names an individual Stands for an individual
that has parts unable to be named when
program is written
Atom Number likes(john, mary) X
alpha17 0 book(dickens, Z, cricket) Gross_pay
gross_pay 1 f(x) Diagnosis
john_smith 57 [1, 3, g(a), 7, 9] _257
dyspepsia 1.618 -(+(15, 17), t) _
+ 2.04e-27 15 + 17 - t
=/= -13.6
’12Q&A’
Compound Terms
The parents of Spot are Fido and Rover.

parents(spot, fido, rover)

Functor (an atom) of arity 3. components (any terms)

It is possible to depict the term as a tree:


parents

spot fido rover


Machine Learning
• Machine Learning is a branch of artificial intelligence that develops
algorithms by learning the hidden patterns of the datasets used it to make
predictions on new similar type data, without being explicitly programmed
for each task.
• Traditional Machine Learning combines data with statistical tools to predict
an output that can be used to make actionable insights.
• Machine learning is used in many different applications, from image and
speech recognition to natural language processing, recommendation
systems, fraud detection, portfolio optimization, automated task, and so on.
Machine learning models are also used to power autonomous vehicles,
drones, and robots, making them more intelligent and adaptable to changing
environments.
Types of machine learning
Reinforcement Learning
• Reinforcement Learning (RL) is the science of decision making. It is about learning the
optimal behavior in an environment to obtain maximum reward. In RL, the data is
accumulated from machine learning systems that use a trial-and-error method. Data is not
part of the input that we would find in supervised or unsupervised machine learning.
• Reinforcement learning uses algorithms that learn from outcomes and decide which action
to take next. After each action, the algorithm receives feedback that helps it determine
whether the choice it made was correct, neutral or incorrect. It is a good technique to use
for automated systems that have to make a lot of small decisions without human guidance.
• Reinforcement learning is an autonomous, self-teaching system that essentially learns by
trial and error. It performs actions with the aim of maximizing rewards, or in other words, it
is learning by doing in order to achieve the best outcomes.
• In reinforcement learning, the learner is a decision-making agent that takes actions in an
environment and receives reward (or penalty) for its actions in trying to solve a problem.
After a set of trial-and error runs, it should learn the best policy, which is the sequence of
actions that maximize the total reward.
Elements of Reinforcement Learning
• Policy: Policy defines the learning agent behavior for given time
period. It is a mapping from perceived states of the environment to
actions to be taken when in those states.
• Reward function: Reward function is used to define a goal in a
reinforcement learning problem.A reward function is a function that
provides a numerical score based on the state of the environment
• Value function: Value functions specify what is good in the long run.
The value of a state is the total amount of reward an agent can expect
to accumulate over the future, starting from that state.
• Model of the environment: Models are used for planning.
Difference between Reinforcement
learning and Supervised learning:
Reinforcement learning Supervised learning

Reinforcement learning is all about making decisions sequentially. In


simple words, we can say that the output depends on the state of the In Supervised learning, the decision is made on the initial input or the
current input and the next input depends on the output of the input given at the start
previous input

In Reinforcement learning decision is dependent, So we give labels to In supervised learning the decisions are independent of each other so
sequences of dependent decisions labels are given to each decision.

Example: Chess game,text summarization Example: Object recognition, spam detection


Application of Reinforcement Learnings

• 1. Robotics: Robots with pre-programmed behavior are useful in structured environments, such
as the assembly line of an automobile manufacturing plant, where the task is repetitive in
nature.

• 2. A master chess player makes a move. The choice is informed both by planning, anticipating
possible replies and counter replies.

• 3. An adaptive controller adjusts parameters of a petroleum refinery’s operation in real time.

RL can be used in large environments in the following situations:

• A model of the environment is known, but an analytic solution is not available;


• Only a simulation model of the environment is given (the subject of simulation-based
optimization)
• The only way to collect information about the environment is to interact with it.
Advantages of Reinforcement learning

• 1. Reinforcement learning can be used to solve very complex problems that cannot be solved
by conventional techniques.

• 2. The model can correct the errors that occurred during the training process.

• 3. In RL, training data is obtained via the direct interaction of the agent with the environment

• 4. Reinforcement learning can handle environments that are non-deterministic, meaning


that the outcomes of actions are not always predictable. This is useful in real-world
applications where the environment may change over time or is uncertain.
• 5. Reinforcement learning can be used to solve a wide range of problems, including those
that involve decision making, control, and optimization.
• 6. Reinforcement learning is a flexible approach that can be combined with other machine
learning techniques, such as deep learning, to improve performance.
Disadvantages of Reinforcement learning

• 1. Reinforcement learning is not preferable to use for solving simple problems.

• 2. Reinforcement learning needs a lot of data and a lot of computation

• 3. Reinforcement learning is highly dependent on the quality of the reward


function. If the reward function is poorly designed, the agent may not learn
the desired behavior.

• 4. Reinforcement learning can be difficult to debug and interpret. It is not


always clear why the agent is behaving in a certain way, which can make it
difficult to diagnose and fix problems.

You might also like