MOOC人工智能原理学习笔记3——无信息搜索

Uninformed Search 无信息搜索

  1. 无信息搜索也被称为盲目搜索,该术语(无信息、盲目的)意味着该搜索策略没有超出问题定义提供的状态之外的附加信息。所有能做的就是生成后继节点,并且区分一个目标状态或一个非目标状态。所有的搜索策略是由节点扩展的顺序加以区分。这些搜索策略是:宽度优先、深度优先、以及一致代价搜索。

  2. 无信息搜索策略可按照如下特性来评价:
    Completeness(完备性):是否总能找到一个存在的解?
    Time complexity(时间复杂性):花费多长时间找到这个解?
    Space complexity(空间复杂性):需要多少内存?
    Optimality(最优性):是否总能找到最优的解?
    策略评价

3. Breadth-first Search (宽度优先搜索)

Search Strategy (搜索策略):扩展最浅的未扩展节点。
Implementation(实现方法):使用FIFO队列,即新的后继节点放在后面。

Breadth-first Search Algoruthm on a Graph (图的宽度优先搜索算法)

function Breadth-First Search(problem) returns a solution, or failure
    node ← a node with State = problem.Initial-State , Path-Test = 0
    frontier ← a FIFO queue with node as the only element
    explored ← an empty set
    loop do
        if Empty ? (frontier) then return failure
        node ← Pop(frontier)     //choose the shallowest node in frontier
        add node.State to explored
        for each action in problem.Action(node.State) do 
            child ← Child-Node(problem, node, action)
            if child.State is not in explored or frontier then
                if problem.Goal-Test(child.State) then return Solution(child)
                froniter ← Insert(child, froniter)

简单二叉树宽度优先算法
宽度优先搜索性质

内存的需求是一个很大的问题,而执行时间仍是一个主要因素。
宽度优先搜索不能解决指数复杂性的问题,小的分支因子除外。

4. Uniform-cost Search (一致代价搜索)

Search Strategy :扩展最低代价的未扩展节点。
Implementation :队列,按路径代价排序,最低优先。

Uniform-cost Search Algorithm

function Uniform-First Search(problem) returns a solution, or failure
    node ← a node with State = problem.Initial-State , Path-Test = 0
    frontier ← a priority queue ordered by Path-Cost, with node as the only element
    explored ← an empty set
    loop do
        if Empty ? (frontier) then return failure
        node ← Pop(frontier)     //choose the lowest-cost node in frontier
        if problem.Goal-Test(node.State) then return Solution(node)
        add node.State to explored
        for each action in problem.Action(node.State) do 
            child ← Child-Node(problem, node, action)
            if child.State is not in explored or frontier then
                froniter ← Insert(child, froniter)
            else if child.State is in frontier with higher Path-Cost then
                replace that froniter node with child

一致代价搜索的特性

5. Depth-first Search (深度优先搜索)

Search Strategy :扩展最深的未扩展节点。
Implementation :使用LIFO队列,把后继节点放在队列的前端。

1
2

深度优先搜索特性

6. Depth-limited Search (深度受限搜索)

若状态空间无限,深度优先搜索就会发生失败。
这个问题可以用一个预定的深度限制l得到解决,即:深度l以外的节点被视为没有后继节点。
缺点:
如果我们选择l<d,即最浅的目标在深度限制之外,这种方法就会出现额外的不完备性。
如果我们选择l>d,深度受限搜索也将是非最优的。

Depth-limited Search Algorithm

function Depth-Limited-Search(problem, limit) returns a solution, or failure/cutoff
    if problem.Goal-Test(node.State) then return Solution(node)
    if limit = 0 then return cutoff     //no solution
    cutoff_occurred? ← false
    for each action in problem.Action(node.State) do 
        child ← Child-Node(problem, node, action)
        result ← Recusive-DLS(child, problem, limit - 1)
        if result = cutoff then cutoff_occurred ? ← true
        else if result ≠ failure then return result
    if cutoff_occurred ? then return cutoff    //no solution
    else return failure

7. Iterative Deepening Search (迭代加深搜索)

它将深度优先和宽度优先的优势相结合,逐步增加深度限制反复运行直到找到目标。
它以深度优先搜索相同的顺序访问搜索树的节点,但先访问节点的累积顺序实际是宽度优先。

function Iterative-Deepening-Search(problem, limit) returns a solution, or failure
    for depth = 0 todo
        result ← Depth-Limited-Search(problem,  depth)
        if result ≠ cutoff then return result

8. Bidirectional Search (双向搜索)

它同时进行两个搜索:一个是从初始状态向前搜索,二另一个则从目标向后搜索。当两者在中间相遇时停止。
双向搜索
该方法可以通过一种剩余距离得启发式估计来导向。

9. Evaluation of Uninformed Tree-search Strategies (无信息树搜索策略评价)

策略评价

10.General Tree-search Algorithm (一种通用的树搜索算法)

function Tree-Search(problem) returns a solution, or failure
    initialize the frontier using the initial state of problem
    loop do
        if the frontier is empty then return failure
        choose a leaf node and remove it from the frontier
        if the node contains a goal state then return the corresponding solution
        expand the chosen node, adding the resulting nodes to the frontier

该frontier(亦称closed list):一种数据结构,用于存储所有的叶节点。
在frontier上扩展节点的过程持续进行,直到找到一个解、或没有其他状态可扩展。
树搜索

11.General Graph-search Algorithm (一种通用的图搜索算法)

function Graph-Search(problem) returns a solution, or failure
    initialize the frontier using the initial state of problem
     initialize the explored to be empty
     loop do
         if the frontier is empty then return failure
         choose a leaf node and remove it from the frontier
         if the node contains a goal state then return the corresponding solution
         add the node to the explored
         expand the chosen node, adding the resutling nodes to the frontier
             only if not in the frontier or explored

该explored(亦称closed list):一种数据结构,用于记忆每个扩展节点。
explored或frontier中的节点可以被丢弃。

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MOOC(大规模开放式在线课程)是一种通过网络平台开设的在线教育课程,可以为广大学习者提供方便灵活的学习机会。人工智能实践:TensorFlow笔记,是由北京大学推出的一门针对人工智能领域的实践课程,旨在帮助学习者掌握使用TensorFlow框架进行深度学习的基本方法和技巧。 该课程的代码提供了一系列丰富的示例和实践项目,通过这些代码我们可以了解和掌握TensorFlow的使用方法。其中包括数据处理、模型构建、模型训练与评估等关键步骤。通过学习和实践,我们可以学会如何搭建神经网络模型,进行图像分类、文本生成等任务。 在这门课程中,北京大学的代码示例主要围绕深度学习的常用库TensorFlow展开,通过给出具体的代码实现,解释了每部分的原理和操作方法,帮助学习者理解基本概念和技术,熟悉TensorFlow框架和编程语言的使用。 此外,这门课程还涵盖了一些实践项目,例如基于TensorFlow的手写数字识别、图像分类与预测、文本生成等。通过完成这些实践项目,我们可以加深对TensorFlow的理解并提高实践能力。 总之,人工智能实践: TensorFlow笔记 - 北京大学代码是一门结合了理论与实践的在线课程,通过教授深度学习的基本概念和TensorFlow的应用方法,帮助学习者掌握人工智能领域的基本技能。通过这门课程,我们可以学习到TensorFlow的使用方法,掌握一定的实践能力,并将这些知识应用于实际项目当中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值