## Theory _posts/2018-09-13-Detection.md Detection

Got to know the work CornerNet which was attractive as researchers seems having done what I want to do but could not with limited knowledge and programming skills.

## Theory _posts/2018-09-12-Confusion.md The confusing Math

### Foreword

Symbols let us express complex things in concise way. But without enough context information, mathematics is poisonous rather than being helpful for our reading and learning experience, serves as a trick to make the paper looks meaty.

As math troubles most of us when we met for the first time, genius guys could help by creating sites like Khan Academy, Better Explained, AOPS, writing books like Calculus Lifesaver, providing courses like LHTL. We need to practice like learning a language to really embrace it rather than let it being the jargon for professionals.

### Number for everything

To extend the power of human mind by joining us in a union.

The name of google came from the word Googol which stands for a fairly big number($10^{100}$), and the roadmap of the company is interesting: turn everything to numbers->do computation->automate repetitive work->iterate.

It doesn’t matter what the world is, atoms for real world but numbers for human mind, which could link all human minds as a whole entity to do things that could not be done solely by anyone of us.

## Programming _posts/2018-09-11-Tricks.md Daily Tricks

Programmers hold nice tricks for computer power users

### Self-serviced 2X Video

As HTML5 is widely used, you can easily accelerate the video by opening the browser console and type in the following code:

vElement = document.querySelector('video');
vElement.pause();
vElement.playbackRate = 2.0;
vElement.play();


feel free to enjoy customized speed, ignore the criticisms saying young generation are impatient as that came from the same population who forces their child to start competing in the early age without being prepared in the name of win at the start line. DO NOT JUDGE.

### Easy to use File Transfer Service in Local Area Network

If you have python installed, just type in

python3 -m http.server -p 6666


at the directory with files you want to share, then use ipconfig/ifconfig to check your ip, visit http://[ip]:[port] at any machine via webbrowser to get the file:)No need of QQ, Wechat or anything else.

## Theory _posts/2018-09-10-Segmentation.md Segmentation

Image/Semantic/Instance segmentation and various video segmentation methods.

Assuming there are three major colors in the image, so we can segment the image by clustering pixels according to their color. In OpenCV(py, 3.4.1), we could use code as below:

im = cv2.imread('x.jpg') # Assuming to be color image
pixels = im.reshape([-1, 3])
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 10, 1.0)
ret,label,center=cv2.kmeans(pixels.astype(np.float32),4, None, criteria,5,cv2.KMEANS_RANDOM_CENTERS)


For visualization we could also plot this dots in three dimensional space with help of matplotlib.

# https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()


## Knowledge _posts/2018-09-10-NN4ML.md Neural Networks for Machine Learning

Course note for NN4ML offered by Geoffrey Hinton.

Computer vision

## Toolkit _posts/2018-09-05-Caffe.md Caffe Guide

Caffe was purposed and implemented in 2014 as the follow-up work done by Yangqing Jia after published their ICML paper, the prototype was called DeCAF. The framework was introduced to fast-prototyping training and testing of convolutional neural networks.

Caffe was not the first deep learning framework, nor the last one. It was successful due to the easy-to-reuse feature, support for command-line, python and MATLAB interface and rich model zoo. It heavily depends on a bunch of libraries which makes the compiling procedure painful and troublesome. Caffe was gradually replaced by other newly appeared frameworks but it’s concept in implementation and even partial of code has been inherited by new generations.

The logic behind Caffe is clear, the data are saved in a 4-dimension array(blob), flow between layers, both forward and backward, weight update controlled by optimizers. The whole model defined by protobuf specifications and declarations which looks similar to SUN RPC. Accelerated by CUDA, tested using GTest, en-powered by libraries like boost. But due to the various sources of input data, lots of Caffe code dedicated to data loading and pre-processing which may be confusing if you are not familiar with distributed file systems and other related topics. Customized Caffe and layers are also available in different sites(mainly on github) for specific purpose, Nvidia also provided a customized Caffe which has been optimized with support for new tech like TensorRT.

## Toolkit _posts/2018-09-05-Caffe-AddLayer.md Add layers in Caffe

You should be able to compile Caffe successfully before reading this post.

By chance, I need to test the SINT project, and this would be a good demo showing how to add new layers to Caffe.

For this case, using official Caffe developed by BVLC, we need to put provided normalize_layer.cpp and .cu file into src/caffe/layers folder, put .hpp file into include/caffe/layers. Then adding ROI pooling layer included in Fast-RCNN, copy lines defining ROIPooling(keyword search is enough) in src/caffe/proto/caffe.proto from Fast-RCNN to the our caffe.proto(BTW, protobuf is quite similar to SUN RPC), copy roi_* files inside src/caffe/layers combined with fast_rcnn_layers.hpp inside include/caffe/ to corresponding folders to our branch.

Then re-make Caffe, SINT model should be runnable now which serves as a good example for adding given new layers.

TODO

## 杂谈

$w^{k+1} = w^k - \alpha \nabla f(w^k)$

• 怎样才算是一个好问题？

if $1+1 > 2$

def bienaole():
return "ok"
print("要你好看!")

• 门派、故事以及推荐的书和老师？

• Sklearn, Tensorflow, Pytorch, DIGITS, Spark, Hadoop…如何在工具海洋中挣扎求存，处理编译安装等各种问题？

• 二分类、感知机、支持向量机到黄焖鸡，赶只鸡？用肉眼做二分类的坑。

• 神经网络的暴力美学，如何做到知行合一？

TODO