LMS 機器學習方法
類神經網路
前言
感知器
LMS 學習法
反傳遞網路
反傳遞學習法
自組織網路
自組織學習法
相關書籍
人工智慧
自然語言
機器翻譯
邏輯推論
計算理論
相關資源
相關網站
相關書籍
參考文獻
統計資訊
最新修改
網頁標記
訊息
相關網站
參考文獻
最新修改
簡體版
English
[フレーム]
相關程式:LMS.java , LMSTest.java
程式全文
public abstract class LMS {
Object[] examples;
double[] values;
int[] successors;
double[] weights;
public LMS(Object[] E, double[] V, int[] S, double[] W) {
examples = E; values = V; successors = S; weights = W;
}
public void learn() {
// For each training example (e, V(s)) where s = successor(e)
for (int ei=0; ei<examples.length; ei++) {
Object e = examples[ei];
// use the current weight to calculate V(e)
double ve = value(e);
double vs = values[successors[ei]];
// For each weight wi, update it as
// wi = wi + c( V(s) - V(e) )
for (int wi=0; wi<weights.length; wi++)
weights[wi] = weights[wi]+0.001 * (vs - ve);
}
System.out.print("w=");
for (int wi=0; wi<weights.length; wi++)
System.out.print(weights[wi]+",");
System.out.println();
}
public abstract double value(Object e);
}
public class LMSTest extends LMS {
public static void main(String[] args) {
Object[] E = {new Double(1), new Double(3), new Double(5)};
double[] V = {2, 4, 6};
int[] S = {0, 1, 2};
double[] W = {0,0};
LMSTest learner = new LMSTest(E,V,S,W);
for (int i=0; i<1000; i++)
learner.learn();
}
public LMSTest(Object[] E, double[] V, int[] S, double[] W) {
super(E,V,S,W);
}
public double value(Object example) {
double x = ((Double) example).doubleValue();
return weights[0]+weights[1]*x;
}
}
[フレーム]
本網頁的作者、授權與引用方式
- 作者
- 陳鍾誠,於金門大學資訊工程系,電子郵件:wt.ude.uqn|ccc#wt.ude.uqn|ccc,網站:http://ccckmit.wikidot.com。
- 授權
- 本文採用創作共用 (Creative Common) 3.0 版的 姓名標示─非商業性─相同方式分享 授權條款,歡迎轉載或修改使用,但若做為商業使用時必須取得授權,引用本文時請參考下列格式。
- 中文版 (APA格式)
- 陳鍾誠 (27 Oct 2009 01:07),(網頁標題) LMS 機器學習方法,(網站標題) 陳鍾誠的網站,取自 http://ccckmit.wikidot.com/nn:lmsjava ,網頁修改第 11 版。
- 英文版 (APA格式)
- Chung-Chen Chen (27 Oct 2009 01:07), Retrieved from http://ccckmit.wikidot.com/nn:lmsjava , Page Revision 11.
page revision: 11, last edited: 11 Sep 2010 00:11