Sha256: 8d52496958edb594a8a6f8d705e835f289b82c879b567920d56ce852f3f904c2
Contents?: true
Size: 433 Bytes
Versions: 6
Compression:
Stored size: 433 Bytes
Contents
#ライブラリの読み込み require "nn" x = [ [0, 0], [1, 0], [0, 1], [1, 1], ] y = [[0], [1], [1], [0]] #ニューラルネットワークの初期化 nn = NN.new([2, 4, 1], #ノード数 learning_rate: 0.1, #学習率 batch_size: 4, #ミニバッチの数 activation: [:sigmoid, :identity] #活性化関数 ) #学習を行う nn.train(x, y, 20000) #学習結果の確認 p nn.run(x)
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
nn-2.4.0 | sample/xor.rb |
nn-2.3.0 | sample/xor.rb |
nn-2.2.0 | sample/xor.rb |
nn-2.1.0 | sample/xor.rb |
nn-2.0.0 | sample/xor.rb |
nn-2.0.1 | sample/xor.rb |