疊代學習範例: 二元一次、收斂型、直達目標

機器學習

簡介

歷史

輸入

特徵

分群

最佳化

鄰近搜尋法

疊代搜尋法

案例比對法

函數分割法

模糊分群法

神經網路法

機率統計法

分群

分類

規則學習

語法規則學習

劇本規則學習

推理規則學習

網路關係學習

物件知識學習

貝氏法則與疊代

類別學習

最近 K 鄰居法

核心機

支持向量機

EM 學習法

程式實作

訊息

相關網站

參考文獻

最新修改

簡體版

English

程式範例

#include <stdio.h>
#include <math.h>

// a+b=3
// 2a-b=5
int main() {
  float a=1.0, b=1.0;
  int i;
  for (i=0; i<100; i++) {
      float ta = ((3.0-b)+((5.0+b)/2.0))/2;
      float tb = ((3.0-a)+(2*a-5.0))/2.0;
      a = ta;
      b = tb;
      printf("a=%6.2f b=%6.2f\n", a, b);
  }
}

執行結果

a=  2.50 b= -0.50
a=  2.88 b=  0.25
a=  2.69 b=  0.44
a=  2.64 b=  0.34
a=  2.66 b=  0.32
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33
a=  2.67 b=  0.33

Facebook

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License