My bookmarks

https://www.gitbook.com/book/cyberzhg/clrs_solution/details

我的这几年

[Watershed]

NLP is defined as the area I would fight for in the next 10 years.

[Adv. topics in control]Elements of Matrix theory

Course name: Advanced topics in control
Prof. Florian Dorfler
March 3, 2016
Course website: http://control.ee.ethz.ch/~ifaatic/

Lecture 1: Elements of matrix theory
In motivating examples such as distributed estimation in sensor networks and social opinion dynamics, problems can be formally posed in the following iteration operations:

[math]x^{+}=Ax[/math],

with the following properties:
-sparsity pattern induced by graph
-nonnegative coefficents: [math]a_{ij}\geq 0[/math]
-unit row sums: [math]\sum_{j}a_{ij}=1[/math]
Here comes the question: is such an iteration convergent and what is it converging to. This topic will be discussed in the following two lectures using different approach(matrix theory approach and graph theory approach)

看了两个clip的春晚片段,觉得这是近五年来我对国家感到最失望的时刻。非常难过。

[HPCSE]C++11, a very brief review

Adapted from HPCSE I notes, Prof. Troyer.
The new c++ standard c++11 introduced several useful and tricky features.

std::function

Great for callbacks, collection of callbacks, and threading. Support lambda functions.
[cpp]//From http://www.hankcs.com/program/cpp/c11-std-function-usage.html
#include <iostream>
#include <map>
#include <functional>
using namespace std;

// 普通函数
int add(int i, int j) { return i + j; }
// lambda表达式
auto mod = [](int i, int j){return i % j; };
// 函数对象类
struct divide
{
int operator() (int denominator, int divisor)
{
return denominator / divisor;
}
};

///////////////////////////SubMain//////////////////////////////////
int main(int argc, char *argv[])
{
// 受限的map
map<char, int(*)(int, int)> binops_limit;
binops_limit.insert({ ‘+’, add });
binops_limit.insert({ ‘%’, mod });
// 错误 1 error C2664: “void std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::insert(std::initializer_list<std::pair<const _Kty,_Ty>>)”: 无法将参数 1 从“initializer-list”转换为“std::pair<const _Kty,_Ty> &&”
// binops_limit.insert({ ‘%’, divide() });

// 更灵活的map
map<char, function<int(int, int)>> binops =
{
{ ‘+’, add },
{ ‘-‘, minus<int>() },
{ ‘*’, [](int i, int j){return i – j; } },
{ ‘/’, divide() },
{ ‘%’, mod },
};
cout << binops[‘+’](10, 5) << endl;
cout << binops[‘-‘](10, 5) << endl;
cout << binops[‘*’](10, 5) << endl;
cout << binops[‘/’](10, 5) << endl;
cout << binops[‘%’](10, 5) << endl;
system("pause");
return 0;
}
///////////////////////////End sub//////////////////////////////////[/cpp]

auto

[cpp]auto x=3.141+5;
auto y=call_to_function_with_horrible_return_type();
[/cpp]

[Uncertainty Quantification]MCMC simulation review

Summarized from lecture notes: Prof. J. L. Beck

Initiation

Standard MCS cannot sample directly from the posterior PDF given by Bayes’ Theorem:

QQ截图20151121174950

because we cannot analytically evaluate the normalizing integral in the denominator, even if we could, it is still difficult to sample from an arbitrary multi-dimensional PDF.

In order to deal with it, Metropolis-Hasting algorithm is used and generates samples from a Markov chain whose stationary PDF is an target PDF, even an unnormalized one such as the PDF we posted above. However, these samples are not independent, thus reduces the efficiency. i.e. it increases the number of samples needed to get the same c.o.v. compared with MCS.

Metropolis Algorithm

Consider continuous stochastic variables [math]$\theta_k \in \Re^d$[/math], [math]$\forall$ k \geq 0$[/math]

Markov charin is defined by the PDF for its initial state, [math]p_{0}(\theta_0)[/math], and its transition PDF, i.e. the conditional PDF [math]p_{k|k-1}(\theta_k|\theta_k-a) , $\forall$ k \geq 1[/math]

Defn.

A homogeneous Markov chain has a transitional PDF that is independent of the step, i.e. [math]p_{k|k-1}(\theta|\xi)=p_{1|0}(\theta|\xi) $\triangleq$ p(\theta|\xi)[/math]

Defn.

[math]p_{s}(\theta)[/math]is a stationary PDF for a homogeneous Markov chain if: [math]p_{s}(\theta)=\int_{\Theta} p(\theta|\xi)p_{s}(\xi)d\xi ,\quad$\forall$\theta \in \Theta[/math]

OpenMP: HPCSE course review

Compile and link using openMP:
[bash]g++ -fopenmp openmp1.cpp[/bash]
Directives control multi-threading, in c/c++:
[cpp]#include <iostream>
#include <omp.h>
int main(){
#pragma omp pararrel
{
std::cout << "I am thread" << get_omp_thread_num()
<< "of" <<omp_get_num_threads() << "threads."<<std::endl;
}
}[/cpp]

新学期的愿景

新学期排的满满当当,所有课都是自己喜欢的,是用来证明自己的一个学期。
50学分,9门课,没有水课。希望自己能以全5以上的成绩结束这个学期。
这学期没有娱乐,两周休息一天。
之后就可以较为顺利地选择细分方向,选择课题组了。

知道,但并不扎实