0%

1. Overview

主要分成四个部分

  1. 面向对象的准则
  • 面向对象设计,抽象、类、封装、继承
  • 对象
  • 对象相似时
  • 异常捕获
  1. 这些准则如何应用到Python内置函数中、
  • 何时使用面向对象
  • Python数据结构
  • 面向对象的捷径
  • 字符串与序列化
  1. 设计模式
  • 迭代器模式
  • 装饰器模式、观察者模式
  • 适配器模式、门面模式
  1. 有趣的主题
  • 测试面向对象程序
  • 并发
Read more »

1. Abstractions and Approximations

We have made some assumptions so far

  • Dynamics, $\dot x=u$, NOT even close to being reasonable!
  • Sensors, we can measure distance and angle

Recall teh unicycle model, we want to our system behave like $\dot x=u $

How? A Layered Architercture

  • Navigation system can be decoupled along 3 levels of abstraction:
  • Strategic Level: Where should the goal points be (Not in this course)
  • Dijkstra, A*, D*, RRT…
  • Operational Level: which direction to move (go-to-goal and avoid-obstacles)
  • Tactical Level: How to make the robot move in those direction (control design)

2. Transforming the Unicycle

The unicycle model
$$
\begin{array}{l}
\dot{x}=v \cos \phi \
\dot{y}=v \sin \phi \
\dot{\phi}=\omega
\end{array}
$$
What if we ignored the orientation and picked a different point on the robot as the point we care about

And now the $u_1,u_2$ would directly related to $v$ and $w$

Before: Use a Planner and Tracker

Read more »

1. Behavior

Use control theory to describe the problem

  1. We need a model
    $$
    \dot x=u
    $$

  2. We need 2 basic behaviors

  • Go-To-Goal: $e=x_g-x$, $u=Ke$, $\dot e=-\dot x=-Ke$

A concern: This is a linear controller which means the robot goes faster the further away the goal is. So in practice, make the gain $K$ a function of $e$

image-20200509165421125

  • Avoid-Obstacle:

Concern: the robot drives off to infinity, we care less the closer we get?

image-20200509165836313

  1. Figure out the mode transitions
Read more »

1. Switches Everywhere

Why should we switch? The robotics world is very complicated, so we should change our model and control method when situation changes.

  • By necessity: the dynamics change
  • By design: we want the robots to behave differently

What we are should deal with while switching?

  • Model
  • Stability
  • Compositionality
  • Traps

2. Model: Hybrid Automata

This is a finite state machine.

  • Dynamics: $\dot x=f_q(x,u)$, $q$ stand for discrete state
  • when $x$ is in the guard conditions, state $q$ change
  • Reset the state

A Simple 2-Mode System
$$
\begin{aligned}
&\dot{x}=A_{1} x=\left[\begin{array}{cc}
-\epsilon & 1 \
-2 & -\epsilon
\end{array}\right] x\
&\dot{x}=A_{2} x=\left[\begin{array}{cc}
-\epsilon & 2 \
-1 & -\epsilon
\end{array}\right] x
\end{aligned}
$$

$$
eig(A_i)=-\epsilon+1.41i
$$

Both two system is stable.

Now we combine them with a hybrid automata

image-20200508011600344

But what if we change the automata

image-20200508011934625

Punchlines

Read more »

1. 0 介绍

图灵机可以解决计算所有的问题. 有些问题无法通过计算解决.

对于人工智能来说, 可计算性是一个非常重要的议题, 值得学习与思考

$\lambda$运算 是与图灵机类似的一种工具, 听说比图灵机更加简洁. 因此学习并记录

2. 1 历史

发明者: Alonzo Church. 美国逻辑学家

发明初衷: 给逻辑学提供一个基础, 代替罗素的类型理论和策梅洛的集合理论

作用: 系统中的$\lambda$演算具有良好的性质, 可以等价地定义出可计算函数. 用$\lambda$演算证明了判定性问题不可答, 比图灵证明停机问题不可判更早

发展: 计算机出现后, 有研究者发现$\lambda$演算可以看成是一种程序设计语言(如Lisp). 因为它既可以描述计算过程, 也可以看成一个数学对象, 用于推导证明命题

3. 2 解释

Read more »

1. Science: Past and Present

科学家如何获取知识? 怎么验证他们获得的知识是可靠的?

目前国家和机构花了很多钱在科研上, 那么科研的产出是什么呢?

  • 物理\天文\基因\环境\生物

有多种多样的问题, 这些问题的共性是什么呢? 我们只有科研的方式才能解决这些问题吗?

1.1. 例1:进化论

生物方面

1.2. 例2: 宇宙时间

爱因斯坦, 宇宙扩张, NASA天文观察, 这是一个很大的工程项目

1.3. 例3: 气候变化

Read more »

We need $x$ but we do have is only $y$. What can we do?

  • Design $u$ as if we had $x$
  • Figure out $x$ from $y$

