无人车准备0902

In general, entropy measures the amount of uncertainty. Since the update step increases uncertainty, then entropy should increase. The measurement step decreases uncertainty, so entropy should decrease.

Let's look at our current example where the robot could be at five different positions. The maximum uncertainty occurs when all positions have equal probabilities [0.2,0.2,0.2,0.2,0.2]

Following the formula (, we get .Entropy=Σ(p×log(p)), we get 5×(.2)×log(0.2)=0.699.

Taking a measurement should decrease uncertainty and thus decrease entropy. Let's say after taking a measurement, the probabilities become [0.05,0.05,0.05,0.8,0.05] Now the entropy decreased to 0.338. Hence a measurement step should decrease entropy whereas an update step should increase entropy.


关于str.translate(table[,deletechars])


[python]  view plain  copy
  1. import string    
  2.     
  3. s = 'abcd--dcba'    
  4.     
  5. # 参数from和to的长度必须一致    
  6. table = string.maketrans('''')   # type(table) is 'str'  
  7. print(s.translate(table))   # 输出 abcd--dcba  
  8.   
  9. table = string.maketrans('ab''12')  
  10. print(s.translate(table))   # 输出 12cd--dc21  
  11.   
  12. # 将先删除'ad',然后再转换  
  13. print(s.translate(table, 'ad'))     # 输出 2c--c2  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值