<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>LIU Wang-Sheng</title>
    <description>Stay awesome &amp; Stay real</description>
    <link>https://robinseaside.github.io/my_blog/</link>
    <atom:link href="https://robinseaside.github.io/my_blog/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sun, 22 Mar 2020 08:29:06 +0000</pubDate>
    <lastBuildDate>Sun, 22 Mar 2020 08:29:06 +0000</lastBuildDate>
    <generator>Jekyll v3.8.5</generator>
    
      <item>
        <title>新冠病毒是否在中国爆发前已经在美国传播？</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;根据美国疾病预防中心(CDC)的数据，从2019年9月29日到2020年3月10日，美国流感人数超过3400万，其中死亡人数达2万。最近，美国马萨诸塞大学公共健康与健康科学的教授 &lt;a href=&quot;https://www.umass.edu/sphhs/person/faculty/nicholas-g-reich&quot;&gt;Nicholas G. Reich&lt;/a&gt;追踪了类流感疾病在美国的病例数量，认为新冠病毒可能早已在美国传播。&lt;strong&gt;申明：1. 每条生命都值得重视！2. 这篇文章不是为了挑起对立，研究病毒的起源对疫苗开发和类似疾病预防至关重要。3. 我不是医学专业，如本文有不准确的信息请联系我。&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;!-- more --&gt;

