0. 和式作用的对象是 labels 时
P(y)=exp(yz)∑y′=01exp(y′z)
这里不要将分母代换为 exp(z)+1,而是:
P(y)=exp(yz)exp(yz)+exp((1−y)z)
实现分子和分母的协调;
1. 加和
注意下标的范围,尤其在双下标时;
∑1≤i<j≤nai+aj=(n−1)(a1+a2+⋯+an)=(n−1)∑iai
2. 加和的平方
(∑i=1nai)2=∑i,jaiaj=∑i=1na2i+2∑1≤i<j≤naiaj
∑1≤i<j≤nij,可以理解为 i 表示行号,j 表示列号,构成的方阵的上三角,
3. 样本方差
S2=1n−1∑i=1n(Xi−X¯)2=1n−1(∑i=1nX2i−nX¯2)
4. 常量与变量的四则运算
∑i=ab(A[i]−m)2=(b−a+1)m2+∑i=abA[i]2−2m∑i=abA[i]
5. 错位相乘在相加
nd+Nd(nd−1+Nd−1(nd−2+Nd−2⋅(⋯+N2n1)⋯))=∑k=1d⎛⎝∑ℓ=k+1dNℓ⎞⎠nk