brains 0.2.1-java → 0.2.2-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 967864f9d4f7eb19e59af56e381642cb6826044c
4
- data.tar.gz: 1e4db63c7205236442cf3475cc3860eea299f76c
3
+ metadata.gz: fd0c26cf0bff42754d712f71bac17252f282e643
4
+ data.tar.gz: 89ad29e913c41a5979b53d707bdd73889bc9adfe
5
5
  SHA512:
6
- metadata.gz: 8a80e8653d4456c1f83aed602d7aa1f145508b025efaac7571b6a08753991c1f3b42504f1da1de485d84f36181b7d0e9214f52376545f3cd96c897fcf439952f
7
- data.tar.gz: a44708442903502cc8ec7b73fe569f979fed56caa1ff9cd0ad75e658a0d41adf7bc2e290853efdd0e358a423e22d1bd4e7bc04eaae3072d0f8e1ba8ffa828667
6
+ metadata.gz: 394a55535069b6d11980cacf4c7e6d7dc270694e03c867c7027a03a784c415c2eec5cb36d2be6b1af28fcd15181f9d2c45e61f57eab0195ffed5026509a30ee3
7
+ data.tar.gz: '08b742bf16e4b9bdce63fc2b4a3df2932e1cf2a51b1fb48aeae15f0ecd9a9e3faf700872bb21d8087970b065a47631c11301632fb204c7e45b38d5a609b017de'
@@ -1,3 +1,13 @@
1
+ Version 0.2.2
2
+ -------------
3
+
4
+ * Bug fix for softmax function support in the output layer
5
+
6
+ Version 0.2.1
7
+ -------------
8
+
9
+ * Bug fix for recurrent neural network support
10
+
1
11
  Version 0.2.0
2
12
  -------------
3
13
 
@@ -52,7 +52,10 @@ training_data = [
52
52
  [color_value('4C516D'), BLUE],
53
53
  ]
54
54
 
55
- nn = Brains::Net.create(3, 3, 2, { neurons_per_layer: 5 })
55
+ nn = Brains::Net.create(3, 3, 1, {
56
+ neurons_per_layer: 3,
57
+ output_function: :softmax,
58
+ error: :cross_entropy })
56
59
 
57
60
  # randomize weights before training
58
61
  nn.randomize_weights
@@ -77,7 +80,7 @@ test_data.each_with_index { |item , index|
77
80
 
78
81
  puts "#{correct}/#{test_data.length}"
79
82
 
80
- result = nn.optimize(training_data, 0.005, 1_000_000, 100 ) { |i, error|
83
+ result = nn.optimize(training_data, 0.25, 100_000, 100 ) { |i, error|
81
84
  puts "#{i} #{error}"
82
85
  }
83
86
 
@@ -87,9 +90,10 @@ puts "after training"
87
90
 
88
91
  correct = 0
89
92
  test_data.each_with_index { |item , index|
90
- c = color_desc(nn.feed(item[0]))
93
+ r = nn.feed(item[0])
94
+ c = color_desc(r)
91
95
  correct +=1 if (c == item[1])
92
- puts c
96
+ puts "#{r} -> #{c}"
93
97
  }
94
98
 
95
99
  puts "#{correct}/#{test_data.length}"
@@ -24,7 +24,6 @@ testing_data = generate_sine_test_data(11, 20)
24
24
 
25
25
  # input sequence
26
26
  input_sequence = training_data[0][0].map { |a| a[0] }
27
- output_sequence = training_data[0][1].map { |a| a[0] }
28
27
  test_input_sequence = testing_data[0][0].map { |a| a[0] }
29
28
  test_output_sequence = testing_data[0][1].map { |a| a[0] }
30
29
 
@@ -42,18 +41,11 @@ results.each_with_index do |a, index|
42
41
  puts "#{test_input_sequence[index]} => #{a[0]}"
43
42
  end
44
43
 
45
- result = nn.optimize_recurrent(training_data, 0.001, 100_000_000, 10_000 ) { |i, error|
44
+ result = nn.optimize_recurrent(training_data, 0.001, 100_000, 10_000 ) { |i, error|
46
45
  puts "#{i} #{error}"
47
46
  }
48
47
 
49
- results = nn.feed(training_data[0][0])
50
- puts " Training data"
51
- results.each_with_index do |a, index|
52
- puts "#{input_sequence[index]} => #{a[0]} (#{output_sequence[index]})"
53
- end
54
- puts " Testing data"
55
48
  results = nn.feed(testing_data[0][0])
56
-
57
49
  results.each_with_index do |a, index|
58
50
  puts "#{test_input_sequence[index]} => #{a[0]} (#{test_output_sequence[index]})"
59
51
  end
Binary file
@@ -1,3 +1,3 @@
1
1
  module Brains
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brains
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: java
6
6
  authors:
7
7
  - Joseph Emmanuel Dayo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-15 00:00:00.000000000 Z
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement