IT201 Basics of Intelligent Computing
Module -1 part-A
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Course Outcomes(COs)
After the completion of this course, students will be able to:
• CO1-Distinguish between different branches of AI
• CO2-Solve problems related to Fuzzy Logic and Design an FIS
system.
• CO3-Solve Optimization problems using GA.
• CO4-Design Simple ANN models
• CO5-Discuss Basics of Cloud Computing and IoT.
Assessment of COs
Module 1-Introduction
Things to discuss in Module-1
• Definition of Computing
• Types of Computing
• What is Intelligence?
• Necessity of Intelligent Computing
• Current Trends in Intelligent Computing
What is Computing?[1]
• Computing is any activity that uses computers to
manage, process, and communicate information.
• It includes development of both hardware and
software.
• Computing has become a critical, integral
component of modern industrial technology.
[1] https://en.wikipedia.org/wiki/Computing
Types of Computing Devices[2]
• Supercomputer.
• Mainframe.
• Server Computer.
• Workstation Computer.
• Personal Computer or PC.
• Microcontroller.
• Smartphone.
[2]https://en.wikiversity.org/wiki/Types_of_computers
What is Intelligence?
Definition(Merriam Webster):
• Capacity for Learning, Reasoning,
Understanding and similar forms of mental
activity.
• Aptitude in grasping truths,
relationships,facts ,meanings
https://en.wikipedia.org/wiki/Learning_pyramid
[1]https://www.youtube.com/watch?v=Pwy_f-Ke2hA
[2]https://www.practicereasoningtests.com/deductive-reasoning-questions/
[3] funwithpuzzles.com
[1]fibonicci.com
[2] https://www.slideserve.com/zack/reasoning
https://www.differencebetween.com/difference-between-facts-and-truths/
Facts and Truths
Comprehension
We talked about :Learning,Reasoning,Understanding and Now we talk about
Comprehension: Act of grasping truths, Capacity for understanding fully.
[1]https://slideplayer.com/slide/8597416/
[2] https://www.liveworksheets.com/
https://www.slideshare.net/logu73/introduction-to-ai-13559350
IT201 BIC
End of Lecture -1
Thank You
Email:kspatnaik@bitmesra.ac.in
IT201 Basics of Intelligent Computing
Module -1 part-A
(Lecture2)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Intelligent Computing /Computational Intelligence
• Can Computers be Intelligent?
1)In the mid-1900s, Alan Turing gave much thought to this question. He
believed that machines could be created that would mimic the processes of
the human brain.
2)In 1950 Turing published his test of computer intelligence, referred to as the
Turing test.
3)Computational Intelligence (CI) is the theory, design, application and
development of biologically and linguistically motivated computational
paradigms. Traditionally the three main pillars of CI have been Neural
Networks, Fuzzy Systems ,Evolutionary Computation.
[1]https://cis.ieee.org/about/what-is-ci
[2]Computational Intelligence: An Introduction, Second Edition A.P. Engelbrecht
2007 John Wiley & Sons, Ltd
[3] A. M. Turing (1950) Computing Machinery and Intelligence. Mind 49: 433-460.
Turing Test (1950)"Can Machine think?"
[1] https://www.javatpoint.com/turing-test-in-ai
[2] A. M. Turing (1950) Computing Machinery and Intelligence. Mind 49: 433-460.
Alan Turing
Turing test is used to determine” weather or not machines can think intelligently like Humans
Chinese Room Argument
• 1980-John Searle
[1]https://plato.stanford.edu/entries/chinese-room/
[2]Source: Wikicomms
Necessity of Intelligent Computing
• Intelligent systems are revolutionizing a variety of industries, including
transportation and logistics, security, and manufacturing.
• Intelligent systems are complex and use a wide range of technologies – artificial
intelligence, cybersecurity, natural language processing, deep learning, embedded
CPUs, distributed storage, wireless networking and graphical signaling.
[1]https://online.lewisu.edu/mscs/resources/what-are-intelligent-systems
Current Trends in Intelligent Computing
• A current trend in computing is for sure the Computer Data Security and
this is because computers are not only used in the office or at home but in
almost every field.
• Computers controls telephones, information on the Internet, distribution
of electrical power, monitors operations in nuclear power plants among
other very important applications; as it is mentioned by David Salomon in
his “Elements of Computer Security”
https://www.coursehero.com/file/17615788/Current-Trends-in-Computing
Computational Intelligence paradigms
[1]Computational Intelligence: An Introduction, Second Edition A.P. Engelbrecht 2007 John Wiley
& Sons, Ltd
Module 1-Part-B
Artificial Intelligence- Concepts
• Artificial intelligence (AI)(John McCarthy 1956)- is a
branch of computer science and engineering that deals with
intelligent behavior, learning, and adaptation in machines
[1]peace.saumag.edu › AIWashingtonMcKeeNelson.ppt.ppt
Birth of AI
AI Problems
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
[2]https://www.tutorialspoint.com/artificial_intelligence/artificial_intelligence_research_areas.htm
AI Problems Cont.
• People learn the mundane tasks first.
• The formal and expert tasks are the most
difficult to learn.
• AI is doing very well in the formal and expert
tasks; however it is doing very poorly in the
mundane tasks.
AI problems Cont.
• Much of the early work in the field focused on Formal tasks-game
playing and theorem proving.
• Samuel-Wrote checkers-playing program that not only played games
with opponents but also used its experience at those games to
improve its later performance. Chess also.
https://en.wikipedia.org/wiki/Arthur_Samuel
AI problems Cont.
• Logic Theorist is a computer program written in 1956 by Allen
Newell, Herbert A. Simon and Cliff Shaw.
• It was the first program deliberately engineered to mimic the
problem-solving techniques of a human being and is called "the
first artificial intelligence program".
https://en.wikipedia.org/wiki/Logic_Theorist
AI problems Cont.
• It was able to prove several theorems from the first
chapter of Whitehead and Russell’s Principia
Mathematica.
• Gelernter's theorem prover explored another area of
mathematics: geometry.
• Game playing and theorem proving share the property
that people who do them well are considered to be
displaying intelligence.
https://plato.stanford.edu/entries/principia-mathematica
To discuss:
• What are our underlying assumptions about
intelligence?
• What kind of techniques will be useful for solving AI
problems?
• At what level of detail, if at all, are we trying to
model human intelligence?
• How will we know when we have succeeded in
building an intelligent program?
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
The Underlying Assumption
Physical Symbol System Hypothesis:
A physical symbol system has the necessary and sufficient
means for general intelligence action.
A physical symbol system (formal system) takes physical
patterns (symbols), combining them into structures
(expressions) and manipulating them (using processes) to
produce new expressions.
http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
PSSH
• The physical symbol system hypothesis (PSSH) is a
position in the philosophy of artificial intelligence
formulated by Allen Newell and Herbert A. Simon.
• PSS consists of entities, called symbols, which are physical
patterns that can occur as components of another type of
entity called an expression(or symbol structure).
• The symbol structure is composed of number of
instances(tokens)of symbols related in some physical
way(such as one token being next to another)
http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
PSSH
• At any instance of time the system will contain a collection of these
symbol structure.
• Besides these structures,the system also contains a collection of
processes that operate on expressions to produce other
expressions.(processes of creation, modification, reproduction and
destruction) .
• A PSS is a machine that produces through time an evolving collection
of symbol structures.
http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
Examples of PSSH
• Formal Logic
• Algebra
• Digital Computer
• Chess
• Thoughts
• AI program
http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
PSS Hypothesis
• There is no way to prove/disprove on logical grounds.
• So it must be subject to empirical validation. (In science, empirical evidence is
required for a hypothesis to gain acceptance in the scientific community.
Normally, this validation is achieved by the scientific method of forming a
hypothesis, experimental design, peer review, reproduction of results,
conference presentation, and journal publication).
• Bulk of the evidence says that it is TRUE. But the only way to determine its
truth is by experimentation.
• Computers provide the perfect medium for this experimentation since they
can be programmed to simulate any PSS we like.
http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
PSS Hypothesis Cont.
• Influence of sub symbolic model(ANN) on symbolic ones.
• Importance of PSS Hypothesis:
• 1)Significant theory of the nature of human intelligence and is of
great interest to psychologists.
• 2)It also forms the basis of the belief that it is possible to build
programs that can perform intelligent tasks now performed by
people.
http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
End of Lecture 2
IT201 Basics of Intelligent Computing
Module -1 part-A and B
IT201 Basics of Intelligent Computing
Module -1 part-B
(Lecture-3)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
What is AI Technique?
Introductory Problem: Tic-Tac-Toe
Two Problems and series of
approaches for solving each of them
Program 1:
Data Structures:
 Board: 9 element vector representing the board, with 1-9 for each square. An
element contains the value 0 if it is blank, 1 if it is filled by X, or 2 if it is filled with
a O
 Movetable: A large vector of 19,683 elements ( 3^9), each element is 9-element
