if (ae.getSource() == this.button5) {\r
// 「状態出力」\r
System.out.println("状態出力開始。");\r
- try {\r
- this.simpleNN.outputState();\r
- } catch (IOException e) {\r
- e.printStackTrace();\r
- }\r
+ // TODO\r
+ // try {\r
+ // this.simpleNN.outputState();\r
+ // } catch (IOException e) {\r
+ // e.printStackTrace();\r
+ // }\r
System.out.println("状態出力完了。");\r
}\r
}\r
// 学習モード\r
\r
// 閾値と重みの乱数設定\r
- this.simpleNN = new SimpleNN();\r
+ this.simpleNN = new SimpleNN(SimpleNNApplet.INPUT, SimpleNNApplet.HIDDEN, SimpleNNApplet.OUTPUT, 1.2);\r
\r
// -------------------------- 学習 --------------------------\r
for (p = 0; p < SimpleNNApplet.OUTER_CYCLES; p++) {\r
for (r = 0; r < SimpleNNApplet.INNER_CYCLES; r++) {\r
// 内部サイクル\r
\r
- // 順方向演算\r
- this.recognizeOut = this.simpleNN.forwardNeuralNet(this.sampleIn);\r
-\r
- // 逆方向演算(バックプロパゲーション)\r
- this.simpleNN.backwardNeuralNet(this.sampleIn, this.recognizeOut, this.teach);\r
+ this.simpleNN.learn(this.sampleIn, this.teach);\r
}\r
\r
// 内部二乗誤差の計算\r
-\r
- // 内部二乗誤差のクリヤー\r
- innerError = this.simpleNN.calcError(this.recognizeOut, this.teach);\r
+ innerError = this.simpleNN.reportError(this.sampleIn, this.teach);\r
\r
// 外部二乗誤差への累加算\r
outerError += innerError;\r
this.sampleIn = this.sampleArray[q];\r
\r
// 順方向演算\r
- this.recognizeOut = this.simpleNN.forwardNeuralNet(this.sampleIn);\r
+ this.recognizeOut = this.simpleNN.calculate(this.sampleIn);\r
\r
// 結果の表示\r
g.setColor(Color.black);\r
Graphics g = this.getGraphics();\r
\r
// 順方向演算\r
- this.recognizeOut = this.simpleNN.forwardNeuralNet(this.writtenIn);\r
+ this.recognizeOut = this.simpleNN.calculate(this.writtenIn);\r
\r
// 結果の表示\r
for (int k = 0; k < SimpleNNApplet.OUTPUT; k++) {\r