1. Assume We Got $x$

We can design the $k_1$ and $k_2$ to make the eigenvalue of the closed-loop system to be desired (negative)

e.g. If we want to the eigen value of the $-1$, then, $\varphi(\lambda)=(\lambda+1)(\lambda+1)=\lambda^{2}+2 \lambda+1$

and we got $\chi_{A-B K}=\lambda^{2}+k_{2} \lambda+k_{1}$

so just let $k_2=2$ and $k_1=1$, the system would be stable

To say it in another way, we place the pole of the system on the desired position

Still, we have some question about the method?

  • This method is not always possible
  • The system needs to be controllable
  • It’s a science and art of picking the eigenvalue
  • No clear-cut answer

2. Controllability

The key matter here is the $B$ matrix, how rich is $B$ that we can control the system.

Read more »

今天下午抽空翻阅了Nilsson的人工智能教材–Artificial Intelligence–A New Synthesis. 写一写自己的感受

这本书是Nilsson于1998年写的, 书的主要内容就是到那个时间点为止的人工智能的研究方向, 文章中随处可见的引用以及大量的参考内容让我感觉这更像是一篇带有教材性质的Review.

从大的方面来说, 人工智能领域有三个学派

  • 符号主义
  • 连接主义
  • 行为主义

Nilsson显然是符号主义的支持者(代表人物). 书的前一半介绍了连接主义的神经网络\Perception等知识以及许多搜索算法, 后一半就主要是介绍知识的表示和推理\基于逻辑的规划方法.

对我来说, 前一半的知识是比较熟悉的, 毕竟这几年借着算力的提升, 神经网络的方法也是火的一塌糊涂, 所以平时接触的也比较多, 所以前一半看起来并不费力, 看起来也很快. 不得不说社会热点对知识的普及作用比我想象中的要强很多, 20年前最领先的(部分)知识到今天几乎都变成了领域内入门的知识, 可能随便找一个本科生也能对这些知识讲得头头是道. 可能这和学科也有关系, 各个基础科学的知识显然就普及的少很多, 我们大部分人掌握的都是几百年前的物理\数学知识. 而计算机科学虽然也叫科学, 但本质上还是偏向于工程多一些.

后一半是关于知识和推理的, 其实我对人工智能最早的理解可能就是关于知识和推理, 当时看钢铁侠的时候, 那个能够根据指令和互联网来做出响应的贾维斯实在是太酷了. 但是上了大学之后好像就被带偏了, 默认把神经网络\机器学习\深度学习和人工智能联想起来, 没有深入了解其他方面的人工智能, 有点后悔. 因为只是粗略地翻阅了一下, 所以没有特别的感悟, 总体上和我想象的差不多, 将知识存储起来, 通过逻辑的方式进行推理. 我觉得难点也很显而易见, 知识太多且除了人工录入外似乎没有简单的方法收集合理表达的知识.


突然想起来要吐槽一下这本书的翻译, 不知道是因为这本书年代的原因还是两位浙大老师的翻译水平问题, 读的过程非常难受, 经常有的句子读不通, 有的专有名词和现在的名称不一样. 如果要仔细阅读应该直接阅读英文原文

Read more »

1. Simple Robot

We need a more systematic way in discussion

Give a point mass on a line whose acceleration is directly controlled:

Translate the physics model into state space form, 3 steps

  1. Pick the state variables
  2. High order to low order
  3. Put these in terms of state, input and output

$$
\dot{x}=\left[\begin{array}{c}
\dot{x}{1} \
\dot{x}
{2}
\end{array}\right]=\left[\begin{array}{c}
x_{2} \
u
\end{array}\right]=\left[\begin{array}{cc}
0 & 1 \
0 & 0
\end{array}\right]\left[\begin{array}{c}
x_{1} \
x_{2}
\end{array}\right]+\left[\begin{array}{c}
0 \
1
\end{array}\right] u
$$

$$
y=p=x_1=[1 \space0]x
$$

Write in a more general form
$$
\begin{aligned}
&\dot{x}=A x+B u\
&y=C x
\end{aligned}
$$
Here, $A$ is given by physics. What we can design is $B$ (how we control the system) and $C$ (how we sensor the system)

2. State-Space Models & Linearization

We need know how the system works, then we can model it using physics

Read more »

1. How to Drive Robots

We mainly need 3 part

  • Controller
  • Sensors
  • Robot model

Some basic facts we need know

  • the world is changing
  • controller must be able to respond to environmental conditions
  • Instead of building one complicated controller, we divide and conquer and build some Behavior
  • goal-to-goal
  • obstacles-avoid
  • line-follow

2. Robot Model – Differential Drive Robots

This is a very common type

image-20200408010708398

we need to know some basic parameter $L$ , $R$, easy to measure

What we can control: $v_r$ and $v_l$

Read more »