2023 hnust Junior Exam Review Notes for Introduction to Artificial Intelligence Course

foreword

  1. ★ high probability test
  2. ✦Personal speculation test points
  3. ※to add on
  4. Does not fully cover key points of "Introduction to Artificial Intelligence Review 2023.pdf"
  5. Credits: hwl , lyf, lqx

question type

  1. Question and answer: 5*10 points
  2. Comprehensive: 15 points
  3. Design: 25 points
  4. Open questions/essay questions: 10 points

Chapter 1 Introduction

Definition of artificial intelligence

intelligent

  • thinking and understanding
  • Intelligence is the ability to apply knowledge to deal with the environment or the ability to think abstractly as measured by objective criteria

smart machine

  • A machine capable of exhibiting human-intelligent behavior

    Intelligent Behavior: Humans use their brains to think about problems or create ideas

  • A machine capable of performing various anthropomorphic tasks in uncertain environments and achieving desired goals

Artificial Intelligence (Subject) ✦

  • Artificial intelligence (discipline) is a branch of computer science concerned with the study, design and application of intelligent machines .
  • The main goal in the near future is to study the use of machines to imitate and execute certain intellectual functions of the human brain , and to develop related theories and technologies.

Artificial Intelligence (Competence) ✦

Artificial intelligence (capabilities) are intelligent behaviors performed by intelligent machines that are usually related to human intelligence , such as thinking activities such as judgment, reasoning, proof, recognition, perception, understanding, communication, design, thinking, planning, learning, and problem solving.

development of artificial intelligence

internationality

  1. Breeding period (-1956)
  2. Formative period (1956-1970)
  3. Dark Times (1966-1974)
  4. Knowledge application period (1970-1988)
  5. Integrated development period (1986-2010)
  6. Integration development period (2011-)

China

  1. foggy
  2. rough start
  3. usher in the dawn
  4. Flourish
  5. National strategy

Various Cognitive Views of Artificial Intelligence

Compare ✦

symbolism Connectionism Behaviorism
that artificial intelligence stems from mathematical logic bionics Cybernetics
principle Based on the assumption of physical symbol systems and the principle of bounded rationality Based on Neural Network and its Connection Mechanism and Learning Algorithm Based on cybernetics and perception-action control system
basic unit symbol Neurons (depends on) perception and action
Research methods Functional Simulation Structural simulation method Behavioral Simulation

Symbolism/Logicism/Psychology

traditional artificial intelligence

It is believed that artificial intelligence comes from mathematical logic.

principle

Based on the assumption of physical symbol systems and the principle of bounded rationality

basic unit

symbol

Research methods

Functional Simulation

Connectionism/Bionics/Physiology

It is believed that artificial intelligence comes from bionics.

principle

Based on Neural Network and its Connection Mechanism and Learning Algorithm

basic unit

Neurons

Research methods

Structural simulation method

Behaviorist/Evolutionist/Cybernetic Schools

It is believed that artificial intelligence comes from cybernetics.

principle

Based on cybernetics and perception-action control system

base unit (depends)

perception and action

Research methods

Behavioral Simulation

relation

Long-term coexistence and cooperation, learn from each other's strengths, and move towards integration and integration to contribute to the development of artificial intelligence

Human Intelligence and Artificial Intelligence

cognitive process

image-20230429155952826

Information Processing System/Symbol Operating System/Physical Symbol System

Automatic control system with intelligent information processing capability

Six basic functions of symbol system

  1. input symbol
  2. output symbol
  3. storage symbol
  4. copy symbol
  5. build symbol structure
  6. conditional transfer

hypothesis / hypothesis

System intelligence ⇔ the above 6 functions

  • An intelligent system must have the above six functions;
  • The system has the above 6 functions and can show intelligence

three inferences

  1. Human beings are intelligent and are physical symbol systems
  2. Computers are physical symbol systems capable of exhibiting intelligence
  3. Human is a physical symbol system, and computer is a physical symbol system, so we can use computer to simulate human

Computer Simulation of Human Intelligence

  • Machine intelligence can mimic human intelligence
  • intelligent computer
    • play chess
    • theorem proof
    • language translation
  • new intelligent computer
    • neural computer
    • quantum computer

elements of artificial intelligence

  1. Knowledge is the source of artificial intelligence
  2. Data is the foundation of artificial intelligence
  3. Algorithms are the soul of artificial intelligence
  4. Computing power is the power of artificial intelligence
  5. Talent is the key to the development of artificial intelligence

Classification of artificial intelligence systems

  1. expert system
  2. fuzzy system
  3. neural network system
  4. machine learning system
  5. bionic evolution system
  6. swarm intelligence system
  7. Distributed Intelligent System
  8. Integrated Intelligent System
  9. autonomous intelligent system
  10. Human-machine collaborative intelligent system

AI research goals

General Research Objectives

  • understanding human intelligence

    By writing programs to imitate and test theories related to human intelligence, we can better understand human intelligence.

  • Realize human intelligence

    Achieve human intelligence by creating useful dexterous programs that perform tasks that normally require human experts.

Recent research goals

Build intelligent computers to replace part of human intellectual labor.

Long-term research goals

Reveal the fundamental mechanism of human intelligence, and use intelligent machines to simulate, extend and expand human intelligence.

The short-term goal lays the theoretical and technical foundation for the long-term goal, and the long-term goal points out the direction for the short-term goal.

Research content of artificial intelligence

  1. Cognitive ModelingHalston
    summarizes cognition into five models
  2. Knowledge representation
    State space, problem reduction, predicate logic
  3. Knowledge Reasoning
    Deductive Reasoning, Inductive Reasoning, Analogical Reasoning
  4. Computational Intelligence
    Neural Computing, Fuzzy Computing, Evolutionary Computing
  5. Knowledge application
    expert system, machine learning, automatic planning
  6. Machine Perception
    Pattern Recognition, Natural Language Processing
  7. Machine thinking
    Comprehensive knowledge representation, knowledge reasoning, etc.
  8. Machine Learning
    Machines acquire knowledge and learn automatically
  9. Machine Behavior
    Expressiveness and Action
  10. Intelligent system construction
    Distributed system, parallel processing system

Artificial Intelligence Research Methods

  1. Functional Simulation
  2. Structural simulation method
  3. Behavioral Simulation
  4. integrated simulation

Computational Methods for Artificial Intelligence

  1. probability calculation
  2. Symbolic regular logic operations
  3. fuzzy calculation
  4. neural computing
  5. Evolutionary Computation and Immune Computation
  6. Swarm intelligence optimization calculation, ant colony algorithm, etc.

Research and application fields of artificial intelligence

Traditional fields of study (16 areas)

  1. Problem Solving and Games
  2. Logical reasoning and theorem proving
  3. computational intelligence
  4. Distributed Artificial Intelligence and Agents
  5. automatic programming
  6. expert system
  7. machine learning
  8. natural language understanding
  9. robotics
  10. pattern recognition
  11. machine vision
  12. Neural Networks
  13. intelligent control
  14. Intelligent dispatch and command
  15. Intelligent search
  16. System and Language Tools

New industry fields (9 aspects)

  1. smart manufacturing
  2. Smart medical
  3. Smart Agriculture
  4. Smart Finance
  5. Intelligent Transportation and Intelligent Driving
  6. Smart City
  7. smart home
  8. intelligent management
  9. smart economy

exercise

1-1 What is artificial intelligence? Try to explain it from two aspects of discipline and ability.

1-5 Why can machines (computers) imitate human intelligence?※

  1. Six basic functions of symbol system
  2. hypothesis / hypothesis
  3. three inferences

1-6 What are the current schools of artificial intelligence ? What is their perception?

  1. Symbolism/Logicism/Psychlogism/Computerism

    Its principle is mainly the assumption of physical symbol system (namely symbol operating system) and the principle of limited rationality.

    • It is believed that human's cognitive unit is a symbol, and the cognitive process is the process of symbol operation.
    • It is considered that human beings are a physical symbol system, and computers are also a physical symbol system, so we can use computers to simulate human intelligent behavior.
    • Knowledge is considered to be a form of information and the basis of intelligence.
    • It is believed that the core issues of artificial intelligence are knowledge representation, knowledge reasoning and knowledge application.
  2. Connectionism/Bionicsism/Physiology

    Its principle is mainly the neural network and the connection mechanism and learning algorithm between the neural networks.

    • It is believed that the basic unit of human thinking is a neuron, rather than a symbol processing process.
    • He believes that the human brain is different from a computer, and proposes a connectionist brain working model to replace the computer working model of symbolic manipulation.
  3. Actionism/Evolutionism/Cyberneticsism

    Its principle is cybernetics and perception-action control system

    • Think intelligence depends on perception and action.
    • It is believed that intelligence does not require knowledge, representation, or reasoning; artificial intelligence can evolve gradually like human intelligence.
    • It is believed that intelligent behavior can only be manifested in the real world by interacting with the surrounding environment.
    • It is believed that symbolism and connectionism describe the objective things in the real world and the working mode of intelligent behavior is an oversimplified abstraction, so it cannot truly reflect the objective existence.

1-11 What are the main research and application fields of artificial intelligence? Among them, which are new research hotspots?

  1. Main research and application areas

    Problem solving (chess playing program), logical reasoning and theorem proof (four-color theorem proof), natural language understanding, automatic programming, expert system, machine learning, neural network, robotics (interstellar exploration robot), pattern recognition (handwriting recognition , vehicle license plate recognition, fingerprint recognition), machine vision (machine assembly, satellite image processing), intelligent control, intelligent retrieval, intelligent dispatching and command (vehicle transportation height, train marshalling command), system and language tools

  2. new research hotspot

    Distributed Artificial Intelligence and Agent, Computational Intelligence and Evolutionary Computing, Data Mining and Knowledge Discovery (Supermarket Commodity Data Analysis), Artificial Life

Chapter 2 Knowledge Representation Methods

knowledge representation (step)

chatGPT-4

  1. Conceptualization: This is the first step in knowledge representation, which involves abstracting things, concepts, and relationships in the real world into a form that computers can understand. In this process, we need to determine which concepts and relations are important in order to represent and process them in a computer.

  2. Formalization: On the basis of conceptualization, formalization is the transformation of abstract concepts and relationships into strictly defined mathematical or logical structures. This can ensure the consistency and accuracy of knowledge representation, which is convenient for computers to reason and calculate. Common formal representation methods include predicate logic, first-order logic, description logic, etc.

  3. Modeling: Modeling is the application of formalized knowledge representations to practical problems and scenarios to build specific knowledge models. These models can be rule-based expert systems, ontology-based knowledge graphs, probability-based Bayesian networks, etc. The process of modeling needs to consider how to effectively store, retrieve and update knowledge, and how to use this knowledge for reasoning and decision-making.

state space representation

state

An ordered collection of a minimum set of variables q 0 , q 1 ,...,q n introduced to describe the difference between certain types of different things .

operator / operator (operator) / operator

means of changing a problem from one state to another

state space (S, F, G)

definition

  • is a graph representing all possible states of the problem and their relationships
    • S: set of initial states
    • F: collection of operators/operation sequences
    • G: set of target states

