<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://honkeechan.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://honkeechan.github.io/" rel="alternate" type="text/html" /><updated>2026-08-31T08:31:07+08:00</updated><id>https://honkeechan.github.io/feed.xml</id><title type="html">陈洪健的博客</title><subtitle>学习笔记 · 旅游规划 · 技术随笔</subtitle><entry><title type="html">决策树学习笔记 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/17/%E5%86%B3%E7%AD%96%E6%A0%91%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Honkee.html" rel="alternate" type="text/html" title="决策树学习笔记 - Honkee" /><published>2015-11-17T00:00:00+08:00</published><updated>2015-11-17T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/17/%E5%86%B3%E7%AD%96%E6%A0%91%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/17/%E5%86%B3%E7%AD%96%E6%A0%91%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Honkee.html"><![CDATA[<blockquote>
  <p>为什么需要数据挖掘</p>
</blockquote>

<p>通过观察概率表来发现数据之间的规律 但是当数据的规模大了，属性多了，决定规律的属性多了，我们就有会得到很多概率表，发现数据之间的概率的困难程度大大地增高了。</p>

<p>决定一个模式是不是有用的，我们用信息熵来度量</p>

<p>决策树先去判断哪个模式，就要看哪个模式的信息熵高，然后再找第二个模式，这样递归找下去，直到剩下的分类完全一样，那个属性就是决策树的一个终止节点。</p>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[为什么需要数据挖掘]]></summary></entry><entry><title type="html">不平衡学习 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/15/%E4%B8%8D%E5%B9%B3%E8%A1%A1%E5%AD%A6%E4%B9%A0-Honkee.html" rel="alternate" type="text/html" title="不平衡学习 - Honkee" /><published>2015-11-15T00:00:00+08:00</published><updated>2015-11-15T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/15/%E4%B8%8D%E5%B9%B3%E8%A1%A1%E5%AD%A6%E4%B9%A0---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/15/%E4%B8%8D%E5%B9%B3%E8%A1%A1%E5%AD%A6%E4%B9%A0-Honkee.html"><![CDATA[<h3 id="不平衡学习">不平衡学习</h3>

<blockquote>
  <p>定义</p>
</blockquote>

<p>顾名思义即我们的数据集样本类别极不均衡，以二分类问题为例，假设我们的数据集是$S$，数据集中的多数类为$S_maj$，少数类为$S_min$，通常情况下把多数类样本的比例为$100:1$,$1000:1$，甚至是$10000:1$这种情况下为不平衡数据，不平衡数据的学习即需要在如此分布不均匀的数据集中学习到有用的信息。</p>

<p>如搜索引擎的点击预测（点击的网页往往占据很小的比例），电子商务领域的商品推荐（推荐的商品被购买的比例很低），信用卡欺诈检测，网络攻击识别等等。</p>

<blockquote>
  <p>缺点</p>
</blockquote>

<p>考虑一个$500:1$的数据集，即使把所有样本都预测为多数类其精度也能达到$500/501$之高，很显然这并不是一个很好的学习效果，因此传统的学习算法在不平衡数据集中具有较大的局限性。</p>

<p>但是可以考虑平衡两个样本的误差率</p>

<blockquote>
  <p>解决方案</p>
</blockquote>

<ol>
  <li>
    <p>采样，使样本均衡些</p>

    <ul>
      <li>随机欠采样</li>
    </ul>
  </li>
</ol>

<p>在多样本中选择少量样本跟少数样本组成训练样本 * 随机过采样</p>

<p>在少数样本中重复采样跟多样本组成训练样本</p>

<p>对于上述两种采样方法都有一些缺点，针对这些问题提出了几种其它的采样算法。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> * SMOTE 基于随机过采样算法的一种改进方案
</code></pre></div></div>

<p>通过建模去生成新的样本</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> * informedundersampling采样技术 EasyEnsemble算法和BalanceCascade算法
</code></pre></div></div>

<ol>
  <li>
    <p>考虑不同误分类情况代价的差异性对算法进行优化</p>

    <ul>
      <li>代价敏感学习算法(Cost-Sensitive Learning)</li>
      <li>AdaCost算法</li>
    </ul>
  </li>
</ol>

<blockquote>
  <p>不平衡学习的评价方法</p>
</blockquote>

<ul>
  <li>正确率与F值</li>
  <li>G-Mean</li>
  <li>ROC曲线和AUC</li>
</ul>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[不平衡学习]]></summary></entry><entry><title type="html">Python Thread - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/13/Python-Thread-Honkee.html" rel="alternate" type="text/html" title="Python Thread - Honkee" /><published>2015-11-13T00:00:00+08:00</published><updated>2015-11-13T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/13/Python-Thread---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/13/Python-Thread-Honkee.html"><![CDATA[<p>今天看到这篇文章，关于多线程编程的，感觉这篇文章讲得挺好的。<a href="http://segmentfault.com/a/1190000000414339#articleHeader3">文章在这里</a></p>

<p>这篇文章一开始讲了一个生产者消费者的多线程的模型，生产者往队列里添加任务，消费者从队列里取出任务去执行。多线程就相当于多个消费者同时从这个队列里取出任务去完成。</p>

<p>这篇文章讲到了用线程池</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>from multiprocessing import Pool
pool = Pool()
pool.map(urllib2.urlopen, urls)
pool.close()
pool.join()



from multiprocessing.dummy import Pool as ThreadPool
pool = ThreadPool(4) 
results = pool.map(urllib2.urlopen, urls)
pool.close() 
pool.join() 
</code></pre></div></div>

<p><a href="http://www.ibm.com/developerworks/aix/library/au-threadingpython/">IBM的一篇关于Python多线程的文章</a> 当线程涉及到共享数据时，我们就可以考虑使用 信号量，条件变量，事件， 锁（semaphores, condition variables, events, and locks）</p>

<p>队列的设计模式使线程编程变得更加简单。使用一个线程安全的队列Queue，我们就可以用多个线程从这个队列中取出任务去完成了。</p>

<p>这篇文章先讲了一个用for循环去打开网址的例子，再用多线程去取得队列打开网址。最后一个例子是通过多线程去打开网址，并将获得的内容放到另一个队列里，供另一个用途（数据挖掘）。</p>

<p>对于线程后面都需要用join去等待线程完成我理解得还不是很清楚。</p>

<h3 id="总结">总结</h3>

<p>虽然多线程能充分的利用处理器的资源，但是线程的数量对效率的影响也是比较大得。对于计算密集型程序，线程数量不宜太多，这种程序太多的线程会造成过多的线程切换，浪费太多的时间。对于IO密集型程序，线程数量则应该多一些。</p>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[今天看到这篇文章，关于多线程编程的，感觉这篇文章讲得挺好的。文章在这里]]></summary></entry><entry><title type="html">Python Logging模块 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/12/Python-Logging%E6%A8%A1%E5%9D%97-Honkee.html" rel="alternate" type="text/html" title="Python Logging模块 - Honkee" /><published>2015-11-12T00:00:00+08:00</published><updated>2015-11-12T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/12/Python-Logging%E6%A8%A1%E5%9D%97---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/12/Python-Logging%E6%A8%A1%E5%9D%97-Honkee.html"><![CDATA[<h3 id="logger的level">logger的Level</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>logger.setLevel()
</code></pre></div></div>

<p>设置logger的level，level有以下几个级别 NOTSET &lt; DEBUG &lt; INFO &lt; WARNING &lt; ERROR &lt; CRITICAL 如果把looger的级别设置为INFO， 那么小于INFO级别的日志都不输出， 大于等于INFO级别的日志都输出</p>

<h3 id="logger的处理器">logger的处理器</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>logger.addHandler()
</code></pre></div></div>

<p>logger可以雇佣handler来帮它处理日志， handler主要有以下几种：</p>

<ul>
  <li>StreamHandler: 输出到控制台</li>
  <li>FileHandler: 输出到文件</li>
</ul>

<p>handler还可以设置自己的level以及输出格式。</p>

<h3 id="将logger封装起来方便使用">将logger封装起来方便使用</h3>

<p>这个logger类具有控制台，文件同时输出的功能，使用方法如下</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import logging

class MyLogging:
    def __init__(self, loggerName = 'mylog', fileName = 'log.txt'):
        self.logger = logging.getLogger(loggerName)  
        self.logger.setLevel(logging.DEBUG)         
        # 创建一个handler，用于写入日志文件  
        fh = logging.FileHandler(fileName)  
        fh.setLevel(logging.DEBUG)  
        # 再创建一个handler，用于输出到控制台  
        ch = logging.StreamHandler()  
        ch.setLevel(logging.DEBUG)          
        # 定义handler的输出格式  
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')  
        fh.setFormatter(formatter)  
        ch.setFormatter(formatter)          
        # 给logger添加handler  
        self.logger.addHandler(fh)  
        self.logger.addHandler(ch) 
if __name__ == '__main__':
    logger = MyLogger('hello_log', 'main.log').logger
    logger.info('info message')
    logger.debug('debug message')
    logger.warning('warning message')
    logger.critical('critical message')
</code></pre></div></div>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[logger的Level logger.setLevel()]]></summary></entry><entry><title type="html">OpenCV图片处理 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/11/OpenCV%E5%9B%BE%E7%89%87%E5%A4%84%E7%90%86-Honkee.html" rel="alternate" type="text/html" title="OpenCV图片处理 - Honkee" /><published>2015-11-11T00:00:00+08:00</published><updated>2015-11-11T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/11/OpenCV%E5%9B%BE%E7%89%87%E5%A4%84%E7%90%86---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/11/OpenCV%E5%9B%BE%E7%89%87%E5%A4%84%E7%90%86-Honkee.html"><![CDATA[<h2 id="opencv读取图片">opencv读取图片</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import cv2
img = cv2.imread('/path/to/image')
img.shape()
</code></pre></div></div>

<p>out:(heigh,width,color)</p>

<h2 id="opencv截取图片">opencv截取图片</h2>

<p>图片存储的第一维是图片的高度，第二维是图片的宽度，第三维是图片的颜色维度。所以我们去寻址的时候先对行寻址，再对列寻址。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cropImg = img[t:b, l:r]
</code></pre></div></div>

<h2 id="opencv通道分离合并">opencv通道分离、合并</h2>

<h3 id="分离">分离</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>b, g, r = cv2.split(img)
</code></pre></div></div>

<p>或者用numpy的数组</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>b = np.zeros((img.shape[0],img.shape[1]), dtype=img.dtype)  
g = np.zeros((img.shape[0],img.shape[1]), dtype=img.dtype)  
r = np.zeros((img.shape[0],img.shape[1]), dtype=img.dtype)  
b[:,:] = img[:,:,0]  
g[:,:] = img[:,:,1]  
r[:,:] = img[:,:,2]  
</code></pre></div></div>

<h3 id="合并">合并</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nerged = cv2.merge([b, g, r])
</code></pre></div></div>

<p>或者numpy的方法</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mergedByNp = np.dstack([b, g, r])
</code></pre></div></div>

<p>网上说numpy的组合方法不能用于opencv的其他函数，因为他们的组合方法不一样。<a href="http://blog.csdn.net/sunny2038/article/details/9080047" title="Title">点击这里</a></p>

<p>但是我做过一个试验显示这两种方法合并得到的结果是一样的。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mergedByNp.strides
out: (1920, 3, 1)
merged.strides
out: (1920, 3, 1)
</code></pre></div></div>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[opencv读取图片 import cv2 img = cv2.imread('/path/to/image') img.shape()]]></summary></entry><entry><title type="html">《思考的艺术》 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/10/%E6%80%9D%E8%80%83%E7%9A%84%E8%89%BA%E6%9C%AF-Honkee.html" rel="alternate" type="text/html" title="《思考的艺术》 - Honkee" /><published>2015-11-10T00:00:00+08:00</published><updated>2015-11-10T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/10/%E6%80%9D%E8%80%83%E7%9A%84%E8%89%BA%E6%9C%AF---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/10/%E6%80%9D%E8%80%83%E7%9A%84%E8%89%BA%E6%9C%AF-Honkee.html"><![CDATA[<p>这段时间读了《思考的艺术》这本书，我读这本书的时候感觉不能认真的读下去，不知道是这本书讲得太罗嗦了，还是我定不下心来看这本书。 我觉得这本书并没有封面上所说的这么完美：“批判性思维领域的‘圣经’！权威大师之作”。也许很多外国翻译过来的书讲得都是那么详细吧，反正他就是建议做他的那些课后习题，我是看了一点，然后觉得没什么兴趣看下去，所以我基本上就是遇到课后习题就跳过了。看书的内容的话，我也是看到感兴趣的小标题我才会认真的看看内容，否则就是大概的浏览一下标题，所以这本书看的时间也不是很长。</p>

<p>但是这本书提到了一些做法，我觉得还是不错的，所以我打算记录下来。</p>

<h2 id="思考">思考</h2>

<ul>
  <li>我们思考的内容和思考的有效性不同，造成了我们社会的不同分工。</li>
</ul>

<p>我对这句话的理解就是：思考的内容不同，造成我们工作内容不同。思考的有效性不同，造成我们的社会地位不同。所以最重要的是思考的有效性的问题，至于如何去提高思考的有效性的问题，也是一门高深的学问。我也正在想办法提高自己思考的有效性。</p>

<ul>
  <li>工作效率</li>
</ul>

<p>很多时候我们的工作效率很低，也许是因为那个时间段，或者那个工作的地方的因素影响了我们的效率。我们可以尝试着找到自己工作效率高的时间段和工作地点。</p>

<ul>
  <li>
    <p>不以别人对自己的评价定义自己</p>
  </li>
  <li>
    <p>批判性阅读：略读、反思、阅读、评价和表达判断</p>
  </li>
  <li>
    <p>时刻使自己保持着好奇心</p>
  </li>
</ul>

<p>大多数人都满怀好奇心降临在世界上开始自己的一生，却随着时光的迁移将这份好奇心永远埋葬。</p>

<p>很多时候我们是因为别人对我们的评价而改变了自己的行为。比如说，我们学习的时候遇到了一个问题，想着去问老师，被身边的人一边讽刺，我们就放弃了去询问老师这个想法。</p>

<p>好奇心也建立在你对这个领域有一定了解的基础上。完全不懂也是提不出问题的。比如说我在随机过程的课上，虽然也有很多问题不懂，但是我却不知道从哪开始问。因为我觉得我的问题就是让老师重新讲一遍。</p>

<p>虽然好奇心很重要，但是我们不能有什么不懂就跑去问他人，因为别人也有别人的事情，我们不应该总是花费他人的时间来给自己答案。我们向别人提问题的时候最好就是先经过自己的思考，提出一些有质量的问题，这样才是体会到思考的艺术。</p>

<ul>
  <li>
    <p>创新过程</p>

    <ul>
      <li>寻找挑战</li>
      <li>描述问题或争议</li>
      <li>研究问题或争议</li>
      <li>产生想法</li>
    </ul>
  </li>
  <li>
    <p>避免先入为主</p>

    <ul>
      <li>人们对某个问题越是熟悉，就越有可能拥有自己的看法</li>
      <li>当其他人的想法和你不同，他们很可能放大你想法中的瑕疵</li>
      <li>如果你希望问题及其表达有条理，那么你首先需要有清晰的建构</li>
    </ul>
  </li>
  <li>
    <p>改进问题的解决方法</p>
    <ul>
      <li>制定解决方法的细节</li>
      <li>寻找缺点和新问题</li>
      <li>进行改善</li>
    </ul>
  </li>
</ul>

<h2 id="演讲">演讲</h2>

<ul>
  <li>了解你的听众
    <ul>
      <li>你的听众在最重要的问题上是否会听得认真，预先了解哪些地方容易被忽略，我们可以确定在哪些地方进行更充分的解释。</li>
      <li>你的听众是否知道各种可能的解决方案，提供多点解决方案，并说明其他的解决方案的不足。</li>
    </ul>
  </li>
  <li>尽可能让听众有感同身受</li>
  <li>回应所有的反驳意见</li>
  <li>把握演讲时机的重要性
    <ul>
      <li>知道听众被证明是错误致歉，稍稍克制自己的表达</li>
    </ul>
  </li>
</ul>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[这段时间读了《思考的艺术》这本书，我读这本书的时候感觉不能认真的读下去，不知道是这本书讲得太罗嗦了，还是我定不下心来看这本书。 我觉得这本书并没有封面上所说的这么完美：“批判性思维领域的‘圣经’！权威大师之作”。也许很多外国翻译过来的书讲得都是那么详细吧，反正他就是建议做他的那些课后习题，我是看了一点，然后觉得没什么兴趣看下去，所以我基本上就是遇到课后习题就跳过了。看书的内容的话，我也是看到感兴趣的小标题我才会认真的看看内容，否则就是大概的浏览一下标题，所以这本书看的时间也不是很长。]]></summary></entry><entry><title type="html">Face Landmark Lib - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/09/Face-Landmark-Lib-Honkee.html" rel="alternate" type="text/html" title="Face Landmark Lib - Honkee" /><published>2015-11-09T00:00:00+08:00</published><updated>2015-11-09T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/09/Face-Landmark-Lib---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/09/Face-Landmark-Lib-Honkee.html"><![CDATA[<p>最近在刷微博的时候发现了一个人脸特征点检测的库——CLM Framework，之前用过Dlib做人脸特征点检测，觉得准确率还是相当可观的。现在找到CLM Framework这个库，感觉准确率应该也不错，它还提供认的头部朝向，感觉应用它的地方会更广。</p>

<h3 id="clm-framework">CLM Framework</h3>

<p><strong>function:</strong> face landmark and head pose estimation</p>

<p>C++开发的，<a href="https://github.com/TadasBaltrusaitis/CLM-framework" title="Title">Github</a>上有个VS项目。</p>

<h3 id="dlib">Dlib</h3>

<p><strong>function:</strong> face landmark</p>

<p>C++写的库，有C++接口和Python接口。</p>

<h3 id="application">Application</h3>

<ul>
  <li>化妆</li>
</ul>

<p>通过获得face landmark，对眼睛附近区域和嘴唇附近区域进行一些颜色的处理，就相当于后期化妆~ <img src="/images/taaz-before-after.jpg" alt="alt text" /></p>

<ul>
  <li>
    <p>换人脸</p>
  </li>
  <li>人脸特征检测和人脸追踪</li>
  <li>人脸对齐</li>
</ul>

<p>通过Affine Transform将人脸的多个特征点映射到一个固定的地方，这样做有利于提高人脸识别的准确率。</p>

<p>通过Delaunay triangulation和Voronoi Diagram对识别出来的特征点进行分割，我还不知道这个有什么用。</p>

<p><img src="/images/opencv-delaunay-vornoi-subdiv-example.jpg" alt="alt text" /> Figure 1. Left : Image of President Obama with landmarks detected using dlib. Center : Delaunay triangulation of the landmarks. Right : Corresponding Voronoi Diagram.</p>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[最近在刷微博的时候发现了一个人脸特征点检测的库——CLM Framework，之前用过Dlib做人脸特征点检测，觉得准确率还是相当可观的。现在找到CLM Framework这个库，感觉准确率应该也不错，它还提供认的头部朝向，感觉应用它的地方会更广。]]></summary></entry><entry><title type="html">Mac配置Caffe - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/08/Mac%E9%85%8D%E7%BD%AECaffe-Honkee.html" rel="alternate" type="text/html" title="Mac配置Caffe - Honkee" /><published>2015-11-08T00:00:00+08:00</published><updated>2015-11-08T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/08/Mac%E9%85%8D%E7%BD%AECaffe---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/08/Mac%E9%85%8D%E7%BD%AECaffe-Honkee.html"><![CDATA[<p>今天跟着caffe项目的官网向导去安装caffe，前面安装依赖库的时候多次出现下载失败的情况，但是最后在早上再次安装依赖库，貌似每一句都安装成功了。可是到了编译的时候，显示着找不到blas相关字眼的错误信息。 于是我就通过brew这个包管理器去安装blas。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew install blas
</code></pre></div></div>

<p>brew提示错误信息说找不到blas，但提供了相关的包</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pro:~ honkee$ brew install blas
Error: No available formula with the name "blas" 
==&gt; Searching for similarly named formulae...
These similarly named formulae were found:
homebrew/science/blasr                   homebrew/science/rmblast               
homebrew/science/blast                   homebrew/science/samblaster            
homebrew/science/clblas                  liblas                                 
homebrew/science/jblas                   liblastfm                              
homebrew/science/openblas (installed)    mp3blaster                             
To install one of them, run (for example):
  brew install homebrew/science/blasr
==&gt; Searching taps...
This formula was found in a tap:
Caskroom/cask/blast2go
To install it, run:
  brew install Caskroom/cask/blast2go
</code></pre></div></div>

<p>我选择了openblas</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew install openblas
</code></pre></div></div>

<p>安装完openblas之后，需要去修改Makefile.config文件</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>42 # BLAS choice:
43 # atlas for ATLAS (default)
44 # mkl for MKL 
45 # open for OpenBlas
46 BLAS := open



53 # Homebrew puts openblas in a directory that is not on the standard search p    ath
54  BLAS_INCLUDE := $(shell brew --prefix openblas)/include
55  BLAS_LIB := $(shell brew --prefix openblas)/lib
</code></pre></div></div>

<p>修改了这两处就可以去编译caffe了。 修改这两处的目的是让编译caffe的时候找到blas，还有说明我们用的是openblas。 如果没有说明我们用的是openblas会出现下述错误。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>caffe ld: framework not found vecLib
</code></pre></div></div>

<p>如果没有说明我们的blas库安装地址，就会显示一些头文件包含错误，找不到blas之类的。</p>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[今天跟着caffe项目的官网向导去安装caffe，前面安装依赖库的时候多次出现下载失败的情况，但是最后在早上再次安装依赖库，貌似每一句都安装成功了。可是到了编译的时候，显示着找不到blas相关字眼的错误信息。 于是我就通过brew这个包管理器去安装blas。 brew install blas]]></summary></entry><entry><title type="html">VS插件-GetSet生成器 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/06/VS%E6%8F%92%E4%BB%B6-GetSet%E7%94%9F%E6%88%90%E5%99%A8-Honkee.html" rel="alternate" type="text/html" title="VS插件-GetSet生成器 - Honkee" /><published>2015-11-06T00:00:00+08:00</published><updated>2015-11-06T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/06/VS%E6%8F%92%E4%BB%B6-GetSet%E7%94%9F%E6%88%90%E5%99%A8---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/06/VS%E6%8F%92%E4%BB%B6-GetSet%E7%94%9F%E6%88%90%E5%99%A8-Honkee.html"><![CDATA[<p>Java，C#都有GetSet生成器的方法，而C++却没有这样的工具，即使是现在是有插件做到相应的功能，但是 这个要查一下！！！！！！ 现有的插件做得不够方便，所以我们就做了这个插件。 现在来讲讲这个插件的具体思路。</p>

<h2 id="从选择文本中选择变量生成其getset方法">从选择文本中选择变量生成其GetSet方法</h2>

<h4 id="文本分割">文本分割</h4>

<p>先将选中的文本分行，我们可以以‘\r\n’来分割。然后对每行进行分割。 我们一般定义变量都是每一行定义一个变量，以分号结束,所以我们可以得到一句中分号前面的那段字符串。 变量类型与变量名称之间隔着空格，所以我们可以用空格去分离变量类型与变量名称，考虑到指针类型（星号与类型之间可以有空格），所以我们的空格从后面开始找。就这样我们就可以将变量类型与变量名称分离出来。我们用得到的变量类型和变量名称就可以生成GetSet方法的字符串。</p>

<h4 id="找到插入点">找到插入点</h4>

<p>为了找到GetSet方法的插入点，我们就要遍历整个文件，去寻找每个类对应的public域跟private域。</p>

<h2 id="通过填写信息生成getset方法">通过填写信息生成GetSet方法</h2>

<p>这个要比上面的方法容易一点，我们只需要拼凑GetSet方法字符串，并且找到插入点就可以了。</p>

<h2 id="如何去找到合适的插入点">如何去找到合适的插入点</h2>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[Java，C#都有GetSet生成器的方法，而C++却没有这样的工具，即使是现在是有插件做到相应的功能，但是 这个要查一下！！！！！！ 现有的插件做得不够方便，所以我们就做了这个插件。 现在来讲讲这个插件的具体思路。]]></summary></entry><entry><title type="html">参加微软黑客马拉松经历 - Honkee</title><link href="https://honkeechan.github.io/legacy/2015/11/03/%E5%8F%82%E5%8A%A0%E5%BE%AE%E8%BD%AF%E9%BB%91%E5%AE%A2%E9%A9%AC%E6%8B%89%E6%9D%BE%E7%BB%8F%E5%8E%86-Honkee.html" rel="alternate" type="text/html" title="参加微软黑客马拉松经历 - Honkee" /><published>2015-11-03T00:00:00+08:00</published><updated>2015-11-03T00:00:00+08:00</updated><id>https://honkeechan.github.io/legacy/2015/11/03/%E5%8F%82%E5%8A%A0%E5%BE%AE%E8%BD%AF%E9%BB%91%E5%AE%A2%E9%A9%AC%E6%8B%89%E6%9D%BE%E7%BB%8F%E5%8E%86---Honkee</id><content type="html" xml:base="https://honkeechan.github.io/legacy/2015/11/03/%E5%8F%82%E5%8A%A0%E5%BE%AE%E8%BD%AF%E9%BB%91%E5%AE%A2%E9%A9%AC%E6%8B%89%E6%9D%BE%E7%BB%8F%E5%8E%86-Honkee.html"><![CDATA[<p>这次参加黑客马拉松，队伍一共三人，一个是微软俱乐部部长，另一个是一个女生。 我来总结下我的工作吧。</p>

<p>我们的作品是一个VS的插件，主要功能是为C++生成Get，Set方法。 VS插件有两种，一个是AddIn，另一个是VSPackage。我使用的是前者，前者是一种旧的技术，微软推荐VS2008以后开发VS插件都使用VS SDK开发VSPackage，由于我看过C++做AddIn的，对AddIn有了一定的了解，所以我最后决定用C#写AddIn。</p>

<p>因为部长说他擅长C++，我们发现C++也可以写VS的插件，所以我们一开始用的是C++作为开发语言。因为以前没做过VS插件，所以要找一些教程作为入门，于是我们找到了两份教程，感谢这两位Engineer，他们带我入了门吧。<a href="http://blog.csdn.net/clever101/article/details/8733799" title="第一篇">第一篇</a>，<a href="https://aigudao.net/category/windows/1/" title="第二篇">第二篇</a> 但是由于对C++的COM编程不熟悉，又由于网上关于C++做VS插件的资料少之又少，在使用CComPtr智能指针遇上各种问题无解之后，我们决定改用C#。因为网上关于C#做VS插件的资料非常多。我花了一上午加一晚上的时间，就将这个插件的雏形写了出来。</p>

<p>AddIn的主要类就是Connect，创建工程后，它有OnConnection，Exec，等等方法，因为只是入门，所以后面的方法我都没有去详细了解，竞赛要求在这段时间内做出一个Demo就可以了。</p>

<blockquote>
  <p>OnConnection</p>
</blockquote>

<p>就是做一些初始化的东西，比如说添加一个右击菜单项，添加菜单栏之类的操作都是在这里面做的。</p>

<blockquote>
  <p>Exec</p>
</blockquote>

<p>这个函数是在我们触发一个事件之后执行的，比如说单击了我们添加的那个右击菜单项。 通过commandName这个参数来判断是触发了哪个点击。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>if(commandName == "MyAddin_csharp.Connect.MyAddin_csharp")
{
    handled = true;
    return;
}
</code></pre></div></div>

<p>既然知道了这些，我们在OnConnection函数里添加一个右击菜单来实现触发生成GetSet方法的触发器。然后在Exec函数里得到我们选中的文本，然后在做些字符串处理，提取出选中的变量类型，变量名字，我们就可以生成GetSet方法了，再添加到当前的Document中，就完成了！！！！</p>

<hr />

<h2 id="comments">Comments</h2>

<p>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a> <a href="http://disqus.com">comments powered by Disqus</a></p>]]></content><author><name>陈洪健</name></author><category term="legacy" /><summary type="html"><![CDATA[这次参加黑客马拉松，队伍一共三人，一个是微软俱乐部部长，另一个是一个女生。 我来总结下我的工作吧。]]></summary></entry></feed>