摘要:
寻找最大公约数方法代码如下:1 int gcd (int a, int b) {2 return b ? gcd (b, a % b) : a;3 }应用:求最小公倍数代码如下:1 int lcm (int a, int b) {2 return a / gcd (a, b) * b;3 } 阅读全文
摘要:
1. hypothsis2. cost function:3. Goal:4. Gradient descent algorithmrepeat until convergence { (for j = 0 and j = 1)}note: simultaneous updateα:learning rateifα is too small, gradient descent can be slow.ifα is too large, gradient descent can overshoot the minimum. It may fail to converge, or ... 阅读全文