State Diagram/State Space Diagram

A graph composed of nodes corresponding to various states that can be reached from the initial state

Example: 15 Puzzle Problem (15 digital puzzles)

image-20230429201650772

image-20230429201705990

  • Status: chess game
  • operator
    • 15×4=60 pieces
    • Move 4 spaces
  • Solving method: Starting from the initial chess position, try various new chess positions obtained by each legal move, and then calculate the next set of chess positions obtained by taking another step. This continues until the target game is reached. This attempt essentially involves some kind of heuristic search.

State Diagram

directed graph

  • Nodes are connected by arcs, pointing from one node to another.
  • Parent node / ancestor -> successor node / descendant

path

sequence of nodes (n i1 , n i2 , ..., n ik ), paths of length k

cost

The cost c(n i , n j ) of the arc from node n i to node n j , the cost of the two-node path is equal to the sum of all arc costs on the path. For optimization problems, it is necessary to find the path with the minimum cost between two nodes.

explicit graph (explicit description of the graph)

Each node and its costed arc are given explicitly by a table. Not suitable for large graphs.

Implicit graphs (implicit descriptions of graphs)

An infinite set {s i } of nodes is known as a starting node. A successor node operator Γ is also known, which can be applied to any node to generate the cost of all successor nodes and connecting arcs of that node.

example

choose one of three

Example 1 route planning

image-20230429210011881

Example 2 Monkey and Banana Problem ✦

slightly modified

image-20230429204112872

  1. state

    Use a 4-element list (W, x, Y, z) to represent the problem state

    • W: Horizontal position of the monkey
    • x: take x=1 when the monkey is on top of the box; otherwise take x=0
    • Y: the horizontal position of the box
    • z: z=1 when the monkey picked a banana; otherwise, z=0
  2. operator

    1. goto (U): Indicates that the monkey goes to the horizontal position U

      ( W , 0 , Y , 0 ) g o t o ( U ) ( U , 0 , Y , 0 ) (W,0,Y,0) \dfrac{goto(U)}{} (U,0,Y,0) (W,0,Y,0)goto(U)(U,0,Y,0)

    2. pushbox (V): Indicates that the monkey pushes the box to the horizontal position V

      To apply the operator pushbox (V), it is required that the left side of the rule, the monkey and the box must be in the same position, and the monkey is not on top of the box. Such conditions of applicability imposed on operations are called preconditions of production rules .

      ( W , 0 , W , 0 ) p u s h b o x ( V ) ( V , 0 , V , 0 ) (W,0,W,0) \dfrac{pushbox(V)}{} (V,0,V,0) (W,0,W,0)pushbox(V)(V,0,V,0)

    3. climbbox: the monkey climbs to the top of the box

      ( W , 0 , W , 0 ) c l i m b b o x ( W , 1 , W , 0 ) (W,0,W,0) \dfrac{climbbox}{} (W,1,W,0) (W,0,W,0)climbbox(W,1,W,0)

    4. grasp: indicates that the monkey picked a banana

      ( c , 1 , c , 0 ) g r a s p ( c , 1 , c , 1 ) (c,1,c,0) \dfrac{grasp}{} (c,1,c,1) (c,1,c,0)grasp(c,1,c,1)

  3. state space

    1. Initial state set S

      {(a,0,b,0)}

    2. set of sequences of operations F

      {goto(a),goto(b),goto©,pushbox(a),pushbox(b),pushbox©,climbbox,grasp}

    3. Goal state set G

      {(c,1,c,1)}

  4. solve

    I always feel that this picture should be expanded and drawn in more detail.

    image-20230508111910106

Example 3 The missionary savage problem★

Suppose 3 missionaries and 3 savages came to the river, intending to cross from the right bank to the left bank in a boat. The boat has a load capacity of two people. At any time, if the wildlings outnumber the missionaries, the wildlings will eat the missionaries. How are they going to get everyone across the river safely in this boat? (the method is not unique)

method one
  1. state

    Use a ternary list (N x , N y , C) to represent the status of monks and wildlings on the right bank of the river

    • N x represents the actual number of monks on the right bank
    • N y represents the actual number of wildlings on the right bank
    • C is used to indicate if the boat is on the right bank
      • C=1 means on the right bank
      • C=0 means on the left bank
  2. operator

    1. L(i,j): means to transport i monks and j savages from the right bank to the left bank
    2. R(i,j): means to transport i monks and j savages from the left bank to the right bank

    Constraints: i+j <= 2, N x >= N y , 3-N x >= 3-N y

  3. state space

    1. Initial state set S

      {(3,3,1)}

    2. set of sequences of operations F

      {L(1,0),L(2,0),L(1,1),L(0,1),L(0,2),R(1,0),R(2,0),R(1,1),R(0,1),R(0,2)}

    3. Goal state set G

      {(0,0,0)}

  4. solve

    image-20230429212845418

    • Four different paths can be seen in the figure, for a total of four answers.
    • Where: L(1,1), R(1,0), L(0,2), R(0,1), L(2,0), R(1,1), L(2,0) , R(0,1), L(0,2), R(0,1), L(0,2) is one of the solutions with the fewest operators
Method Two
  1. state

    Use S i (nC, nY) to represent the state of the other side of the river after the ith crossing

    • nC is the number of missionaries
    • nY represents the number of savages
  2. operator

    Use d i (dC, dY) to represent the state change of the opposite bank during the process of crossing the river

    • dC represents the change in the number of missionaries on the other side after crossing the river for the ith time
    • dY represents the change in the number of savages on the opposite bank after the ith river crossing.

    constraint:

    1. When i is an even number, dC and dY are both non-negative numbers, indicating that the ship is heading to the opposite bank
    2. When i is an odd number, dC and dY are non-positive numbers at the same time, indicating that the boat is heading back to the shore.
  3. state space

    1. Initial state set S

      {(0,0)}

    2. set of sequences of operations F

      {…}

    3. Goal state set G

      {(3,3)}

  4. solve

    image-20230430114932142

    • Use graphs to solve this problem, let the abscissa be nY, the ordinate be nC, and the feasible state is represented by a hollow point. Each time you can move one grid along the diagonal or one grid along the coordinate axis, or Move 2 grids in the direction of the coordinate axis.

    • constraint

      • Odd number of state transitions, move to the right, above, or above the right,
      • The even-numbered number of state transitions moves to the left, down, or down to the left.
    • Starting from (0,0), change the state sequentially along the direction of the arrow, and after 11 steps, you can reach the target state (3,3),

    • The corresponding crossing scheme is

      d1(1,1) -> d2(-1,0)-> d3(0,2)-> d4(0,-1)-> d5(2,0)-> d6(-1,-1)-> d7(2,0)-> d8(0,-1)-> d9(0,2)-> d10(-1,0) -> d11(1,1)

problem reduction representation

Based on state space

Relation to State Space Representation

PPT

  1. The state space method is a problem representation and solution method based on the solution space, which is based on states and operators. When using the state space diagram to represent, starting from an initial state, adding an operator each time, and incrementally establishing the test sequence of the operator until the target state is reached. Since the state space method needs to expand too many nodes, it is easy to A " combination explosion " occurs , so it is only suitable for expressing relatively simple problems.
  2. The problem reduction method starts from the goal (the problem to be solved), reverse reasoning, and transforms the initial problem into a set of sub-problems and a set of sub-sub-problems through a series of transformations, until finally it is reduced to an ordinary set of primitive problems. These primitive problems The solution of can be obtained directly, thus the initial problem is solved, and the solution method of the reduction method is effectively illustrated by using the AND or graph.
  3. The state space method is a special case of the problem reduction method . In the and-or graph of the problem reduction method, there are and nodes and or nodes , but only or nodes are contained in the state-space method .

chatGPT-4

  1. Purpose: Both are about solving a problem or achieving a goal.

    1. Problem reduction means focusing on decomposing a complex problem into several simple sub-problems, and then solving the original problem by solving these sub-problems.

    2. The state space representation focuses on describing all possible states of the problem and the rules for transitioning from one state to another, so as to find the path from the initial state to the goal state.

  2. display method

    1. Problem reduction representation usually uses a tree structure to represent the decomposition process of the problem, each node represents a sub-problem, and the edge represents the relationship between the sub-problems.

    2. A state space representation uses a graph structure to represent all possible states of a problem, with nodes representing states and edges representing transitions between states.

  3. Solution strategy

    1. Problem reduction representation usually adopts a top-down solution strategy, starting from the original problem, and gradually decomposing it into sub-problems until the sub-problems can be solved directly.

    2. State space representation usually uses search algorithms (such as depth-first search, breadth-first search, A* search, etc.) to find the path from the initial state to the goal state in the state space.

  4. Applicable scene

    1. The problem reduction representation is suitable for problems that can be decomposed into independent or relatively simple sub-problems, such as sorting, shortest path, etc.
    2. The state space representation is suitable for problems that need to find a solution in a large number of possible states, such as the eight queens problem, the traveling salesman problem, etc.

substance

Starting from the goal (problem to be solved), reverse reasoning is established, sub-problems and sub-problems of sub-problems are established, until the initial problem is finally reduced to a set of ordinary original problems.

Tower of Hanoi Puzzle

state space method

image-20230430103558725

problem statute

  • Reduce (simplify) the original Vatican problem into the following three sub-problems

  • (ABC) meaning:

    C B A
    which pillar is the disc on

    image-20230430103720395

  • Problem-solving process (3 disc Vatican puzzles)

    image-20230430104415329

  • Vatican problem reduction graph (and-or graph)

    image-20230430104817337

related terms

image-20230430112615375

AND-OR Graph/Problem Reduction Graph/AND-OR Tree

definition

image-20230430105029140

image-20230430112356423

  • Use a graph-like structure to represent the replacement set that reduces the problem to the successor problem
  • A structure graph consisting of AND nodes and OR nodes.
  • Each AND node is marked with a small arc that bridges the arc to their successor node
AND OR Graph Formation Rules
  • Each node in an AND-OR graph represents a single problem or set of problems to be solved.

    The start node corresponds to the original question. The terminal leaf nodes correspond to the nodes of the primitive problem.

  • For each possible case of applying an operator to a problem A , the problem is transformed into a set of sub-problems; directed arcs point from A to subsequent nodes, representing the set of sub-problems obtained, and these sub-problem nodes are called or nodes .

  • Generally, for each node representing a set of two or more sub-problems , a directed arc points from this node to each node in the set of sub-problems, and these sub-problem nodes are called AND nodes.

start node

For the nodes described in the original problem

terminal leaf node

Nodes corresponding to primitive problems

or node

A set of nodes that can solve its parent problem as long as a certain problem is solved, such as (M, N, H).

with node

Only by solving all child problems can the node set of its parent problem be solved, such as (B, C) and (D, E, F). Each node is marked with a small arc connection.

Solvable Node

  • Terminal leaf nodes are solvable nodes (because they are associated with the primitive problem).
  • If a non-terminal node contains or successor nodes, then as long as there is a successor node that is solvable , the non-terminal node is solvable.
  • If a non-terminal node contains a successor node, the non-terminal node is solvable only if all its successor nodes are solvable .

image-20230430113219309

