behavior planning——15.cost function design weightTweaking
Designing cost functions is difficult and getting them all to cooperate to produce reasionable vehicle behavior is hard.
some of the difficulties associated with cost function design include solving new problems without unsolving old ones.
when you are working on a self-driving car,you may find that the vehicle is behaving reasonably well except for some
particular situations.Maybe it is not being aggressive enough about making left turns at traffic lights.
So, in an effort to solve this problem, you either add new cost funcions, tweak existing ones, or modify weights.But every time you do, there is chance that you will introduce some breaking change into something that already works.
in pracice ,we solve this throuth regression testing, where we define some set of situations, Then ,whenever we make a change, we simulate the viheicle in all of our test cases and make sure that it still behaves expected.
We won't say more about testing here, but it is an important part of developing software in a safety-cricical application.
The next difficulty is balancing costs of drastically different magnitudes.

Because, yes ,we want to get to our destination efficiently, but if we are in a situation where safety is an issue,
we want to solve that problem and not think about efficiency at all. one way to do that is to have weights which reflect
the type of problem the cost function addresses. so we want to most heavily penalize any behavior which simply is not possible due to physics, then we want to think about safety ,legality ,comfort.

And only once those are satisfied do we want to think about efficiency. But we alse may want to adjust the relative importance if these weights depending on situation. If a light turns red ,for example,legality becomes a much more relevant
concern than when we engage in normal highway driving . this leads us to out last difficulty, reasoning about individual cost functions. Ideally, each cost function will serve a very specific responsibility.
which is something we do not do in our earlier example of s speed cost function.
We were trying to balance out desire to drive quickly, which has to do with efficiency, with out desire to not exceed the speed limit , which is legality. In practice, we might want to difine several cost functions associated with vehicle speed.
In which case we might have a binary cost function which just checks to see if we are breaking the speed limit and the continuous cost function which pulls us towards out target speed.

By assigning each cost function to a very specific role, like safety versus legality versus efficiency, we can then standardize the output of all cost functions to be between -1 and 1. Additionlly, It is helpful to paraetrize whenever possible.
This allows us to use some parameter optimization technique like gradient descent along with our set of regression tests to
programmatically tweak our cost functions. Finally ,thinking in terms of vehicle state is helpful. The things we can indirestly
control about our vehicle are it is position, velocity, and acceleration. It can be helpful to keep these in mind when coming up with cost functions. Let is walk through an example.
Say we want to think about the following classer of cost functions.

And to make it easier, to keep everything straight,let is think in terms of position, velocity ,and acceleration.
The binary "Are we exceeding the speed? "cost functin would go here, then the cost function that wanted to keep us close
to the speed limit would go here. and now ,instead of being that weird discontinuous gragh we made earlier, this could just be some parabola like this.


And even though the cost of this is low even for speeds that exceed the speed limit, that is OK because we have our
binary cost function which would prevent that behavior. Continuing to think about speed, we also might want to try to
drive at a speed that is close to the average speed of traffic, for safety reasons ,even if that speed is above or below the
speed limit. And that would go here.

In the position column, we would have an obvious feasibility concern which is collision avoidance.

We can not drive somewhere if there is already a car there. Then, for safety reasons, wo would want the buffer distance,

which tries to keep us far from other vehicles, and the cost function which checks to make sure we are driving on the road
near the center of our lane and in a lane that is close to our goal lane.

For acceleration, we would first want to make sure we only consider behaviors that the car can execute,

Make sure we only consider behaviors that the car can execute, and then we would want to avoid having any rapid changes in acceleration because those are perceived as uncomfortable.

This is also known as jerk as which you will learn more about in the next lesson.
consider a merge onto a highway, for example.

This is a potentially dangerous situation where we really want to get up to traffic speed as quickly as possible.

So this cost function may become more relevant than it mormally is. But we alse want to make sure that we yield if there
is not really a gap, so we want to make sure this cost funcion and this one are weighted sufficiently high.

and we can compare these merge priorities to a different situation.
for examle, a car approaching a green light that suddenly turns yellow.

In this situation, we would probably want to boost the weights associated with legality and would probably need to
add a whole new cost function for obeying traffic rules.
now that do not fall neatly into the position, velocity ,or acceleration classes, so I will just put it over here.
If this is all starting to feel like it is getting pretty complex ,well,you are right.
It is pretty hard to aviod this exploding complexity when using finite state machines.
Partially that is because of the finite state machine itself, but we are also trying to solve a very hard problem and
some complexity is unavoidable no matter what solution approach you take.

behavior planning——15.cost function design weightTweaking的更多相关文章
- behavior planning——13. implement a cost function in C++
In the previous quizzes, you designed a cost function to choose a lane when trying to reach a goal i ...
- behavior planning——11 create a cost function speed penalty
A key part of getting transitions to happen when we want them to is the design of reasonable cost ...
- behavior planning——14.implement a cost function in C++
n most situations, a single cost function will not be sufficient to produce complex vehicle behavior ...
- behavior planning——12.example cost funtion -lane change penalty
In the image above, the blue self driving car (bottom left) is trying to get to the goal (gold sta ...
- Model Representation and Cost Function
Model Representation To establish notation for future use, we’ll use x(i) to denote the “input” vari ...
- 吴恩达机器学习笔记 - cost function and gradient descent
一.简介 cost fuction是用来判断机器预算值和实际值得误差,一般来说训练机器学习的目的就是希望将这个cost function减到最小.本文会介绍如何找到这个最小值. 二.线性回归的cost ...
- loss function与cost function
实际上,代价函数(cost function)和损失函数(loss function 亦称为 error function)是同义的.它们都是事先定义一个假设函数(hypothesis),通过训练集由 ...
- 【caffe】loss function、cost function和error
@tags: caffe 机器学习 在机器学习(暂时限定有监督学习)中,常见的算法大都可以划分为两个部分来理解它 一个是它的Hypothesis function,也就是你用一个函数f,来拟合任意一个 ...
- 逻辑回归损失函数(cost function)
逻辑回归模型预估的是样本属于某个分类的概率,其损失函数(Cost Function)可以像线型回归那样,以均方差来表示:也可以用对数.概率等方法.损失函数本质上是衡量”模型预估值“到“实际值”的距离, ...
随机推荐
- mysql 查询条件不区分大小写问题
转自 http://blog.csdn.net/qishuo_java/article/details/40118937 转自 https://www.cnblogs.com/wuyun-blog/p ...
- Codeforces 608E. Marbles
E. Marbles time limit per test 2 seconds memory limit per test 256 megabytes input standard input ou ...
- web前端学习(三)css学习笔记部分(8)-- SVN的介绍和应用、CSS动画效果、CSS3布局属性全接触
15.SVN的介绍和应用 15.1.SVN的介绍和应用课程概要 将代码进行集中管理,有版本号的进行迭代,方便集体工作的build流程 15.2.SVN的介绍 SVN是Subversion的简称,是一个 ...
- Java 分页对象
以前一直没有自己写过分页对象,自己模仿着写了一个分页对象,写完之后感觉也是挺简单的 package com.css.util; import java.io.Serializable;import j ...
- vue中 表头 th 合并单元格,且表格列数不定的动态渲染方法
吐槽 今天,在vue中遇到 复杂表格的渲染 ,需要合并表头th的单元格,且合并单元格的那列的表头数据是动态数据,也就是不知道会有多少个表头列,而这几个表头列还分了好几个子表头. 这个需求在js里用Ju ...
- 云计算、大数据、编程语言学习指南下载,100+技术课程免费学!这份诚意满满的新年技术大礼包,你Get了吗?
开发者认证.云学院.技术社群,更多精彩,尽在开发者会场 近年来,新技术发展迅速.互联网行业持续高速增长,平均薪资水平持续提升,互联网技术学习已俨然成为学生.在职人员都感兴趣的“业余项目”. 阿里云大学 ...
- let 和const命令
ES6新增了let命令,用来声明变量.它的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效.换句话说,let声明了块级作用域. 输出 看下面代码: 输出: 变量i是var声明的,在 ...
- XML配置里的Bean自动装配与Bean之间的关系
需要在<bean>的autowire属性里指定自动装配的模式 byType(根据类型自动装配) byName(根据名称自动装配) constructor(通过构造器自动装配) 名字须与属性 ...
- Directx11教程(45) alpha blend(2)
原文:Directx11教程(45) alpha blend(2) 在myTutorialD3D11_40中,我们在场景中再添加一个box,并把box放在水里,实现半透明的效果.如下图所示: ...
- Directx11教程(42) 纹理映射(12)-简单的bump mapping
原文:Directx11教程(42) 纹理映射(12)-简单的bump mapping 有时候,我们只有一个粗糙的模型,但是我们想渲染纹理细节,比如一个砖墙,我们如何在只有一个平面的时候 ...