&lt;h1 id=&quot;数据和指标&quot;&gt;数据和指标&lt;/h1&gt;
&lt;p&gt;Reich教授的论文相关资料都托管在github(&lt;a href=&quot;https://github.com/reichlab/ncov/&quot;&gt;点我&lt;/a&gt;)。Reich教授的原推特截图如下，感兴趣的可以直接点这个链接(&lt;a href=&quot;https://twitter.com/reichlab/status/1241174589079572480&quot;&gt;点我&lt;/a&gt;)查看。推特底下很多人留言说早在2019年11月就出现流感症状和很严重的肺炎，但是流感测试呈阴性。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/tweet-from-nicholas.png&quot; alt=&quot;tweet-from-nicholas.png&quot; height=&quot;30%&quot; width=&quot;30%&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;数据来源&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Reich教授的分析基于两个数据集：(1) ILINet (2) WHO-NREVSS。所有数据都是以星期（CDC定义的MMWR）为单位。研究结果的展示采用两种粒度：(1) 美国HHS划分的区域 (2) 联邦各州。对于第一种粒度，使用从1997/1998到2019/2020，总共23季的数据；对于第二种粒度，使用了从2010/2011到2019/2020，总共10季的数据。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;指标&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;该团队提出了rILI- (relavie percentage of influenza illness not attributable to influenza) 指标，即类流感疾病中病因并非流感病毒的相对比例。换言之，该指标高，则表明有流感症状的人群中很有可能是别的病毒或细菌引起的。虽然不能得出&lt;strong&gt;其他病因就是新冠病毒&lt;/strong&gt;的结论，但也不能排除可能性。&lt;/p&gt;

&lt;p&gt;同时，由rILI-可以计算得到Z值。Z值越高表明rILI-超出历史平均值越明显。&lt;/p&gt;

&lt;h1 id=&quot;主要发现&quot;&gt;主要发现&lt;/h1&gt;
&lt;p&gt;为了便于非专业人士阅读，此处我省略以HHS区域为粒度划分的结果，仅摘录以美国各州为粒度的结果。&lt;/p&gt;

&lt;p&gt;从下图可以看到，2019/2020流感季(黑色粗线)的各州的rILI-明显高于过去9年 (2010/2011 ~ 2018/2019，灰色粗线)的流感季。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/rILI.png&quot; alt=&quot;rILI.png&quot; height=&quot;50%&quot; width=&quot;50%&quot; /&gt;&lt;/p&gt;

&lt;p&gt;从Z值也可以看出，从2019年11月份起，美国多个州已经出现了rILI-值高于历史数据的情况出现。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/z-of-rILI.png&quot; alt=&quot;z-of-rILI.png&quot; height=&quot;70%&quot; width=&quot;70%&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;已有证据&quot;&gt;已有证据&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;1 CDC的director承认部分新冠病毒死亡案例在早些时候被误诊为流感：&lt;a href=&quot;https://www.youtube.com/watch?v=Y_dU2RCqWs4&quot;&gt;点我，youtube链接&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;2 To be added&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;如何获取更多证据&quot;&gt;如何获取更多证据&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;查抗体&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;在Reich教授的推特，很多人留言说早在2019年11月份就有人出现类似新冠病毒感染症状。最好的验证方式是&lt;strong&gt;查这些已经康复的人，体内是否有新冠病毒抗体&lt;/strong&gt;。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/ex1.png&quot; alt=&quot;ex1&quot; height=&quot;70%&quot; width=&quot;70%&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“我的父母（七十多岁，非常活跃和健康）在11月份的时候得了非常糟糕的呼吸疾病。几星期都不能从沙发上坐起来。但是流感测试呈阴性。最终康复但是他们大概同时得病，甚至他们可能已经是新冠患者。您认为呢？”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/ex2.png&quot; alt=&quot;ex2&quot; height=&quot;70%&quot; width=&quot;70%&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“我也是从11月到1月生病了，2月份再次得病。从小到大都没有病到这种程度。也花了很多的钱。我们需要测试每个人来确定我们中是否有人已经免疫，因为我们可能已经得过这个病了。我们应该照顾我们的家人！”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/ex3.png&quot; alt=&quot;ex3&quot; height=&quot;70%&quot; width=&quot;70%&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“我18岁的孩子在12月8日至15日病得很严重。咳嗽，发烧，呼吸短促。但是流感检测是阴性的。急症医生束手无策。把她送回家后在床上休息了一周。医生让她服用了阿司匹林和iburofen”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/ex4.png&quot; alt=&quot;ex4&quot; height=&quot;70%&quot; width=&quot;70%&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“我在的英国也出现了非常奇怪的像流感但又不是流感的病，我也得这种病。我病的太严重了，我大口喘气，跟得了哮喘一样。家人也病了两个月，严重的胸部感染症状，但是细菌测试是阴性。”&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sat, 21 Mar 2020 05:00:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2020-03-21-05</link>
        <guid isPermaLink="true">/blog/covid19-originate</guid>
        
        <category>social resilience</category>
        
        <category>pandemic</category>
        
        <category>covid-19</category>
        
        
      </item>
    
      <item>
        <title>Welcome!</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;“In the morning I walked down the Boulevard to the rue Soufflot for coffee and brioche. It was a fine morning. The horse-chestnut trees in the Luxembourg gardens were in bloom. There was the pleasant early-morning feeling of a hot day. I read the papers with the coffee and then smoked a cigarette. The flower-women were coming up from the market and arranging their daily stock. Students went by going up to the law school, or down to the Sorbonne. The Boulevard was busy with trams and people going to work.”     – &lt;em&gt;The Sun Also Rises&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;news&quot;&gt;News&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;em style=&quot;color:blue; font-size:140%; fond-weight:bold;&quot;&gt;18 NOV 2019&lt;/em&gt;: I am excited to join Singapore-ETH Center! I will be working on the project - &lt;em&gt;Distributed Cognition Enabled by Data Science&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;em style=&quot;color:blue; font-size:140%; fond-weight:bold;&quot;&gt;11 NOV 2019&lt;/em&gt;: Check out my oral presentation in Micron Technical Leadership Programme !
&lt;!-- more --&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 30 Jan 2020 12:00:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2020-01-30-12</link>
        <guid isPermaLink="true">/blog/about-me-and-updates</guid>
        
        <category>computer vision</category>
        
        <category>interpretability</category>
        
        <category>deep learning</category>
        
        
      </item>
    
      <item>
        <title>[挑事儿] 就算你把文章糊我脸上，这神经网络呐，还是那个黑箱</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;2018年3月6日，Google Brain 团队在distill上发表了7人共同完成的文章 &lt;a href=&quot;https://distill.pub/2018/building-blocks/&quot;&gt;《The Building Blocks of Interpretability》&lt;/a&gt;。两日后，Limber便迅速在Udacity上写了一篇文章来介绍Google Brain的这个最新成果：&lt;a href=&quot;https://zhuanlan.zhihu.com/p/34378318&quot;&gt;《再说深度学习是黑匣子，就把这篇文章互Ta脸上》&lt;/a&gt;。能拆黑匣子当然很让人兴奋了，遂找来原文读一读，不知道读完之后会不会产生把它糊到自己脸上的冲动。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;!-- more --&gt;

&lt;h1 id=&quot;一个解释神经网络的用户接口&quot;&gt;一个解释神经网络的用户接口&lt;/h1&gt;
&lt;p&gt;目前，神经网络在很多方面的推断能力已经超过了人类。但是，我们不仅希望神经网络能推断以帮助我们决策，还希望它对做出的决策进行解释，即神经网络需要具备一定的可解释性(Interpretability)。Google Brain的这篇论文提供了一个用户接口，使神经网络能向“人”解释它看到了什么，以及它做出最终决定的依据。该接口整合了特征可视化、归因、以及降维等增强解释性的方法。&lt;/p&gt;

&lt;p&gt;首先，这篇论文在可视化输入层和输出层的基础上，试图通过可视化(feature visualization)回答神经网络在隐藏层中看到了什么。这一步非常重要，因为每个隐藏层都能利用激活器对输入数据产生一个新的表征。从计算的角度，一个激活器（即单个神经元）表示为一个抽象的向量，因此很难从中得出相应的意义。而利用特征可视化可以把向量和一个更容易理解得”语义词典”进行一一对应。语义词典使我们能把神经网络学到的抽象向量和常规的实际概念联系起来。需要注意的是，尽管我们非常希望用明确的词语来概括每个语义词典，但这个操作是有损的。因为神经网络可能已经学到了人类无法察觉的细微差别，甚至它学到的概念是人类认知里没有的。更进一步，在每一个隐藏层，我们可以对同一空间位置的所有激活器对应的语义词典进行叠加，得到该位置叠加后的语义词典；根据激活程度的大小，我们可以比较各个空间位置探测到的特征强弱程度。&lt;/p&gt;

&lt;p&gt;另一个问题是，我知道了神经网络所看到的，我也想知道它如何做出最终决定（例如判断一张图片中是猫还是狗）。各类问题概括为归因(attribution)，是文中所提出的用户接口的第二个组件。归因最常用是显著图法，即把输入图像转化为简单的热点图，用颜色的深浅来表示每个像素点对最终判断的影响程度。显然，基于显著图的归因有至少两个问题：一、没有证据表明每个像素点应该是归因的最小单元；二、每次仅能为一个类别归因。为了解决这些问题，作者们在文章中对隐藏层进行归因，在更高层次地量化一个概念（即上一步中每一个隐藏层的所有通道叠加后的语义词典）对最终判断的重要性。对应通道叠加得到空间归因，我们还可以空间叠加得到通道归因，即各个通道对最终判断的影响程度。需要注意的是，虽然文中的神经元之间的关系用线性近似，文章提出的接口可以嵌入任何其他归因方法。&lt;/p&gt;

&lt;p&gt;最后一步，神经网络的解释必须被“人”所理解，即最终展示的数据量必须是人类尺度，而不是一大堆纷杂的信息。在前面两步中，每一个隐藏层可以用三种方式进行划分：空间激活器集，通道激活器集，或者单个神经元。显然，任何以上任何一种划分都很难反映这个该隐藏层的整体状况。另一个问题是，这种划分方式最终信息太多了，试想，如果对每层几万的神经元进行特征可视化，我们几乎不能得到有用的结论，即便通过空间激活器集进行划分，几百个激活器集也很难描述。为了解决这个问题，文中采用矩阵因式分解的成组技术，如下图所示，最终大量的神经元被划分为很小数量的组（grouping）来更简洁地描述该隐藏层所见所想。隐藏层的矩阵因式分解过程本质上是一个权衡人类尺度和减少损失信息的过程，往往建模成多目标的最优化问题。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://robinseaside.github.io/my_blog/images/blog_images/slicing_a_hidden_layer.png&quot; alt=&quot;slicing_a_hidden_layer.png&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;神经网络还是不是黑箱&quot;&gt;神经网络还是不是黑箱？&lt;/h1&gt;
&lt;p&gt;黑箱通常定义为，非基于物理定律的数学模型。黑箱包含的函数往往有很强的灵活性和泛化能力，但只是根据输入给出输出而不能解释模型参数对最终预测所起的作用。&lt;/p&gt;

&lt;p&gt;我们不希望我们的模型是一个黑箱。因为拆开黑箱，往往意味着: (i) 在知道模型性能决定因素的基础上，预测模型实际生产中的表现；(ii) 探测到模型中可能存在的偏见（一定程度上与数据有关）；(iii) 为建立更有效的模型提供洞察力。&lt;/p&gt;

&lt;p&gt;在得出神经网络是不是黑箱的定论之前，我们不妨问自己以下几个问题：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;各层参数的含义是什么？&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;影响神经网络决策的最主要因素是什么？&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;如何确定神经网络的结构？&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;可以看到，这三个问题是层层递进的。目前的研究，包括&lt;a href=&quot;https://distill.pub/2018/building-blocks/&quot;&gt;《The Building Blocks of Interpretability》&lt;/a&gt;，对前两个问题进行了很好的回答。反卷积特征图可视化等工作也在不断的进行过程中。而第三个问题涉及到的不仅仅是参数或者特征，它是一个模型选择的问题。对于确定性的模型，例如决策树或者线性回归，模型选择问题不存在，而对于结构变幻莫测的神经网络，这个问题则需要答案。&lt;/p&gt;

&lt;p&gt;模型选择的难度显而易见，从传统的统计学习来看（我目前所做的贝叶斯推断也属于此类），神经网络属于一类不可识别的模型：给定数据集和网络拓扑结构，不同的模型参数可以得到相同的结果。&lt;/p&gt;

&lt;p&gt;综上，从数学定义上，神经网络将长期是个黑箱，直至大脑研究的生物科技取得突破；从可解释性角度，神经网络已经是个可以解释的黑箱，但模型选择仍然未得到解释。&lt;/p&gt;

&lt;p&gt;我们可能不喜欢黑箱，但不可否认黑箱的强大能力。神经网络对于各个方向的空间扩展以及不同空间域之间的相互作用能力，显示了其巨大的应用潜力。&lt;/p&gt;

&lt;h1 id=&quot;关于distill&quot;&gt;关于distill&lt;/h1&gt;
&lt;p&gt;这篇文章发表在distill，这个去年推出的论文网站背后是Google Brain中诸如Ian Goodfellow的大神。distill上的论文在网上发表，采用便于网上阅读的格式，采用交互图片，同时也有doi和传统文章发表的同行评审过程。目前，arXiv上的文章不断抢占idea高地，对idea的理论推导和具体implementation有意无意的忽视；学术期刊上的文章，又饱受各大出版商(elsivier, springer)的压榨。正如某云说的，“银行不改变，我们就来改变银行”，distill仿佛在说：“出版商不改变，我们就来改变出版商”。&lt;/p&gt;

</description>
        <pubDate>Sat, 10 Mar 2018 12:00:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2018-03-10-12</link>
        <guid isPermaLink="true">/blog/interpretability-building-blocks</guid>
        
        <category>computer vision</category>
        
        <category>interpretability</category>
        
        <category>deep learning</category>
        
        
      </item>
    
      <item>
        <title>[简单总结] 用机器学习反欺诈 (Fraud Detection)</title>
        <description>&lt;h1 id=&quot;什么是反欺诈&quot;&gt;什么是反欺诈？&lt;/h1&gt;
&lt;p&gt;根据Cambridge Dictionary，欺诈(Fraud)定义为：通过欺骗获取物质或者货币的犯罪行为。自古以来，欺诈广泛地存在在商业活动中，所谓“无奸不商，无商不奸”。随着互联网的快速发展，犯罪分子越来越多地利用电信和网络进行诈骗，且手段不断更新进化。目前反欺诈的重点主要包括网上购物（商家卖假货）、银行业务（信用卡欺诈）、互联网优惠券、保险业务等。&lt;/p&gt;

&lt;p&gt;魔高一尺，道高一丈。反欺诈技术也在不断地进步，从起初的黑名单到现在基于深度网络的recurrent neural network。方法和算法将在下文做详细介绍。&lt;/p&gt;

&lt;h1 id=&quot;常用算法&quot;&gt;常用算法&lt;/h1&gt;
&lt;p&gt;在介绍算法之前，我们先来总结下反欺诈问题建模的主要难点：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;问题难定义。欺诈手段的不断变化，我们不可能期望训练完成的模型能识别所有欺诈。&lt;/li&gt;
  &lt;li&gt;标注成本高。每一个欺诈正样本的获取必须识别并验证这是一次欺诈行为。这个过程很有可能需要人工去搜集证据去核实，费时费力。这就造成了整个数据集中正负样本往往表现为极大的不平衡。&lt;/li&gt;
  &lt;li&gt;负样本噪声大，存在异常值。大体来说，欺诈行为具有隐蔽性，识别难度很高，标记为负样本的记录同样可能是一次欺诈。这就意味着负样本实际上是正样本，我们打错了标签。&lt;/li&gt;
  &lt;li&gt;欺诈手段是不断进化的，新的欺诈手段不停出现。这就要求我们不断地更新和进化模型，或者模型本身要包含时间这一个重要的变量。&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- more --&gt;

&lt;h2 id=&quot;有监督学习supervised-learning&quot;&gt;有监督学习(supervised learning)&lt;/h2&gt;
&lt;p&gt;建模为分类或回归问题，用RL, random forest, NN等算法&lt;br /&gt;
&lt;strong&gt;缺点&lt;/strong&gt;：需要大量的已标记好的数据&lt;br /&gt;
&lt;strong&gt;优点&lt;/strong&gt;：可解释性强&lt;/p&gt;

&lt;h2 id=&quot;无监督学习unsupervised-learning&quot;&gt;无监督学习(unsupervised learning)&lt;/h2&gt;
&lt;p&gt;建模为聚类或者异常值检测问题。可用概率图模型，异常值检测较为常用是周志华老师提出的isolation forest (已经在sklearn中实现)，聚类可用k-means, GMM等模型。&lt;br /&gt;
&lt;strong&gt;缺点&lt;/strong&gt;：可解释性差，结果不可控&lt;br /&gt;
&lt;strong&gt;优点&lt;/strong&gt;：无需标签，用图模型可以提高解释性&lt;/p&gt;

&lt;h2 id=&quot;规则rules&quot;&gt;规则(rules)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;缺点&lt;/strong&gt;：需要有经验作为支撑，来提出规则；需要不断改进规则来适应具体问题的变化&lt;br /&gt;
&lt;strong&gt;优点&lt;/strong&gt;：可快速部署，准确率高&lt;/p&gt;

</description>
        <pubDate>Sun, 04 Feb 2018 08:26:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2018-02-04-08</link>
        <guid isPermaLink="true">/blog/fraud-detection-introduction</guid>
        
        <category>chinese</category>
        
        <category>fraud detection</category>
        
        <category>tutorial</category>
        
        
      </item>
    
      <item>
        <title>On binary search</title>
        <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Binary Search (BS) a.k.a. half-interval search, is a search algorithm that finds the position of a target value within a &lt;strong&gt;sorted&lt;/strong&gt; array&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. Specifically, assume the array has been sorted in ascending order, first the algorithm compares the target value to the middle element of the array; if equal, the search ends with the position of the target value is the position of the middle element, otherwise, the array is divided into left and right parts by taking the middle element as the boundary, and search in the left (right) part if the target value is smaller (larger) than the middle element; the search continues until the target value is found in the array (successful) or the array to be searched becomes empty (unsuccessful).&lt;/p&gt;

&lt;p&gt;BS is widely used due to its low level of computational complexity. BS requires O(log(n)) comparisons in the worst case. And the worst-case space complexity is O(1). Despite its search efficiency, the drawback is that the array must be sorted before searching and therefore operations such as insert and delete elements are difficult to implement.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;h1 id=&quot;python-code-block&quot;&gt;Python code block&lt;/h1&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;binary_search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;    
    &lt;span class=&quot;n&quot;&gt;low&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;high&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;low&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;high&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;        
        &lt;span class=&quot;n&quot;&gt;mid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;low&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;high&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;# the indice of the middle element      
&lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mid&lt;/span&gt;        
        &lt;span class=&quot;k&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;high&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;        
        &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;          
            &lt;span class=&quot;n&quot;&gt;low&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mid&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;    
     &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;# tval is not in the list, return none
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;notes&quot;&gt;Notes&lt;/h1&gt;
&lt;p&gt;BS is efficient and can be applied to different types of problems; for specialized data structures (e.g., Hash table), they can be seached even faster.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;
      &lt;p&gt;https://en.wikipedia.org/wiki/Binary_search_algorithm &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Sun, 27 Aug 2017 14:55:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2017-08-27-14</link>
        <guid isPermaLink="true">/blog/BinarySearch</guid>
        
        <category>algorithm</category>
        
        <category>search</category>
        
        
      </item>
    
      <item>
        <title>Curriculum Vitae</title>
        <description>&lt;h1 id=&quot;education&quot;&gt;Education&lt;/h1&gt;
&lt;p&gt;Tongji University
Nanyang technological&lt;/p&gt;

&lt;h1 id=&quot;experiences&quot;&gt;Experiences&lt;/h1&gt;

&lt;h1 id=&quot;publications&quot;&gt;Publications&lt;/h1&gt;

&lt;h1 id=&quot;skills&quot;&gt;Skills&lt;/h1&gt;
&lt;p&gt;Machine learning, density estimation, programming&lt;/p&gt;

&lt;h1 id=&quot;updated-cv&quot;&gt;Updated CV&lt;/h1&gt;
&lt;p&gt;linkedin&lt;/p&gt;
</description>
        <pubDate>Mon, 21 Aug 2017 20:10:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2017-08-21-20</link>
        <guid isPermaLink="true">/blog/CV</guid>
        
        <category>cv</category>
        
        <category>welcome</category>
        
        
      </item>
    
      <item>
        <title>Bayesian sequential partitioning</title>
        <description>&lt;h1 id=&quot;details-about-my-first-publication&quot;&gt;Details about my first publication&lt;/h1&gt;

&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;One&lt;/li&gt;
  &lt;li&gt;Two&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Sun, 20 Aug 2017 22:00:00 +0000</pubDate>
        <link>https://robinseaside.github.io/my_blog#2017-08-20-22</link>
        <guid isPermaLink="true">/blog/BSP</guid>
        
        <category>cv</category>
        
        <category>welcome</category>
        
        
      </item>
    
  </channel>
</rss>
