rann 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d6d82c495eff427af738f4734993fd2611848b9
4
- data.tar.gz: de50063a5696ae822b565ce61629f4474e237d78
3
+ metadata.gz: 671da77af2c018b9391e64bc6d6a3bdcd3267648
4
+ data.tar.gz: edeb0b1f7c6c59b5afb692872efc1c1e80492971
5
5
  SHA512:
6
- metadata.gz: 478e37a62c101eec3f8bc23125c308fb49f27257b80a119dea4747c481fe65f5d53397db7013cf4642e097ff81699471d4e6ff860720e2366fd90cf2760ca61a
7
- data.tar.gz: 1a131eb754900d36f2353064cd8b05f1e179adbbee95e25063511a029636378490dff0b2f1bc7678a31027d0dbc6b0fee6bd20df14ef25ace465b6b31fff828e
6
+ metadata.gz: 6527cce72e2d732c2efee6e1acf1ca9c01187e5dbc69f27600842de1d2685766e6631183abab171a1dabb029ce45d64486a62af6b69c40f656d9dc4afe58fca8
7
+ data.tar.gz: 617ea35293d0a34f40f4e613124e73d6771bad29f47cb5860786a0e03564cd798619b51b84f0397624f5f3100a7b15a3e0ba2db0d1bef143f9e7c5e07e37bb0e
data/CHANGES.md CHANGED
@@ -1,3 +1,20 @@
1
+ - Fix alias error.
2
+
3
+ *Michael Campbell*
4
+
5
+ - Simple weight initialisation method.
6
+
7
+ *Michael Campbell*
8
+
9
+ - Fix ProductNeuron backprop bug, and index bug in parallel code.
10
+
11
+ *Michael Campbell*
12
+
13
+ - Total backprop refactor. Removed recursion in network traversal in favour of
14
+ custom stack iteration and the whole thing is tons more memory efficient.
15
+
16
+ *Michael Campbell*
17
+
1
18
  - Basic classes required for most neural network designs and backprop.
2
19
 
3
20
  *Michael Campbell*
data/lib/rann/network.rb CHANGED
@@ -165,6 +165,16 @@ module RANN
165
165
  end
166
166
  end
167
167
 
168
+ def init_normalised!
169
+ connections.each do |c|
170
+ out_cons = c.output_neuron.connection_count.to_d
171
+ from = -1.to_d.div out_cons.sqrt(10), 10
172
+ to = 1.to_d.div out_cons.sqrt(10), 10
173
+ c.weight = (to - from).mult(rand.to_d, 10) + from
174
+ end
175
+ end
176
+ alias init_normalized! init_normalised!
177
+
168
178
  def recalculate_neuron_connection_counts!
169
179
  neurons.each do |neuron|
170
180
  neuron.connection_count = connections.count{ |c| c.output_neuron == neuron }
data/lib/rann/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RANN
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rann
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Campbell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-26 00:00:00.000000000 Z
11
+ date: 2017-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel