The type deduction of Template and auto

The type deduction of template will ignore one level of reference and pointer

Example 1:

Input argument as reference

template<typename T>
void f(T& param); 

int x = 27; // x is an int
const int cx = x; // cx is a const int
const int& rx = x; // rx is a reference to x as a const int 
f(x);// T is int
f(cx);// T is const int, param's typeis const int&
f(rx);// T is const int, param's type is const int& 

PCA (Principal component analysis), just as its name shows, it computes the data set’s internal structure, its “principal components”.

Considering a set of 2 dimensional data, for one data point, it has 2 dimensions and . Now we get n such data points . What is the relationship between the first dimension and the second dimension ? We compute the so called covariance:

the covariance shows how strong is the relationship between and . Its logic is the same as Chebyshev’s sum inequality:

[DllImport("user32.dll")]   
public static extern void SwitchToThisWindow(IntPtr hWnd,bool turnon);
String ProcWindow = "wechat";
private void switchToWechart()
{
    Process[] procs = Process.GetProcessesByName(ProcWindow);
    foreach (Process proc in procs)
    {
         //switch to process by name
         SwitchToThisWindow(proc.MainWindowHandle, true);
    }
}

HoG (Histograms of Oriented Gradients) feature is a kind of feature used for human figure detection. At an age without deep learning, it is the best feature to do this work.

Just as its name described, HoG feature compute the gradients of all pixels of an image patch/block. It computes both the gradient’s magnitude and orientation, that’s why it’s called “oriented”, then it computes the histogram of the oriented gradients by separating them to 9 ranges.

One image block (upper left corner of the image) is combined of 4 cells, one cell owns a 9 bins histogram, so for one image block we get 4 histograms, and all these 4 histograms will be flattened to one feature vector with a length of 4x9. Compute the feature vectors for all blocks in the image, we get a feature vector map.

Taking one pixel (marked red) from the yellow cell as an example: compute the and of this pixel, then we get its magnitude and orientation(represented by angle). When calculating the histogram, we vote its magnitude to its neighboring 2 bins using bilinear interpolation of angles.

Finally, when we get the 4 histograms of the 4 cells, we normalize them according to the summation of all the 4x9 values.

The details are described in the following chart:

Loss Function

Now we want to solve a image classification problem, for example classifying an image to be cow or cat. The machine learning algorithm will score a unclassified image according to different classes, and decide which class does this image belong to based on the score. One of the keys of the classification algorithm is designing this loss function.

Map/compute image pixels to the confidence score of each class

Assume a training set:

is the image and is the corresponding class

i∈1…N means the traning set constains N images

∈1…K means there are K image categories

So a score function maps x to y:

In the above function, each image is flattend to a 1 dimention vector

If one image’s size is 32x32 pixels with 3 channels

will be a 1 dimention vector with the length of D=32x32x3=3072 Parameter matrix W has the size of [KxD], it is often called weights b of size [Kx1] is often called bias vector In this way, W is evaluating ’s confidence score for K categories at the same time

安装基本软件

  • 首先安装一个能在windows环境下运行的包管理器Chocolatey

  • 因为Jekyll是用Ruby写的,所以要安装Ruby,在控制台中输入choco install ruby -y回车

  • 关闭控制台,然后再打开控制台并输入gem install jekyll,这样Jekyll就装好了:如果出现ssl3错误按照以下步骤(点我看原文)解决:

    在 https://rubygems.org/pages/download 下载最新版的rubygem

    cmd输入 gem install –local C:\rubygems-update-x.x.xx.gem:local后面即刚下载好的gem文件

    然后输入update_rubygems –no-ri –no-rdoc

    结束后再输入gem install jekyll,应该就可以了

  • 重新打开控制台,输入chcp 65001避免编码问题

  • 安装Ruby开发环境,在控制台中输入:

    choco install ruby2.devkit

  • C:\tools\DevKit2文件夹中打开控制台,执行命令 ruby dk.rb init,产生config.yml文件

框架的文件夹结构

_includes :存放了一些定制的网页元素,比如header.html是整个页面的头,也就是最上面的菜单栏。又如author.html,是作者页面,用于展示作者信息。通用的JS文件都放在scripts.html里。

_layout :主要定义了两种类型页面的排版,post是为单篇文章设计的排版,post-index是为一系列文章设计的排版。

_posts:用于存放所有文章的md文件,md文件的命名必须严格按照”年-月-日-标题”的格式命名。

_sass:用于存放定制的css文件,比如_page就规定了页面各个元素的宽度颜色字体,_variables定义了一些全局变量的值。

_site:模板编译完成后生成的页面,这个是真正可以直接部署的页面,平时不用看

_templates:规定了不同类型的排版文件中可以定义的变量

前面不带下划线的文件夹存放用户自己定制的页面,比较重要的有:

images:用于存放图片

search:用于存放搜索框页面

tags:用于存放按照tags列出所有文章的页面

categories:用于存放按照category列出所有文章的页面

posts:用于存放列出所有文章的页面

迪奥多.立普斯著

刘斯坦译

我在本文中只要论及移情,不过我只想谈谈几种对象的移情,特别是真实或造型的人的动作,姿态。进一步的还会在建筑形态上展开讨论。

审美享受的乐趣对于不同的情况各不相同,对每一个新的审美客体又都不同,他是我们在面对审美客体时产生的有颜色的愉悦感。如此说来“审美对象”必是感觉性的,也就是我们通过感官或想象得来的感觉,而且也仅仅是这么一种感觉。我对一个审美对象产生了愉悦感,这意味着我面对的就是这通过感官和想象得来的感觉,美的客体以这种方式作用于我。我拥有这种感觉,并且在其中观照他,或者说关注他,统觉他。然而只有审美客体展现出来的能激发人感官感觉的表象,才能在审美观照中被“观看”,例如艺术作品的外表形象。这个表象是审美享受中的唯一对象,这个表象是唯一与我自身对峙的异己之物,我自身及我的愉悦感在其上发生联系。因为我体会到了这种联系,我同时也就感觉到了愉悦,或者快乐,简而言之,享受。