vector.
Algorithm:
1. View the vector as a ternary number. Convert it to a
decimal number.
2. Use the computed number as an index into
Move-Table and access the vector stored there.
3. Set the new board to that vector.
Comments:
This program is very efficient in time.
1. A lot of space to store the Move-Table.
2. A lot of work to specify all the entries in the
Move-Table.
3. Difficult to extend.
Program 2:
Data Structure: Board-A nine element vector representing the board. But instead of
using 0,1 and 2 in each element, we store 2 for blank, 3 for X and 5 for O.
Turn:An integer indicating which move of the game is about to be played;1 indicates
the first move and 9 the last
The Algorithm:
Make2: returns 5 if the centre square is blank(Board[5]=2. Else any other blank sq
Posswin(p): Returns 0 if the player p cannot win on his next move; otherwise it
returns the number of the square that constitutes a winning move. If the product
is 18 (3x3x2), then X can win. If the product is 50 ( 5x5x2) then O can win.
Go(n): Makes a move in the square n.This procedure sets Board[n] to 3 if turn is odd,or
5 if Turn is even.It also increments Turn by one.
Strategy:
Turn = 1 Go(1)
Turn = 2 If Board[5] is blank, Go(5), else Go(1)
Turn = 3 If Board[9] is blank, Go(9), else Go(3)
Turn = 4 If Posswin(X)  0, then Go(Posswin(X)){i.e block opponents win],else
Go(Make2)
.......
Comments:
1. Not efficient in time, as it has to check several
conditions before making each move.
2. Easier to understand the program’s strategy.
3. Hard to generalize.
Comments:
1. Require much more time to consider all
possible
moves.
2. Could be extended to handle more
complicated
games.
Question Answering
Russia massed troops on the Czech border.
The following question –answer dialogues might occur (in fact occur with
POLITICS)
Dailogue1
Q Why did Russia do this?
A Because Russia thought that it could take political control of Czech by
sending troops.
Q what should the US do?
A The US should intervene militarily.
Dialogue 2
Q Why did Russia do this?
A Because Russia wanted to increase its political
influence over Czech.
Q what should the US do?
A The US should denounce the Russia action in
the United Nations.
Mary went for a new coat.She found a red she really liked.When she got it
home,she discovered that it went perfectly with her favourite dress.
Q1What did Mary go shopping for?
Q2What did Mary find that she liked?
Q3Did Mary buy anything?
Program 1
Data structures:
Question patterns-Look for Templates and patterns
Ex If the template “Who did xy”(Input Question).
The text patterns “xyz”is matched against the input text and the value of z
is given as the answer to the question.
• Text The input text stored simply as a long character string.
• Question The current question also stored as a character string.
• The Algorithm:
• 1)Compare each element of QuestionPatterns against the question and
use all those that match successfully to generate a set of text patterns.
• 2)Pass each of these patterns through a substitution process that
generates alternative forms of verbs so that for example,”go”in a
question might match “went “in the text.This step generates a
new,expanded set of text patterns
3 Apply each of these text patterns to Text,and collect all the resulting
answers.
4 Reply with the set of answers just collected.
Example
Q1The template “what did xy”matches this question and generates the text
pattern”Marry go shopping for z”.
After the pattern – substitution step,expand to a set of patterns including
“Mary goes shopping for z”and “Marry went shopping for z”
Assign z “a new coat”.
Q2 Unless the template set is very large,allowing for the insertion of the
object of “find”between it and the modifying phrase”that she liked”.
The insertion of word “really” and the substition of “she” for “Marry”,this
question in unanswerable.
Q3 Since No answer to this question is contained in the text,so no answer
will be found.
Program 2
A Structured representation of a Sentence
(converts the input text into a structured internal form that captures the
meaning.It also converts questions into that form,it finds answers by
matching structural forms against each other)
Data structures
EnglishKnow
Input Text
StructureText
Input Question
StructQuestion
Algorithm
1Convert the question to structured form using knowledge in EnglishKnow
2Match this structured form against StructuredText.
3Return as the answer those parts of the text that match the requested
segment of the question.
A Structured Representation
Event2
Instance:Finding
Tense:Past
Agent:Mary
Object:Thing1
Thing1
Instance:Coat
Color:Red
Event2
Instance:Liking
Tense:Past
Modifier:Much
Object:Thing1
(Slot-and-filler structure)
AI Techniques
• Search
• Use of Knowledge
• Abstraction
To Build a system to solve a particular
problem:
Define the problem as state space
search
• Total Number of moves or board positions is
10^120(Shanon’s Number).
• Operationalization(Formal description from
informal ones)
Production Systems
Thank You
End of Lecture 3
IT201 Basics of Intelligent Computing
Module -1 part-B
(Lecture-3)
IT201 Basics of Intelligent Computing
Module -1 part-A
(Lecture 4)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Summary of Lecture 3
Game problems:
Tic-tac-toe(Problem1 using
movetable,problem2 using Algorithimic
procudures,problem2’(magic square)
Problem 3(minmax procedure)
Minmax procedure
Minmax procedure
(www.geeksforgeeks.org)
Assume that there are 2 possible ways for X to win the game from a give board state.
Move A : X can win in 2 move
Move B : X can win in 4 moves
Move A will have a value of +10 – 2 = 8
Move B will have a value of +10 – 4 = 6
(www.geeksforgeeks.org)
About minmax
• Problem 3 requires more time than either of the
problems(it must search a tree representing all
possible move sequences before making each
move).
• Superior to other programs, could be extended to
more complicated ones than tic tac toe.
• Generate moves from any initial state(helps in
creating knowledge base about games and how
to play them)
• Example of the use of AI technique.
Summary of Lecture 3
• Question Answering:(problem1)This program attempts
to answer questions using the literal input text.It
simply matches text fragments in the questions
against the input text.
• (problem2)uses structural representations.
• Important knowledge representation
systems(production rules, slot and filler structure,
statements in mathematical logic)
• (Problem3)uses tree structure(seeF ig1.3AI text
book)
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
We conclude That AI technique
requires:
• Search
• Use of Knowledge
• Abstraction
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
Problems,Problem Spaces and Search
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
Water-Jug Problem
Production Rules
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
One Solution to the Water Jug Problem
Galloons in the 4-Gallon
Jug
Gallons in the 3 –Gallon
Jug
Rule Applied
0 0
2
0 3
9
3 0
2
3 3
7
4 2
5or12
0 2
9or 11
2 0
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
Control Strategies
• First requirement-It causes motion.
• Second requirement-Systematic(global motion and local
motion)
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
Depth-first and Breadth-first Search
O(𝒃𝒅
), 𝒃 = 𝒃𝒓𝒂𝒏𝒄𝒉𝒊𝒏𝒈 𝒇𝒂𝒄𝒕𝒐𝒓, 𝒅 = 𝒅𝒆𝒑𝒕𝒉
https://medium.com/basecs/breaking-down-breadth-first-search-cebe696709d9
Water Jug Problem
https://www.ques10.com/p/30407/explain-water-jug-problem-with-state-space-search-/
Differences
BFS(Queue Data Structure,FIFO),DFS(Stack Data Structure,LIFO)
More Differences(BFS VsDFS)
https://www.tutorialspoint.com/difference-between-bfs-and-dfs
End of lecture 4
Thank you
IT201 Basics of Intelligent Computing
Module -1 part-A
(Lecture 5)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Heuristic Search
• An uninformed search(Brute Force/Blind search) is a
searching technique that has no additional information
about the distance from the current state to the goal.Ex
DFS,BFS(gives optimal solution)
• Informed Search(Heuristic search/Rule of thumb) is
another technique that has additional information about
the estimate distance from the current state to the
goal.Ex,BestFirstSearch,HDFS,A*Algorithm.
• Heuristics are like Tour Guides(gives solution may be
optimal or may not be)
https://techdifferences.com/difference-between-informed-and-uninformed-
search.html
Heuristic Function
• A heuristic function,h(n), provides an estimate of the cost of
the path from a given node to the closest goal state.Must be
zero if node represents a goal state.-Example: Straight-line
distance from current location to the goal location in a road
navigation problem.
• Let us solve a 8-puzzle problem with Heuristic(Informed
Search).
https://www.cs.utexas.edu/~mooney/cs343/slide-handouts/heuristic-search.4.pdf
https://blog.goodaudience.com/solving-8-puzzle-using-a-algorithm-7b509c331288
Search Strategies
• DFS
• BFS
• Generate-and-Test
• Best-first search
• Problem reduction
• Constraint satisfaction
• Means-ends analysis
Generate and Test
• Heuristic search,DFS with backtracking
Steps: 1-Generate a possible solution
2-Test to see if this is a actual solution
3-If the solution is found,quit,otherwise go to
step-1
Properties of generator:Complete,Non
Redundant,Informed
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
Example
https://artint.info/2e/html/ArtInt2e.Ch4.S2.html
Best First Search
• (Informed,heuristic,gives good solution,may be optimal or may not be)
Algorithm: Let OPEN be a priority QUEUE containing initial state
LOOP
If OPEN is empty return failure
Node<- Remove-First(OPEN)
• If node is goal
• Then return the path from initial to Node
• Else
• Generate all successors of Node and
• Put the newly generated Node into OPEN
• According to their f values
• END LOOP
Example1
A
B
C
D
32
25
35
E
F
19
17
G 0
A->C->F->G
Edges in Fig indicates
cost
Example2
• S=13,A=12,B=4,C=7,D=3,E=8,F=2,H=4,I=9,G=0
Ans-SBFG
End of Lecture 5
Thank You
IT201 Basics of Intelligent Computing
Module -1 part-A
(Lecture 6)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Best First Search
1)DFS +BFS=Best First Search
2)f(n)=Actual cost and h(n)=Heuristic cost
3)In the previous example 1
F(n)=44
H(n)=ADFG=42
H(n)<=f(n)
• Greedy Best First Search: h(n){carries
additional information required for the search
algorithm} hence it is estimated cost of the
cheapest path from current node n to the goal
node.
• Best First Search:f(n){evaluation function}
• GBFS is better than BFS
Solve using BFS
http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,-
Disadvantages_8881/
http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,-
Disadvantages_8881/
http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,-
Disadvantages_8881/
http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,-
Disadvantages_8881/
http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,-
Disadvantages_8881/
Cont. BFS
• Inside queue-open list(Read)
• Outside queue-closed list(Read and expand)
• The Best first search allows us to switch
between paths by gaining the benefits of both
breadth first and depth first search.
• Because, depth first is good because a
solution can be found without computing all
nodes and Breadth first search is good
because it does not get trapped in dead ends.
http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,-
Disadvantages_8881/
A* Algorithm (*(admissible))
• f(n)=g(n)+h(n),g(n)=actual cost from start
node to n,h(n)=estimated cost from n to goal
node
https://www.mygreatlearning.com/blog/a-search-algorithm-in-artificial-intelligence/
https://www.mygreatlearning.com/blog/a-search-algorithm-in-artificial-intelligence/
https://www.mygreatlearning.com/blog/a-search-algorithm-in-artificial-intelligence/
https://www.mygreatlearning.com/blog/a-search-algorithm-in-artificial-intelligence/
Use A* to find the optimal cost and
path
End of Lecture 6
Thank You
IT201 Basics of Intelligent Computing
Module -1 part-A
(Lecture 7)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
A*Algorithm
(over and underestimate)
1)Underestimation leads to optimal solution(Admissible)
How to make A* Admissible?
h(n)≤h*(n)
Underestimation,h(n)(estimated),h*(n)(actual or
optimal)
h(n)≥h*(n) Overestimation,
We Know in A*,f(n)=g(n)+h(n)
g(A)=200 and g(B)=200
Consider CASE-I (Overestimation)
Let h(A)=80 and h(B)=70,both are ≥h*(n)
Find f(A),f(A)=g(A)+h(A)=200+80=280
Find f(B),f(B)=g(B)+h(B)=200+70=270
Find f(G),f(G)=g(G)+h(G)=200+50+0=250(through B)
https://www.youtube.com/watch?v=xz1Nq6cZejI
S
B
G
A
280 270
250
Case-II Underestimation
g(A)=200 and g(B)=200
Let h(A)=30 and h(B)=20,both are ≤h*(n)
Find f(A),f(A)=g(A)+h(A)=200+30=230
Find f(B),f(B)=g(B)+h(B)=200+20=220
Find f(G),f(G)=g(G)+h(G)=200+50+0=250through B
Since A has 230<250,the algo explores A G also
F(G)= 200+40=240 through A (optimal solution )
S
B
G
A
230 220
250
240
Student Exercise
• AO* Algorithm
• Hill Climbing(Local search, Greedy approach,
no backtracking)
Knowledge Base Creation
1)In order to solve the complex problems encountered in AI ,one
needs both a large amount of knowledge(Facts) and some
mechanisms for manipulating that knowledge to create solutions
to new problems.
a)Facts: Truths in some relevant world. These are the things we
want to represent.
b)Representations of facts in some chosen form. These are the
things we actually be able to manupulate.
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawHills,2009
Mapping between Facts and Representations
Dog is an animal(english)
Dog(animal)(logical)
All animals have legs(english)
⩝ 𝑥: 𝑎𝑛𝑖𝑚𝑎𝑙 𝑥 → 𝑙𝑒𝑔𝑠 𝑥
Legs(dog) (logical )
dog has legs(english)
[1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawHills,2009
Fig .Representation of Facts
Abstract type
Concrete implementation
Knowledge Representation Techniques
https://www.edureka.co/blog/knowledge-representation-in-ai/
script
propositional
predicate
googleGraph
If then
Slots and fillers
Improper representation of knowledge
Syntax error
Semantic error
objects attributes
Propositional Logic
• Proposition means sentence/statement(Not all statements are propositions)
• Logic means reasoning
• Statement may be True or False but not Both
Ex… 10+10=20 True,3X 3=9 True,7-6=2 False
Some ECE students are intelligent True/False Not a part of propositional logic
Sun rises in the east True
Propositional logic
Semantic
Syntax
Complex
Atomic
Single Proposition
(Two or more propositions combine)
¬ Negation
˅ Disjunction
˄ Conjunction
→ If then
↔iff
https://study.com/academy/lesson/propositional-logic-algorithms-definition-types.html
https://pt.slideshare.net/ersaranya/propositional-logic-inference-21191950/19
Examples of Propositional logic
https://www.youtube.com/watch?v=qV4htTfow-E
https://www.cs.sfu.ca/~ggbaker/zju/math/logic.html
If then(conditional) and Biconditional
https://www.cs.sfu.ca/~ggbaker/zju/math/logic.html
Pros and Cons of Propositional logic
• Propositional logic is declarative.
• Allow partial/disjunctive/negated information
• It is compositional.
• Meaning of A˄B is derived from the meaning of A and B.
• Meaning of propositional logic is context independent
• Has limited expressive power.
Limitations: Ex”all humans are mortal”, In propositional logic we
require billions of statements .similarly “some people can read “.
https://www.ics.uci.edu/~kkask/Fall-2018%20CS271/slides/07-predicate-logic-I.pdf
Predicate Logic(FOL(First Order Logic))
• Propositional logic assumes the world contains facts.
• FOL(like Natural language) assumes the world contains:
• Objects-people,houses,colors, desk, tables, baseball games,…
• Relations-red,bigger than,part of, comes between,…
• Function relations-father of,best friend,one more than,plus,…
FOL contains subject and predicate. Ex.
“X is an integer” Bunny is a dog
Mathematically-
dog(x)-x is a dog,
dog(bunny).
tony is a dog,
Int(x)-x is an integer, If y is an integer dog(tony)
Int(y)
subject predicate
https://www.ics.uci.edu/~kkask/Fall-2018%20CS271/slides/07-predicate-logic-I.pdf
Predicate Logic(FOL)
If subject is not single and become group then
Ex-some dogs are intelligent (instead of dog is intelligent)
-Every dog drinks milk, x
x1,x2,x3 are different dogs
UoD*(domain)
X1 drinks milk ,milk(x1) every
˄ (and)
X2 drinks milk ,milk(x2) ⩝x:milk(x),Every x has
property of milk(x)
˄(and)
X3 drink milk, milk(x3)
dogs
*universe of discourse
Predicate Logic(FOL)
• Some dogs are intelligent.
“d1 is intelligent” v(OR) “d2 is intelligent “v (OR)“d3 is intelligent". If d1 is
true then all are true.
∃𝑥: 𝑖𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡(𝑥)
There exists at least one dog that is intelligent.
Now,Change the UoD from dogs to animals
⩝x,milk(x),is not valid ,
If a1 is a dog, then it drinks milk
˅
If a2 is a dog,then it drinks milk
˅
If a2 is a dog,then it drinks milk ⩝x:dog(x)→milk(x)
dog(a1)→milk(a1)
dog(a2)→milk(a2)
dog(a3)→milk(a3)
dogs
d1
d2
d3
animals
a3
a2
a1
Predicate Logic(FOL)
some dogs are intelligent. ∃𝑥: 𝑖𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡(𝑥)
If the UoD changes to animals
∃𝑥: 𝑑𝑜𝑔(𝑥)˄𝑖𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡(𝑥)
Example: 1)Every Student in this ECEclass has visited USA or UK
⩝x:student(x)→viUSA(x) ˅ viUK(x)
2)Some prime number is odd number.
∃𝑥: 𝑝𝑟𝑖𝑚𝑒𝑛𝑢𝑚𝑏𝑒𝑟(𝑥)˄𝑜𝑑𝑑𝑛𝑢𝑚𝑏𝑒𝑟(𝑥)
animals
a1
a2
a3
2 variable Predicate
loves(x,y)- x loves y
John loves Marry-loves(John, Marry)
John loves everyone- ⩝x: likes(John, x)
Everyone loves everyone- ⩝y ⩝x: likes( y,x)
Someone likes someone- ∃𝑥 ∃𝑦: 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑦), john likes someone-∃𝑦: 𝑙𝑖𝑘𝑒𝑠(𝑗𝑜ℎ𝑛, 𝑦)
Someone likes everyone- ∃𝑦 :[⩝x: 𝑙𝑖𝑘𝑒𝑠(𝑦, 𝑥)],john likes everyone-⩝x: likes(John, x)
Everyone likes someone-⩝x: ∃𝑦: 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑦)
Nobody likes everyone- lets us see- john doesn't like everyone- ¬ [⩝x likes(john,x)]
⩝y[ ¬ [⩝x likes(y,x)]]
Marcus was a man- man(marcus)
All Pompeians were Romans- ⩝x:Pompeians(x)→Roman(x)
All romans were either loyal to Caesar or hated him-
⩝x:Roman(x)→[(loyalto(x,Caesar)˅ hate(x,Caesar))˄ ¬(loyalto(x,Caesar)˅
hate(x,Caesar))]
https://www.youtube.com/watch?v=2juspgYR7as
Exercises
Gold and Silver ornaments are precious.
Given:
G(x) :x is a gold ornament.
S(x):x is a silver ornament
P(x):x is precious.
Ans-⩝x(G(x)˅S(x)→p(x))
Every teacher is liked by some student
⩝x:*Teacher(x)→ ∃𝑦:student(y)˄likes(y,x)]
Some boys in the class are taller than all the girls
∃x *boys(x) ˄ ⩝y[girls(y)→taller(y,x)]]
https://www.youtube.com/watch?v=xR2YzdGzf9k,GATE,CSE-2009,2005,2004
End of Lecture 7
Thank You
IT201 Basics of Intelligent Computing
Module -1 part-A
(Lecture 8)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Intelligent Agents
In artificial intelligence, an intelligent agent (IA) refers to an
autonomous entity which acts, directing its activity towards
achieving goals (i.e. it is an agent), upon an environment using
observation through sensors and consequent actuators .
https://mc.ai/quarantine-intelligent-agents-and-vacuum-cleaner/
https://www.researchgate.net/publication/333907788_Multi-agent_Systems_Applied_to_Knowledge_Assessment/figures?lo=1
https://www.educba.com/intelligent-agents/
Simple Reflex Agent
• They have very low intelligence capability as they don’t have
the ability to store past state.
• These type of agents respond to events based on pre-defined
rules which are pre-programmed.
• They perform well only when the environment is fully
observable.
https://www.educba.com/intelligent-agents/
https://www.researchgate.net/publication/276019253_Scheduling_Reputation_Maintenance_in_Agent-
based_Communities_Using_Game_Theory/figures?lo=1&utm_source=google&utm_medium=organic
Model Based Agents
(Model Based Reflex Agents)
• It is an advanced version of the Simple Reflex agent. Like
Simple Reflex Agents, it can also respond to events based on
the pre-defined conditions, on top of that it also has the
capability to store the internal state (past information) based
on previous events.
• Model-In order to perform any action, it relies on both
internal state and current percept. Based Agents updates the
internal state at each step.
• In order to perform any action, it relies on both internal state
and current percept.
• However, it is almost next to impossible to find the exact state
when dealing with a partially observable environment.
https://www.educba.com/intelligent-agents/
https://www.ques10.com/p/30196/explain-model-based-reflex-agent/
Goal Based and Utility Agents
• The action taken by these agents depends on the distance
from their goal (Desired Situation). The actions are intended
to reduce the distance between the current state and the
desired state.
• In order to attain its goal, it makes use of the search and
planning algorithm.
• One drawback of Goal-Based Agents is that they don’t always
select the most optimized path to reach the final goal.
• The action taken by these agents depends on the end
objective so they are called Utility Agent.
• Utility Agents are used when there are multiple solutions to a
problem and the best possible alternative has to be chosen.
• They perform a cost-benefit analysis of each solution and
select the one which can achieve the goal in minimum cost.
https://www.educba.com/intelligent-agents/
Learning Agents
• Learning Agents have learning abilities so they can
learn from their past experiences.
• These types of agents can start from scratch and over
time can acquire significant knowledge from their
environment.
• The learning agents have four major components
which enable it to learn from its past
experience.(Critic,learning elements,performance
element,Problem generator.
https://www.educba.com/intelligent-agents/
Classification of AI
https://techvidvan.com/tutorials/artificial-intelligence-and-machine-learning/
Classification of AI
• Weak AI-able to solve just a few predefined problem setsAn
example of Weak AI can be voice assistants like SIRI. It has a
limited range and capability.
• General AI:If the productivity of the system is equivalent to
that of a human, it is General AI.Ex IBM WATSON.
• Super AI:When the productivity of the system is more than
that of a human. This type of technology is not yet developed.
• Reactive Machines:This is one of the fundamental types of AI.
It doesn’t have past memory and can’t use past data to data
for future activities. Model:- IBM chess program that beat
Garry Kasparov during the 1990s.
https://techvidvan.com/tutorials/artificial-intelligence-and-machine-learning/
Classification of AI
• Limited Memory-Modern day AI frameworks are capable of
using past encounters to educate future choices. A portion of
the dynamic capacities in self-driving vehicles have been
planned along these lines. Perceptions used to advise
activities occurring not long from now, for example, automatic
lane switching of vehicles.
• Theory of Mind-This sort of AI ought to have the option to
comprehend individuals’ feelings, convictions, considerations,
desires. They have the option to collaborate socially, however,
a ton of upgrades are there in this field. This sort of AI isn’t
finished at this point.
https://techvidvan.com/tutorials/artificial-intelligence-and-machine-learning/
Classification of AI
• Self awareness -An AI that has it’s own cognizant, incredibly
smart, mindfulness, and aware (In straightforward words a
total person). Obviously, this sort of bot likewise doesn’t exist,
and whenever accomplished it will be one of the
achievements in the field of AI.
• Examples of AI-
• SIRI
• Autopilot
• NetFlix
End of Lecture 8
Enjoy This
https://www.youtube.com/watch?v=wFOrkJuqSiY
https://www.amazon.com/b?ie=UTF8&node=16008589011
Thank You
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 9)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
What is Soft Computing?
• The idea behind soft computing is to model
cognitive behavior of human mind.
• Soft computing is foundation of conceptual
intelligence in machines.
• Unlike hard computing , Soft computing is
tolerant of imprecision, uncertainty, partial
truth, and approximation.
Hard Vs Soft Computing Paradigms
∙ Hard computing
− Based on the concept of precise modeling and analyzing
to yield accurate results.
− Works well for simple problems, but is bound by the
NP-Complete set.
∙ Soft computing
− Aims to surmount NP-complete problems.
− Uses inexact methods to give useful but inexact answers
to intractable problems.
− Represents a significant paradigm shift in the aims of
computing - a shift which reflects the human mind.
− Tolerant to imprecision, uncertainty, partial truth, and
approximation.
− Well suited for real world problems where ideal models
are not available.
• Can all computational problems be solved by a computer?
• There are computational problems that can not be solved by algorithms
even with unlimited time.
• For example Turing Halting problem (Given a program and an input,
whether the program will eventually halt when run with that input, or will
run forever)
• Alan Turing proved that general algorithm to solve the halting problem for
all for all possible program-input pairs cannot exist
• A key part of the proof is, Turing machine was used as a mathematical
definition of a computer and program (Source Halting Problem).
• NP complete problems are problems whose status is unknown.
• No polynomial time algorithm has yet been discovered for any NP
complete problem, nor has anybody yet been able to prove that no
polynomial-time algorithm exist for any of them.
• The interesting part is, if any one of the NP complete problems can be
solved in polynomial time, then all of them can be solved.
• P is set of problems that can be solved by a
deterministic Turing machine in Polynomial time.
• NP is set of decision problems that can be solved
by a Non-deterministic Turing Machine in
Polynomial time.
• P is subset of NP (any problem that can be solved
by deterministic machine in polynomial time can
also be solved by non-deterministic machine in
polynomial time).
What are NP, P, NP-complete and NP-
Hard problems?
• NP-complete problems are the hardest problems in NP set. A
decision problem L is NP-complete if:
• 1) L is in NP (Any given solution for NP-complete problems can
be verified quickly, but there is no efficient known solution)
• 2) Every problem in NP is reducible to L in polynomial time
• A problem is NP-Hard if it follows property 2 mentioned
above, doesn’t need to follow property 1. Therefore, NP-
Complete set is also a subset of NP-Hard set
Hard Computing Soft Computing
Conventional computing requires a
precisely stated analytical model.
Soft computing is tolerant of
imprecision.
Often requires a lot of computation time. Can solve some real world problems in
reasonably less time.
Not suited for real world problems for
which ideal model is not present.
Suitable for real world problems.
It requires full truth Can work with partial truth
It is precise and accurate Imprecise.
High cost for solution Low cost for solution
Difference b /w Soft and Hard
Computing
Unique Features of Soft Computing
• Soft Computing is an approach for constructing
systems which are
− computationally intelligent,
− possess human like expertise in particular domain,
− can adapt to the changing environment and can learn
to do better
− can explain their decisions
Components of Soft Computing
∙ Components of soft computing include:
− Fuzzy Logic (FL)
− Evolutionary Computation (EC) - based on the
origin of the species
 Genetic Algorithm
Swarm Intelligence
 Ant Colony Optimizations
− Neural Network (NN)
− Machine Learning (ML)
 AI: predicate logic and symbol
manipulation techniques
User
Interface
Inference
Engine
Explanation
Facility
Knowledge
Acquisition
KB: •Fact
•rules
Global
Database
Knowledge
Engineer
Human
Expert
Question
Response
Expert Systems
User
ANN
Learning and
adaptation
Fuzzy Set Theory
Knowledge representation
Via
Fuzzy if-then RULE
Genetic Algorithms
Systematic
Random Search
AI
Symbolic
Manipulation
https://slideplayer.com/slide/7488659/
cat
cut
knowledge
Animal? cat
Neural character
recognition
 Conventional AI:
◦ Focuses on attempt to mimic human
intelligent behavior by expressing it in
language forms or symbolic rules
◦ Manipulates symbols on the assumption
that such behavior can be stored in
symbolically structured knowledge bases
(physical symbol system hypothesis)
 Intelligent Systems
Sensing Devices
(Vision)
Natural
Language
Processor
Mechanical
Devices
Perceptions
Actions
Task
Generator
Knowledge
Handler
Data
Handler Knowledge
Base
Machine
Learning
Inferencing
(Reasoning)
Planning
9/8/2020 20
• The real world problems are pervasively
imprecise and uncertain
• Precision and certainty carry a cost
• Some problems may not even have any precise
solution
• may not even have any precise solutions
Premises of Soft Computing
9/8/2020 21
The guiding principle of soft computing is:
•Exploit the tolerance for imprecision,
uncertainty, partial truth, and approximation
to achieve non-conventional solutions,
tractability (easily handled, managed, or
controlled), robustness and low costs.
Guiding Principle of Soft Computing
9/8/2020 22
Hard Computing
•Premises and guiding principles of Hard Computing
are
- Precision, Certainty, and Rigor.
• Many contemporary problems do not lend
themselves to precise solutions such as
- Recognition problems (handwriting, speech,
objects, images, texts)
- Mobile robot coordination, forecasting,
combinatorial problems etc.
- Reasoning on natural languages
• The man is about eighty to eighty five years
old(pure imprecision)
• The man is very old(imprecision and
vagueness)
• The man is probably from India(uncertainty)
9/8/2020 24
•Soft computing employs ANN, EC, FL etc, in a
complementary rather than a competitive way.
• One example of a particularly effective
combination is "neurofuzzy systems.”
• Such systems are becoming increasingly visible
as consumer products ranging from air
conditioners and washing machines to
photocopiers, camcorders and many industrial
applications.
Implications of Soft Computing
9/8/2020 25
Unique Property of Soft computing
• Learning from experimental data  generalization
• Soft computing techniques derive their power of
generalization from approximating or interpolating
to produce outputs from previously unseen inputs
by using outputs from previous learned inputs
• Generalization is usually done in a high
dimensional space.
9/8/2020 26
• Handwriting recognition
• Automotive systems and manufacturing
• Image processing and data compression
• Architecture
• Decision-support systems
• Data Mining
• Power systems
• Control Systems
Current Applications using Soft
Computing
End of Lecture 9
Thank You
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 10)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
 What is fuzzy thinking
◦ Experts rely on common sense when they solve
the problems
◦ How can we represent expert knowledge that
uses vague and ambiguous terms in a computer
◦ Fuzzy logic is not logic that is fuzzy but logic that
is used to describe the fuzziness. Fuzzy logic is
the theory of fuzzy sets, set that calibrate the
vagueness.
◦ Fuzzy logic is based on the idea that all things
admit of degrees. Temperature, height, speed,
distance, beauty – all come on a sliding scale.
Jim is tall guy
It is really very hot today
 Communication of “fuzzy “ idea
This box is
too heavy.. Therefore, we need
a lighter one…
 Boolean logic
◦ Uses sharp distinctions. It forces us to
draw a line between a members of class
and non members.
 Fuzzy logic
◦ Reflects how people think. It attempt to
model our senses of words, our decision
making and our common sense -> more
human and intelligent systems
 Prof. Lotfi Zadeh
 Classical Set vs Fuzzy set
 Classical Set vs Fuzzy set
1
0
175 Height(cm)
1
0
175 Height(cm)
Universe of discourse
Membership value Membership value
 Classical Set vs Fuzzy set