Solid nodes have solutions, and hollow nodes have no solutions; nodes marked with t are terminal nodes, and nodes without a mark are non-terminal nodes.

unsolvable node

  • A non-terminal node with no descendants is an unsolvable node.
  • If a non-terminal node contains or successor nodes, then the non-terminal node is unsolvable only if all its descendants are unsolvable .
  • If a non-terminal node contains a successor node, then as long as one of its descendants is unsolvable , the non-terminal node is unsolvable.

predicate logic representation

composition

  1. predicate symbol
  2. variable symbol
  3. function symbol
  4. constant symbol

first-order predicate logic

predicate symbol

definition
  • An attribute of an object of thought (individual) or a symbol for a relationship between individuals.
  • Indicated by an uppercase letter or a string of uppercase letters. Such as: P, Q, LIKE, ON
predicate form

P(x1,x2,x3,…,xn)

atomic formula

predicate symbol + term

item

constant, variable

function symbol

definition

The mapping symbol of several thinking objects to a thinking object. Indicated by a lowercase letter or a string of lowercase letters. Such as f, g, etc.

functional form

f(x1,x2,x3,…,xn)

conjunction

~: negative (not) ~P

∧: conjunction (and) P∧Q

∨: disjunction (or) P∨Q

⇒: implies P⇒Q(if P then Q)

⇔: Equivalent P ⇔ Q

quantifier

State the range of individual variables

∃ \exists (full quantifier): "all", "any", "everything", "each"

$\forall$ (existential quantifier): "some", "at least one", "exists"

predicate formula

Atomic Formula/Atomic Predicate Formula

Use P(x1, x2, ..., xn) to represent an n-ary predicate formula, where P is an n-ary predicate, and x1, x2, ..., xn are object variables or variables. P(x1, x2, ..., xn) is usually called the atomic formula of the predicate calculus , or the atomic predicate formula .

Molecular Predicate Formula

Atomic predicate formulas can be composed of compound predicate formulas with conjunctions, and they are called molecular predicate formulas .

joint formula
recursive definition
  • Atomic predicate formulas are well-formed formulas.
  • If A is a well-formed formula, then ~A is also a well-formed formula.
  • If A and B are well-formed formulas, then (A∧B), (A∨B), (A ⇒ B) and (A ⇔ B) are also well-formed formulas.
  • If A is a well-formed formula and x is a free variable in A, then (∀ x)A and (ョx)A are both well-formed formulas.
  • Only those formulas obtained according to the above rules are proper formulas.
truth table

image-20230501095904006

nature

image-20230501100958717

equivalence

Two well-formed formulas are said to be equivalent if their truth tables are the same no matter how they are interpreted.

Everlasting

P is true (T) under all possible interpretations

Perpetual leave (unsatisfiable)

P is false under all possible explanations (F)

satisfiable

P is true only under a certain interpretation.

Replacement and Unity

Pseudo-meta-inference

image-20230501101649284

By the well-formed formula W 1 and W 1 ⇒ \Rightarrow W2yields the well-formed formula W2

universal reasoning

image-20230501101638121

synthetic reasoning

image-20230501101810002

replacement

definition

Substitute variables in expressions with substitution terms. If E is used to represent an expression, and s is a substitution, then the expression after substitution is recorded as Es .

example

image-20230501101943074

nature
  • associative law
    • (Ls1)s2=L(s1s2)
    • (s1s2)s3=s1(s2s3)
  • Non-Commutability Law: s1s2 ≠ s2s1

oneness

Unity definition
  • Finds a permutation of terms for variables such that the two expressions agree.

If a permutation s is applied to every element of the expression set {E i}, then we denote the set of permutations by {E i} s.

Can be combined

The set of expressions {E i} is said to be unifying if there exists a permutation s such that:

E 1 s = E 2 s = E 3 s = … E 1 s = E 2 s = E 3 s =… E 1 s=E2s _ _=E3s _ _=

s is called the unifier of {E i}.

example

image-20230501102954937

mgu

The most general unifier: if for any unifier s of the expression set {E i }, there exists a certain s' such that {E i }s = {E i }gs', then g is called { The most universal unifier of E i } is denoted as mgu.

g={B/y} is the simplest unifier of {P[x,f(y),B], P[x,f(B),B]} in the above example

Semantic Network Representation

Semantic Web

It is a structured graphical representation of knowledge, a directed graph consisting of nodes and edges (also known as directed arcs). (Directed graph representation of knowledge, using directed graphs to represent entities or concepts and their semantic relationships)

Node

Entities , concepts , situations, etc. in the problem domain . Nodes are generally divided into instance nodes and class nodes.

Arc/Chain

Relationships between nodes. (Characterize the semantic connection between nodes)

composition

  1. lexical part
  2. Structural part
  3. process part
  4. semantic part
  • A semantic network is formed by connecting triplets (node1, arc, node2) represented by some directed graphs.

  • Graph representation of a triplet (A,R,B):

    image-20230501155652273

relation

  1. example relationship

    1. Logo: ISA

    2. Definition: Represents the link between a class and its instances (individuals).

    3. Example: "Xiaohua is a college student"

      image-20230501160036391

  2. Taxonomic relationships (subordination, generalization)

    1. Label: AKO

    2. definition

      1. class relationship among things;
      2. Links between class nodes and more abstract class nodes.

      image-20230501160115697

  3. Aggregation (Assembly)

    1. Identification: part-of

    2. definition

      1. Represents the link between an individual and its constituents.
      2. Based on the decomposition of concepts, high-level concepts are decomposed into a collection of several low-level concepts.
    3. Features: The attributes of nodes in each layer may be very different.

      image-20230501160315617

  4. attribute relationship

    1. definition

      1. Represents the connection between individuals, attributes and their values.
      2. A directed arc represents an attribute, and the node pointed to by the arc represents the value of the attribute.
    2. example

      Semantic network as shown on the right: it means that sumon is a person, male, 40 years old, and his occupation is a teacher.

      image-20230501160503482

  5. Collections and Membership

    1. definition

      1. Represents the association between members (elements) and collections.
      2. "Is a member" is generally identified as "a-member-of".
    2. example

      "Zhang San is a member of the Computer Society" can be expressed as the following figure

      image-20230501160610117

  6. Logic

    If a concept can be deduced from another concept, and there is a causal relationship between the two concepts, it is said that there is a logical relationship between them.

    image-20230501160647906

  7. Orientation relationship

    1. definition

      Point out when and where something happened, or point out its composition, shape, etc.

    2. example

      Zhang Hong is a teaching assistant at the Petroleum Institute; the Petroleum Institute is located at Electronic 2nd Road, Xi'an City; Zhang Hong is 25 years old this year. It can be represented by a semantic network as shown in the figure below.

      image-20230501160754082

  8. Affiliation

    1. definition

      The affiliation relationship means "has".

    2. example

      "A dog has a tail" can be expressed as

      image-20230501160844717

binary semantic network

Select Semantic Primitives

  • Reason: It is usually necessary to express the knowledge about a group of objects or concepts with a semantic network, otherwise it will cause too many networks and complicate the problem.
  • Method: Attempt to represent knowledge with a set of primitives in order to simplify the representation and use simple knowledge to represent more complex knowledge, called selection semantic primitives.

Concept node and instance node

image-20230501161303014

multivariate semantic network

form

image-20230501162340483

  1. Semantic networks can represent binary relations without difficulty
  2. Semantic networks can only express binary relations in essence
  3. Use the conjunction of binary relations to represent multiple relations, and need to introduce additional nodes

For example: to express the score of a match between the basketball teams of Peking University (BEIJING University, referred to as BU) and Tsinghua University (TSINGHUA University, referred to as TU) at Peking University is 85 to 89.

  1. predicate logic representation

    SCORE(BU,TU,(85:89))

  2. Semantic Network Representation

    image-20230501162459991

reasoning process

inherit

Passes descriptions of things from concept nodes or class nodes to instance nodes.

  • Slots (arcs): A node's slot is the named line that emanates from it.
  • Slot value: The node the arc points to. is the end node of the link.
value inheritance
  1. Definition: The instance node affirmatively inherits all attribute values ​​of the class to which it belongs and the parent class.

  2. Steel: ISA, AKO

  3. Example: Building Block Semantic Network Description

    image-20230501163026019

    • The instance object Wedge18 inherits the slot value of Wedge's Shape (shape slot): triangle.
    • The instance object Brick12 inherits the slot value of Brick's Shape (shape slot): rectangle
"if necessary" inheritance
  1. Definition: When the slot value is not known, it can be calculated using known information

  2. Example: Calculating the mass of a building block based on volume and density of matter

    image-20230501163558125

"default" inheritance
  1. definition

    1. The default value is generally a value that occurs more often, or a value with a higher probability of being true. When there is not enough information to determine a value, the default value is generally taken.
    2. "Node-slot-value": Allows a slot to have multiple types of values, and each type corresponds to a value type surface of the slot. Therefore, the default value type is called the DEFAULT side of the slot, and the ordinary value type is called the VALUE side of the slot.
  2. example

    In the Semantic Web in the figure below, the color of the building block may be blue, but in the subclass of the rectangular building block, the possible color is red. The surface of the COLOR slot at the BLOCK and BRICK nodes is the DEFAULT surface, which is indicated by brackets in the figure.

    image-20230501163817520

match
definition

When dealing with things made up of several parts , the problem of passing values ​​must be considered

example
  1. Since TOY-HOUSE77 is an instance of TOY-HOUSE, it must have two parts, one is a brick and the other is a wedge. Also, the bricks that are part of the playhouse must support the wedges. In the figure, the Toyhouse-77 components, and the links between them, are represented by dotted nodes and arrows. Because the knowledge is known indirectly through inheritance , not directly through actual nodes and chains. Therefore, nodes indicated by dotted lines and links indicated by arrows are imaginary nodes and links.

    image-20230501164335028

  2. Structure 35 (STRUCTURE35) in the figure below. This structure is known to have two parts, a brick BRICK12 and a wedge WEDGE18. Once you put the ISA chain between STRUCTURE35 and TOY-HOUSE, you know that BRICK12 must support WEDGE18. The SUPPORT imaginary link between BRICK12 and WEDGE18 is indicated by a dotted arrow in the figure above. Because it is easy to do component matching, the position and direction of the dotted arrows can be easily determined. WEDGE18 must match the wedge that is a part of TOY-HOUSE, and BRICK12 must match the brick.

    image-20230501164410960

  3. In the knowledge base, there are semantic network fragments of Zhao Yun’s school. Zhao Yun is a student. He is studying at Dongfang University. What courses are you taking?

    image-20230501164457798

Sample Question★

choose one of three

Small swallows occupy a nest from spring to autumn

image-20230501165334706

John gives Mary a gift

  1. Transform the ternary relationship Gives(John, Mary, Gift) into a conjunction of multiple binary relationships

    1. The entire description is represented as a giving event G1, making it an example of the event class Giving-Event
    2. John in G1 is the Giver
    3. Mary is the Receiver
    4. Gift is something given (Thing)
  2. Convert to a binary relationship: Isa(G1,Giving-Event)∧Giver(G1,John)∧Receiver(G1,Mary)∧Thing(G1,Gift)

  3. Draw a Multivariate Semantic Network

    image-20230501165243997

Nell is an elephant ✦

Use semantic networks to represent the followings:

  1. Nellie is an elephant,
  2. he likes apples.
  3. Elephants are a kind of mammals,
  4. they live in Africa,
  5. and they are big animals.
  6. Mammals and reptiles are both animals,
  7. all animals have head.

image-20230501164915999

Framework representation, Ontology technology, Process representation

the teacher did not speak

exercise

2-2 The missionary savage problem

[Three missionaries and three savages come to the river, intending to cross from the right bank to the left bank in a boat. The boat has a load capacity of two people. At any time, if the wildlings outnumber the missionaries, the wildlings will eat the missionaries. How are they going to use this boat to get everyone across the river safely?](#Example 3 Missionary Savage Problem ★)

Use the quaternion sequence structure to express the four-disk Vatican problem, and draw the AND-OR diagram for solving the problem

Use the quaternion sequence (nA, nB, nC, nD) to represent the state, where nA means that the A plate is on the nA column, nB means that the B plate is on the nB column, and nC means that the C plate is on the nC column On the No. column, nD means that the D disk falls on the nD No. column.

The initial state is 1111 and the target state is 3333

image-20230501165947915

2-7 Use the predicate calculus formula to express the following English sentences (Use more than omission of different predicates and terms. For example, do not use a single predicate letter to express each sentence.)

Exam questions may be slightly modified

A computer system is intelligent if it can perform a task which,if performed by a human, requires intelligence.

Method 1 (recommended)

  1. Define the basic predicate first

    1. INTLT(x) means x is intelligent
    2. PERFORM(x,y) means x can perform y
    3. REQUIRE(x) means x requires intelligence
    4. CMP(x) means x is a computer system
    5. HMN(x) means x is a human
  2. The above sentence can be expressed as

    (∀ x){(ョt) (ョy)[HMN(y) ∧PERFORM(y,t) ∧REQUIRE(t) ∧CMP(x) ∧PERFORM(x,t)]⇒INTLT(x) }

    • t:a task
    • x:a computer system
    • and:a human

Method Two

  1. P(x,y):x performs y task(x completes y task);

  2. Q(y):y requires intelligence (y requires intelligence)

  3. C(x):x is a computer system (x is a computer system)

  4. I(x): x is intelligent (x is intelligent)

    (∀ x)(ョy)((C(x)∧P(x,y)∧P(human,y)∧Q(y))⇒I(x))

2-8 Represent the following sentences as Semantic Web descriptions

  1. All man are mortal.
  2. Every cloud has a silver lining.
  3. All branch managers of DEC participate in a profit-sharing plan.

image-20230501171108546

Chapter 3 Search Reasoning Techniques

solve

initial state → goal state

Graph search strategy

4 search algorithms (without information: DFS, BFS; with information (heuristic): A, A*) to choose one

Classification

image-20230501172708859

  1. By whether to use heuristic information
    1. blind search
    2. heuristic search
  2. by question representation
    1. State-space search: A search performed to solve a problem using state-space methods
    2. AND-OR tree search: the search performed when solving a problem using problem reduction

data structure

OPEN table

Record the points that have not yet been expanded (remember which points you can go to in the next step)

CLOSED table

Record points that have been extended (remember which points have been traveled)

pointer to parent node

Every node structure representing state must have a pointer to the parent node (remember the path back from the target)

Node Data Structure

image-20230501173635655

  1. status description
  2. Pointer (indicates that the node is at the parent node leading to the initial node)
  3. The operation of converting from the parent node to the current node
  4. The depth of the current node in the search tree
  5. The estimated cost of the node (the distance from the node to the target node)

General process of graph search (GRAPHSEARCH)

The basic steps

  1. initialization;
  2. Determine whether the OPEN table is empty;
  3. select node n;
  4. Determine whether n is the target node;
  5. expand node n;
  6. Modify the pointer direction;
  7. Rearrange the OPEN table.

pseudocode

  1. G←S0,open ← S0;
  2. closed() ←( );
  3. loop: if open=( ) then return FAIL
  4. n←fisrt(open);
  5. remove(n,open);
  6. add(n,closed)
  7. if goal(n) then EXIT(success)
  8. M←expand(n),G←{M,G}
  9. For all nodes m in M:
    if m ∉ \notin/G then establish pointer m→n,open←add(m,open)
    if m ∈ G then decide whether to change its pointer m→n
    if m ∈ closed then decide whether to change the successor pointer of m
  10. Reorder the nodes in open according to a certain method or a certain heuristic value.
  11. Go loop

The main difference between various search strategies lies in the order in which the nodes in the Open table are arranged.

Algorithm flowchart

image-20230501174358341

No information search/blind search

A blind search can lead to a combinatorial explosion.

definition

The search is carried out according to the predetermined control strategy, and the intermediate information obtained in the search process does not change the control strategy. Blindness, low efficiency, good completeness.

Breadth First/Breadth First/Lateral Search

features
  1. Expand nodes layer by layer as close to the starting node as possible
  2. no prior knowledge
  3. OPEN tables are queues
  4. The CLOSED table is a sequential table, each node in the table is numbered in sequence, and the node being investigated has the largest number in the table.
  5. Completeness: If there is a solution, it must be found
  6. Universality: The breadth-first search strategy has nothing to do with the problem and is universal.
  7. low search efficiency
Algorithm diagram

image-20230501175023798

example

8-puzzle problem

image-20230502124930042

Regulations: The order of moving the cards into the space is: starting from the left of the space and rotating clockwise. It is not allowed to move diagonally, nor to return to the predecessor node.

As shown in the figure below (the breadth-first search tree of the eight-number puzzle), 26 nodes need to be expanded, and a total of 46 nodes are generated before the solution (target node) is obtained.

image-20230508154049436

Depth-first/vertical search

features
  1. The most recent (ie deepest) node is expanded first.
  2. The OPEN table is a stack
  3. The CLOSED table is a sequential table, each node in the table is numbered in sequence, and the node being investigated has the largest number in the table.
  4. There is generally no guarantee that an optimal solution will be found.
  5. When the depth limit is unreasonable, the solution may not be found, and the algorithm can be changed to a variable depth limit , that is, bounded depth-first search.
  6. In the worst case, the search space is equivalent to exhaustive.
depth limit

Prevents the search process from expanding along unhelpful paths, often giving a maximum depth of node expansion

Algorithm diagram

image-20230501175736441

Examples ✦

8-puzzle problem

image-20230502124930042

Regulations: The order of moving the cards into the space is: starting from the left of the space and rotating clockwise. It is not allowed to move diagonally, nor to return to the predecessor node.

depth-first search

image-20230506104936995

Bounded Depth First Search

image-20230508155658777

equal cost search

definition
  • A generalization of breadth-first search that instead of expanding along faults of equal-length paths, it expands along faults of equal-cost paths.
  • The relevant cost on each connection arc in the search tree, representing the cost of time, distance, etc.
algorithm
  • Let g(i) represent the cost from initial node S0 to node i, and use c(i, j) to represent the cost from parent node i to its child node j. The cost to node j is: g(j)=g(i)+c(i, j).

  • Expand nodes according to the increasing order of g(i), (sort all nodes in the Open table by g(i))

    The purpose of cost tree search is to find the best solution, that is, to find a solution path with the least cost.

features
  1. Need to calculate the cost
  2. Distinguish between cost and length
Algorithm diagram

image-20230501180216969

example

The numbers represent the cost of transportation between the two cities, the cost. Use the breadth-first search of the cost tree to find the transportation route with the least cost starting from city S to city G

image-20230501180648723

heuristic search

definition

In the search, heuristic information related to the problem is added to guide the search to the most promising direction , speed up the problem solving process and find the optimal solution. Poor completeness .

Strategy

  • The greater the "hope" of a node, the smaller its f-value. The selected node is the node with the smallest value function.
  • Always choose the "most promising" node as the next expanded node

Valuation function

f(x)

Greedy Search

f(x)=h(x)

Equal cost search UCS

f(x)=g(x)

Ordered Search/Best First Search

Strategy

Select the node with the smallest f-value on the OPEN table as the next node to expand.

Algorithm diagram

image-20230501182100705

Algorithm A

f(x)=g(x)+h(x)

A* algorithm

As long as the A* algorithm has a solution, it must be the best solution

Valuation function

f(x)=g(x)+h(x)

  • f(x): Indicates the evaluation function value of node x
  • g(x): cost function
    • The cost from the start state to the current state x
    • g(x)>0
  • h(x): heuristic function: the estimated cost from the current state x to the target state
    • h(x)≤h*(x): not greater than the actual cost of x to the target
Algorithm diagram

image-20230501182636160

Eight Number Puzzle ✦
h(x)=number of misplaced pieces

image-20230506164005460

  1. Definition of Valuation Function

    f (x) = g (x) + h (x)

    • g (x): the number of movement operations required from the initial state to x
    • h (x): the number of misplaced pieces in the x state
      • subject to restrictions
      • Empty space is not misplaced
  2. Solving process

    image-20230501183102895

h(x)=Manhattan distance✦

image-20230506164005460

  1. Definition of Valuation Function

    f (x) = g (x) + h (x)

    • g (x): the number of movement operations required from the initial state to x

    • h (x): the Manhattan distance between each digit and its target position

      Manhattan distance: the sum of the horizontal and vertical distances between two points

  2. Solving process

    image-20230503214250489

Digestion Principle/Resolution Principle

letter

An atomic formula and its negation.

clause

A well-formed formula consisting of disjunctions of literals.

Digest / boil down

The predicate calculus formula is decomposed and simplified, and some symbols are eliminated to obtain the derived clauses.

Digestion process

Resolution rules are applied to pairs of parent clauses in order to produce the derived

Obtaining the set of clauses★

You must memorize it by heart, and solve the problem step by step, at least remember which step you need to do

formulate the following predicate calculus as a set of clauses

(∀x){P(x) ⇒ {(∀y)[P(y) ⇒ P(f(x,y))]∧ ~(∀y)[Q(x,y) ⇒ P(y)]}}

  1. Eliminate the implied sign

    Using the ∨ and ~ symbols, replace A ⇒ B with ~A ∨ B.

    image-20230501194321689

  2. Reduce the scope of negation symbols

    Each negation symbol ~ at most one predicate symbol is used

    image-20230501194600808

    image-20230501194607338

  3. Standardize the variables

    Rename dummy variables (imaginary variables) to ensure that each quantifier has its own unique dummy .

    (∀x)(P(x)(ョx)Q(x)) ⇒ \Rightarrow (∀x)P(x)(yoy)Q(y)

    image-20230501194707906

  4. Eliminate the existential quantifier ョ

    1. For the existential quantifiers within the scope of universal quantifiers , the constraint variables in the existential quantifiers are replaced by Skolem function
    2. For free existential quantifiers, replace with a new constant

    image-20230501195245726

  5. toe-in

    Move all universal quantifiers to the left of the formula , and make the scope of each quantifier include the entire part of the formula that follows the quantifier.

    Toe-in = {prefix} (full quantifier string) {parent formula} (no quantifier formula)

    image-20230501195425198

  6. Matricizing into Conjunctive Normal Form

    Any parent formula can be written as a conjunction consisting of some predicate formulas and/or a finite set of disjunctive negations of predicate formulas. (distributive law)

    image-20230501200123092

    image-20230501200128687

  7. Eliminate universal quantifiers

    All remaining quantifiers are quantified by universal quantifiers. Eliminate prefixes, that is, eliminate obvious universal quantifiers.

    image-20230501200003740

  8. Eliminate the conjunction symbol ∧

    Replace (A∧B) with {A,B} and eliminate the symbol ∧. You end up with a finite set where each formula is a disjunction of literals.

    image-20230501200032353

  9. change variable name

    The names of variable symbols can be replaced so that a variable symbol does not appear in more than one clause.

    image-20230501200151807

Dissolving inference rules

Robinson Digestion Principle

  • Check whether the clause set S contains empty clauses, if so, then S is unsatisfiable.
  • If it is not included, select the appropriate clause in S to resolve, once the empty clause is resolved, it means that S is unsatisfiable.

Finding method of digestion formula

Taking the disjunction of the two clauses, and then canceling the complementary pairs, we get the solution

Subtractive example★

The empty clause for digestion and inversion will be used

  1. Hypothetical reasoning Modus ponens

    image-20230502093748201

  2. MergeCombination

    image-20230502093814564

  3. Tautologies

    image-20230502093857224

  4. NIL Clause: A clause that does not contain any literals.

    An empty clause appears during the digestion process, indicating that there must be a contradiction in S.

    image-20230502093740567

  5. Chain (syllogism) Chain

    The syllogism of P100 in the book may be wrong

    image-20230502093903632

Subtractive reasoning process

Starting from the clause set S, use the resolution reasoning rules for the clauses of S, put the obtained resolution formula into S, and then perform resolution reasoning until the empty clause (NIL) is obtained, then S is unsatisfiable, that is, the formula G is insatiable.

Digest with variables

To extend the rules of resolution inference to clauses containing variables, it is necessary to find a permutation that acts on the parent clause so that the parent clause contains complementary words.

image-20230502103247307

Digestion and inversion solution process

Digestion and inversion
step

Given formula set {S} and target formula B

  1. Negate B, get ~B;
  2. Add ~B to S;
  3. Turn the newly generated set {~B, S} into a clause set;
  4. Applying the principle of resolution, try to derive an empty clause expressing a contradiction
example

Other sample questions are also possible, but the savings question is the most likely

  1. Savings Question (A Roll)

    There may be some changes in this question, and it will be placed in the middle of a question. The question must be carefully reviewed, and the steps are interlocking

    1. Premise: Everyone who saves money earns interest.

    2. Conclusion: If there is no interest, then no one saves money

    3. prove

      1. specify atomic formula

        1. S(x,y) means "x saves y"
        2. M(x) means "x is money"
        3. I(x) means "x is interest"
        4. E(x,y) means "x gets y"
      2. Use Predicate Formulas to Express Premises and Conclusions

        I modified it, the answer to P101 in the book seems to be a bit wrong

        1. Premise:(∀x)[ [(ョy)(S(x,y) ∧ M(y))] ⇒ [(ョy)(I(y) ∧ E(x,y))] ]
        2. Conclusion: ~[(ョx)I(x)] ⇒ (∀x)(∀y)(M(y) ⇒ ~S(x,y))
      3. Negating the premise and conclusion into a set of clauses (the simplification process can be omitted in the exam)

        1. Premise:(∀x)[ [(ョy)(S(x,y) ∧ M(y))] ⇒ [(ョy)(I(y) ∧ E(x,y))] ]

          1. Eliminate implied sign

            (∀x)[ [~[(ョy)(S(x,y) ∧ M(y))] ] ∨ [(ョy)(I(y) ∧ E(x,y))] ]

          2. Reduce the scope of negation symbols

            1. (∀x)[ [(~ョy)(~S(x,y) ∨ ~M(y))] ∨ [(ョy)(I(y) ∧ E(x,y))] ]
            2. (∀x)[ [(∀y)(~S(x,y) ∨ ~M(y))] ∨ [(ョy)(I(y) ∧ E(x,y))] ]
          3. Standardize the variables

            No need for this step

          4. Eliminate existential quantifiers

            1. Define the Skolem function: y=f(x)
            2. (∀x)[ [(∀y)(~S(x,y) ∨ ~M(y))] ∨ [(I(f(x)) ∧ E(x,f(x)))] ]
          5. toe-in

            (∀x)(∀y)[ (~S(x,y) ∨ ~M(y)) ∨ [(I(f(x)) ∧ E(x,f(x)))] ]

          6. Matricizing into Conjunctive Normal Form

            (∀x)(∀y)[ [~S(x,y) ∨ ~M(y) ∨ I(f(x))] ∧ [~S(x,y) ∨ ~M(y) ∨ E(x,f(x))] ]

          7. Eliminate universal quantifiers

            [~S(x,y) ∨ ~M(y) ∨ I(f(x))] ∧ [~S(x,y) ∨ ~M(y) ∨ E(x,f(x))]

          8. Eliminate the conjunction symbol ∧

            All the clauses after simplification must be written in the answer

            • 子句①:~S(x,y) ∨ ~M(y) ∨ I(f(x))
            • Clause ②: ~S(x,y) ∨ ~M(y) ∨ E(x,f(x))
          9. change variable name

            There is no such step in the book, but it feels better to replace it

        2. Negation of conclusion: ~[~(ョx)I(x) ⇒ (∀x)(∀y)(M(y) ⇒ ~S(x,y))]

          1. Eliminate implied sign

            1. ~[~[(ョx)I(x)] ⇒ (∀x)(∀y)(~M(y) ∨ ~S(x,y))]
            2. ~[(ョx)I(x) ∨ (∀x)(∀y)(~M(y) ∨ ~S(x,y))]
          2. Reduce the scope of negation symbols

            1. [~(ョx)I(x) ∧ [~[(∀x)(∀y)(~M(y) ∨ ~S(x,y))] ] ]
            2. (∀x)(~I(x)) ∧
          3. Standardize the variables

            No need for this step

          4. Eliminate existential quantifiers

            Replace x with constant a and y with b

            (∀x)(~I(x)) ∧ (M(b) ∧ S(a,b))

          5. toe-in

            (∀x)(~I(x) ∧ (M(b) ∧ S(a,b)) )

          6. Matricizing into Conjunctive Normal Form

            (∀x)(~I(x) ∧ M(b) ∧ S(a,b) )

          7. Eliminate universal quantifiers

            ~I(x) ∧ M(b) ∧ S(a,b)

          8. Eliminate the conjunction symbol ∧

            All the clauses after simplification must be written in the answer

            • Clause ③:~I(x)
            • Clause ④: S(a,b)
            • Clause ⑤: M(b)
          9. change variable name

            • Clause ③:~I(z)
            • Clause ④: S(a,b)
            • Clause ⑤: M(b)
      4. Digestion and inversion to find the null clause (NIL)

        Savings Problem Inversion Tree

        image-20230502120203955

  2. A company recruits staff, A, B, and C three people take the test (B paper test)

    1. premise

      1. At least one of the three
      2. If A is accepted but B is accepted, C must be admitted
      3. If you get B, you must get C
    2. Conclusion: The company must admit C

    3. prove

      1. specify atomic formula

        P(x) means admission x

      2. Use Predicate Formulas to Express Premises and Conclusions

        1. premise
          1. P(A) ∨ P(B) ∨ P©
          2. (P(A) ∧ ~P(B)) ⇒ P©
          3. P(B) → P©
        2. Conclusion: P©
      3. Negating the premise and conclusion into a set of clauses (the simplification process can be omitted in the exam)

        1. premise

          1. Clause①: P(A) ∨ P(B) ∨ P©
          2. Clause ②: ~P(A) ∨ P(B) ∨ P©
          3. Clause ③: ~P(B) ∨ P©
        2. negation of conclusion

          Clause ④: ~P©

        3. prove

          image-20230502121134918

  3. A set of formulas that assume facts

    1. premise

      1. P
      2. (P∧Q)⇒ R
      3. (S∨T) ⇒ Q
      4. T
    2. Conclusion: R

    3. prove

      1. clause set

        1. P
        2. ~P ∨~Q ∨ R
        3. ~S ∨ Q
        4. ~T ∨ Q
        5. T
        6. ~R
      2. Digest Deduction Tree / Digest Inversion Tree

        Using a tree to visually express the digestion reasoning process

        image-20230502122041083

  4. Happy student

    1. premise

      Everyone who pass the computer test and win the prize is happy. Everyone who wish study or is lucky can pass all tests. Zhang doesn’t study, but he is lucky. Every lucky person can win the prize.

    2. in conclusion

      Zhang is happy

    3. prove

      1. specify atomic formula

        1. Pass(x,y):x pass y test
        2. Win(x,y):x win y
        3. Happy(x):x is happy
        4. Study(x):x study
        5. Lucky(x):x is lucky
      2. Use Predicate Formulas to Express Premises and Conclusions

        1. premise

          image-20230502122542783

        2. Negation of the conclusion: ~Happy (zhang)

      3. Negating the premise and conclusion into a set of clauses (the simplification process can be omitted in the exam)

        image-20230502122751316

      4. Digest Deduction Tree / Digest Inversion Tree

        image-20230502122830292

Inversion solution
process
  1. Add each clause resulting from the negation of the target formula to the clauses of the negation of the target formula negation.
  2. According to the inversion tree, perform the same digestion as before until a certain clause is obtained at the root.
  3. use the root clause as an answer statement
substance

root is NIL transforms to root is answer statement

example
  1. Subtractive inversion

    1. premise

      1. Wherever JOHN goes, FIDO goes there too

      2. JOHN is in school now.

    2. Conclusion: Where FIDO is can be determined.

    3. prove

      1. Atomic Formula Definition and Predicate Expression

        image-20230502123804922

      2. clause set solution

      image-20230502123819941

      1. Digestion and inversion reasoning

      image-20230502123832683

      1. The conclusion is established!
  2. Inversion solution

    Wherever JOHN goes, FIDO goes there; JOHN is in school now. Q: Where is FIDO?

    image-20230502124036272

Rule Deduction System…

The latter should not be mentioned, it is estimated that it will not be tested

exercise

3-1 What is the graph search process ? Among them, what does it mean to rearrange the OPEN table, and what is the principle of rearrangement?

  1. The general process of graph search is as follows: (Describe the general process of graph search (GRAPHSERCH)) (use text or flow chart)

    1. Create a search graph G (initially only contains the starting node S), and put S in the unexpanded node table (OPEN table).

    2. Create an expanded node table (CLOSED table), which is initially an empty table.

    3. LOOP : If the OPEN list is empty, it will fail and exit.

    4. Select the first node n on the OPEN list, remove it from the OPEN list and put it in the CLOSED list.

    5. If n is a target node, there is a solution and exits successfully .

      This solution is obtained by following the path in graph G along the pointer from n to S (the pointer will be set in step 7)

    6. Expand node n to generate a set M of successor nodes.

    7. Modify the pointer direction of the M member

      1. For those members of M that have never appeared in G (neither on the OPEN list nor on the CLOSED list)
        1. set a pointer to n
        2. Add them to the OPEN table
      2. For each M member already on the OPEN or CLOSED table, determine whether its original parent node needs to be changed to n
      3. For each M member already on the CLOSED table, if its parent node is modified, the node is removed from the CLOSED table and re-added to the OPEN table.
    8. Reorder the OPEN list in some arbitrary way or by some heuristic.

    9. GO LOOP

  2. Rearranging the OPEN table means that in step (6), which node will be expanded first, and different sorting criteria correspond to different search strategies .

  3. The principle of rearrangement depends on the specific needs, and different principles correspond to different search strategies

    1. If you want to find a solution as soon as possible, you should arrange those nodes that are most likely to reach the target node in the front part of the OPEN list
    2. If you want to find the solution with the least cost, you should rearrange the OPEN list in order of cost from small to large .

3-4 How to obtain the answer to the question through subtractive inversion?

See the process of inversion solution for details

3-7 eight number puzzle

Use the A* algorithm to draw the search tree of the eight-digit puzzle; mark the nodes of the OPEN table and the CLOSED table; write the optimal solution from the initial state to the target state. See details

3-12 Transform the following sentences into clause form

9 steps to find the clause set:

  1. Eliminate implied sign
  2. Reduce the scope of negation symbols
  3. Standardize the variables
  4. Eliminate existential quantifiers
  5. toe-in
  6. Matricizing into Conjunctive Normal Form
  7. Eliminate universal quantifiers
  8. Eliminate the conjunction symbol ∧
  9. change variable name

Solve:

  1. (∀x){P(x)⇒P(x)}

    1. Eliminate the implied symbol: (∀x){~P(x)∨P(x)}

    2. 2-6 No operation required

    3. Eliminate the full quantifier: ~P(x)∨P(x)

    4. 8-9 No action required

  2. (∀x)(∀y)(On(x,y)⇒Above(x,y))

    1. Eliminate implication symbols: (∀x)(∀y)(~On(x,y)∨Above(x,y))

    2. 2-6 No operation required

    3. Eliminate the full quantifier: ~On(x,y)∨Above(x,y)

    4. 8-9 No action required

  3. (∀x)(∀y)(∀z)(Above(x,y)∧Above(y,z)⇒Above(x,z))

    implies a lower precedence than ∧

    1. Eliminate implication symbols: (∀x)(∀y)(∀z)(~(Above(x,y)∧Above(y,z))∨Above(x,z))

    2. Reduce the scope of negation symbols: (∀x)(∀y)(∀z)(~Above(x,y)∨~Above(y,z)∨Above(x,z))

    3. 3-6. No operation required

    4. Eliminate the full quantifier: ~Above(x,y)∨~Above(y,z)∨Above(x,z)

    5. 8-9 No action required

  4. ~((∀x)P(x)⇒((∀y)(P(y)⇒P(f(x,y)))∧(∀y)(Q(x,y)⇒P(y)))))

    It's too difficult, bet it doesn't pass the exam

    image-20230502162152915

    image-20230502162202030

Chapter 4 Computational Intelligence

Computational Intelligence ✦

Computational intelligence depends on numerical data provided by the maker , not on knowledge . Computational intelligence is the low-level cognition of intelligence.

Computational Intelligence System

  • When a system involves only numerical (low-level) data, includes a pattern recognition part, does not apply knowledge in the sense of artificial intelligence, and can present:

    1. Computational adaptability;

    2. Computational fault tolerance;

    3. approaching human speed;

    4. The error rate is similar to that of humans

  • Then the system is a computational intelligence system .

The difference and relationship between Computational Intelligence (CI) and Artificial Intelligence (AI)✦

  • Computational intelligence is a low-level cognition of intelligence. The difference between it and artificial intelligence is that the cognitive level drops from the middle level to the low level . Middle-level systems contain knowledge (boutiques), while low-level systems do not.
  • When a computing intelligence system adds knowledge (boutique) value in a non-numerical way , it becomes an artificial intelligence system .

related terms

  • ABC
    • A-Artificial, means artificial (non-biological);
    • B-Biological, means physical + chemical + (?) = biological;
    • C-Computational, means mathematics + computer
  • NN: neural network
  • PR: pattern recognition
  • I: Intelligence

image-20230502163107671

the term
BN Human Intelligence Hardware: Brain Human sensory input processing
ANN Middle-level model: CNN + knowledge products Brain-like middle-level processing
CNN Low-level, bioinspired model Sensory data processing in a brain way
BPR Searching for Human Sensing Data Structures Recognition of structures in the human perceptual environment
APR Middle-level model: CPR + knowledge products Middle-level numeric and syntax processing
CPR Searches for sensory data structures All CNNs + fuzzy, statistical and deterministic models
BI Human Intelligence Software: Intelligence Human cognition, memory and function
AI Middle-level model: CI + knowledge products Middle-level cognition in the way of the brain
CI Low-Level Algorithms for Computational Reasoning low-level cognition in the way of the brain

Neural Computing (ANN, Artificial Neural Network)

Research progress

  1. 1943 M-P model and neuron interconnection model.
  2. In the 1960s, neural network learning models and perceptrons were proposed .
  3. From the 1970s to the 1980s, neural network research was further developed, and BP algorithm (Werbos) was proposed.
  4. Since the late 1980s, the research on neural networks has been very active, and has continued to make progress and has been widely used in the fields of pattern recognition, image processing, automatic control, robotics, management, business and military.

Characteristics of ANNs

  1. parallel distributed processing
  2. nonlinear mapping
  3. learning by training
  4. Adapt and integrate
  5. hardware implementation

Structure of Artificial Neural Network

Neurons

image-20230502170216163

A neuron unit consists of a plurality of inputs x i , i=1, 2, . . . , n and an output y. Intermediate states are represented by the weighted sum of the input signalsimage-20230502165901312

  • θ j is the bias (threshold) of the neuron unit

  • w ji is the connection weight coefficient

  • n is the number of input signals

  • y j is the neuron output

  • t is time

  • f(_) is the output transformation function.

    image-20230502170327105

two types of structure

Recurrent (feedback) networks

image-20230502170552008

In a recurrent network, multiple neurons are interconnected to organize an interconnected neural network

feedforward network

image-20230502170600547

Feedforward networks have a hierarchical structure consisting of layers with no interconnection between neurons in the same layer

Learning Algorithms ✦

Learn from a teacher

Supervised learning algorithms: The ability to adjust the strength or weight of connections between neurons based on the difference between the expected and actual network output (corresponding to a given input) .

Learning without a teacher

Unsupervised learning algorithms: No need to know the expected output.

reinforcement learning

Reinforcement learning algorithms: Employ a " critic " to evaluate the goodness (quality factor) of the output of a neural network for a given input . An example of a reinforcement learning algorithm is the Genetic Algorithm (GA).

An example of artificial neural network and its algorithm

model name with or without a teacher learning rules Forward or Backpropagation Application field
AG none Hebb律 reverse Data Classification
SG none Hebb律 reverse information processing
ART-I none law of competition reverse Pattern Classification
DH none Hebb律 reverse speech processing
CH none Hebb/Law of Competition reverse Portfolio Optimization
BAM none Hebb/Law of Competition reverse image processing
AM none Hebb律 reverse schema storage
ABAM none Hebb律 reverse signal processing
CAB none Hebb律 reverse Portfolio Optimization
FCM none Hebb律 reverse Portfolio Optimization
LM have Hebb律 Forward Process Monitoring
DR have Hebb律 Forward process forecasting, control
LAM have Hebb律 Forward system control
FAM have Hebb律 Forward knowledge processing
BSB have error correction Forward real-time classification
Perceptron have error correction Forward linear classification, prediction
Adaline/Madaline have error correction reverse classification, noise suppression
BP have error correction reverse Classification
AVQ have error correction reverse data self-organization
CPN have Hebb律 reverse self-organizing map
BM have Hebb/simulated annealing reverse Portfolio Optimization
CM have Hebb/simulated annealing reverse Portfolio Optimization
AHC have error correction reverse control
ARP have random increase reverse pattern matching, control
SNMF have Hebb律 reverse Voice/Image Processing

Knowledge Representation and Reasoning Based on Neural Network

AND operation

Neural Network Implementation and Logic

image-20230502171127748

Input-Output Relationship Function

image-20230502171136590

Satisfies the weight of the relationship with (and)

image-20230502171351710

OR operation, NOT operation

I can't find it, I'm too lazy to write

XOR★

Take the neural network with the following two structures as an example

Neural Network Implements XOR Logic
  1. image-20230502172149702
  2. image-20230502175500444
function
  1. network 1

    1. Input-Output Relational Functions Functions

      1. y = f(x1·w3 + x2·w4 + z·w5)
      2. Nh = z =f(x1·w1+x2·w2)
    2. Threshold function f

      image-20230502175410051

    3. adjacency matrix

      N I1 N i2 Nh NO
      N I1 0 0 0.3 1
      N i2 0 0 0.3 1
      Nh 0 0 0 -2
      NO 0 0 0 0
    4. Weight vector (w1,w2,w3,w4,w5)

      (0.3,0.3,1,1,-2)

    5. threshold vector

      (0,0,0,0,0)

    6. truth table

      x1 x2 z/N h y
      0 0 0<0.5=0 0<0.5=0
      0 1 0.3<0.5=0 0+1=1>=0.5=1
      1 0 0.3<0.5=0 0+1=1>=0.5=1
      1 1 0.6>=0.5=1 1+1-2=0<0.5=0
  2. 网络2

    1. 输入输出关系函数函数

      1. Nh1= f (x1·1.6 + x2·(-0.6)-1)
      2. Nh2= f (x1·(-0.7) + x2·2.8-2.0)
      3. y=N0=f (Nh1·2.102+Nh2·3.121)
    2. 阈值函数f

      image-20230502175410051

    3. 邻接矩阵

      NI1 NI2 Nh1 Nh2 NO
      NI1 0 0 1.6 -0.7 0
      NI2 0 0 -0.6 2.8 0
      Nh1 0 0 0 0 2.102
      Nh2 0 0 0 0 3.121
      NO 0 0 0 0 0
    4. 阈值向量

      (0,0,-1,-2,0)

基于神经网络的知识推理

todo:知识获取、知识库、泛化能力

模糊计算

todo

进化算法与遗传算法

进化算法分类

  1. 遗传算法(Genetic Algorithm, GA)
  2. 进化策略(Evolutional Strategy, ES)
  3. 进化编程(Evolutional Programming, EP)
  4. 遗传编程(Genetic Programming, GP)

基本概念

个体

  • 模拟生物个体而对问题中的对象(一般就是问题的解)的一种称呼
  • 一个个体也就是搜索空间中的一个点

种群(population)

  • 模拟生物种群而由若干个体组成的群体
  • 一般是整个搜索空间的一个很小的子集
  • 通过对种群实施遗传操作,使其不断更新换代而实现对整个论域空间的搜索

适应度(fitness)

借鉴生物个体对环境的适应程度,而对问题中的个体对象所设计的表征其优劣的一种测度

适应度函数(fitness function)

  • 问题中的全体个体与其适应度之间的一个对应关系
  • 一般是一个实值函数,该函数就是遗传算法中指导搜索的评价函数

染色体(chromosome)

  • 生物学:染色体是由若干基因组成的位串
  • 遗传算法
    • 染色体是问题中个体的某种字符串形式的编码表示
    • 染色体以字符串来表示
    • 基因是字符串中的一个个字符

编码与解码

编码(Encoding)

将问题结构变换为位串形式编码表示的过程

解码/译码(Decoding)

将位串形式编码表示变换为原问题结构的过程

二进制编码解码
  1. 编码长度

    编码长度取决于自变量的范围(更准确点应该是决策变量的范围)和搜索精度

    此处初始群体的每个个体用一个长度为10的二进制串来表示

  2. 自变量的范围:5-(-5)= 10

  3. 搜索精度:0.01

    image-20230502200557988

  4. 实际的搜索精度:0.009775

    image-20230502200721739

  5. 解码

    二进制信息转换成十进制公式

    image-20230502201059679

适应度

算法思想
  • 个体适应度计算

    • 在被选集中每个个体具有一个选择概率
    • 选择概率取决于种群中个体的适应度及其分布
    • 个体适应度计算,即个体选择概率计算
  • 个体选择方法

    按照适应度进行父代个体的选择

计算算法
  1. 按比例的适应度计算(proportional fitness assignment)
  2. 基于排序的适应度计算(rank-based fitness assignment)

遗传算子(genetic operator)

  • 模拟生物界优胜劣汰的自然选择法则的一种染色体运算
  • 从种群中选择适应度较高的染色体进行复制,以生成下一代种群
选择(selection)
  1. 轮盘赌选择(roulette wheel selection)

    1. 原理

      image-20230506164241989

      1. 做一个单位圆,然后按各个染色体的选择概率将圆面划分为相应的扇形区域
      2. 转动轮盘,轮盘静止时指针指向某一扇区,即为选中扇区,相应的个体/染色体即被选中
    2. 算法

      1. 在[0,1]区间,产生一个均匀分布的伪随机数r

      2. 若r≤q1,则染色体1被选中

      3. 若qk-1< r ≤qk(2≤k≤N),则染色体k被选中

        qi为染色体xi(i=1, 2, …, n)的累积概率

  2. 随机遍历抽样(stochastic universal sampling)

  3. 局部选择(local selection)

  4. 截断选择(truncation selection)

  5. 锦标赛选择/联赛选择(tournament selection)

交叉(crossover)
  1. (Single point crossover)一点交叉/单点交叉

    1. 原理

      1. 产生一个在1到L-1之间的随机数I
      2. 配对的两个串相互对应的交换从i+1到L的位段
    2. 例题

      设染色体s1 = 1011 0111 00,染色体s2 = 0001 1100 11,交换其后2位基因

      image-20230502203032162

  2. (Two point crossover)两点交叉/(Multi point crossover)多点交叉

    image-20230502203237477

  3. (Uniform crossover)模版交叉/均匀交叉

变异(mutation)

image-20230502203306249

遗传算法

定义

  • 遗传算法是模仿生物遗传学和自然选择机理,通过人工方式所构造的一类优化搜索算法,是对生物进化过程进行的一种数学仿真,是进化计算的最重要的形式。
  • 遗传算法为那些难以找到传统数学模型的难题指出了一个解决方法。

参数

  1. 种群规模:种群的大小,用染色体个数表示
  2. 最大换代数:种群更新换代的上限,也是算法终止一个条件
  3. 交叉率Pc:参加交叉运算的染色体个数占全体染色体总数的比例取值范围:0.4-0.99
  4. 变异率Pm
    1. 发生变异的基因位数占全体染色体的基因总位数的比例
    2. 取值范围:0.0001-0.1
  5. 染色体编码:长度L

基本原理✦

  • 通过随机方式产生若干个所求解问题的数字编码(染色体),形成初始群体
  • 通过适应度函数给每个个体一个数值评价
    • 淘汰低适应度的个体
    • 选择高适应度的个体参加遗传操作(交叉、变异)
  • 经过遗传操作后的个体集合形成下一代新的种群。对这个新种群进行下一轮进化。

遗传算法步骤✦

  1. 初始化群体;
  2. 计算群体上每个个体的适应度值;
  3. 按由个体适应度值所决定的某个规则选择将进入下一代的个体;
  4. 按概率Pc进行交叉操作;
  5. 按概率Pm进行突变操作;
  6. 若没有满足某种停止条件,则转第(2)步,否则进入下一步。
  7. 输出群体中适应度值最优的染色体作为问题的满意解或最优解。

算法流程图

image-20230502203519087

精英策略

原因
  • 从理论上保证全局收敛性
  • 在实际执行中优化性能
定义

在每一次迭代中群体中具有最高适应度的个体直接进入下一代群体,不参与交叉和变异

书上P160例题

image-20230503214737741

image-20230503214743625

人工生命

人工生命是一项抽象地提取控制生物现象的基本动态原理,并且通过物理媒介(如计算机)来模拟生命系统动态发展过程的研究工作。

群智能优化算法

粒群优化算法PSO

原理

  1. 每只鸟抽象为一个无质量,无体积的“粒子”
  2. 每个粒子有一个速度决定它们的飞行方向和距离,初始值可随机确定
  3. 每一次单位时间的飞行后,所有粒子分享信息,下一步将飞向自身最佳位置和全局或邻域最优位置的加权中心
  4. 每次迭代中,粒子通过跟踪“个体极值”和“全局极值”来更
    新自己的位置

算法流程

  1. 初始化一群粒子(群体规模为m),包括随机的位置和速度;
  2. 评价每个粒子的适应度;
  3. 对每个粒子,更新个体最优位置;
  4. 更新全局最优位置;
  5. 根据速度和位置更新方程更新粒子速度和位置;
  6. 如未达到结束条件(通常为足够好的适应值或达到一个预设最大迭代次数) ,回到2。

蚁群优化算法ACO

原理

  1. 基于蚂蚁寻找食物时的最优路径选择问题
  2. 把具有简单功能的工作单元看作蚂蚁
  3. 信息素会随着时间慢慢挥发,短路径上的信息素相对浓度高
  4. 优先选择信息素浓度大的路径

基本思想

  1. 将待聚类数据随机地散布到一个二维平面内
  2. 虚拟蚂蚁分布在这个空间内,并以随机方式移动
  3. 当一只蚂蚁遇到一个待聚类数据时即将之拾起并继续随机运动
  4. 若运动路径附近的数据与背负的数据相似性高于设置的标准则将其放置在该位置,然后继续移动
  5. 重复上述数据搬运过程

习题

4-1 计算智能的含义是什么?它涉及哪些研究分支?

  1. 含义
  2. 主要的研究领域:神经计算,模糊计算,进化计算,人工生命。

4-6 设计一个神经网络,用于计算含有两个输入的XOR函数。

详见

4-14 试述遗传算法的基本原理,并说明遗传算法的求解步骤?

  1. 基本原理
  2. 步骤

4-16 用遗传算法求f(x)=xcosx+2的最大值※

网上找的,估计算错了

image-20230504200410037

第6章 机器学习

机器学习的定义

  1. 机器学习是研究如何使用机器来模拟人类学习活动的一门学科
  2. 机器学习是一门研究机器获取新知识和新技能,并识别现有知识的学问。
  3. 机器学习是研究机器模拟人类的学习活动、获取知识和技能的理论和方法,以改善系统性能的学科

发展史

  1. 热烈时期:50年代中叶到60年代中叶
  2. 冷静时期:60年代中叶至70年代中叶
  3. 复兴时期:70年代中叶至80年代中叶
  4. 最新阶段:始于1986年

主要策略

  1. 推理:机械学习、示教学习、类比学习、示例学习
  2. 统计:有监督学习、无监督学习、半监督学习、增强
    学习

基本结构✦

  1. 推理:环境、学习、知识库、执行

    image-20230502222807075

  2. 统计:学习模型、历史数据、新数据、未知属性

归纳学习

定义

归纳学习(induction learning)是从特定的实事和数据出发,应用归纳规则进行学习的一种方法。根据归纳学习有无教师指导,可把它分为示例学习和观察与发现学习。

学习模式

image-20230502205700804

  1. 给定

    1. 观察陈述(事实)F,用以表示有关某些对象、状态、过程等的特定知识;
    2. 假定的初始归纳断言(可能为空);
    3. 背景知识,用于定义有关观察陈述、候选归纳断言以及任何相关问题领域知识、假设和约束,其中包括能够刻画所求归纳断言的性质的优先准则。
  2. 归纳断言(假设)H,能重言蕴涵或弱蕴涵观察陈述,并满足背景知识。

归纳概括规则

image-20230502210049733

学习方法

  1. 示例学习/实例学习
  2. 观察发现学习

决策树学习

决策树定义

  1. 通过把实例从根节点排列到某个叶子节点来分类实例。
  2. 叶子节点即为实例所属的分类
  3. 树上每个节点说明了对实例的某个属性的测试
  4. 节点的每个后继分支对应于该属性的一个可能值

决策树代表实例属性值约束的合取的析取式。从树根到树叶的每一条路径对应一组属性测试的合取,树本身对应这些合取的析取

实例

  1. 正实例:产生正值决策的实例
  2. 负实例:产生负值决策的实例

决策树算法★

CLS和ID3选一个考

决策树构造算法CLS

算法流程

按照个人理解修改了一下

  1. 如果TR中所有实例分类结果均为Ci,则返回Ci;
  2. 从属性表中选择某一属性A作为检测属性;
  3. 假定|ValueType(Ai)|=k,根据不同的ValueType(Ai),将TR划分为k个集 TR1,TR2 ,…,TRk;
    1. ValueType(Ai):属性A的第i种取值
    2. |ValueType(Ai)|=k:属性A有k种不同的取值
  4. 从属性表中去掉已做检验的属性A;
  5. 对每一个i (l≤i≤k),用 TRi,和新的属性表递归调用CLS,生成TRi的决策树DTRi;
  6. 返回以属性A为根,以DTR1,DTR2 ,…, DTRk为子树的决策树。
举例

image-20230502210743321

image-20230502210751725

决策树学习算法ID3✦

实质上是在CLS的基础上用信息增益的方法来选择决策属性/检测属性

ID3是一种自顶向下增长树的贪婪算法,在每个结点选取能最好地分类样例的属性。继续这个过程直到这棵树能完美分类训练样例,或所有的属性都使用过了。

信息熵
定义

是对随机变量不确定度的度量,熵越⼤,随机变量的不确定性就越⼤。

公式

image-20221114214744952

信息增益
定义

针对特征而言的,就是看一特征,系统有它和没有它时的信息量各是多少,两者的差值就是这个特征给系统带来的信息量,即信息增益。

公式

image-20221114214751140

伪代码

  1. 来源数据挖掘笔记

    • 输入:训练数据集D,特征集A ,阈值 ϵ \epsilon ϵ

    • 输出:以node为根节点的——棵决策树

      image-20221114215347369

  2. 来源PPT(推荐,省略了信息熵的计算细节)

    • 输入

      1. Examples:训练样例集。
      2. Target_attribute:这棵树要预测的目标属性。
      3. Attributes:除Target_attribute外供学习到的决策树测试的属性列表。
    • 输出:能正确分类给定Examples的决策树Root。

    • 伪代码

      ID3(Examples, Target_attribute, Attributes)

      1. 创建树的Root结点

      2. 如果Examples都为正,那么返回label= + 的单结点树Root

      3. 如果Examples都为反,那么返回label= - 的单结点树Root

      4. 如果Attributes为空,那么返回单结点树Root,label=Examples中最普遍的Target _attribute值

      5. 否则

        1. A←Attributes中分类 Examples 能力最好的属性

          具有最高信息增益的属性

        2. Root的决策属性←A

        3. 对于A的每个可能值vi;

          1. 在Root下加一个新的分支对应测试A=vi
          2. E x a m p l e s v i Examples_{v_{i}} Examplesvi 为Examples中满足A属性值为vi的子集
          3. 如果 E x a m p l e s v i Examples_{v_{i}} Examplesvi 为空
            1. 在这个新分支下加一个叶子结点,结点的label=Examples中最普遍的Target_attribute值
            2. 否则在这个新分支下加一个子树 ID3( E x a m p l e s v i Examples_{v_{i}} Examplesvi ,Target_attribute, Attributes-{A})
      6. 结束

      7. 返回Root

类比学习

推理过程

回忆与联想→选择→建立对应关系→转换

过程

  1. 输入一组已知条件和一组未完全确定的条件。
  2. 对两组输入条件寻找其可类比的对应关系。
  3. 根据相似转换的方法,进行映射。
  4. 对类推得到的知识进行校验。

研究类型

  1. 问题求解型
  2. 预测推定型

解释学习

EBG

求解形式

image-20230502215757026

给定

  1. 目标概念描述TC
  2. 训练实例TE
  3. 领域知识DT
  4. 操作准则OC

求解

训练实例的一般化概括,使之满足:

  1. 目标概念的充分概括描述TC
  2. 操作准则OC

步骤

  1. 解释,即根据领域知识建立一个解释,以证明训练实例如何满足目标概念定义。目标概念的初始描述通常是不可操作的。
  2. 概括(一般化),即对第(1)步的证明树进行处理,对目标概念进行回归,包括用变量代替常量以及必要的新项合成等工作,从而得到所期望的概念描述。

神经网络学习

两大学派

化学学派

认为人脑经学习所获得的信息是记录在某些生物大分子之上的。例如,蛋白质、核糖核酸、神经递质,就像遗传信息是记录在DNA(脱氧核糖核酸)上一样。

突触修正学派

  • 人脑学习所获得的信息是分布在神经元之间的突触连接上的
  • 人脑的学习和记忆过程实际上是一个在训练中完成的突触连接权值的修正和稳定过程。其中,学习表现为突触连接权值的修正,记忆则表现为突触连接权值的稳定
  • 是人工神经网络学习和记忆机制研究的心理学基础,与此对应的权值修正学派也一直是人工神经网络研究的主流学派。

学习方法

有师学习

能够根据期望的和实际的网络输出(对应于给定输入)间的差来调整神经元间连接的强度。

无师学习

不需要知道期望输出。

增强学习

采用一个“评论员”来评价与给定输入对应的神经网络输出的优度(质量因数)。增强学习算法的一个例子是遗传算法(GA)。

反向传播(BP)算法

是一种有师学习

核心思想

  • 将输出误差以某种形式通过隐层向输入层逐层反传
  • 给定训练模式,利用传播公式,沿着减小误差的方向不断调整网络连接权值和阈值的过程

学习过程

信号的正向传播,误差的反向传播

步骤✦

  1. 初始化
  2. 输入训练样本对,计算各层输出
  3. 计算网络输出误差
  4. 计算各层误差信号
  5. 调整各层权值
  6. 检查网络总误差是否达到精度要求。
    1. 满足,则训练结束;
    2. 不满足,则返回步骤2

程序流程图

image-20230502220741183

基于Hopfield网络学习

反馈神经网络,它是一种动态反馈系统,比前馈网络具有更强的计算能力。

Hopfield网络是一种具有正反相输出的带反馈人工神经元。

知识发现

定义

数据库中的知识发现(Knowledge Discovery in Databases ,KDD)是从大量数据中辨识出有效的、新颖的、潜在有用的、并可被理解的模式的高级处理过程。

处理过程

  1. 数据选择。根据用户的需求从数据库中提取与KDD相关的数据。
  2. 数据预处理。主要是对上述数据进行再加工,检查数据的完整性及数据的一致性,对丢失的数据利用统计方法进行填补,形成发掘数据库。
  3. 数据变换。即从发掘数据库里选择数据。
  4. 数据挖掘。根据用户要求,确定KDD的目标是发现何种类型的知识。
  5. 知识评价。这一过程主要用于对所获得的规则进行价值评定,以决定所得的规则是否存入基础知识库。

方法

  1. 统计
  2. 机器学习
  3. 神经计算
  4. 可视化

应用

金融业、保险业、制造业、市场和零售业、医疗业、司法、工程与科学

增强学习

学习自动机

image-20230502221328817

自适应动态程序设计(时差学习)

在自适应动态程序设计中,状态i的效应值U(i)可以用下式计算:

image-20230502221418256

Q学习(Q-值代替效用值)

一种基于时差策略的增强学习,是指定在给定的状态下,在执行完某个动作后期望得到的效用函数,该函数为动作-值函数。

深度学习

定义

深度学习算法是一类基于生物学对人脑进一步认识,将神经-中枢-大脑的工作原理设计成一个不断迭代、不断抽象的过程,以便得到最优数据特征表示的机器学习算法;该算法从原始信号开始,先做低层抽象,然后逐渐向高层抽象迭代,由此组成深度学习算法的基本框架。

特点

  1. 使用多重非线性变换对数据进行多层抽象
  2. 以寻求更适合的概念表示方法为目标
  3. 形成一类具有代表性的特征表示学习(Learning representation)方法

优点

  1. 采用非线性处理单元组成的多层结构,使得概念提取可以由简单到复杂
  2. 架构非常灵活,有利于根据实际需要调整学习策略
  3. 学习无标签数据优势明显

模型

卷积神经网络、循环神经网络、受限玻耳兹曼机、自动编码器、深度信念网络

应用

机器博弈、计算机视觉、语音识别、机器人…

习题

6-1 什么是学习和机器学习?为什么要研究机器学习?

  1. 学习就是系统在不断重复的工作中对本身能力的增强或者改进,使得系统在下一次执行同样任务或类似任务时,会比现在做得更好或效率更高

  2. 机器学习是研究如何使用机器来模拟人类学习活动的一门学科,是一门研究机器获取新知识和新技能,并识别现有知识的学问。

    这里所说的“机器”,指的就是计算机。

  3. 原因:现有的计算机系统和人工智能系统没有什么学习能力,至多也只有非常有限的学习能力,因而不能满足科技和生产提出的新要求。

6-2 试述机器学习系统的基本结构,并说明各部分的作用。

image-20230502222807075

  1. 环境向系统的学习部分提供某些信息
  2. 学习部分利用这些信息修改知识库,以增进系统执行部分完成任务的效能
  3. 执行部分根据知识库完成任务,同时把获得的信息反馈给学习部分。

影响学习系统设计的最重要的因素是环境向系统提供的信息。更具体地说是信息的质量

6-3 简介决策树学习的结构※

详见

6-4 决策树学习的主要学习算法

以ID3为例

6-8 试比较说明符号系统和连接机制在机器学习中的主要思想※

详见人工智能的各种认知观的对比部分

6-9 用C语言编写一套计算机程序,用于执行 BP 学习算法

详见BP算法实现步骤

什么是知识发现?知识发现与数据挖掘有何关系?※

  1. 知识发现的定义

  2. 关系

    数据挖掘是知识发现中的一个步骤,它主要是利用某些特定的知识发现算法,在一定的运算效率内,从数据中发现出有关的知识。

什么是深度学习?它有何特点?※

详见深度学习的定义和特点

开放题/论述题

对AI发展的看法以及研究热点★

GPT-4

看法

  • 人工智能在过去的几十年里取得了巨大的进步。随着计算能力的提高和大量数据的积累,深度学习和机器学习技术得到了广泛的应用。AI已经渗透到了诸如自动驾驶、医疗诊断、语言翻译、虚拟助手等许多行业。
  • 在未来,我们预期 AI 将在各个领域产生更多的影响,提高生产效率改变人们的生活方式
  • 然而,AI发展也引发了一些关切。例如,隐私、数据安全、失业、道德伦理等问题需要解决。因此,政策制定者、研究人员和产业界需要共同努力,确保AI技术的安全、可靠、公平和透明。

[研究热点](#1-11 人工智能的主要研究和应用领域是什么?其中,哪些是新的研究热点?)

  1. 强化学习:通过让机器学习在特定环境中进行试错,以获取最佳策略的方法。在游戏、机器人控制和自动驾驶等领域有广泛应用。
  2. 生成对抗网络(GAN):一种用于生成数据的深度学习方法,通过让两个神经网络相互竞争来提高生成数据的质量。广泛应用于图像合成、风格迁移等任务。
  3. 自然语言处理(NLP):关注让计算机理解、生成和处理自然语言的技术。目前研究热点包括预训练语言模型、机器翻译、情感分析等。
  4. 计算机视觉:关注让计算机理解和处理图像或视频的技术。研究热点包括目标检测、人脸识别、图像分割等。
  5. 无监督学习和半监督学习:在训练数据缺乏标签的情况下,让机器学习模型自我学习的方法。这些方法在处理大量未标注数据时具有巨大潜力。
  6. 人工智能伦理和政策:关注AI技术带来的道德、法律和社会影响,以及如何制定相应的政策和规范。
  7. 机器学习的可解释性:让机器学习模型更加透明和可解释的研究。这有助于提高人们对AI系统的信任,增加模型的可靠性和安全性。
  8. 神经符号整合:探索将深度学习和传统符号逻辑相结合的方法,以解决AI系统在推理、抽象和知识表示方面的局限性。
  9. Multimodal Learning: Enables AI systems to process and understand information from multiple senses (such as sight, hearing, touch, etc.). This helps to develop more intelligent and
    adaptive AI systems.
  10. Meta-learning: Improve the generalization ability of the model in new tasks and domains by letting the AI ​​system learn how to learn by itself.
  11. Small sample learning: Study how to make machine learning models learn efficiently with a small amount of labeled data. This helps reduce the AI ​​system
    's reliance on large amounts of labeled data.
  12. Safe AI: Research on how to ensure the safety, stability and controllability of AI systems under various conditions, including resisting adversarial attacks and preventing model collapse.
  13. Intersecting research between artificial intelligence and psychology and neuroscience: developing AI systems by mimicking the human brain and cognitive processes to enhance their intelligence and adaptability.

Guess you like

Origin blog.csdn.net/qq_33843237/article/details/130496897