Skip to content

ccc-js/nn6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nn6 -- Neural Network Library

Install

$ npm install nn6

Example

$ node optimizeAddTest.js // 梯度下降法測試 AddGate ...
$ node optimizeSumTest.js // 梯度下降法測試 SumGate ...
$ node solveXy.js         // 用梯度下降法解方程組 1
$ node solveMatXy.js      // 用梯度下降法解方程組 2
$ node solveLearnXy.js    // 用梯度下降法解方程組 3
$ node perceptron.js      // 感知器 1 -- 用優化法 gd
$ node neuron.js          // 感知器 2 -- 用學習法 learn
$ node mlp7seg            // 多層感知器 -- 學習七段顯示器函數
$ node mlpXor             // 多層感知器 -- 學習 XOR 函數
$ node rnn01              // 循環神經網路 -- 學習 001001001 後自動產生
$ node lstm01              // 循環神經網路 -- 學習 001001001 後自動產生

Test

$ npm run test

Example

請先切換到 /example 資料夾後,再下後續的指令

mlp7seg

$ node mlp7seg
...
4999:
  0 => b3:0.034269 b2:0.012976 b1:0.021451 b0:0.028648
  1 => b3:0.000842 b2:0.041068 b1:0.022055 b0:0.963260
  2 => b3:0.019968 b2:0.032174 b1:0.999014 b0:0.040691
  3 => b3:0.011768 b2:0.018414 b1:0.957074 b0:0.977835
  4 => b3:0.029668 b2:0.957882 b1:0.001688 b0:0.041681
  5 => b3:0.034571 b2:0.971502 b1:0.055255 b0:0.979630
  6 => b3:0.018145 b2:0.977717 b1:0.948456 b0:0.002354
  7 => b3:0.000010 b2:0.960058 b1:0.978877 b0:0.980482
  8 => b3:0.958534 b2:0.009918 b1:0.040354 b0:0.011252
  9 => b3:0.949144 b2:0.029037 b1:0.000938 b0:0.958945
  ==> energy = 0.03754739722159074

rnn01

$ node rnn01.js
...
1900:
  0 => x:0.001949 f:0.216367
  1 => x:-0.009379 f:0.996231
  2 => x:1.007826 f:0.007287
  3 => x:0.001948 f:0.216332
  4 => x:-0.009377 f:0.996233
  5 => x:1.007825 f:0.007286
  6 => x:0.001948 f:0.216298
  7 => x:-0.009375 f:0.996235
  8 => x:1.007823 f:0.007284
  ==> energy = 0.04538939117125736
o=[0]
o=[0]
o=[1]
o=[0]
o=[0]
o=[0]
o=[1]
o=[0]
o=[0]
o=[1]

lstm01

$ node lstm01.js
...
2900:
  0 => x:0.027677 f:0.433760
  1 => x:-0.029265 f:0.924218
  2 => x:1.001942 f:0.003093
  3 => x:0.027676 f:0.433720
  4 => x:-0.029266 f:0.924285
  5 => x:1.001945 f:0.003089
  6 => x:0.027675 f:0.433680
  7 => x:-0.029268 f:0.924353
  8 => x:1.001947 f:0.003086
  ==> energy = 0.5100184993830975
o=[0]
o=[1]
o=[0]
o=[0]
o=[1]
o=[0]
o=[0]
o=[1]
o=[0]
o=[0]

About

A neural network framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published