A
x
A
x
x
f
X
x
f A
A
if
,
0
if
,
1
)
(
where
},
1
,
0
{
:
)
(
Let X be the universe of discourse and its elements be denoted as x.
In the classical set theory, crisp set A of X is defined as function fA(x) called the
the characteristic function of A
In the fuzzy theory, fuzzy set A of universe of discourse X is defined by function
called the membership function of set A
)
(x
A

.
in
partly
is
if
1
)
(
0
;
in
not
is
if
0
)
(
;
in
totally
is
if
1
)
(
],
1
,
0
[
:
)
(
A
x
x
A
x
x
A
x
x
where
X
x
A
A
A
A









9
 An example:
◦ Define the seven levels of education:
10
Highly educated
(0.8)
Very highly
educated (0.5)
 Several fuzzy sets representing linguistic concepts such as low,
medium, high, and so one are often employed to define states of a
variable. Such a variable is usually called a fuzzy variable.
 For example:
11
 Given a universal set X, a fuzzy set is defined by a
function of the form
This kind of fuzzy sets are called ordinary fuzzy
sets(type 1 fuzzy set).
L-fuzzy set is ,
L is partial order set
 Interval-valued fuzzy sets:
◦ The membership functions of ordinary fuzzy sets are often
overly precise. We may be able to identify appropriate
membership functions only approximately.
◦ .
]
1
,
0
[
: 
X
A
12
:
A X L

• Interval-valued fuzzy sets: a fuzzy set whose
membership functions does not assign to each
element of the universal set one real number, but a
closed interval of real numbers between the
identified lower and upper bounds.
]),
1
,
0
([
: 

X
A
15
 Fuzzy sets of type 2:
◦ : the set of all ordinary fuzzy sets that can be defined
with the universal set [0,1].
◦ is also called a fuzzy power set of [0,1].
16
 Discussions:
◦ The primary disadvantage of interval-value fuzzy sets,
compared with ordinary fuzzy sets, is computationally
more demanding.
◦ The computational demands for dealing with fuzzy sets
of type 2 are even greater then those for dealing with
interval-valued fuzzy sets.
◦ This is the primary reason why the fuzzy sets of type 2
have almost never been utilized in any applications.
17
Fuzzy set-type 2
• Let Set A=“adult”. The MF of this set maps the
entire range of ‘age’ to ‘infant’, ’young’, ’adult’
,’senior’.
• The values of MFs for ‘infant’, ’young’etc are
FSs.Thus set ‘adult’ is type-2 FS. The sets
‘infant’, ’young’, and so on are type-1 FS.
If the values of MF of ‘infant’, ’young’ and so on
are type -2 ,the set ‘adult ‘is ……….
• Leve-2 FS
FS ‘x closer to r’,x: fuzzy variable,r:a
particular number,Ex 5
Level-3 FS
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
End of Lecture 10
Thank You(Tribute to LA Zadeh)
Born
Lotfi Aliasker Zadeh
February 4, 1921
Baku, Azerbaijan SSR
Died
September 6, 2017 (aged 96)
Berkeley, California,
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 11)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Typical MFs
Triangular MF
(Ex ‘young’)20,25,30{correction-
Trapezoidal
(neither so high nor so slow)
Gaussian MF(m=center,Sigma=width)
Ex:’young’,m=22
Some Definitions
• Find: support,core,crossover point,
alpha cut(0.7) of A
Magnitude of FS
Cardinality
Relative Cardinality
Properties
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
End of Lecture 11
Thank You
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 12)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Maxmin and Maxproduct composition
• E=Complete Relation, O=Null Relation
Crisp Equivalence Relation
• Let R1 is a Tolerance Relation
• R1 can become equivalence relation through
one composition R1oR1
Fig3.5
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
End of Lecture 12
Thank You
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 13)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Fuzzy Number
Extension principle
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
End of Lecture 13
Thank You
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 14)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
• Principle of incompatibility: As the complexity of the system increases, our ability
to make precise and yet significant statements about its behaviour diminishes until
a threshold is reached beyond which a precision and significance become almost
mutually exclusive characteristics.
• Syntactic rule: refers to the way the linguistic
values in the term set T(age) are generated.
• Semantic rule: defines the MFs of each
linguistic value of the term set.
•
• Assume:very=too, extremely=vary very very
• INT
• A coupled with B
• A entails B
Propositional logic(modus ponens)
• w the degree of belief for the antecedent part of
a rule,gets propagated by the if-then rules and
the resulting degree of belief or MF for the
consequent part should be no greater than w
Graphic interpretation of GMP using Mamdani Fuzzy implication
and the max-min composition
Theorem
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
End of Lecture 14
Thank You(Tribute to LA Zadeh)
Born
Lotfi Aliasker Zadeh
February 4, 1921
Baku, Azerbaijan SSR
Died
September 6, 2017 (aged 96)
Berkeley, California,
IT201 Basics of Intelligent Computing
Module -2 part-A
(Lecture 15)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Note
• Fuzzy rule based system,Fuzzy expert
system,Fuzzy model,Fuzzy associative
memory,Fuzzy logic contoller,
• Centroid method
• Mean-max MF(middle-of-maxima)
• Center of largest area
• First or last of maxima
• Find the crisp value using all the
defuzzification methods methods
a)Centroid method
• Weighted avg method
• Mean-max MF method=(6+7)/2=6.5m
• Centre of Sums
• If the out put of the fuzzy set has at least two
convex sub regions then the center of gravity
of the convex fuzzy sub region with the largest
area is used to obtain the defuzzified value of
the output z*
Center of largest area
• First or last of maxima
Find the Defuzzified value using all
methods
References
Contents of the presentation is taken from :
Text Book:Neuro Fuzzy and Soft Computing by
J.S.R.Jang and C.T.Sun,Prentice Hall.
Reference Books:Fuzzy logic with Engg App,Timothy J
Ross,Willey Pub.
Soft Computing and Its application,Vol 1 K.S.Ray,Apple
Academic Press.
First Course on Fuzzy Theory and App.K.H.Lee,Spinger.
Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger
Science
End of Lecture 15
Thank You(Tribute to LA Zadeh)
Born
Lotfi Aliasker Zadeh
February 4, 1921
Baku, Azerbaijan SSR
Died
September 6, 2017 (aged 96)
Berkeley, California,
IT201 Basics of Intelligent Computing
Module -2 part-B
(Lecture 16)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Evolutionary Computation:
Genetic algorithms
 Introduction, or can evolution be
intelligent?
 Simulation of natural evolution
 Genetic algorithms
 Case study: maintenance scheduling
with genetic algorithms
 Summary
Can evolution be intelligent?
 Intelligence can be defined as the capability of a
system to adapt its behavior to ever-changing
environment. According to Alan Turing, the form
or appearance of a system is irrelevant to its
intelligence.
 Evolutionary computation simulates evolution on a
computer. The result of such a simulation is a
series of optimization algorithms, usually based on
a simple set of rules. Optimization iteratively
improves the quality of solutions until an optimal,
or at least feasible, solution is found.
Cont.
 The behavior of an individual organism is an
inductive inference about some yet unknown
aspects of its environment. If, over successive
generations, the organism survives, we can say
that this organism is capable of learning to predict
changes in its environment.
 The evolutionary approach is based on
computational models of natural selection and
genetics. We call them evolutionary
computation, an umbrella term that combines
genetic algorithms, evolution strategies and
genetic programming.
Simulation of natural evolution
 On 1 July 1858, Charles Darwin presented his
theory of evolution before the Linnean Society of
London. This day marks the beginning of a
revolution in biology.
 Darwin’s classical theory of evolution, together
with Weismann’s theory of natural selection and
Mendel’s concept of genetics, now represent the
neo-Darwinian paradigm
Neo-Darwinism
• Neo-Darwinism is based on processes of
reproduction, mutation, competition and
selection. The power to reproduce appears to be
an essential property of life. The power to mutate
is also guaranteed in any living organism that
reproduces itself in a continuously changing
environment.
• Processes of competition and selection normally
take place in the natural world, where expanding
populations of different species are limited by a
finite space.
Cont.
 Evolution can be seen as a process leading to the
maintenance of a population’s ability to survive
and reproduce in a specific environment. This
ability is called evolutionary fitness.
 Evolutionary fitness can also be viewed as a
measure of the organism’s ability to anticipate
changes in its environment.
 The fitness, or the quantitative measure of the
ability to predict environmental changes and
respond adequately, can be considered as the
quality that is optimized in natural life.
How is a population with increasing
fitness generated?
 Let us consider a population of rabbits. Some
rabbits are faster than others, and we may say that
these rabbits possess superior fitness, because they
have a greater chance of avoiding foxes, surviving
and then breeding.
 If two parents have superior fitness, there is a good
chance that a combination of their genes will
produce an offspring with even higher fitness.
Over time the entire population of rabbits becomes
faster to meet their environmental challenges in the
face of foxes.
Simulation of natural evolution
• All methods of evolutionary computation
simulate natural evolution by creating a
population of individuals, evaluating their
fitness, generating a new population through
genetic operations, and repeating this process
a number of times.
• We will start with Genetic Algorithms (GAs)
as most of the other evolutionary algorithms
can be viewed as variations of genetic
algorithms.
Genetic Algorithms
• In the early 1970s, John Holland introduced
the concept of genetic algorithms.
• His aim was to make computers do what
nature does. Holland was concerned with
algorithms that manipulate strings of binary
digits.
• Each artificial “chromosomes” consists of a
number of “genes”, and each gene is
represented by 0 or 1:
1 1
0 1 0 1 0 0 0 0 0 1 0 1 1
0
Cont.
• Nature has an ability to adapt and learn without
being told what to do. In other words, nature
finds good chromosomes blindly. GAs do the
same. Two mechanisms link a GA to the problem
it is solving: encoding and evaluation.
• The GA uses a measure of fitness of individual
chromosomes to carry out reproduction. As
reproduction takes place, the crossover operator
exchanges parts of two single chromosomes, and the
mutation operator changes the gene value in
some randomly chosen location of the chromosome.
Basic genetic algorithms
• Step 1: Represent the problem variable domain
as a chromosome of a fixed length, choose the
size of a chromosome population N, the crossover
probability pc and the mutation probability pm.
• Step 2: Define a fitness function to measure the
performance, or fitness, of an individual
chromosome in the problem domain. The fitness
function establishes the basis for selecting
chromosomes that will be mated during
reproduction.
Cont.
• Step 3: Randomly generate an initial population
of chromosomes of size N:
x1, x2 , . . . , xN.
• Step 4: Calculate the fitness of each individual
chromosome:
f (x1), f (x2), . . . , f (xN)
• Step 5: Select a pair of chromosomes for mating
from the current population. Parent
chromosomes are selected with a probability
related to their fitness.
• Step 6: Create a pair of offspring chromosomes
by applying the genetic operators - crossover
and mutation.
• Step 7: Place the created offspring chromosomes
in the new population.
• Step 8: Repeat Step 5 until the size of the new
chromosome population becomes equal to the
size of the initial population, N.
• Step 9: Replace the initial (parent) chromosome
population with the new (offspring) population
Genetic algorithms
• GA represents an iterative process. Each iteration
is called a generation. A typical number of
generations for a simple GA can range from 50 to
over 500. The entire set of generations is called a
run.
• Because GAs use a stochastic search method, the
fitness of a population may remain stable for a
number of generations before a superior
chromosome appears.
• A common practice is to terminate a GA after a
specified number of generations and then examine
the best chromosomes in the population. If no
satisfactory solution is found, the GA is restarted.
Credit/References
• Th. Bäck, Evolutionary Algorithms in Theory and Practice,
Oxford University Press, 1996
• L. Davis, The Handbook of Genetic Algorithms, Van
Nostrand & Reinhold, 1991
• D.B. Fogel, Evolutionary Computation, IEEE Press, 1995
• D.E. Goldberg, Genetic Algorithms in Search, Optimisation
and Machine Learning, Addison-Wesley, ‘89
• J. Koza, Genetic Programming, MIT Press, 1992
• Z. Michalewicz, Genetic Algorithms + Data Structures =
Evolution Programs, Springer, 3rd ed., 1996
• H.-P. Schwefel, Evolution and Optimum Seeking, Wiley &
Sons, 1995
(Tribute to Charles Darwin)
Tribute to John Henry Holland
Father of GA
End of Lecture 16
Thank You
Happy learning
IT201 Basics of Intelligent Computing
Module -3
(Lecture 17)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Biological Neurons
Ref: J¨urgen Schmidhuber. Deep learning in neural networks: An overview. Neural
Networks, 61:85–117, 2015.
The Deep Revival
Cats
• An algorithm inspired by an experiment on
cats is today used to detect cats in videos :-)
• Faster, higher, stronger
The Curious Case of Sequences
The Madness (2013 -)
`
IT201 Basics of Intelligent Computing
Module -2 part-B
(Lecture 16)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
(Deep Learning)
K.Sridhar Patnaik,BIT Mesra
Ref:NPTEL onlinecourse,Mitesh M Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Biological Neurons
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Disclaimer
• I understand very little about how the brain
works!
• What you saw so far is an overly simplified
explanation of how the brain works!
• But this explanation suffices for the purpose
of this course!
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
McCulloch Pitts Neuron
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Let us implement some boolean functions using
this McCulloch Pitts (MP) neuron
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
• Can any boolean function be represented
using a McCulloch Pitts unit ?
• Before answering this question let us first see
the geometric interpretation of a MP unit ...
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Find Threshold for the Function
• With and without x3 and x4 as inhibitory.
• Answers:……., ……., ………., ……….
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
The story so far ...
• A single McCulloch Pitts Neuron can be used
to represent boolean functions which are
linearly separable.
• Linear separability (for boolean functions) :
There exists a line (plane) such that all inputs
which produce a 1 lie on one side of the line
(plane) and all inputs which produce a 0 lie on
other side of the line (plane)
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Perceptron
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
What kind of functions can be implemented
using the perceptron? Any difference from
McCulloch Pitts neurons?
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Errors and Error Surfaces
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Let us plot the error surface corresponding to
different values of w0,w1,w2
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Perceptron Learning Algorithm
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Proof of Convergence
• Now that we have some faith and intuition
about why the algorithm works, we will see a
more formal proof of convergence ...
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Linearly Separable Boolean Functions
• So what do we do about functions which are
not linearly separable ?
• Let us see one such simple boolean function
first ?
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
• Before seeing how a network of perceptrons
can deal with linearly inseparable data, we will
discuss boolean functions in some more detail
...
• How many boolean functions can you design
from 2 inputs ?
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
Representation Power of a Network of
Perceptrons
• We will now see how to implement any
boolean function using a network of
perceptrons ...
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
What if we have more than 3 inputs ?
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
What if we haven inputs ?
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
• Again, why do we care about boolean
functions ?
• How does this help us with our original
problem: which was to predict whether we
like a movie or not? Let us see!
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM
IT201 Basics of Intelligent Computing
Module -3
(Lecture 21)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
K.Sridhar Patnaik
BIT Mesra
References NPTEL-Onlinecourse,Mitesh M Khapre,IITM,
http://neuralnetworksanddeeplearning.com
Acknowledgements
• Borrowed ideas from the videos by Ryan Harris
on “visualize backpropagation” (available on
youtube)
• Borrowed ideas from this excellent book
(http://neuralnetworksanddeeplearning.com/cha
p4.html) which is available online
• I am sure I would have been influenced and
borrowed ideas from other sources and I
apologize if I have failed to acknowledge them.
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Sigmoid Neuron
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
A typical Supervised Machine Learning
Setup
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Learning Parameters: (Infeasible) guess
work
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Let us see this in more detail....
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Let us look at something better than our
“guess work” algorithm....
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Let us look at the geometric interpretation of our
“guess work” algorithm in terms of this error surface
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Learning Parameters : Gradient Descent
Now let us see if there is a more efficient and
principled way of doing this
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
Representation Power of a Multilayer
Network of Sigmoid Neurons
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
http://neuralnetworksanddeeplearning.com/cha
p4.html
• The discussion in the next few slides is based
on the ideas presented at the above link
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
References NPTEL-Onlinecourse,Mitesh M
Khapre,IITM,
http://neuralnetworksanddeeplearning.co
End of lecture 21
Thank you
IT201 Basics of Intelligent Computing
Module -3
(Lecture23)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
References
• Ian Goodfellow, Yoshua Bengio, and Aaron
Courville. Deep Learning. MIT Press, 2016.
• NPTEL Course on Computer Vision and Deep
Learning, V.N Subramanium,IITH
• NPTEL Course on Deep learning part-1,M.N
Kapre,IITM
IT201 Basics of Intelligent Computing
Module -IV
(Lecture-24)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Introduction to Cloud Computing
Credit: #AWSTutorial #CloudTutorial
#GettingStartedWithCloud
Thank You
End of Lecture 24
IT201 Basics of Intelligent Computing
Module -4
(Lecture-24)
IT201 Basics of Intelligent Computing
Module -IV
(Lecture 25)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Virtualization In Cloud Computing
and Types
• Virtualization is a technique of how to separate a
service from the underlying physical delivery of
that service.
• It is the process of creating a virtual version of
something like computer hardware. It was initially
developed during the mainframe era.
• It involves using specialized software to create a
virtual or software-created version of a computing
resource rather than the actual version of the same
resource.
• With the help of Virtualization, multiple
operating systems and applications can run on
same machine and its same hardware at the
same time, increasing the utilization and
flexibility of hardware.
• In other words, one of the main cost effective,
hardware reducing, and energy saving
techniques used by cloud providers is
virtualization
• Virtualization allows to share a single physical
instance of a resource or an application
among multiple customers and organizations
at one time.
• It does this by assigning a logical name to a
physical storage and providing a pointer to
that physical resource on demand.
• The term virtualization is often synonymous
with hardware virtualization, which plays a
fundamental role in efficiently delivering
Infrastructure-as-a-Service (IaaS) solutions for
cloud computing.
• Moreover, virtualization technologies provide
a virtual environment for not only executing
applications but also for storage, memory, and
networking.
BENEFITS OF VIRTUALIZATION
1.More flexible and efficient allocation of
resources.
2.Enhance development productivity.
3.It lowers the cost of IT infrastructure.
4.Remote access and rapid scalibility.
5.High availability and disaster recovery.
6.Pay per use of the IT infrastructure on
demand.
7.Enables running multiple operating system.
Types of Virtualization
• 1.Application Virtualization.
• 2.Network Virtualization.
• 3.Desktop Virtualization.
• 4.Storage Virtualization.
Application Virtualization
• Application virtualization helps a user to have a remote
access of an application from a server.
• The server stores all personal information and other
characteristics of the application but can still run on a
local workstation through internet.
• Example of this would be a user who needs to run two
different versions of the same software. Technologies
that use application virtualization are hosted
applications and packaged applications.
Network Virtualization
• The ability to run multiple virtual networks with
each has a separate control and data plan. It co-
exists together on top of one physical network.
• It can be managed by individual parties that
potentially confidential to each other.
• Network virtualization provides a facility to create
and provision virtual networks—logical switches,
routers, firewalls, load balancer, Virtual Private
Network (VPN), and workload security within
days or even in weeks.
Desktop virtualization
• Desktop virtualization allows the users’ OS to be
remotely stored on a server in the data center.It
allows the user to access their desktop virtually,
from any location by different machine.
• Users who wants specific operating systems other
than Windows Server will need to have a virtual
desktop.Main benefits of desktop virtualization
are user mobility,portability, easy management of
software installation, updates and patches.
Storage virtualization
• Storage virtualization is an array of servers that are
managed by a virtual storage system. The servers
aren’t aware of exactly where their data is stored, and
instead function more like worker bees in a hive.
• It makes managing storage from multiple sources to be
managed and utilized as a single repository. storage
virtualization software maintains smooth operations,
consistent performance and a continuous suite of
advanced functions despite changes, break down and
differences in the underlying equipment.
Thank You
End of Lecture 3
IT201 Basics of Intelligent Computing
Module -1 part-B
(Lecture-3)
References-
https://www.geeksforgeeks.org/virtualization-cloud-
computing-types/
IT201 Basics of Intelligent Computing
Module -IV
(Lecture 26)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Examples of Cloud Storage
Dropbox, Gmail, Facebook
Right now, Dropbox is the clear leader in streamlined
cloud storage allowing users to access files on any
device through its application or website with up to 1
terabyte of free storage.
Google’s email service provider Gmail, on the other
hand, provides unlimited storage on the cloud. Gmail
has revolutionized the way we send emails and largely
responsible for the increased usage of email
worldwide.
Cont.
• Facebook is a mix of the two, in that it can
store an infinite amount of information,
images, and videos on your profile. They can
then be easily accessed on multiple devices.
Facebook goes a step further with their
Messenger app, which allows for profiles to
exchange data.
Examples of Marketing Cloud
Platforms
• Maropost for Marketing, Hubspot, Adobe
Marketing Cloud.
• A marketing cloud is an end-to-end digital
marketing platform for clients to manage
contacts and target leads. Maropost Marketing
Cloud combines easy-to-use marketing
automation and hyper-targeting of leads. At the
same time, ensuring emails actually arrive in the
inbox, thanks to its advanced email deliverability
capabilities.
• In general, marketing clouds fulfill a need for
personalization. This is important in a market
that demands messaging be “more human.”
That’s why communicating that your brand is
here to help, will make all the difference in
closing.
Examples of Cloud Computing in
Education
• SlideRocket, Ratatype, Amazon Web Services
• Education is increasingly adopting advanced
technology because students already are. So,
in an effort to modernize classrooms,
educators have introduced e-learning
software like SlideRocket.
• SlideRocket is a platform that students can use
to build presentations and submit them.
Students can even present them through web
conferencing all on the cloud. Another tool
teachers use is Ratatype, which helps students
learn to type faster and offers online typing
tests to track their progress.
• For school administration, Amazon’s AWS
Cloud for K12 and Primary Education features
a virtual desktop infrastructure (VDI) solution.
Through the cloud, allows instructors and
students to access teaching and learning
software on multiple devices.
Examples of Cloud Computing in
Healthcare
• ClearDATA, Dell’s Secure Healthcare Cloud,
IBM Cloud
• Ultimately, cloud technology ensures patients
receive the best possible care without
unnecessary delay. The patient’s condition
can also be updated in seconds through
remote conferencing.
• Salesforce(SaaS)(It is both a business-to-
business and business to consumer commerce
solution.)
• Creatio(cloud service specifically for
marketing, sales and servicers to manage
business processes and assist companies to
facilitate consumer experience and customer
journey.)
• Slack(is an American based cloud service
designed to facilitate internal team
collaboration through its tools and services.)
• Google Cloud(a cloud service offered by
Google, runs on the same infrastructure that
Google uses internally for its end-user
products like Google and YouTube.)
• Microsoft 365(is a product line of
subscription-based services such as Outlook,
Powerpoint, and Excel.)
• Adobe Creative Cloud(is a set of applications
and services from Adobe Systems that gives
subscribers access to various software used
for graphic design, video editing, web design,
photography and more.)
End of Lecture 26
Thank You
IT201 Basics of Intelligent Computing
Module -IV
(Lecture 27)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Amazon EC2 Quick Start
adapted from
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
EC2_GetStarted.html
Amazon Elastic Compute Cloud (EC2)
• Amazon Machine Images (AMIs) are the basic
building blocks of Amazon EC2
• An AMI is a template that contains a software
configuration (operating system, application
server and applications) that can run on
Amazon’s computing environment
• AMIs can be used to launch an instance,
which is a copy of the AMI running as a virtual
server in the cloud.
Getting Started with Amazon EC2
• Step 1: Sign up for Amazon EC2
• Step 2: Create a key pair
• Step 3: Launch an Amazon EC2 instance
• Step 4: Connect to the instance
• Step 5: Customize the instance
• Step 6: Terminate instance and delete the
volume created
Creating a key pair
• AWS uses public-key cryptography to encrypt
and decrypt login information.
• AWS only stores the public key, and the user
stores the private key.
• There are two options for creating a key pair:
– Have Amazon EC2 generate it for you
– Generate it yourself using a third-party tool such
as OpenSSH, then import the public key to
Amazon EC2
Generating a key pair with Amazon EC2
1. Open the Amazon EC2 console at
http://console.aws.amazon.com/ec2/
2. On the navigation bar select region for the key pair
3. Click Key Pairs in the navigation pane to display
the list of key pairs associated with the account
Generating a key pair with EC2 (cont.)
4. Click Create Key Pair
5. Enter a name for the key pair in the Key Pair
Name field of the dialog box and click Create
6. The private key file, with .pem extension, will
automatically be downloaded by the
browser.
Launching an Amazon EC2 instance
1. Sign in to AWS Management Console and
open the Amazon EC2 console at
http://console.aws.amazon.com/ec2/
2. From the navigation bar select the region for
the instance
Launching an Amazon EC2 instance (cont.)
3. From the Amazon EC2 console dashboard, click
Launch Instance
Launching an Amazon EC2 instance (cont.)
4. On the Create a New Instance page, click Quick
Launch Wizard
5. In Name Your Instance, enter a name for the
instance
6. In Choose a Key Pair, choose an existing key pair, or
create a new one
7. In Choose a Launch Configuration, a list of basic
machine configurations are displayed, from which
an instance can be launched
8. Click continue to view and customize the settings
for the instance
Launching an Amazon EC2 instance (cont.)
9. Select a security group for the instance. A
Security Group defines the firewall rules
specifying the incoming network traffic delivered
to the instance. Security groups can be defined
on the Amazon EC2 console, in Security Groups
under Network and Security
Launching an Amazon EC2 instance (cont.)
10.Review settings and click Launch to launch the
instance
11.Close the confirmation page to return to EC2
console
12.Click Instances in the navigation pane to view
the status of the instance. The status is pending
while the instance is launching
After the instance is launched, its status changes to
running
Connecting to an Amazon EC2 instance
• There are several ways to connect to an EC2
instance once it’s launched.
• Remote Desktop Connection is the standard
way to connect to Windows instances.
• An SSH client (standalone or web-based) is
used to connect to Linux instances.
Connecting to Linux/UNIX Instances
from Linux/UNIX with SSH
Prerequisites:
- Most Linux/UNIX computers include an SSH client by
default, if not it can be downloaded from openssh.org
- Enable SSH traffic on the instance (using security
groups)
- Get the path the private key used when launching the
instance
1. In a command line shell, change directory to the path
of the private key file
2. Use the chmod command to make sure the private
key file isn’t publicly viewable
Connecting to Linux/UNIX Instances(cont.)
3. Right click on the instance to connect to on the
AWS console, and click Connect.
4. Click Connect using a standalone SSH client.
5. Enter the example command provided in the
Amazon EC2 console at the command line shell
Transfering files to Linux/UNIX
instances from Linux/UNIX with SCP
Prerequisites:
- Enable SSH traffic on the instance
- Install an SCP client (included by default mostly)
- Get the ID of the Amazon EC2 instance, public DNS
of the instance, and the path to the private key
If the key file is My_Keypair.pem, the file to transfer is
samplefile.txt, and the instance’s DNS name is ec2-
184-72-204-112.compute-1.amazonaws.com, the
command below copies the file to the ec2-user home
Terminating Instances
- If the instance launched is not in the free
usage tier, as soon as the instance starts to
boot, the user is billed for each hour the
instance keeps running.
- A terminated instance cannot be restarted.
- To terminate an instance:
1. Open the Amazon EC2 console
2. In the navigation pane, click Instances
3. Right-click the instance, then click Terminate
4. Click Yes, Terminate when prompted for
confirmation
Google App Engine Quick Start
adapted from
https://developers.google.com/appengine/docs/whatisgoo
gleappengine
Google App Engine (GAE)
• GAE lets users run web applications on Google’s
infrastructure
• GAE data storage options are:
– Datastore: a NoSQL schemaless object datastore
– Google Cloud SQL: Relational SQL database service
– Google Cloud Storage: Storage service for objects and files
• All applications on GAE can use up to 1 GB of storage
and enough CPU and bandwidth to support an efficient
application serving around 5 million page views a
month for free.
• Three runtime environments are supported: Java,
Python and Go.
End of Lecture 27
Thank You
IT201 Basics of Intelligent Computing
Module -IV
(Lecture 28)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
Virtualization and Cloud
Computing
Definition
• Virtualization is the ability to run multiple
operating systems on a single physical system and
share the underlying hardware resources*
• It is the process by which one computer hosts the
appearance of many computers.
• Virtualization is used to improve IT throughput
and costs by using physical resources as a pool
from which virtual resources can be allocated.
*VMWare white paper, Virtualization Overview
Virtualization Architecture
•A Virtual machine (VM) is an isolated runtime
environment (guest OS and applications)
•Multiple virtual systems (VMs) can run on a single
physical system
Hypervisor
• A hypervisor, a.k.a. a virtual machine
manager/monitor (VMM), or virtualization
manager, is a program that allows multiple
operating systems to share a single hardware
host.
• Each guest operating system appears to have the
host's processor, memory, and other resources all
to itself. However, the hypervisor is actually
controlling the host processor and resources,
allocating what is needed to each operating
system in turn and making sure that the guest
operating systems (called virtual machines)
cannot disrupt each other.
Benefits of Virtualization
• Sharing of resources helps cost reduction
• Isolation: Virtual machines are isolated from
each other as if they are physically separated
• Encapsulation: Virtual machines encapsulate a
complete computing environment
• Hardware Independence: Virtual machines
run independently of underlying hardware
• Portability: Virtual machines can be migrated
between different hosts.
Virtualization in Cloud Computing
Cloud computing takes virtualization one step
further:
• You don’t need to own the hardware
• Resources are rented as needed from a cloud
• Various providers allow creating virtual servers:
– Choose the OS and software each instance will have
– The chosen OS will run on a large server farm
– Can instantiate more virtual servers or shut down
existing ones within minutes
• You get billed only for what you used
Virtualization Security Challenges
The trusted computing base (TCB) of a virtual
machine is too large.
• TCB: A small amount of software and hardware
that security depends on and that we distinguish
from a much larger amount that can misbehave
without affecting security*
• Smaller TCB  more security
*Lampson et al., “Authentication in distributed systems: Theory
and practice,” ACM TCS 1992
Xen Virtualization Architecture and
the Threat Model
• Management VM – Dom0
• Guest VM – Dom
• Dom0 may be malicious
– Vulnerabilities
– Device drivers
– Careless/malicious
administration
• Dom0 is in the TCB of DomU because it can access the
memory of DomU, which may cause information
leakage/modification
Virtualization Security Requirements
• Scenario: A client uses the service of a cloud
computing company to build a remote VM
– A secure network interface
– A secure secondary storage
– A secure run-time environment
• Build, save, restore, destroy
Virtualization Security Requirements
• A secure run-time environment is the most fundamental
– The first two problems already have solutions:
• Network interface: Transport layer security (TLS)
• Secondary storage: Network file system (NFS)
– The security mechanism in the first two rely on a
secure run-time environment
• All the cryptographic algorithms and security
protocols reside in the run-time environment
Smaller TCB Solution
Smaller TCB
Actual TCB
*Secure Virtual Machine Execution under an Untrusted Management OS. C. Li, A.
Raghunathan, N.K. Jha. IEEE CLOUD, 2010.
Domain building
• Building process
Domain save/restore
Hypervisor Vulnerabilities
Malicious software can run on the same server:
– Attack hypervisor
– Access/Obstruct other VMs
15
Physical Hardware
Hypervisor
OS OS
Apps Apps
Guest VM1 Guest VM2
servers
NoHype*
• NoHype removes the hypervisor
– There’s nothing to attack
– Complete systems solution
– Still retains the needs of a virtualized cloud
infrastructure
16
Physical Hardware
OS OS
Apps Apps
Guest VM1 Guest VM2
No hypervisor
*NoHype: Virtualized Cloud Infrastructure without the Virtualization. E. Keller, J. Szefer, J.
Rexford, R. Lee. ISCA 2010.
Roles of the Hypervisor
• Isolating/Emulating resources
– CPU: Scheduling virtual machines
– Memory: Managing memory
– I/O: Emulating I/O devices
• Networking
• Managing virtual machines
Push to HW /
Pre-allocation
Remove
Push to side
Removing the Hypervisor
• Scheduling virtual machines
– One VM per core
• Managing memory
– Pre-allocate memory with processor support
• Emulating I/O devices
– Direct access to virtualized devices
• Networking
– Utilize hardware Ethernet switches
• Managing virtual machines
– Decouple the management from operation
References
• http://www.vmware.com/pdf/virtualization.pdf
• NoHype: Virtualized Cloud Infrastructure
without the Virtualization. E. Keller, J. Szefer, J.
Rexford, R. Lee. ISCA 2010.
• Secure Virtual Machine Execution under an
Untrusted Management OS. C. Li, A.
Raghunathan, N.K. Jha. IEEE CLOUD, 2010.
• An Introduction to Virtualization and Cloud
Technologies to Support Grid Computing. I.M.
Lorente. EGEE08.
Thank You
End of Lecture 28
IT201 Basics of Intelligent Computing
Module -4
IT201 Basics of Intelligent Computing
Module -IV
(Lecture 29-34)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
IoT ?
Internet of Things
• Overview of internet
• IoT meaning
• IoT characteristics
Internet
5
People Connecting to Things
Motion sensor
Motion sensor
Motion sensor
ECG sensor
Internet
7
77
Future Networks
8
8
“Thing” connected to the internet
Image Courtesy: : CISCO
Internet of Things(IoT)?
The Internet of Things (IoT) is the network of
physical objects—devices, vehicles, buildings
and other items embedded with electronics,
software, sensors, and network connectivity—
that enables these objects to collect and
exchange data.
Why should I learn about IoT?
• Business trend
• Emerging technologies
• Growing IoT Services and Application
10
Internet Connected devices
11
Source: Siemens, http://www.siemens.com/innovation/apps/pof_microsite/_pof-fall-2012/_html_en/facts-and-forecasts-growth-market-of-the-future.html
Opportunities
12
Source: http://blog.trentonsystems.com/internet-of-things-crosses-business-personal-boundaries/
Technology trend
13
Smart product sales
14
Source: Siemens, http://www.siemens.com/innovation/apps/pof_microsite/_pof-fall-2012/_html_en/facts-and-forecasts-growth-market-of-the-future.html
Global Data Generation
15
- Everyday around 20 quintillion (10^18) bytes
of data are produced (Source: http://www-
01.ibm.com/software/data/bigdata/).
- This data includes textual content
(unstructured, semi-structured, structured) to
multimedia content (images, video and audio),
on a variety of platforms (enterprise, social
media, and sensors).
Data Generation
16
IoT is everywhere
• In our daily lives, we have become more
reliant on IoT with our wearable tech,
appliances, our cars, how we receive health
care.
Wearable Tech
Health Care
Smart Appliances
• Internet of Things may interact with various
service sectors within the public/private
sectors and ordinary consumers.
• Public sector entities (such as universities)
may have some level of involvement and
interaction within all service sectors depicted;
• Ranging from the operation and industry
elements of buildings, to levels of research,
retail entities, transportation, and IT/Networks
IoT Market
• As of 2013, 9.1 billion IoT units
• Expected to grow to 28.1 billion IoT devices by
2020
• Revenue growth from $1.9 trillion in 2013 to
$7.1 trillion in 2020
Wireless Communication Protocol
Comparison:Driver of IoT Connectivity
End of Brief
Know –How about IoT
Logical Design of IoT
• It refers to an abstract representation of the entities
and processes without going into the low-level
specifics of the implementation.
• Functional Blocks of IoT:
1) Device (S,A,M,C)
2) Communication(Protocols)
3) Services(DM,DC,DPS,DD)
4) Management(provides functions to govern IoTS)
5) Security(A,A,MI/CI,DS)
6) Application(provide UI)
• Device: An IoT system comprises of devices
that provide sensing, actuation, monitoring
and control functions.
• Communication: Handles the communication
for the IoT system.
• Services: services for device monitoring,
device control service, data publishing
services and services for device discovery.
• Management: this blocks provides various
functions to govern the IoT system.
• Security: this block secures the IoT system and by
providing functions such as authentication ,
authorization, message and content integrity, and
data security.
• Application: This is an interface that the users
can use to control and monitor various aspects of
the IoT system. Application also allow users to
view the system status and view or analyze the
processed data.
Functional Blocks of IoT
APPLICATION
DEVICE
SERVICES
COMMUNICATION
MANAGEMENT SECURITY
Five layer IoT architecture
A layered Architecture based n
SDN
IoT Communication Models
• Request –Response
• Public-Subscribe
• Push-Pull
• Exclusive Pair
Request Response
Communication Model
CLIENT
Sends
Request to
Server
RESOURCES
SERVER
Receives Req
from
Client,processes
Req,looksup/
Fetches
resources,
Prepares
response and
sends response
to client
Publish-Subscribe Communication
Model
Survey of various type of Publish
Subscribe implementations
package pubSub;
import
javax.naming.InitialContext;
import javax.jms.Topic;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.TopicPublisher;
import javax.jms.DeliveryMode;
import javax.jms.TopicSession;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
• public class Publisher
• {
• public static void main(String[] args) throws Exception
• {
• // get the initial context
• InitialContext ctx = new InitialContext();
•
• // lookup the topic object
• Topic topic = (Topic) ctx.lookup("topic/topic0");
•
• // lookup the topic connection factory
• TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx.
• lookup("topic/connectionFactory");
•
• // create a topic connection
• TopicConnection topicConn = connFactory.createTopicConnection();
•
• // create a topic session
• TopicSession topicSession = topicConn.createTopicSession(false,
• Session.AUTO_ACKNOWLEDGE);
•
•
• // create a topic publisher
• TopicPublisher topicPublisher = topicSession.createPublisher(topic);
• topicPublisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
•
• // create the "Hello World" message
• TextMessage message = topicSession.createTextMessage();
• message.setText("Hello World");
•
• // publish the messages
• topicPublisher.publish(message);
•
• // print what we did
• System.out.println("Message published: " + message.getText());
•
• // close the topic connection
• topicConn.close();
• }
• }
package pubSub;
import
javax.naming.InitialContext;
import javax.jms.Topic;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
• public class Subscriber
• {
• public static void main(String[] args) throws Exception
• {
• // get the initial context
• InitialContext ctx = new InitialContext();
•
• // lookup the topic object
• Topic topic = (Topic) ctx.lookup("topic/topic0");
•
• // lookup the topic connection factory
• TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx.
• lookup("topic/connectionFactory");
•
• // create a topic connection
• TopicConnection topicConn = connFactory.createTopicConnection();
•
• // create a topic session
• TopicSession topicSession = topicConn.createTopicSession(false,
• Session.AUTO_ACKNOWLEDGE);
• // create a topic subscriber
• TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
•
• // start the connection
• topicConn.start();
•
• // receive the message
• TextMessage message = (TextMessage) topicSubscriber.receive();
•
• // print the message
• System.out.println("Message received: " + message.getText());
•
• // close the topic connection
• topicConn.close();
• }
• }
Push-communication
Sent to specific recipients who need to receive the information. This
ensures that the information is distributed but does not
ensure that it actually reached or was understood by intended
audience. Push communication include letters, memos, reports,
emails, faxes, voice mails, blogs, press releases, etc.
Pull-communication
Used for very large volumes of information, or for very large audience,
and requires the recipient to access the communication content at
their own discretion. These methods include intranet sites, e-learning,
lessons learned database, knowledge repositories, etc.
Push-Pull Communication Model
Google AppEngine: Task Queues API
<queue-entries> <!--Set the number of max
concurrent requests to 10-->
<queue> <name>optimize-queue</name>
<rate>20/s</rate> <bucket-size>40</bucket-
size> <max-concurrent-requests>10</max-
concurrent-requests> </queue>
</queue-entries>
A Java Task Queue Example
Exclusive Pair Communication Model
IoT Communication APIs
• REST-based Communication APIs.
• WebSocket-based Communication APIs
REST(Representational State Transfer)is a set of
architectural principles by which you can design
web services and web APIs that focus on a
system’s resources and how resource states are
addressed and transferred.
• REST APIs follow the Request-Response
communication.
• REST architectural constraints:
Client-server
Stateless
Cache-able
Layered System
Uniform Interface
Code on Demand
TCP/IP Protocols handle Data
Communication
Communication with REST APIs
Request Response Model used by REST
HTTP request methods and actions
Points to Note
• RESTfull web service is a webAPI implemented
using HTTP and REST principles.
• RESTfull web service is a collection of
resources which are represented by URIs.
• RESTfull web API has a base
URI(e.g.http://example.com/api/tasks/).
• Client sends request to these URIs using the
HTTP methods
Cont
• RESTfull web service can support various
internet media types(JSON)
WebSocket-based
Communication APIs
• WebSocket APIs allow bi-directional ,full
duplex communication between clients and
servers.
• Follows Exclusive pair communication model.
• Unlike request-response APIs such as REST, the
WebSocket APIs allow full duplex
communication and do not require a new
connection to be setup for each message to be
sent.
• In order to communicate using the WebSocket
protocol, you need to create a WebSocket object; this
will automatically attempt to open the connection to
the server.
WebSocket WebSocket(
in DOMString url,
in optional DOMString protocols );
var exampleSocket = new
WebSocket("ws://www.example.com/socketserver",
"protocolOne");
• On return,
• exampleSocket.readyState is CONNECTING.
The readyState will become OPEN once the
connection is ready to transfer data.
• Once you've opened your connection, you can
begin transmitting data to the server. To do
this, simply call the WebSocket object's
send() method for each message you want to
send:
Sending data to the server
• exampleSocket.send("Here's some text that
the server is urgently awaiting!");
exampleSocket.onopen = function (event) {
exampleSocket.send("Here's some text that the
server is urgently awaiting!"); };
Using JSON to transmit objects
// Send text to all users through the server function sendText()
{ // Construct a msg object containing the data the server
needs to process the message from the chat
client. var msg = { type: "message",
text: document.getElementById("text").value,
id: clientID,
date: Date.now() };
// Send the msg object as a JSON-formatted string.
exampleSocket.send(JSON.stringify(msg));
// Blank the text input element, ready to receive the next line
of text from the user.
document.getElementById("text").value = ""; }
Receiving messages from the server
• exampleSocket.onmessage = function (event) {
console.log(event.data); }
Web Socket URL in tokens
• The latest specification of Web Socket
protocol is defined as RFC 6455 – a proposed
standard.
• RFC 6455 is supported by various browsers
like Internet Explorer, Mozilla Firefox, Google
Chrome, Safari, and Opera.
Existing techniques, which are used for
duplex communication between the
server and the client.
• Polling
• Long Polling
• Streaming
• Postback and AJAX
• HTML5
• AJAX is based on Javascript's XmlHttpRequest
Object.
• XmlHttpRequest Object allows execution of
the Javascript without reloading the complete
web page. AJAX sends and receives only a
portion of the web page.
The major drawbacks of AJAX in
comparison with Web Sockets are
• They send HTTP headers, which makes total
size larger.
• The communication is half-duplex.
• The web server consumes more resources.
HTML5
• HTML5 is a robust framework for developing
and designing web applications. The main
pillars include Mark-up, CSS3 and Javascript
APIs together.
There are four main Web Socket API events −
• Open
• Message
• Close
• Error
The Web Socket protocol supports two main
actions, namely −
• send( )
• close( )
Thank You
End of Lecture 29-34
IT201 Basics of Intelligent Computing
Module -5
IT201 Basics of Intelligent Computing
Module -IV
(Lecture 35-36)
K.Sridhar Patnaik
Associate Professor
Dept. of CSE,BIT Mesra Ranchi
Email:kspatnaik@bitmesra.ac.in
WSN
Cloud Computing
Big Data Analytics
Embedded System
Communication Protocols
• Internet communication protocols are published by the Internet
Engineering Task Force (IETF). The IEEE handles wired and
wireless networking, and the International Organization for
Standardization (ISO) handles other types.
• The ITU-T handles telecommunication protocols and formats for
the public switched telephone network (PSTN). As the PSTN
and Internet converge, the standards are also being driven
towards convergence.
• In IoT we used MQTT, COAP, AMQP etc. protocols
Thank You
End of Lecture 35-36
IT201 Basics of Intelligent Computing
Module -5
REFERENCES
1) Neuro Fuzzy and Soft Computing,Jan,Sun and Mizutani,Prentice Hall.
2) Principals of SoftComputing by S.N Deepa,Sivanandam,Wiley.
3) Artificial Intelligence by Rich and Knight,McGraw Hill
4) NPTEL and Standford Online Learning Material.
5) Genetic Algorithm by Goldberg. Addison-Wesley Publishing
Company, Inc.

Basics of Intelligent Computing.pdf

  • 1.
    IT201 Basics ofIntelligent Computing Module -1 part-A K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 2.
    Course Outcomes(COs) After thecompletion of this course, students will be able to: • CO1-Distinguish between different branches of AI • CO2-Solve problems related to Fuzzy Logic and Design an FIS system. • CO3-Solve Optimization problems using GA. • CO4-Design Simple ANN models • CO5-Discuss Basics of Cloud Computing and IoT.
  • 3.
  • 4.
    Module 1-Introduction Things todiscuss in Module-1 • Definition of Computing • Types of Computing • What is Intelligence? • Necessity of Intelligent Computing • Current Trends in Intelligent Computing
  • 5.
    What is Computing?[1] •Computing is any activity that uses computers to manage, process, and communicate information. • It includes development of both hardware and software. • Computing has become a critical, integral component of modern industrial technology. [1] https://en.wikipedia.org/wiki/Computing
  • 6.
    Types of ComputingDevices[2] • Supercomputer. • Mainframe. • Server Computer. • Workstation Computer. • Personal Computer or PC. • Microcontroller. • Smartphone. [2]https://en.wikiversity.org/wiki/Types_of_computers
  • 7.
    What is Intelligence? Definition(MerriamWebster): • Capacity for Learning, Reasoning, Understanding and similar forms of mental activity. • Aptitude in grasping truths, relationships,facts ,meanings
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
    Comprehension We talked about:Learning,Reasoning,Understanding and Now we talk about Comprehension: Act of grasping truths, Capacity for understanding fully. [1]https://slideplayer.com/slide/8597416/ [2] https://www.liveworksheets.com/
  • 15.
  • 16.
    IT201 BIC End ofLecture -1 Thank You Email:kspatnaik@bitmesra.ac.in
  • 17.
    IT201 Basics ofIntelligent Computing Module -1 part-A (Lecture2) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 18.
    Intelligent Computing /ComputationalIntelligence • Can Computers be Intelligent? 1)In the mid-1900s, Alan Turing gave much thought to this question. He believed that machines could be created that would mimic the processes of the human brain. 2)In 1950 Turing published his test of computer intelligence, referred to as the Turing test. 3)Computational Intelligence (CI) is the theory, design, application and development of biologically and linguistically motivated computational paradigms. Traditionally the three main pillars of CI have been Neural Networks, Fuzzy Systems ,Evolutionary Computation. [1]https://cis.ieee.org/about/what-is-ci [2]Computational Intelligence: An Introduction, Second Edition A.P. Engelbrecht 2007 John Wiley & Sons, Ltd [3] A. M. Turing (1950) Computing Machinery and Intelligence. Mind 49: 433-460.
  • 19.
    Turing Test (1950)"CanMachine think?" [1] https://www.javatpoint.com/turing-test-in-ai [2] A. M. Turing (1950) Computing Machinery and Intelligence. Mind 49: 433-460. Alan Turing Turing test is used to determine” weather or not machines can think intelligently like Humans
  • 20.
    Chinese Room Argument •1980-John Searle [1]https://plato.stanford.edu/entries/chinese-room/ [2]Source: Wikicomms
  • 21.
    Necessity of IntelligentComputing • Intelligent systems are revolutionizing a variety of industries, including transportation and logistics, security, and manufacturing. • Intelligent systems are complex and use a wide range of technologies – artificial intelligence, cybersecurity, natural language processing, deep learning, embedded CPUs, distributed storage, wireless networking and graphical signaling. [1]https://online.lewisu.edu/mscs/resources/what-are-intelligent-systems
  • 22.
    Current Trends inIntelligent Computing • A current trend in computing is for sure the Computer Data Security and this is because computers are not only used in the office or at home but in almost every field. • Computers controls telephones, information on the Internet, distribution of electrical power, monitors operations in nuclear power plants among other very important applications; as it is mentioned by David Salomon in his “Elements of Computer Security” https://www.coursehero.com/file/17615788/Current-Trends-in-Computing
  • 23.
    Computational Intelligence paradigms [1]ComputationalIntelligence: An Introduction, Second Edition A.P. Engelbrecht 2007 John Wiley & Sons, Ltd
  • 24.
    Module 1-Part-B Artificial Intelligence-Concepts • Artificial intelligence (AI)(John McCarthy 1956)- is a branch of computer science and engineering that deals with intelligent behavior, learning, and adaptation in machines
  • 25.
  • 26.
    AI Problems [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rdEd,McGrawwHills,2009 [2]https://www.tutorialspoint.com/artificial_intelligence/artificial_intelligence_research_areas.htm
  • 27.
    AI Problems Cont. •People learn the mundane tasks first. • The formal and expert tasks are the most difficult to learn. • AI is doing very well in the formal and expert tasks; however it is doing very poorly in the mundane tasks.
  • 28.
    AI problems Cont. •Much of the early work in the field focused on Formal tasks-game playing and theorem proving. • Samuel-Wrote checkers-playing program that not only played games with opponents but also used its experience at those games to improve its later performance. Chess also. https://en.wikipedia.org/wiki/Arthur_Samuel
  • 29.
    AI problems Cont. •Logic Theorist is a computer program written in 1956 by Allen Newell, Herbert A. Simon and Cliff Shaw. • It was the first program deliberately engineered to mimic the problem-solving techniques of a human being and is called "the first artificial intelligence program". https://en.wikipedia.org/wiki/Logic_Theorist
  • 30.
    AI problems Cont. •It was able to prove several theorems from the first chapter of Whitehead and Russell’s Principia Mathematica. • Gelernter's theorem prover explored another area of mathematics: geometry. • Game playing and theorem proving share the property that people who do them well are considered to be displaying intelligence. https://plato.stanford.edu/entries/principia-mathematica
  • 31.
    To discuss: • Whatare our underlying assumptions about intelligence? • What kind of techniques will be useful for solving AI problems? • At what level of detail, if at all, are we trying to model human intelligence? • How will we know when we have succeeded in building an intelligent program? [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 32.
    The Underlying Assumption PhysicalSymbol System Hypothesis: A physical symbol system has the necessary and sufficient means for general intelligence action. A physical symbol system (formal system) takes physical patterns (symbols), combining them into structures (expressions) and manipulating them (using processes) to produce new expressions. http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
  • 33.
    PSSH • The physicalsymbol system hypothesis (PSSH) is a position in the philosophy of artificial intelligence formulated by Allen Newell and Herbert A. Simon. • PSS consists of entities, called symbols, which are physical patterns that can occur as components of another type of entity called an expression(or symbol structure). • The symbol structure is composed of number of instances(tokens)of symbols related in some physical way(such as one token being next to another) http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
  • 34.
    PSSH • At anyinstance of time the system will contain a collection of these symbol structure. • Besides these structures,the system also contains a collection of processes that operate on expressions to produce other expressions.(processes of creation, modification, reproduction and destruction) . • A PSS is a machine that produces through time an evolving collection of symbol structures. http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
  • 35.
    Examples of PSSH •Formal Logic • Algebra • Digital Computer • Chess • Thoughts • AI program http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
  • 36.
    PSS Hypothesis • Thereis no way to prove/disprove on logical grounds. • So it must be subject to empirical validation. (In science, empirical evidence is required for a hypothesis to gain acceptance in the scientific community. Normally, this validation is achieved by the scientific method of forming a hypothesis, experimental design, peer review, reproduction of results, conference presentation, and journal publication). • Bulk of the evidence says that it is TRUE. But the only way to determine its truth is by experimentation. • Computers provide the perfect medium for this experimentation since they can be programmed to simulate any PSS we like. http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
  • 37.
    PSS Hypothesis Cont. •Influence of sub symbolic model(ANN) on symbolic ones. • Importance of PSS Hypothesis: • 1)Significant theory of the nature of human intelligence and is of great interest to psychologists. • 2)It also forms the basis of the belief that it is possible to build programs that can perform intelligent tasks now performed by people. http://ai.stanford.edu/users/nilsson/OnlinePubs-Nils/PublishedPapers/pssh.pdf
  • 38.
    End of Lecture2 IT201 Basics of Intelligent Computing Module -1 part-A and B
  • 39.
    IT201 Basics ofIntelligent Computing Module -1 part-B (Lecture-3) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 40.
    What is AITechnique?
  • 41.
  • 42.
    Two Problems andseries of approaches for solving each of them Program 1: Data Structures:  Board: 9 element vector representing the board, with 1-9 for each square. An element contains the value 0 if it is blank, 1 if it is filled by X, or 2 if it is filled with a O  Movetable: A large vector of 19,683 elements ( 3^9), each element is 9-element vector. Algorithm: 1. View the vector as a ternary number. Convert it to a decimal number. 2. Use the computed number as an index into Move-Table and access the vector stored there. 3. Set the new board to that vector.
  • 44.
    Comments: This program isvery efficient in time. 1. A lot of space to store the Move-Table. 2. A lot of work to specify all the entries in the Move-Table. 3. Difficult to extend.
  • 45.
    Program 2: Data Structure:Board-A nine element vector representing the board. But instead of using 0,1 and 2 in each element, we store 2 for blank, 3 for X and 5 for O. Turn:An integer indicating which move of the game is about to be played;1 indicates the first move and 9 the last The Algorithm: Make2: returns 5 if the centre square is blank(Board[5]=2. Else any other blank sq Posswin(p): Returns 0 if the player p cannot win on his next move; otherwise it returns the number of the square that constitutes a winning move. If the product is 18 (3x3x2), then X can win. If the product is 50 ( 5x5x2) then O can win. Go(n): Makes a move in the square n.This procedure sets Board[n] to 3 if turn is odd,or 5 if Turn is even.It also increments Turn by one. Strategy: Turn = 1 Go(1) Turn = 2 If Board[5] is blank, Go(5), else Go(1) Turn = 3 If Board[9] is blank, Go(9), else Go(3) Turn = 4 If Posswin(X)  0, then Go(Posswin(X)){i.e block opponents win],else Go(Make2) .......
  • 47.
    Comments: 1. Not efficientin time, as it has to check several conditions before making each move. 2. Easier to understand the program’s strategy. 3. Hard to generalize.
  • 49.
    Comments: 1. Require muchmore time to consider all possible moves. 2. Could be extended to handle more complicated games.
  • 50.
    Question Answering Russia massedtroops on the Czech border. The following question –answer dialogues might occur (in fact occur with POLITICS) Dailogue1 Q Why did Russia do this? A Because Russia thought that it could take political control of Czech by sending troops. Q what should the US do? A The US should intervene militarily.
  • 51.
    Dialogue 2 Q Whydid Russia do this? A Because Russia wanted to increase its political influence over Czech. Q what should the US do? A The US should denounce the Russia action in the United Nations.
  • 52.
    Mary went fora new coat.She found a red she really liked.When she got it home,she discovered that it went perfectly with her favourite dress. Q1What did Mary go shopping for? Q2What did Mary find that she liked? Q3Did Mary buy anything? Program 1 Data structures: Question patterns-Look for Templates and patterns Ex If the template “Who did xy”(Input Question). The text patterns “xyz”is matched against the input text and the value of z is given as the answer to the question.
  • 53.
    • Text Theinput text stored simply as a long character string. • Question The current question also stored as a character string. • The Algorithm: • 1)Compare each element of QuestionPatterns against the question and use all those that match successfully to generate a set of text patterns. • 2)Pass each of these patterns through a substitution process that generates alternative forms of verbs so that for example,”go”in a question might match “went “in the text.This step generates a new,expanded set of text patterns
  • 54.
    3 Apply eachof these text patterns to Text,and collect all the resulting answers. 4 Reply with the set of answers just collected. Example Q1The template “what did xy”matches this question and generates the text pattern”Marry go shopping for z”. After the pattern – substitution step,expand to a set of patterns including “Mary goes shopping for z”and “Marry went shopping for z” Assign z “a new coat”.
  • 55.
    Q2 Unless thetemplate set is very large,allowing for the insertion of the object of “find”between it and the modifying phrase”that she liked”. The insertion of word “really” and the substition of “she” for “Marry”,this question in unanswerable. Q3 Since No answer to this question is contained in the text,so no answer will be found. Program 2 A Structured representation of a Sentence (converts the input text into a structured internal form that captures the meaning.It also converts questions into that form,it finds answers by matching structural forms against each other)
  • 56.
    Data structures EnglishKnow Input Text StructureText InputQuestion StructQuestion Algorithm 1Convert the question to structured form using knowledge in EnglishKnow 2Match this structured form against StructuredText. 3Return as the answer those parts of the text that match the requested segment of the question.
  • 57.
  • 58.
    AI Techniques • Search •Use of Knowledge • Abstraction
  • 60.
    To Build asystem to solve a particular problem:
  • 61.
    Define the problemas state space search
  • 62.
    • Total Numberof moves or board positions is 10^120(Shanon’s Number). • Operationalization(Formal description from informal ones)
  • 64.
  • 65.
    Thank You End ofLecture 3 IT201 Basics of Intelligent Computing Module -1 part-B (Lecture-3)
  • 66.
    IT201 Basics ofIntelligent Computing Module -1 part-A (Lecture 4) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 67.
    Summary of Lecture3 Game problems: Tic-tac-toe(Problem1 using movetable,problem2 using Algorithimic procudures,problem2’(magic square) Problem 3(minmax procedure)
  • 68.
  • 69.
  • 70.
    Assume that thereare 2 possible ways for X to win the game from a give board state. Move A : X can win in 2 move Move B : X can win in 4 moves Move A will have a value of +10 – 2 = 8 Move B will have a value of +10 – 4 = 6 (www.geeksforgeeks.org)
  • 71.
    About minmax • Problem3 requires more time than either of the problems(it must search a tree representing all possible move sequences before making each move). • Superior to other programs, could be extended to more complicated ones than tic tac toe. • Generate moves from any initial state(helps in creating knowledge base about games and how to play them) • Example of the use of AI technique.
  • 72.
    Summary of Lecture3 • Question Answering:(problem1)This program attempts to answer questions using the literal input text.It simply matches text fragments in the questions against the input text. • (problem2)uses structural representations. • Important knowledge representation systems(production rules, slot and filler structure, statements in mathematical logic) • (Problem3)uses tree structure(seeF ig1.3AI text book) [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 73.
    We conclude ThatAI technique requires: • Search • Use of Knowledge • Abstraction [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 74.
    Problems,Problem Spaces andSearch [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 75.
  • 76.
  • 77.
  • 78.
    One Solution tothe Water Jug Problem Galloons in the 4-Gallon Jug Gallons in the 3 –Gallon Jug Rule Applied 0 0 2 0 3 9 3 0 2 3 3 7 4 2 5or12 0 2 9or 11 2 0 [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 79.
    Control Strategies • Firstrequirement-It causes motion. • Second requirement-Systematic(global motion and local motion) [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 80.
    Depth-first and Breadth-firstSearch O(𝒃𝒅 ), 𝒃 = 𝒃𝒓𝒂𝒏𝒄𝒉𝒊𝒏𝒈 𝒇𝒂𝒄𝒕𝒐𝒓, 𝒅 = 𝒅𝒆𝒑𝒕𝒉 https://medium.com/basecs/breaking-down-breadth-first-search-cebe696709d9
  • 81.
  • 82.
  • 83.
  • 84.
    End of lecture4 Thank you
  • 85.
    IT201 Basics ofIntelligent Computing Module -1 part-A (Lecture 5) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 86.
    Heuristic Search • Anuninformed search(Brute Force/Blind search) is a searching technique that has no additional information about the distance from the current state to the goal.Ex DFS,BFS(gives optimal solution) • Informed Search(Heuristic search/Rule of thumb) is another technique that has additional information about the estimate distance from the current state to the goal.Ex,BestFirstSearch,HDFS,A*Algorithm. • Heuristics are like Tour Guides(gives solution may be optimal or may not be)
  • 87.
  • 88.
    Heuristic Function • Aheuristic function,h(n), provides an estimate of the cost of the path from a given node to the closest goal state.Must be zero if node represents a goal state.-Example: Straight-line distance from current location to the goal location in a road navigation problem. • Let us solve a 8-puzzle problem with Heuristic(Informed Search). https://www.cs.utexas.edu/~mooney/cs343/slide-handouts/heuristic-search.4.pdf
  • 90.
  • 91.
    Search Strategies • DFS •BFS • Generate-and-Test • Best-first search • Problem reduction • Constraint satisfaction • Means-ends analysis
  • 92.
    Generate and Test •Heuristic search,DFS with backtracking Steps: 1-Generate a possible solution 2-Test to see if this is a actual solution 3-If the solution is found,quit,otherwise go to step-1 Properties of generator:Complete,Non Redundant,Informed [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawwHills,2009
  • 93.
  • 94.
    Best First Search •(Informed,heuristic,gives good solution,may be optimal or may not be) Algorithm: Let OPEN be a priority QUEUE containing initial state LOOP If OPEN is empty return failure Node<- Remove-First(OPEN) • If node is goal • Then return the path from initial to Node • Else • Generate all successors of Node and • Put the newly generated Node into OPEN • According to their f values • END LOOP
  • 95.
  • 96.
  • 97.
    End of Lecture5 Thank You
  • 98.
    IT201 Basics ofIntelligent Computing Module -1 part-A (Lecture 6) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 99.
    Best First Search 1)DFS+BFS=Best First Search 2)f(n)=Actual cost and h(n)=Heuristic cost 3)In the previous example 1 F(n)=44 H(n)=ADFG=42 H(n)<=f(n)
  • 100.
    • Greedy BestFirst Search: h(n){carries additional information required for the search algorithm} hence it is estimated cost of the cheapest path from current node n to the goal node. • Best First Search:f(n){evaluation function} • GBFS is better than BFS
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
    Cont. BFS • Insidequeue-open list(Read) • Outside queue-closed list(Read and expand) • The Best first search allows us to switch between paths by gaining the benefits of both breadth first and depth first search. • Because, depth first is good because a solution can be found without computing all nodes and Breadth first search is good because it does not get trapped in dead ends. http://www.brainkart.com/article/Best-First-Search--Concept,-Algorithm,-Implementation,-Advantages,- Disadvantages_8881/
  • 107.
    A* Algorithm (*(admissible)) •f(n)=g(n)+h(n),g(n)=actual cost from start node to n,h(n)=estimated cost from n to goal node https://www.mygreatlearning.com/blog/a-search-algorithm-in-artificial-intelligence/
  • 108.
  • 109.
  • 110.
  • 111.
    Use A* tofind the optimal cost and path
  • 112.
    End of Lecture6 Thank You
  • 113.
    IT201 Basics ofIntelligent Computing Module -1 part-A (Lecture 7) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 114.
    A*Algorithm (over and underestimate) 1)Underestimationleads to optimal solution(Admissible) How to make A* Admissible? h(n)≤h*(n) Underestimation,h(n)(estimated),h*(n)(actual or optimal) h(n)≥h*(n) Overestimation, We Know in A*,f(n)=g(n)+h(n) g(A)=200 and g(B)=200 Consider CASE-I (Overestimation) Let h(A)=80 and h(B)=70,both are ≥h*(n) Find f(A),f(A)=g(A)+h(A)=200+80=280 Find f(B),f(B)=g(B)+h(B)=200+70=270 Find f(G),f(G)=g(G)+h(G)=200+50+0=250(through B) https://www.youtube.com/watch?v=xz1Nq6cZejI
  • 115.
    S B G A 280 270 250 Case-II Underestimation g(A)=200and g(B)=200 Let h(A)=30 and h(B)=20,both are ≤h*(n) Find f(A),f(A)=g(A)+h(A)=200+30=230 Find f(B),f(B)=g(B)+h(B)=200+20=220 Find f(G),f(G)=g(G)+h(G)=200+50+0=250through B Since A has 230<250,the algo explores A G also F(G)= 200+40=240 through A (optimal solution ) S B G A 230 220 250 240
  • 116.
    Student Exercise • AO*Algorithm • Hill Climbing(Local search, Greedy approach, no backtracking)
  • 117.
    Knowledge Base Creation 1)Inorder to solve the complex problems encountered in AI ,one needs both a large amount of knowledge(Facts) and some mechanisms for manipulating that knowledge to create solutions to new problems. a)Facts: Truths in some relevant world. These are the things we want to represent. b)Representations of facts in some chosen form. These are the things we actually be able to manupulate. [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawHills,2009
  • 118.
    Mapping between Factsand Representations Dog is an animal(english) Dog(animal)(logical) All animals have legs(english) ⩝ 𝑥: 𝑎𝑛𝑖𝑚𝑎𝑙 𝑥 → 𝑙𝑒𝑔𝑠 𝑥 Legs(dog) (logical ) dog has legs(english) [1]E.Rich,K.Knight,S.B.Nair,Artificial Intelligence,3rd Ed,McGrawHills,2009 Fig .Representation of Facts Abstract type Concrete implementation
  • 119.
    Knowledge Representation Techniques https://www.edureka.co/blog/knowledge-representation-in-ai/ script propositional predicate googleGraph Ifthen Slots and fillers Improper representation of knowledge Syntax error Semantic error objects attributes
  • 120.
    Propositional Logic • Propositionmeans sentence/statement(Not all statements are propositions) • Logic means reasoning • Statement may be True or False but not Both Ex… 10+10=20 True,3X 3=9 True,7-6=2 False Some ECE students are intelligent True/False Not a part of propositional logic Sun rises in the east True Propositional logic Semantic Syntax Complex Atomic Single Proposition (Two or more propositions combine) ¬ Negation ˅ Disjunction ˄ Conjunction → If then ↔iff
  • 121.
  • 122.
  • 123.
    Examples of Propositionallogic https://www.youtube.com/watch?v=qV4htTfow-E https://www.cs.sfu.ca/~ggbaker/zju/math/logic.html
  • 124.
    If then(conditional) andBiconditional https://www.cs.sfu.ca/~ggbaker/zju/math/logic.html
  • 125.
    Pros and Consof Propositional logic • Propositional logic is declarative. • Allow partial/disjunctive/negated information • It is compositional. • Meaning of A˄B is derived from the meaning of A and B. • Meaning of propositional logic is context independent • Has limited expressive power. Limitations: Ex”all humans are mortal”, In propositional logic we require billions of statements .similarly “some people can read “. https://www.ics.uci.edu/~kkask/Fall-2018%20CS271/slides/07-predicate-logic-I.pdf
  • 126.
    Predicate Logic(FOL(First OrderLogic)) • Propositional logic assumes the world contains facts. • FOL(like Natural language) assumes the world contains: • Objects-people,houses,colors, desk, tables, baseball games,… • Relations-red,bigger than,part of, comes between,… • Function relations-father of,best friend,one more than,plus,… FOL contains subject and predicate. Ex. “X is an integer” Bunny is a dog Mathematically- dog(x)-x is a dog, dog(bunny). tony is a dog, Int(x)-x is an integer, If y is an integer dog(tony) Int(y) subject predicate https://www.ics.uci.edu/~kkask/Fall-2018%20CS271/slides/07-predicate-logic-I.pdf
  • 127.
    Predicate Logic(FOL) If subjectis not single and become group then Ex-some dogs are intelligent (instead of dog is intelligent) -Every dog drinks milk, x x1,x2,x3 are different dogs UoD*(domain) X1 drinks milk ,milk(x1) every ˄ (and) X2 drinks milk ,milk(x2) ⩝x:milk(x),Every x has property of milk(x) ˄(and) X3 drink milk, milk(x3) dogs *universe of discourse
  • 128.
    Predicate Logic(FOL) • Somedogs are intelligent. “d1 is intelligent” v(OR) “d2 is intelligent “v (OR)“d3 is intelligent". If d1 is true then all are true. ∃𝑥: 𝑖𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡(𝑥) There exists at least one dog that is intelligent. Now,Change the UoD from dogs to animals ⩝x,milk(x),is not valid , If a1 is a dog, then it drinks milk ˅ If a2 is a dog,then it drinks milk ˅ If a2 is a dog,then it drinks milk ⩝x:dog(x)→milk(x) dog(a1)→milk(a1) dog(a2)→milk(a2) dog(a3)→milk(a3) dogs d1 d2 d3 animals a3 a2 a1
  • 129.
    Predicate Logic(FOL) some dogsare intelligent. ∃𝑥: 𝑖𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡(𝑥) If the UoD changes to animals ∃𝑥: 𝑑𝑜𝑔(𝑥)˄𝑖𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡(𝑥) Example: 1)Every Student in this ECEclass has visited USA or UK ⩝x:student(x)→viUSA(x) ˅ viUK(x) 2)Some prime number is odd number. ∃𝑥: 𝑝𝑟𝑖𝑚𝑒𝑛𝑢𝑚𝑏𝑒𝑟(𝑥)˄𝑜𝑑𝑑𝑛𝑢𝑚𝑏𝑒𝑟(𝑥) animals a1 a2 a3
  • 130.
    2 variable Predicate loves(x,y)-x loves y John loves Marry-loves(John, Marry) John loves everyone- ⩝x: likes(John, x) Everyone loves everyone- ⩝y ⩝x: likes( y,x) Someone likes someone- ∃𝑥 ∃𝑦: 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑦), john likes someone-∃𝑦: 𝑙𝑖𝑘𝑒𝑠(𝑗𝑜ℎ𝑛, 𝑦) Someone likes everyone- ∃𝑦 :[⩝x: 𝑙𝑖𝑘𝑒𝑠(𝑦, 𝑥)],john likes everyone-⩝x: likes(John, x) Everyone likes someone-⩝x: ∃𝑦: 𝑙𝑖𝑘𝑒𝑠(𝑥, 𝑦) Nobody likes everyone- lets us see- john doesn't like everyone- ¬ [⩝x likes(john,x)] ⩝y[ ¬ [⩝x likes(y,x)]] Marcus was a man- man(marcus) All Pompeians were Romans- ⩝x:Pompeians(x)→Roman(x) All romans were either loyal to Caesar or hated him- ⩝x:Roman(x)→[(loyalto(x,Caesar)˅ hate(x,Caesar))˄ ¬(loyalto(x,Caesar)˅ hate(x,Caesar))] https://www.youtube.com/watch?v=2juspgYR7as
  • 131.
    Exercises Gold and Silverornaments are precious. Given: G(x) :x is a gold ornament. S(x):x is a silver ornament P(x):x is precious. Ans-⩝x(G(x)˅S(x)→p(x)) Every teacher is liked by some student ⩝x:*Teacher(x)→ ∃𝑦:student(y)˄likes(y,x)] Some boys in the class are taller than all the girls ∃x *boys(x) ˄ ⩝y[girls(y)→taller(y,x)]] https://www.youtube.com/watch?v=xR2YzdGzf9k,GATE,CSE-2009,2005,2004
  • 132.
    End of Lecture7 Thank You
  • 133.
    IT201 Basics ofIntelligent Computing Module -1 part-A (Lecture 8) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 134.
    Intelligent Agents In artificialintelligence, an intelligent agent (IA) refers to an autonomous entity which acts, directing its activity towards achieving goals (i.e. it is an agent), upon an environment using observation through sensors and consequent actuators . https://mc.ai/quarantine-intelligent-agents-and-vacuum-cleaner/ https://www.researchgate.net/publication/333907788_Multi-agent_Systems_Applied_to_Knowledge_Assessment/figures?lo=1
  • 135.
  • 136.
    Simple Reflex Agent •They have very low intelligence capability as they don’t have the ability to store past state. • These type of agents respond to events based on pre-defined rules which are pre-programmed. • They perform well only when the environment is fully observable. https://www.educba.com/intelligent-agents/ https://www.researchgate.net/publication/276019253_Scheduling_Reputation_Maintenance_in_Agent- based_Communities_Using_Game_Theory/figures?lo=1&utm_source=google&utm_medium=organic
  • 137.
    Model Based Agents (ModelBased Reflex Agents) • It is an advanced version of the Simple Reflex agent. Like Simple Reflex Agents, it can also respond to events based on the pre-defined conditions, on top of that it also has the capability to store the internal state (past information) based on previous events. • Model-In order to perform any action, it relies on both internal state and current percept. Based Agents updates the internal state at each step. • In order to perform any action, it relies on both internal state and current percept. • However, it is almost next to impossible to find the exact state when dealing with a partially observable environment. https://www.educba.com/intelligent-agents/
  • 138.
  • 139.
    Goal Based andUtility Agents • The action taken by these agents depends on the distance from their goal (Desired Situation). The actions are intended to reduce the distance between the current state and the desired state. • In order to attain its goal, it makes use of the search and planning algorithm. • One drawback of Goal-Based Agents is that they don’t always select the most optimized path to reach the final goal. • The action taken by these agents depends on the end objective so they are called Utility Agent. • Utility Agents are used when there are multiple solutions to a problem and the best possible alternative has to be chosen. • They perform a cost-benefit analysis of each solution and select the one which can achieve the goal in minimum cost. https://www.educba.com/intelligent-agents/
  • 140.
    Learning Agents • LearningAgents have learning abilities so they can learn from their past experiences. • These types of agents can start from scratch and over time can acquire significant knowledge from their environment. • The learning agents have four major components which enable it to learn from its past experience.(Critic,learning elements,performance element,Problem generator. https://www.educba.com/intelligent-agents/
  • 141.
  • 142.
    Classification of AI •Weak AI-able to solve just a few predefined problem setsAn example of Weak AI can be voice assistants like SIRI. It has a limited range and capability. • General AI:If the productivity of the system is equivalent to that of a human, it is General AI.Ex IBM WATSON. • Super AI:When the productivity of the system is more than that of a human. This type of technology is not yet developed. • Reactive Machines:This is one of the fundamental types of AI. It doesn’t have past memory and can’t use past data to data for future activities. Model:- IBM chess program that beat Garry Kasparov during the 1990s. https://techvidvan.com/tutorials/artificial-intelligence-and-machine-learning/
  • 143.
    Classification of AI •Limited Memory-Modern day AI frameworks are capable of using past encounters to educate future choices. A portion of the dynamic capacities in self-driving vehicles have been planned along these lines. Perceptions used to advise activities occurring not long from now, for example, automatic lane switching of vehicles. • Theory of Mind-This sort of AI ought to have the option to comprehend individuals’ feelings, convictions, considerations, desires. They have the option to collaborate socially, however, a ton of upgrades are there in this field. This sort of AI isn’t finished at this point. https://techvidvan.com/tutorials/artificial-intelligence-and-machine-learning/
  • 144.
    Classification of AI •Self awareness -An AI that has it’s own cognizant, incredibly smart, mindfulness, and aware (In straightforward words a total person). Obviously, this sort of bot likewise doesn’t exist, and whenever accomplished it will be one of the achievements in the field of AI. • Examples of AI- • SIRI • Autopilot • NetFlix
  • 145.
    End of Lecture8 Enjoy This https://www.youtube.com/watch?v=wFOrkJuqSiY https://www.amazon.com/b?ie=UTF8&node=16008589011 Thank You
  • 146.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 9) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 147.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 148.
    What is SoftComputing? • The idea behind soft computing is to model cognitive behavior of human mind. • Soft computing is foundation of conceptual intelligence in machines. • Unlike hard computing , Soft computing is tolerant of imprecision, uncertainty, partial truth, and approximation.
  • 149.
    Hard Vs SoftComputing Paradigms ∙ Hard computing − Based on the concept of precise modeling and analyzing to yield accurate results. − Works well for simple problems, but is bound by the NP-Complete set. ∙ Soft computing − Aims to surmount NP-complete problems. − Uses inexact methods to give useful but inexact answers to intractable problems. − Represents a significant paradigm shift in the aims of computing - a shift which reflects the human mind. − Tolerant to imprecision, uncertainty, partial truth, and approximation. − Well suited for real world problems where ideal models are not available.
  • 150.
    • Can allcomputational problems be solved by a computer? • There are computational problems that can not be solved by algorithms even with unlimited time. • For example Turing Halting problem (Given a program and an input, whether the program will eventually halt when run with that input, or will run forever) • Alan Turing proved that general algorithm to solve the halting problem for all for all possible program-input pairs cannot exist • A key part of the proof is, Turing machine was used as a mathematical definition of a computer and program (Source Halting Problem).
  • 151.
    • NP completeproblems are problems whose status is unknown. • No polynomial time algorithm has yet been discovered for any NP complete problem, nor has anybody yet been able to prove that no polynomial-time algorithm exist for any of them. • The interesting part is, if any one of the NP complete problems can be solved in polynomial time, then all of them can be solved.
  • 152.
    • P isset of problems that can be solved by a deterministic Turing machine in Polynomial time. • NP is set of decision problems that can be solved by a Non-deterministic Turing Machine in Polynomial time. • P is subset of NP (any problem that can be solved by deterministic machine in polynomial time can also be solved by non-deterministic machine in polynomial time). What are NP, P, NP-complete and NP- Hard problems?
  • 153.
    • NP-complete problemsare the hardest problems in NP set. A decision problem L is NP-complete if: • 1) L is in NP (Any given solution for NP-complete problems can be verified quickly, but there is no efficient known solution) • 2) Every problem in NP is reducible to L in polynomial time • A problem is NP-Hard if it follows property 2 mentioned above, doesn’t need to follow property 1. Therefore, NP- Complete set is also a subset of NP-Hard set
  • 155.
    Hard Computing SoftComputing Conventional computing requires a precisely stated analytical model. Soft computing is tolerant of imprecision. Often requires a lot of computation time. Can solve some real world problems in reasonably less time. Not suited for real world problems for which ideal model is not present. Suitable for real world problems. It requires full truth Can work with partial truth It is precise and accurate Imprecise. High cost for solution Low cost for solution Difference b /w Soft and Hard Computing
  • 156.
    Unique Features ofSoft Computing • Soft Computing is an approach for constructing systems which are − computationally intelligent, − possess human like expertise in particular domain, − can adapt to the changing environment and can learn to do better − can explain their decisions
  • 157.
    Components of SoftComputing ∙ Components of soft computing include: − Fuzzy Logic (FL) − Evolutionary Computation (EC) - based on the origin of the species  Genetic Algorithm Swarm Intelligence  Ant Colony Optimizations − Neural Network (NN) − Machine Learning (ML)
  • 158.
     AI: predicatelogic and symbol manipulation techniques User Interface Inference Engine Explanation Facility Knowledge Acquisition KB: •Fact •rules Global Database Knowledge Engineer Human Expert Question Response Expert Systems User
  • 159.
    ANN Learning and adaptation Fuzzy SetTheory Knowledge representation Via Fuzzy if-then RULE Genetic Algorithms Systematic Random Search AI Symbolic Manipulation https://slideplayer.com/slide/7488659/
  • 162.
  • 163.
     Conventional AI: ◦Focuses on attempt to mimic human intelligent behavior by expressing it in language forms or symbolic rules ◦ Manipulates symbols on the assumption that such behavior can be stored in symbolically structured knowledge bases (physical symbol system hypothesis)
  • 164.
     Intelligent Systems SensingDevices (Vision) Natural Language Processor Mechanical Devices Perceptions Actions Task Generator Knowledge Handler Data Handler Knowledge Base Machine Learning Inferencing (Reasoning) Planning
  • 165.
    9/8/2020 20 • Thereal world problems are pervasively imprecise and uncertain • Precision and certainty carry a cost • Some problems may not even have any precise solution • may not even have any precise solutions Premises of Soft Computing
  • 166.
    9/8/2020 21 The guidingprinciple of soft computing is: •Exploit the tolerance for imprecision, uncertainty, partial truth, and approximation to achieve non-conventional solutions, tractability (easily handled, managed, or controlled), robustness and low costs. Guiding Principle of Soft Computing
  • 167.
    9/8/2020 22 Hard Computing •Premisesand guiding principles of Hard Computing are - Precision, Certainty, and Rigor. • Many contemporary problems do not lend themselves to precise solutions such as - Recognition problems (handwriting, speech, objects, images, texts) - Mobile robot coordination, forecasting, combinatorial problems etc. - Reasoning on natural languages
  • 168.
    • The manis about eighty to eighty five years old(pure imprecision) • The man is very old(imprecision and vagueness) • The man is probably from India(uncertainty)
  • 169.
    9/8/2020 24 •Soft computingemploys ANN, EC, FL etc, in a complementary rather than a competitive way. • One example of a particularly effective combination is "neurofuzzy systems.” • Such systems are becoming increasingly visible as consumer products ranging from air conditioners and washing machines to photocopiers, camcorders and many industrial applications. Implications of Soft Computing
  • 170.
    9/8/2020 25 Unique Propertyof Soft computing • Learning from experimental data  generalization • Soft computing techniques derive their power of generalization from approximating or interpolating to produce outputs from previously unseen inputs by using outputs from previous learned inputs • Generalization is usually done in a high dimensional space.
  • 171.
    9/8/2020 26 • Handwritingrecognition • Automotive systems and manufacturing • Image processing and data compression • Architecture • Decision-support systems • Data Mining • Power systems • Control Systems Current Applications using Soft Computing
  • 172.
    End of Lecture9 Thank You
  • 173.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 10) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 174.
     What isfuzzy thinking ◦ Experts rely on common sense when they solve the problems ◦ How can we represent expert knowledge that uses vague and ambiguous terms in a computer ◦ Fuzzy logic is not logic that is fuzzy but logic that is used to describe the fuzziness. Fuzzy logic is the theory of fuzzy sets, set that calibrate the vagueness. ◦ Fuzzy logic is based on the idea that all things admit of degrees. Temperature, height, speed, distance, beauty – all come on a sliding scale. Jim is tall guy It is really very hot today
  • 175.
     Communication of“fuzzy “ idea This box is too heavy.. Therefore, we need a lighter one…
  • 176.
     Boolean logic ◦Uses sharp distinctions. It forces us to draw a line between a members of class and non members.  Fuzzy logic ◦ Reflects how people think. It attempt to model our senses of words, our decision making and our common sense -> more human and intelligent systems
  • 177.
  • 178.
     Classical Setvs Fuzzy set
  • 179.
     Classical Setvs Fuzzy set 1 0 175 Height(cm) 1 0 175 Height(cm) Universe of discourse Membership value Membership value
  • 180.
     Classical Setvs Fuzzy set        A x A x x f X x f A A if , 0 if , 1 ) ( where }, 1 , 0 { : ) ( Let X be the universe of discourse and its elements be denoted as x. In the classical set theory, crisp set A of X is defined as function fA(x) called the the characteristic function of A In the fuzzy theory, fuzzy set A of universe of discourse X is defined by function called the membership function of set A ) (x A  . in partly is if 1 ) ( 0 ; in not is if 0 ) ( ; in totally is if 1 ) ( ], 1 , 0 [ : ) ( A x x A x x A x x where X x A A A A         
  • 181.
  • 182.
     An example: ◦Define the seven levels of education: 10 Highly educated (0.8) Very highly educated (0.5)
  • 183.
     Several fuzzysets representing linguistic concepts such as low, medium, high, and so one are often employed to define states of a variable. Such a variable is usually called a fuzzy variable.  For example: 11
  • 184.
     Given auniversal set X, a fuzzy set is defined by a function of the form This kind of fuzzy sets are called ordinary fuzzy sets(type 1 fuzzy set). L-fuzzy set is , L is partial order set  Interval-valued fuzzy sets: ◦ The membership functions of ordinary fuzzy sets are often overly precise. We may be able to identify appropriate membership functions only approximately. ◦ . ] 1 , 0 [ :  X A 12 : A X L 
  • 185.
    • Interval-valued fuzzysets: a fuzzy set whose membership functions does not assign to each element of the universal set one real number, but a closed interval of real numbers between the identified lower and upper bounds. ]), 1 , 0 ([ :   X A
  • 187.
  • 188.
     Fuzzy setsof type 2: ◦ : the set of all ordinary fuzzy sets that can be defined with the universal set [0,1]. ◦ is also called a fuzzy power set of [0,1]. 16
  • 189.
     Discussions: ◦ Theprimary disadvantage of interval-value fuzzy sets, compared with ordinary fuzzy sets, is computationally more demanding. ◦ The computational demands for dealing with fuzzy sets of type 2 are even greater then those for dealing with interval-valued fuzzy sets. ◦ This is the primary reason why the fuzzy sets of type 2 have almost never been utilized in any applications. 17
  • 190.
  • 191.
    • Let SetA=“adult”. The MF of this set maps the entire range of ‘age’ to ‘infant’, ’young’, ’adult’ ,’senior’. • The values of MFs for ‘infant’, ’young’etc are FSs.Thus set ‘adult’ is type-2 FS. The sets ‘infant’, ’young’, and so on are type-1 FS. If the values of MF of ‘infant’, ’young’ and so on are type -2 ,the set ‘adult ‘is ……….
  • 193.
    • Leve-2 FS FS‘x closer to r’,x: fuzzy variable,r:a particular number,Ex 5
  • 194.
  • 195.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 196.
    End of Lecture10 Thank You(Tribute to LA Zadeh) Born Lotfi Aliasker Zadeh February 4, 1921 Baku, Azerbaijan SSR Died September 6, 2017 (aged 96) Berkeley, California,
  • 197.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 11) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 198.
  • 201.
  • 202.
  • 203.
  • 204.
  • 205.
    • Find: support,core,crossoverpoint, alpha cut(0.7) of A Magnitude of FS Cardinality Relative Cardinality Properties
  • 216.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 217.
    End of Lecture11 Thank You
  • 218.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 12) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 228.
  • 237.
    • E=Complete Relation,O=Null Relation
  • 238.
  • 241.
    • Let R1is a Tolerance Relation
  • 242.
    • R1 canbecome equivalence relation through one composition R1oR1
  • 244.
  • 247.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 248.
    End of Lecture12 Thank You
  • 249.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 13) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 250.
  • 264.
  • 267.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 268.
    End of Lecture13 Thank You
  • 269.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 14) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 277.
    • Principle ofincompatibility: As the complexity of the system increases, our ability to make precise and yet significant statements about its behaviour diminishes until a threshold is reached beyond which a precision and significance become almost mutually exclusive characteristics.
  • 279.
    • Syntactic rule:refers to the way the linguistic values in the term set T(age) are generated. • Semantic rule: defines the MFs of each linguistic value of the term set. •
  • 282.
  • 284.
  • 287.
    • A coupledwith B • A entails B
  • 291.
  • 294.
    • w thedegree of belief for the antecedent part of a rule,gets propagated by the if-then rules and the resulting degree of belief or MF for the consequent part should be no greater than w Graphic interpretation of GMP using Mamdani Fuzzy implication and the max-min composition
  • 297.
  • 298.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 299.
    End of Lecture14 Thank You(Tribute to LA Zadeh) Born Lotfi Aliasker Zadeh February 4, 1921 Baku, Azerbaijan SSR Died September 6, 2017 (aged 96) Berkeley, California,
  • 300.
    IT201 Basics ofIntelligent Computing Module -2 part-A (Lecture 15) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 304.
  • 307.
    • Fuzzy rulebased system,Fuzzy expert system,Fuzzy model,Fuzzy associative memory,Fuzzy logic contoller,
  • 311.
  • 313.
  • 316.
    • Center oflargest area • First or last of maxima • Find the crisp value using all the defuzzification methods methods
  • 318.
  • 319.
  • 320.
    • Mean-max MFmethod=(6+7)/2=6.5m
  • 321.
  • 322.
    • If theout put of the fuzzy set has at least two convex sub regions then the center of gravity of the convex fuzzy sub region with the largest area is used to obtain the defuzzified value of the output z* Center of largest area
  • 323.
    • First orlast of maxima
  • 324.
    Find the Defuzzifiedvalue using all methods
  • 325.
    References Contents of thepresentation is taken from : Text Book:Neuro Fuzzy and Soft Computing by J.S.R.Jang and C.T.Sun,Prentice Hall. Reference Books:Fuzzy logic with Engg App,Timothy J Ross,Willey Pub. Soft Computing and Its application,Vol 1 K.S.Ray,Apple Academic Press. First Course on Fuzzy Theory and App.K.H.Lee,Spinger. Fuzzy Set theory and its app,H.Z.Zimmermann,Spinger Science
  • 326.
    End of Lecture15 Thank You(Tribute to LA Zadeh) Born Lotfi Aliasker Zadeh February 4, 1921 Baku, Azerbaijan SSR Died September 6, 2017 (aged 96) Berkeley, California,
  • 327.
    IT201 Basics ofIntelligent Computing Module -2 part-B (Lecture 16) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 328.
    Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent?  Simulation of natural evolution  Genetic algorithms  Case study: maintenance scheduling with genetic algorithms  Summary
  • 329.
    Can evolution beintelligent?  Intelligence can be defined as the capability of a system to adapt its behavior to ever-changing environment. According to Alan Turing, the form or appearance of a system is irrelevant to its intelligence.  Evolutionary computation simulates evolution on a computer. The result of such a simulation is a series of optimization algorithms, usually based on a simple set of rules. Optimization iteratively improves the quality of solutions until an optimal, or at least feasible, solution is found.
  • 330.
    Cont.  The behaviorof an individual organism is an inductive inference about some yet unknown aspects of its environment. If, over successive generations, the organism survives, we can say that this organism is capable of learning to predict changes in its environment.  The evolutionary approach is based on computational models of natural selection and genetics. We call them evolutionary computation, an umbrella term that combines genetic algorithms, evolution strategies and genetic programming.
  • 331.
    Simulation of naturalevolution  On 1 July 1858, Charles Darwin presented his theory of evolution before the Linnean Society of London. This day marks the beginning of a revolution in biology.  Darwin’s classical theory of evolution, together with Weismann’s theory of natural selection and Mendel’s concept of genetics, now represent the neo-Darwinian paradigm
  • 332.
    Neo-Darwinism • Neo-Darwinism isbased on processes of reproduction, mutation, competition and selection. The power to reproduce appears to be an essential property of life. The power to mutate is also guaranteed in any living organism that reproduces itself in a continuously changing environment. • Processes of competition and selection normally take place in the natural world, where expanding populations of different species are limited by a finite space.
  • 333.
    Cont.  Evolution canbe seen as a process leading to the maintenance of a population’s ability to survive and reproduce in a specific environment. This ability is called evolutionary fitness.  Evolutionary fitness can also be viewed as a measure of the organism’s ability to anticipate changes in its environment.  The fitness, or the quantitative measure of the ability to predict environmental changes and respond adequately, can be considered as the quality that is optimized in natural life.
  • 334.
    How is apopulation with increasing fitness generated?  Let us consider a population of rabbits. Some rabbits are faster than others, and we may say that these rabbits possess superior fitness, because they have a greater chance of avoiding foxes, surviving and then breeding.  If two parents have superior fitness, there is a good chance that a combination of their genes will produce an offspring with even higher fitness. Over time the entire population of rabbits becomes faster to meet their environmental challenges in the face of foxes.
  • 335.
    Simulation of naturalevolution • All methods of evolutionary computation simulate natural evolution by creating a population of individuals, evaluating their fitness, generating a new population through genetic operations, and repeating this process a number of times. • We will start with Genetic Algorithms (GAs) as most of the other evolutionary algorithms can be viewed as variations of genetic algorithms.
  • 336.
    Genetic Algorithms • Inthe early 1970s, John Holland introduced the concept of genetic algorithms. • His aim was to make computers do what nature does. Holland was concerned with algorithms that manipulate strings of binary digits. • Each artificial “chromosomes” consists of a number of “genes”, and each gene is represented by 0 or 1: 1 1 0 1 0 1 0 0 0 0 0 1 0 1 1 0
  • 337.
    Cont. • Nature hasan ability to adapt and learn without being told what to do. In other words, nature finds good chromosomes blindly. GAs do the same. Two mechanisms link a GA to the problem it is solving: encoding and evaluation. • The GA uses a measure of fitness of individual chromosomes to carry out reproduction. As reproduction takes place, the crossover operator exchanges parts of two single chromosomes, and the mutation operator changes the gene value in some randomly chosen location of the chromosome.
  • 338.
    Basic genetic algorithms •Step 1: Represent the problem variable domain as a chromosome of a fixed length, choose the size of a chromosome population N, the crossover probability pc and the mutation probability pm. • Step 2: Define a fitness function to measure the performance, or fitness, of an individual chromosome in the problem domain. The fitness function establishes the basis for selecting chromosomes that will be mated during reproduction.
  • 339.
    Cont. • Step 3:Randomly generate an initial population of chromosomes of size N: x1, x2 , . . . , xN. • Step 4: Calculate the fitness of each individual chromosome: f (x1), f (x2), . . . , f (xN) • Step 5: Select a pair of chromosomes for mating from the current population. Parent chromosomes are selected with a probability related to their fitness.
  • 340.
    • Step 6:Create a pair of offspring chromosomes by applying the genetic operators - crossover and mutation. • Step 7: Place the created offspring chromosomes in the new population. • Step 8: Repeat Step 5 until the size of the new chromosome population becomes equal to the size of the initial population, N. • Step 9: Replace the initial (parent) chromosome population with the new (offspring) population
  • 341.
    Genetic algorithms • GArepresents an iterative process. Each iteration is called a generation. A typical number of generations for a simple GA can range from 50 to over 500. The entire set of generations is called a run. • Because GAs use a stochastic search method, the fitness of a population may remain stable for a number of generations before a superior chromosome appears. • A common practice is to terminate a GA after a specified number of generations and then examine the best chromosomes in the population. If no satisfactory solution is found, the GA is restarted.
  • 342.
    Credit/References • Th. Bäck,Evolutionary Algorithms in Theory and Practice, Oxford University Press, 1996 • L. Davis, The Handbook of Genetic Algorithms, Van Nostrand & Reinhold, 1991 • D.B. Fogel, Evolutionary Computation, IEEE Press, 1995 • D.E. Goldberg, Genetic Algorithms in Search, Optimisation and Machine Learning, Addison-Wesley, ‘89 • J. Koza, Genetic Programming, MIT Press, 1992 • Z. Michalewicz, Genetic Algorithms + Data Structures = Evolution Programs, Springer, 3rd ed., 1996 • H.-P. Schwefel, Evolution and Optimum Seeking, Wiley & Sons, 1995
  • 343.
  • 344.
    Tribute to JohnHenry Holland Father of GA
  • 345.
    End of Lecture16 Thank You Happy learning
  • 346.
    IT201 Basics ofIntelligent Computing Module -3 (Lecture 17) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 347.
    Biological Neurons Ref: J¨urgenSchmidhuber. Deep learning in neural networks: An overview. Neural Networks, 61:85–117, 2015.
  • 362.
  • 371.
  • 375.
    • An algorithminspired by an experiment on cats is today used to detect cats in videos :-) • Faster, higher, stronger
  • 385.
    The Curious Caseof Sequences
  • 393.
  • 416.
  • 418.
    IT201 Basics ofIntelligent Computing Module -2 part-B (Lecture 16) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 419.
    (Deep Learning) K.Sridhar Patnaik,BITMesra Ref:NPTEL onlinecourse,Mitesh M Khapre,IITM References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 420.
  • 421.
  • 422.
  • 423.
  • 424.
  • 425.
  • 426.
  • 427.
  • 428.
    Disclaimer • I understandvery little about how the brain works! • What you saw so far is an overly simplified explanation of how the brain works! • But this explanation suffices for the purpose of this course! References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 429.
    McCulloch Pitts Neuron ReferencesNPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 430.
    Let us implementsome boolean functions using this McCulloch Pitts (MP) neuron References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 431.
  • 432.
    • Can anyboolean function be represented using a McCulloch Pitts unit ? • Before answering this question let us first see the geometric interpretation of a MP unit ... References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 433.
  • 434.
  • 435.
  • 436.
    Find Threshold forthe Function • With and without x3 and x4 as inhibitory. • Answers:……., ……., ………., ………. References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 437.
    The story sofar ... • A single McCulloch Pitts Neuron can be used to represent boolean functions which are linearly separable. • Linear separability (for boolean functions) : There exists a line (plane) such that all inputs which produce a 1 lie on one side of the line (plane) and all inputs which produce a 0 lie on other side of the line (plane) References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 438.
  • 439.
  • 440.
  • 441.
  • 442.
  • 443.
  • 444.
  • 445.
  • 446.
    What kind offunctions can be implemented using the perceptron? Any difference from McCulloch Pitts neurons? References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 447.
  • 448.
  • 449.
    Errors and ErrorSurfaces References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 450.
    Let us plotthe error surface corresponding to different values of w0,w1,w2 References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 451.
    Perceptron Learning Algorithm ReferencesNPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 452.
  • 453.
  • 454.
  • 455.
  • 456.
  • 457.
  • 458.
  • 459.
  • 460.
  • 461.
  • 462.
  • 463.
  • 464.
  • 465.
  • 466.
  • 467.
  • 468.
    Proof of Convergence •Now that we have some faith and intuition about why the algorithm works, we will see a more formal proof of convergence ... References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 469.
  • 470.
  • 471.
  • 472.
  • 473.
  • 474.
    Linearly Separable BooleanFunctions • So what do we do about functions which are not linearly separable ? • Let us see one such simple boolean function first ? References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 475.
  • 476.
  • 477.
    • Before seeinghow a network of perceptrons can deal with linearly inseparable data, we will discuss boolean functions in some more detail ... • How many boolean functions can you design from 2 inputs ? References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 478.
  • 479.
    Representation Power ofa Network of Perceptrons • We will now see how to implement any boolean function using a network of perceptrons ... References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 480.
  • 481.
  • 482.
  • 483.
  • 484.
  • 485.
    What if wehave more than 3 inputs ? References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 486.
    What if wehaven inputs ? References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 487.
    • Again, whydo we care about boolean functions ? • How does this help us with our original problem: which was to predict whether we like a movie or not? Let us see! References NPTEL-Onlinecourse,Mitesh M Khapre,IITM
  • 488.
  • 489.
  • 490.
    IT201 Basics ofIntelligent Computing Module -3 (Lecture 21) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 491.
    K.Sridhar Patnaik BIT Mesra ReferencesNPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.com
  • 492.
    Acknowledgements • Borrowed ideasfrom the videos by Ryan Harris on “visualize backpropagation” (available on youtube) • Borrowed ideas from this excellent book (http://neuralnetworksanddeeplearning.com/cha p4.html) which is available online • I am sure I would have been influenced and borrowed ideas from other sources and I apologize if I have failed to acknowledge them. References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 493.
    Sigmoid Neuron References NPTEL-Onlinecourse,MiteshM Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 494.
  • 495.
  • 496.
  • 497.
  • 498.
  • 499.
    A typical SupervisedMachine Learning Setup References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 500.
  • 501.
  • 502.
  • 503.
  • 504.
    Learning Parameters: (Infeasible)guess work References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 505.
  • 506.
  • 507.
    Let us seethis in more detail.... References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 508.
  • 509.
  • 510.
    Let us lookat something better than our “guess work” algorithm.... References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 511.
    Let us lookat the geometric interpretation of our “guess work” algorithm in terms of this error surface References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 512.
    Learning Parameters :Gradient Descent Now let us see if there is a more efficient and principled way of doing this References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 513.
  • 514.
  • 515.
  • 516.
  • 517.
  • 518.
  • 519.
  • 520.
  • 521.
  • 522.
  • 523.
  • 524.
    Representation Power ofa Multilayer Network of Sigmoid Neurons References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 525.
    http://neuralnetworksanddeeplearning.com/cha p4.html • The discussionin the next few slides is based on the ideas presented at the above link References NPTEL-Onlinecourse,Mitesh M Khapre,IITM, http://neuralnetworksanddeeplearning.co
  • 526.
  • 527.
  • 528.
  • 529.
  • 530.
  • 531.
  • 532.
  • 533.
  • 534.
  • 535.
  • 536.
  • 537.
  • 538.
  • 539.
  • 540.
  • 541.
  • 542.
  • 543.
  • 544.
  • 545.
  • 546.
  • 547.
  • 548.
  • 549.
  • 550.
  • 551.
  • 552.
  • 553.
  • 554.
    End of lecture21 Thank you
  • 555.
    IT201 Basics ofIntelligent Computing Module -3 (Lecture23) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 575.
    References • Ian Goodfellow,Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. • NPTEL Course on Computer Vision and Deep Learning, V.N Subramanium,IITH • NPTEL Course on Deep learning part-1,M.N Kapre,IITM
  • 576.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture-24) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 577.
    Introduction to CloudComputing Credit: #AWSTutorial #CloudTutorial #GettingStartedWithCloud
  • 591.
    Thank You End ofLecture 24 IT201 Basics of Intelligent Computing Module -4 (Lecture-24)
  • 592.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture 25) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 593.
    Virtualization In CloudComputing and Types • Virtualization is a technique of how to separate a service from the underlying physical delivery of that service. • It is the process of creating a virtual version of something like computer hardware. It was initially developed during the mainframe era. • It involves using specialized software to create a virtual or software-created version of a computing resource rather than the actual version of the same resource.
  • 594.
    • With thehelp of Virtualization, multiple operating systems and applications can run on same machine and its same hardware at the same time, increasing the utilization and flexibility of hardware. • In other words, one of the main cost effective, hardware reducing, and energy saving techniques used by cloud providers is virtualization
  • 595.
    • Virtualization allowsto share a single physical instance of a resource or an application among multiple customers and organizations at one time. • It does this by assigning a logical name to a physical storage and providing a pointer to that physical resource on demand.
  • 596.
    • The termvirtualization is often synonymous with hardware virtualization, which plays a fundamental role in efficiently delivering Infrastructure-as-a-Service (IaaS) solutions for cloud computing. • Moreover, virtualization technologies provide a virtual environment for not only executing applications but also for storage, memory, and networking.
  • 597.
    BENEFITS OF VIRTUALIZATION 1.Moreflexible and efficient allocation of resources. 2.Enhance development productivity. 3.It lowers the cost of IT infrastructure. 4.Remote access and rapid scalibility. 5.High availability and disaster recovery. 6.Pay per use of the IT infrastructure on demand. 7.Enables running multiple operating system.
  • 598.
    Types of Virtualization •1.Application Virtualization. • 2.Network Virtualization. • 3.Desktop Virtualization. • 4.Storage Virtualization.
  • 599.
    Application Virtualization • Applicationvirtualization helps a user to have a remote access of an application from a server. • The server stores all personal information and other characteristics of the application but can still run on a local workstation through internet. • Example of this would be a user who needs to run two different versions of the same software. Technologies that use application virtualization are hosted applications and packaged applications.
  • 600.
    Network Virtualization • Theability to run multiple virtual networks with each has a separate control and data plan. It co- exists together on top of one physical network. • It can be managed by individual parties that potentially confidential to each other. • Network virtualization provides a facility to create and provision virtual networks—logical switches, routers, firewalls, load balancer, Virtual Private Network (VPN), and workload security within days or even in weeks.
  • 601.
    Desktop virtualization • Desktopvirtualization allows the users’ OS to be remotely stored on a server in the data center.It allows the user to access their desktop virtually, from any location by different machine. • Users who wants specific operating systems other than Windows Server will need to have a virtual desktop.Main benefits of desktop virtualization are user mobility,portability, easy management of software installation, updates and patches.
  • 602.
    Storage virtualization • Storagevirtualization is an array of servers that are managed by a virtual storage system. The servers aren’t aware of exactly where their data is stored, and instead function more like worker bees in a hive. • It makes managing storage from multiple sources to be managed and utilized as a single repository. storage virtualization software maintains smooth operations, consistent performance and a continuous suite of advanced functions despite changes, break down and differences in the underlying equipment.
  • 603.
    Thank You End ofLecture 3 IT201 Basics of Intelligent Computing Module -1 part-B (Lecture-3) References- https://www.geeksforgeeks.org/virtualization-cloud- computing-types/
  • 604.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture 26) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 605.
    Examples of CloudStorage Dropbox, Gmail, Facebook Right now, Dropbox is the clear leader in streamlined cloud storage allowing users to access files on any device through its application or website with up to 1 terabyte of free storage. Google’s email service provider Gmail, on the other hand, provides unlimited storage on the cloud. Gmail has revolutionized the way we send emails and largely responsible for the increased usage of email worldwide.
  • 606.
    Cont. • Facebook isa mix of the two, in that it can store an infinite amount of information, images, and videos on your profile. They can then be easily accessed on multiple devices. Facebook goes a step further with their Messenger app, which allows for profiles to exchange data.
  • 607.
    Examples of MarketingCloud Platforms • Maropost for Marketing, Hubspot, Adobe Marketing Cloud. • A marketing cloud is an end-to-end digital marketing platform for clients to manage contacts and target leads. Maropost Marketing Cloud combines easy-to-use marketing automation and hyper-targeting of leads. At the same time, ensuring emails actually arrive in the inbox, thanks to its advanced email deliverability capabilities.
  • 608.
    • In general,marketing clouds fulfill a need for personalization. This is important in a market that demands messaging be “more human.” That’s why communicating that your brand is here to help, will make all the difference in closing.
  • 609.
    Examples of CloudComputing in Education • SlideRocket, Ratatype, Amazon Web Services • Education is increasingly adopting advanced technology because students already are. So, in an effort to modernize classrooms, educators have introduced e-learning software like SlideRocket.
  • 610.
    • SlideRocket isa platform that students can use to build presentations and submit them. Students can even present them through web conferencing all on the cloud. Another tool teachers use is Ratatype, which helps students learn to type faster and offers online typing tests to track their progress.
  • 611.
    • For schooladministration, Amazon’s AWS Cloud for K12 and Primary Education features a virtual desktop infrastructure (VDI) solution. Through the cloud, allows instructors and students to access teaching and learning software on multiple devices.
  • 612.
    Examples of CloudComputing in Healthcare • ClearDATA, Dell’s Secure Healthcare Cloud, IBM Cloud • Ultimately, cloud technology ensures patients receive the best possible care without unnecessary delay. The patient’s condition can also be updated in seconds through remote conferencing.
  • 613.
    • Salesforce(SaaS)(It isboth a business-to- business and business to consumer commerce solution.) • Creatio(cloud service specifically for marketing, sales and servicers to manage business processes and assist companies to facilitate consumer experience and customer journey.)
  • 614.
    • Slack(is anAmerican based cloud service designed to facilitate internal team collaboration through its tools and services.) • Google Cloud(a cloud service offered by Google, runs on the same infrastructure that Google uses internally for its end-user products like Google and YouTube.)
  • 615.
    • Microsoft 365(isa product line of subscription-based services such as Outlook, Powerpoint, and Excel.) • Adobe Creative Cloud(is a set of applications and services from Adobe Systems that gives subscribers access to various software used for graphic design, video editing, web design, photography and more.)
  • 616.
    End of Lecture26 Thank You
  • 617.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture 27) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 618.
    Amazon EC2 QuickStart adapted from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ EC2_GetStarted.html
  • 619.
    Amazon Elastic ComputeCloud (EC2) • Amazon Machine Images (AMIs) are the basic building blocks of Amazon EC2 • An AMI is a template that contains a software configuration (operating system, application server and applications) that can run on Amazon’s computing environment • AMIs can be used to launch an instance, which is a copy of the AMI running as a virtual server in the cloud.
  • 620.
    Getting Started withAmazon EC2 • Step 1: Sign up for Amazon EC2 • Step 2: Create a key pair • Step 3: Launch an Amazon EC2 instance • Step 4: Connect to the instance • Step 5: Customize the instance • Step 6: Terminate instance and delete the volume created
  • 621.
    Creating a keypair • AWS uses public-key cryptography to encrypt and decrypt login information. • AWS only stores the public key, and the user stores the private key. • There are two options for creating a key pair: – Have Amazon EC2 generate it for you – Generate it yourself using a third-party tool such as OpenSSH, then import the public key to Amazon EC2
  • 622.
    Generating a keypair with Amazon EC2 1. Open the Amazon EC2 console at http://console.aws.amazon.com/ec2/ 2. On the navigation bar select region for the key pair 3. Click Key Pairs in the navigation pane to display the list of key pairs associated with the account
  • 623.
    Generating a keypair with EC2 (cont.) 4. Click Create Key Pair 5. Enter a name for the key pair in the Key Pair Name field of the dialog box and click Create 6. The private key file, with .pem extension, will automatically be downloaded by the browser.
  • 624.
    Launching an AmazonEC2 instance 1. Sign in to AWS Management Console and open the Amazon EC2 console at http://console.aws.amazon.com/ec2/ 2. From the navigation bar select the region for the instance
  • 625.
    Launching an AmazonEC2 instance (cont.) 3. From the Amazon EC2 console dashboard, click Launch Instance
  • 626.
    Launching an AmazonEC2 instance (cont.) 4. On the Create a New Instance page, click Quick Launch Wizard 5. In Name Your Instance, enter a name for the instance 6. In Choose a Key Pair, choose an existing key pair, or create a new one 7. In Choose a Launch Configuration, a list of basic machine configurations are displayed, from which an instance can be launched 8. Click continue to view and customize the settings for the instance
  • 627.
    Launching an AmazonEC2 instance (cont.) 9. Select a security group for the instance. A Security Group defines the firewall rules specifying the incoming network traffic delivered to the instance. Security groups can be defined on the Amazon EC2 console, in Security Groups under Network and Security
  • 628.
    Launching an AmazonEC2 instance (cont.) 10.Review settings and click Launch to launch the instance 11.Close the confirmation page to return to EC2 console 12.Click Instances in the navigation pane to view the status of the instance. The status is pending while the instance is launching After the instance is launched, its status changes to running
  • 629.
    Connecting to anAmazon EC2 instance • There are several ways to connect to an EC2 instance once it’s launched. • Remote Desktop Connection is the standard way to connect to Windows instances. • An SSH client (standalone or web-based) is used to connect to Linux instances.
  • 630.
    Connecting to Linux/UNIXInstances from Linux/UNIX with SSH Prerequisites: - Most Linux/UNIX computers include an SSH client by default, if not it can be downloaded from openssh.org - Enable SSH traffic on the instance (using security groups) - Get the path the private key used when launching the instance 1. In a command line shell, change directory to the path of the private key file 2. Use the chmod command to make sure the private key file isn’t publicly viewable
  • 631.
    Connecting to Linux/UNIXInstances(cont.) 3. Right click on the instance to connect to on the AWS console, and click Connect. 4. Click Connect using a standalone SSH client. 5. Enter the example command provided in the Amazon EC2 console at the command line shell
  • 632.
    Transfering files toLinux/UNIX instances from Linux/UNIX with SCP Prerequisites: - Enable SSH traffic on the instance - Install an SCP client (included by default mostly) - Get the ID of the Amazon EC2 instance, public DNS of the instance, and the path to the private key If the key file is My_Keypair.pem, the file to transfer is samplefile.txt, and the instance’s DNS name is ec2- 184-72-204-112.compute-1.amazonaws.com, the command below copies the file to the ec2-user home
  • 633.
    Terminating Instances - Ifthe instance launched is not in the free usage tier, as soon as the instance starts to boot, the user is billed for each hour the instance keeps running. - A terminated instance cannot be restarted. - To terminate an instance: 1. Open the Amazon EC2 console 2. In the navigation pane, click Instances 3. Right-click the instance, then click Terminate 4. Click Yes, Terminate when prompted for confirmation
  • 634.
    Google App EngineQuick Start adapted from https://developers.google.com/appengine/docs/whatisgoo gleappengine
  • 635.
    Google App Engine(GAE) • GAE lets users run web applications on Google’s infrastructure • GAE data storage options are: – Datastore: a NoSQL schemaless object datastore – Google Cloud SQL: Relational SQL database service – Google Cloud Storage: Storage service for objects and files • All applications on GAE can use up to 1 GB of storage and enough CPU and bandwidth to support an efficient application serving around 5 million page views a month for free. • Three runtime environments are supported: Java, Python and Go.
  • 636.
    End of Lecture27 Thank You
  • 637.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture 28) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 638.
  • 639.
    Definition • Virtualization isthe ability to run multiple operating systems on a single physical system and share the underlying hardware resources* • It is the process by which one computer hosts the appearance of many computers. • Virtualization is used to improve IT throughput and costs by using physical resources as a pool from which virtual resources can be allocated. *VMWare white paper, Virtualization Overview
  • 640.
    Virtualization Architecture •A Virtualmachine (VM) is an isolated runtime environment (guest OS and applications) •Multiple virtual systems (VMs) can run on a single physical system
  • 641.
    Hypervisor • A hypervisor,a.k.a. a virtual machine manager/monitor (VMM), or virtualization manager, is a program that allows multiple operating systems to share a single hardware host. • Each guest operating system appears to have the host's processor, memory, and other resources all to itself. However, the hypervisor is actually controlling the host processor and resources, allocating what is needed to each operating system in turn and making sure that the guest operating systems (called virtual machines) cannot disrupt each other.
  • 642.
    Benefits of Virtualization •Sharing of resources helps cost reduction • Isolation: Virtual machines are isolated from each other as if they are physically separated • Encapsulation: Virtual machines encapsulate a complete computing environment • Hardware Independence: Virtual machines run independently of underlying hardware • Portability: Virtual machines can be migrated between different hosts.
  • 643.
    Virtualization in CloudComputing Cloud computing takes virtualization one step further: • You don’t need to own the hardware • Resources are rented as needed from a cloud • Various providers allow creating virtual servers: – Choose the OS and software each instance will have – The chosen OS will run on a large server farm – Can instantiate more virtual servers or shut down existing ones within minutes • You get billed only for what you used
  • 644.
    Virtualization Security Challenges Thetrusted computing base (TCB) of a virtual machine is too large. • TCB: A small amount of software and hardware that security depends on and that we distinguish from a much larger amount that can misbehave without affecting security* • Smaller TCB  more security *Lampson et al., “Authentication in distributed systems: Theory and practice,” ACM TCS 1992
  • 645.
    Xen Virtualization Architectureand the Threat Model • Management VM – Dom0 • Guest VM – Dom • Dom0 may be malicious – Vulnerabilities – Device drivers – Careless/malicious administration • Dom0 is in the TCB of DomU because it can access the memory of DomU, which may cause information leakage/modification
  • 646.
    Virtualization Security Requirements •Scenario: A client uses the service of a cloud computing company to build a remote VM – A secure network interface – A secure secondary storage – A secure run-time environment • Build, save, restore, destroy
  • 647.
    Virtualization Security Requirements •A secure run-time environment is the most fundamental – The first two problems already have solutions: • Network interface: Transport layer security (TLS) • Secondary storage: Network file system (NFS) – The security mechanism in the first two rely on a secure run-time environment • All the cryptographic algorithms and security protocols reside in the run-time environment
  • 648.
    Smaller TCB Solution SmallerTCB Actual TCB *Secure Virtual Machine Execution under an Untrusted Management OS. C. Li, A. Raghunathan, N.K. Jha. IEEE CLOUD, 2010.
  • 649.
  • 650.
  • 651.
    Hypervisor Vulnerabilities Malicious softwarecan run on the same server: – Attack hypervisor – Access/Obstruct other VMs 15 Physical Hardware Hypervisor OS OS Apps Apps Guest VM1 Guest VM2 servers
  • 652.
    NoHype* • NoHype removesthe hypervisor – There’s nothing to attack – Complete systems solution – Still retains the needs of a virtualized cloud infrastructure 16 Physical Hardware OS OS Apps Apps Guest VM1 Guest VM2 No hypervisor *NoHype: Virtualized Cloud Infrastructure without the Virtualization. E. Keller, J. Szefer, J. Rexford, R. Lee. ISCA 2010.
  • 653.
    Roles of theHypervisor • Isolating/Emulating resources – CPU: Scheduling virtual machines – Memory: Managing memory – I/O: Emulating I/O devices • Networking • Managing virtual machines Push to HW / Pre-allocation Remove Push to side
  • 654.
    Removing the Hypervisor •Scheduling virtual machines – One VM per core • Managing memory – Pre-allocate memory with processor support • Emulating I/O devices – Direct access to virtualized devices • Networking – Utilize hardware Ethernet switches • Managing virtual machines – Decouple the management from operation
  • 655.
    References • http://www.vmware.com/pdf/virtualization.pdf • NoHype:Virtualized Cloud Infrastructure without the Virtualization. E. Keller, J. Szefer, J. Rexford, R. Lee. ISCA 2010. • Secure Virtual Machine Execution under an Untrusted Management OS. C. Li, A. Raghunathan, N.K. Jha. IEEE CLOUD, 2010. • An Introduction to Virtualization and Cloud Technologies to Support Grid Computing. I.M. Lorente. EGEE08.
  • 656.
    Thank You End ofLecture 28 IT201 Basics of Intelligent Computing Module -4
  • 657.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture 29-34) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 658.
  • 659.
    Internet of Things •Overview of internet • IoT meaning • IoT characteristics
  • 660.
  • 661.
    5 People Connecting toThings Motion sensor Motion sensor Motion sensor ECG sensor Internet
  • 663.
  • 664.
    8 8 “Thing” connected tothe internet Image Courtesy: : CISCO
  • 665.
    Internet of Things(IoT)? TheInternet of Things (IoT) is the network of physical objects—devices, vehicles, buildings and other items embedded with electronics, software, sensors, and network connectivity— that enables these objects to collect and exchange data.
  • 666.
    Why should Ilearn about IoT? • Business trend • Emerging technologies • Growing IoT Services and Application 10
  • 667.
    Internet Connected devices 11 Source:Siemens, http://www.siemens.com/innovation/apps/pof_microsite/_pof-fall-2012/_html_en/facts-and-forecasts-growth-market-of-the-future.html
  • 668.
  • 669.
  • 670.
    Smart product sales 14 Source:Siemens, http://www.siemens.com/innovation/apps/pof_microsite/_pof-fall-2012/_html_en/facts-and-forecasts-growth-market-of-the-future.html
  • 671.
    Global Data Generation 15 -Everyday around 20 quintillion (10^18) bytes of data are produced (Source: http://www- 01.ibm.com/software/data/bigdata/). - This data includes textual content (unstructured, semi-structured, structured) to multimedia content (images, video and audio), on a variety of platforms (enterprise, social media, and sensors).
  • 672.
  • 673.
    IoT is everywhere •In our daily lives, we have become more reliant on IoT with our wearable tech, appliances, our cars, how we receive health care.
  • 674.
  • 675.
  • 676.
  • 677.
    • Internet ofThings may interact with various service sectors within the public/private sectors and ordinary consumers. • Public sector entities (such as universities) may have some level of involvement and interaction within all service sectors depicted; • Ranging from the operation and industry elements of buildings, to levels of research, retail entities, transportation, and IT/Networks
  • 679.
    IoT Market • Asof 2013, 9.1 billion IoT units • Expected to grow to 28.1 billion IoT devices by 2020 • Revenue growth from $1.9 trillion in 2013 to $7.1 trillion in 2020
  • 680.
  • 683.
    End of Brief Know–How about IoT
  • 684.
    Logical Design ofIoT • It refers to an abstract representation of the entities and processes without going into the low-level specifics of the implementation. • Functional Blocks of IoT: 1) Device (S,A,M,C) 2) Communication(Protocols) 3) Services(DM,DC,DPS,DD) 4) Management(provides functions to govern IoTS) 5) Security(A,A,MI/CI,DS) 6) Application(provide UI)
  • 685.
    • Device: AnIoT system comprises of devices that provide sensing, actuation, monitoring and control functions. • Communication: Handles the communication for the IoT system. • Services: services for device monitoring, device control service, data publishing services and services for device discovery.
  • 686.
    • Management: thisblocks provides various functions to govern the IoT system. • Security: this block secures the IoT system and by providing functions such as authentication , authorization, message and content integrity, and data security. • Application: This is an interface that the users can use to control and monitor various aspects of the IoT system. Application also allow users to view the system status and view or analyze the processed data.
  • 687.
    Functional Blocks ofIoT APPLICATION DEVICE SERVICES COMMUNICATION MANAGEMENT SECURITY
  • 688.
    Five layer IoTarchitecture
  • 691.
  • 692.
    IoT Communication Models •Request –Response • Public-Subscribe • Push-Pull • Exclusive Pair
  • 693.
    Request Response Communication Model CLIENT Sends Requestto Server RESOURCES SERVER Receives Req from Client,processes Req,looksup/ Fetches resources, Prepares response and sends response to client
  • 694.
  • 698.
    Survey of varioustype of Publish Subscribe implementations
  • 700.
    package pubSub; import javax.naming.InitialContext; import javax.jms.Topic; importjavax.jms.Session; import javax.jms.TextMessage; import javax.jms.TopicPublisher; import javax.jms.DeliveryMode; import javax.jms.TopicSession; import javax.jms.TopicConnection; import javax.jms.TopicConnectionFactory;
  • 701.
    • public classPublisher • { • public static void main(String[] args) throws Exception • { • // get the initial context • InitialContext ctx = new InitialContext(); • • // lookup the topic object • Topic topic = (Topic) ctx.lookup("topic/topic0"); • • // lookup the topic connection factory • TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx. • lookup("topic/connectionFactory"); • • // create a topic connection • TopicConnection topicConn = connFactory.createTopicConnection(); • • // create a topic session • TopicSession topicSession = topicConn.createTopicSession(false, • Session.AUTO_ACKNOWLEDGE); • •
  • 702.
    • // createa topic publisher • TopicPublisher topicPublisher = topicSession.createPublisher(topic); • topicPublisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT); • • // create the "Hello World" message • TextMessage message = topicSession.createTextMessage(); • message.setText("Hello World"); • • // publish the messages • topicPublisher.publish(message); • • // print what we did • System.out.println("Message published: " + message.getText()); • • // close the topic connection • topicConn.close(); • } • }
  • 703.
    package pubSub; import javax.naming.InitialContext; import javax.jms.Topic; importjavax.jms.Session; import javax.jms.TextMessage; import javax.jms.TopicSession; import javax.jms.TopicSubscriber; import javax.jms.TopicConnection; import javax.jms.TopicConnectionFactory;
  • 704.
    • public classSubscriber • { • public static void main(String[] args) throws Exception • { • // get the initial context • InitialContext ctx = new InitialContext(); • • // lookup the topic object • Topic topic = (Topic) ctx.lookup("topic/topic0"); • • // lookup the topic connection factory • TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx. • lookup("topic/connectionFactory"); • • // create a topic connection • TopicConnection topicConn = connFactory.createTopicConnection(); • • // create a topic session • TopicSession topicSession = topicConn.createTopicSession(false, • Session.AUTO_ACKNOWLEDGE);
  • 705.
    • // createa topic subscriber • TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic); • • // start the connection • topicConn.start(); • • // receive the message • TextMessage message = (TextMessage) topicSubscriber.receive(); • • // print the message • System.out.println("Message received: " + message.getText()); • • // close the topic connection • topicConn.close(); • } • }
  • 706.
    Push-communication Sent to specificrecipients who need to receive the information. This ensures that the information is distributed but does not ensure that it actually reached or was understood by intended audience. Push communication include letters, memos, reports, emails, faxes, voice mails, blogs, press releases, etc. Pull-communication Used for very large volumes of information, or for very large audience, and requires the recipient to access the communication content at their own discretion. These methods include intranet sites, e-learning, lessons learned database, knowledge repositories, etc.
  • 707.
  • 708.
    Google AppEngine: TaskQueues API <queue-entries> <!--Set the number of max concurrent requests to 10--> <queue> <name>optimize-queue</name> <rate>20/s</rate> <bucket-size>40</bucket- size> <max-concurrent-requests>10</max- concurrent-requests> </queue> </queue-entries>
  • 710.
    A Java TaskQueue Example
  • 712.
  • 713.
    IoT Communication APIs •REST-based Communication APIs. • WebSocket-based Communication APIs REST(Representational State Transfer)is a set of architectural principles by which you can design web services and web APIs that focus on a system’s resources and how resource states are addressed and transferred.
  • 714.
    • REST APIsfollow the Request-Response communication. • REST architectural constraints: Client-server Stateless Cache-able Layered System Uniform Interface Code on Demand
  • 717.
    TCP/IP Protocols handleData Communication
  • 718.
  • 719.
  • 720.
  • 721.
    Points to Note •RESTfull web service is a webAPI implemented using HTTP and REST principles. • RESTfull web service is a collection of resources which are represented by URIs. • RESTfull web API has a base URI(e.g.http://example.com/api/tasks/). • Client sends request to these URIs using the HTTP methods
  • 722.
    Cont • RESTfull webservice can support various internet media types(JSON)
  • 723.
    WebSocket-based Communication APIs • WebSocketAPIs allow bi-directional ,full duplex communication between clients and servers. • Follows Exclusive pair communication model. • Unlike request-response APIs such as REST, the WebSocket APIs allow full duplex communication and do not require a new connection to be setup for each message to be sent.
  • 725.
    • In orderto communicate using the WebSocket protocol, you need to create a WebSocket object; this will automatically attempt to open the connection to the server. WebSocket WebSocket( in DOMString url, in optional DOMString protocols ); var exampleSocket = new WebSocket("ws://www.example.com/socketserver", "protocolOne");
  • 726.
    • On return, •exampleSocket.readyState is CONNECTING. The readyState will become OPEN once the connection is ready to transfer data. • Once you've opened your connection, you can begin transmitting data to the server. To do this, simply call the WebSocket object's send() method for each message you want to send:
  • 727.
    Sending data tothe server • exampleSocket.send("Here's some text that the server is urgently awaiting!"); exampleSocket.onopen = function (event) { exampleSocket.send("Here's some text that the server is urgently awaiting!"); };
  • 728.
    Using JSON totransmit objects // Send text to all users through the server function sendText() { // Construct a msg object containing the data the server needs to process the message from the chat client. var msg = { type: "message", text: document.getElementById("text").value, id: clientID, date: Date.now() }; // Send the msg object as a JSON-formatted string. exampleSocket.send(JSON.stringify(msg)); // Blank the text input element, ready to receive the next line of text from the user. document.getElementById("text").value = ""; }
  • 729.
    Receiving messages fromthe server • exampleSocket.onmessage = function (event) { console.log(event.data); }
  • 730.
    Web Socket URLin tokens • The latest specification of Web Socket protocol is defined as RFC 6455 – a proposed standard. • RFC 6455 is supported by various browsers like Internet Explorer, Mozilla Firefox, Google Chrome, Safari, and Opera.
  • 731.
    Existing techniques, whichare used for duplex communication between the server and the client. • Polling • Long Polling • Streaming • Postback and AJAX • HTML5
  • 732.
    • AJAX isbased on Javascript's XmlHttpRequest Object. • XmlHttpRequest Object allows execution of the Javascript without reloading the complete web page. AJAX sends and receives only a portion of the web page.
  • 733.
    The major drawbacksof AJAX in comparison with Web Sockets are • They send HTTP headers, which makes total size larger. • The communication is half-duplex. • The web server consumes more resources.
  • 734.
    HTML5 • HTML5 isa robust framework for developing and designing web applications. The main pillars include Mark-up, CSS3 and Javascript APIs together.
  • 736.
    There are fourmain Web Socket API events − • Open • Message • Close • Error The Web Socket protocol supports two main actions, namely − • send( ) • close( )
  • 738.
    Thank You End ofLecture 29-34 IT201 Basics of Intelligent Computing Module -5
  • 739.
    IT201 Basics ofIntelligent Computing Module -IV (Lecture 35-36) K.Sridhar Patnaik Associate Professor Dept. of CSE,BIT Mesra Ranchi Email:kspatnaik@bitmesra.ac.in
  • 741.
  • 743.
  • 745.
  • 747.
  • 749.
  • 750.
    • Internet communicationprotocols are published by the Internet Engineering Task Force (IETF). The IEEE handles wired and wireless networking, and the International Organization for Standardization (ISO) handles other types. • The ITU-T handles telecommunication protocols and formats for the public switched telephone network (PSTN). As the PSTN and Internet converge, the standards are also being driven towards convergence. • In IoT we used MQTT, COAP, AMQP etc. protocols
  • 751.
    Thank You End ofLecture 35-36 IT201 Basics of Intelligent Computing Module -5
  • 752.
    REFERENCES 1) Neuro Fuzzyand Soft Computing,Jan,Sun and Mizutani,Prentice Hall. 2) Principals of SoftComputing by S.N Deepa,Sivanandam,Wiley. 3) Artificial Intelligence by Rich and Knight,McGraw Hill 4) NPTEL and Standford Online Learning Material. 5) Genetic Algorithm by Goldberg. Addison-Wesley Publishing Company, Inc.