ruby-fann 0.7.6 → 0.7.7

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.
data/History.txt CHANGED
@@ -24,6 +24,10 @@
24
24
  * Minor code cleanup & symbol fixage
25
25
  * Nicer message for windows users
26
26
 
27
- == 0.7.6 2008-01-14
28
- * 1 minor enhancements
29
- * Exception (instead of pukage) if zero-length array given on training data
27
+ == 0.7.6 2007-01-14
28
+ * 1 minor bug fix
29
+ * Exception (instead of pukage) if zero-length array given on training data
30
+
31
+ == 0.7.7 2007-01-23
32
+ * 1 minor enhncement
33
+ * Cull bias neuron(s) from get_neurons function
@@ -660,10 +660,14 @@ static VALUE get_neurons(VALUE self, VALUE layer)
660
660
  VALUE value_sym = ID2SYM(rb_intern("value"));
661
661
  VALUE connections_sym = ID2SYM(rb_intern("connections"));
662
662
  unsigned int layer_num = 0;
663
+
664
+
665
+ int nuke_bias_neuron = (fann_get_network_type(f)==FANN_NETTYPE_LAYER);
663
666
  for(layer_it = f->first_layer; layer_it != f->last_layer; layer_it++)
664
667
  {
665
668
  for(neuron_it = layer_it->first_neuron; neuron_it != layer_it->last_neuron; neuron_it++)
666
669
  {
670
+ if (nuke_bias_neuron && (neuron_it==(layer_it->last_neuron)-1)) continue;
667
671
  // Create array of connection indicies:
668
672
  VALUE connection_array = rb_ary_new();
669
673
  for (i = neuron_it->first_con; i < neuron_it->last_con; i++) {
@@ -685,6 +689,18 @@ static VALUE get_neurons(VALUE self, VALUE layer)
685
689
  ++layer_num;
686
690
  }
687
691
 
692
+ // switch (fann_get_network_type(ann)) {
693
+ // case FANN_NETTYPE_LAYER: {
694
+ // /* Report one bias in each layer except the last */
695
+ // if (layer_it != ann->last_layer-1)
696
+ // *bias = 1;
697
+ // else
698
+ // *bias = 0;
699
+ // break;
700
+ // }
701
+ // case FANN_NETTYPE_SHORTCUT: {
702
+
703
+
688
704
  return neuron_array;
689
705
  }
690
706
 
@@ -2,7 +2,7 @@ module RubyFann #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 7
5
- TINY = 6
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/neurotica1.png CHANGED
Binary file
data/neurotica2.vrml CHANGED
@@ -4,9 +4,9 @@ Group { children [
4
4
  scale 0.028 0.028 0.028
5
5
  children [
6
6
  Background { skyColor 1.000 1.000 1.000 }
7
- # node 8419700
7
+ # node 2898230
8
8
  Transform {
9
- translation 6.000 46.000 41.000
9
+ translation 6.000 6.000 89.000
10
10
  scale 2.000 2.000 2.000
11
11
  children [
12
12
  Transform {
@@ -24,9 +24,9 @@ Transform {
24
24
  }
25
25
  ]
26
26
  }
27
- # node 8417440
27
+ # node 2897300
28
28
  Transform {
29
- translation 50.000 6.000 32.000
29
+ translation 28.000 6.000 56.000
30
30
  scale 2.000 2.000 2.000
31
31
  children [
32
32
  Transform {
@@ -44,44 +44,9 @@ Transform {
44
44
  }
45
45
  ]
46
46
  }
47
- # edge 8419700 -> 8417440
48
- Group { children [
47
+ # node 2897070
49
48
  Transform {
50
- children [
51
- Shape {
52
- geometry Cylinder {
53
- bottom FALSE top FALSE
54
- height 38.822 radius 1.000 }
55
- appearance Appearance {
56
- material Material {
57
- ambientIntensity 0.33
58
- diffuseColor 0.000 0.000 1.000
59
- }
60
- }
61
- }
62
- Transform {
63
- translation 0 24.411 0
64
- children [
65
- Shape {
66
- geometry Cone {bottomRadius 3.500 height 10.000 }
67
- appearance Appearance {
68
- material Material {
69
- ambientIntensity 0.33
70
- diffuseColor 0.000 0.000 1.000
71
- }
72
- }
73
- }
74
- ]
75
- }
76
- ]
77
- center 0 5.000 0
78
- rotation -0.000 0 -22.000 -3.975
79
- translation 24.000 17.000 0.000
80
- }
81
- ] }
82
- # node 8418480
83
- Transform {
84
- translation 28.000 46.000 50.000
49
+ translation 50.000 6.000 0.000
85
50
  scale 2.000 2.000 2.000
86
51
  children [
87
52
  Transform {
@@ -99,44 +64,9 @@ Transform {
99
64
  }
100
65
  ]
101
66
  }
102
- # edge 8418480 -> 8417440
103
- Group { children [
104
- Transform {
105
- children [
106
- Shape {
107
- geometry Cylinder {
108
- bottom FALSE top FALSE
109
- height 25.133 radius 1.000 }
110
- appearance Appearance {
111
- material Material {
112
- ambientIntensity 0.33
113
- diffuseColor 0.000 0.000 1.000
114
- }
115
- }
116
- }
67
+ # node 2895200
117
68
  Transform {
118
- translation 0 17.566 0
119
- children [
120
- Shape {
121
- geometry Cone {bottomRadius 3.500 height 10.000 }
122
- appearance Appearance {
123
- material Material {
124
- ambientIntensity 0.33
125
- diffuseColor 0.000 0.000 1.000
126
- }
127
- }
128
- }
129
- ]
130
- }
131
- ]
132
- center 0 5.000 0
133
- rotation -0.000 0 -11.000 -3.644
134
- translation 35.000 17.000 0.000
135
- }
136
- ] }
137
- # node 8418170
138
- Transform {
139
- translation 50.000 46.000 7.000
69
+ translation 72.000 6.000 96.000
140
70
  scale 2.000 2.000 2.000
141
71
  children [
142
72
  Transform {
@@ -154,44 +84,9 @@ Transform {
154
84
  }
155
85
  ]
156
86
  }
157
- # edge 8418170 -> 8417440
158
- Group { children [
159
- Transform {
160
- children [
161
- Shape {
162
- geometry Cylinder {
163
- bottom FALSE top FALSE
164
- height 19.035 radius 1.000 }
165
- appearance Appearance {
166
- material Material {
167
- ambientIntensity 0.33
168
- diffuseColor 0.000 0.000 1.000
169
- }
170
- }
171
- }
87
+ # node 2893280
172
88
  Transform {
173
- translation 0 14.518 0
174
- children [
175
- Shape {
176
- geometry Cone {bottomRadius 3.500 height 10.000 }
177
- appearance Appearance {
178
- material Material {
179
- ambientIntensity 0.33
180
- diffuseColor 0.000 0.000 1.000
181
- }
182
- }
183
- }
184
- ]
185
- }
186
- ]
187
- center 0 5.000 0
188
- rotation -0.000 0 1.000 -3.142
189
- translation 46.000 17.000 0.000
190
- }
191
- ] }
192
- # node 8417870
193
- Transform {
194
- translation 72.000 46.000 50.000
89
+ translation 94.000 6.000 47.000
195
90
  scale 2.000 2.000 2.000
196
91
  children [
197
92
  Transform {
@@ -209,44 +104,9 @@ Transform {
209
104
  }
210
105
  ]
211
106
  }
212
- # edge 8417870 -> 8417440
213
- Group { children [
214
- Transform {
215
- children [
216
- Shape {
217
- geometry Cylinder {
218
- bottom FALSE top FALSE
219
- height 24.018 radius 1.000 }
220
- appearance Appearance {
221
- material Material {
222
- ambientIntensity 0.33
223
- diffuseColor 0.000 0.000 1.000
224
- }
225
- }
226
- }
227
- Transform {
228
- translation 0 17.009 0
229
- children [
230
- Shape {
231
- geometry Cone {bottomRadius 3.500 height 10.000 }
232
- appearance Appearance {
233
- material Material {
234
- ambientIntensity 0.33
235
- diffuseColor 0.000 0.000 1.000
236
- }
237
- }
238
- }
239
- ]
240
- }
241
- ]
242
- center 0 5.000 0
243
- rotation -0.000 0 11.000 -3.644
244
- translation 57.000 17.000 0.000
245
- }
246
- ] }
247
- # node 8417570
107
+ # node 2892270
248
108
  Transform {
249
- translation 94.000 46.000 2.000
109
+ translation 116.000 6.000 38.000
250
110
  scale 2.000 2.000 2.000
251
111
  children [
252
112
  Transform {
@@ -264,41 +124,6 @@ Transform {
264
124
  }
265
125
  ]
266
126
  }
267
- # edge 8417570 -> 8417440
268
- Group { children [
269
- Transform {
270
- children [
271
- Shape {
272
- geometry Cylinder {
273
- bottom FALSE top FALSE
274
- height 37.531 radius 1.000 }
275
- appearance Appearance {
276
- material Material {
277
- ambientIntensity 0.33
278
- diffuseColor 0.000 0.000 1.000
279
- }
280
- }
281
- }
282
- Transform {
283
- translation 0 23.765 0
284
- children [
285
- Shape {
286
- geometry Cone {bottomRadius 3.500 height 10.000 }
287
- appearance Appearance {
288
- material Material {
289
- ambientIntensity 0.33
290
- diffuseColor 0.000 0.000 1.000
291
- }
292
- }
293
- }
294
- ]
295
- }
296
- ]
297
- center 0 5.000 0
298
- rotation -0.000 0 22.000 -3.975
299
- translation 68.000 17.000 0.000
300
- }
301
- ] }
302
127
  ] }
303
- Viewpoint {position 1.852 0.963 6.035}
128
+ Viewpoint {position 2.259 0.222 7.273}
304
129
  ] }
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>ruby-fann</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/ruby-fann"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/ruby-fann" class="numbers">0.7.6</a>
36
+ <a href="http://rubyforge.org/projects/ruby-fann" class="numbers">0.7.7</a>
37
37
  </div>
38
38
  <p><em>Bindings to use <a href="http://leenissen.dk/fann/"><span class="caps">FANN</span></a> (Fast Artificial Neural Network) from within ruby/rails environment.</em></p>
39
39
 
data/xor_cascade.net CHANGED
@@ -30,5 +30,5 @@ cascade_activation_steepnesses_count=4
30
30
  cascade_activation_steepnesses=2.50000000000000000000e-01 5.00000000000000000000e-01 7.50000000000000000000e-01 1.00000000000000000000e+00
31
31
  layer_sizes=3 1 1 1
32
32
  scale_included=0
33
- neurons (num_inputs, activation_function, activation_steepness)=(0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (3, 15, 1.00000000000000000000e+00) (4, 3, 5.00000000000000000000e-01) (5, 5, 5.00000000000000000000e-01)
34
- connections (connected_to_neuron, weight)=(0, 1.64060127614348427727e+00) (1, 1.57263750461912477085e+00) (2, -3.68301579404615997415e-04) (0, 1.07756007111791535236e-02) (1, 6.15052708190636995833e-03) (2, -5.73600239194447922841e+01) (3, 1.26449875516921987628e-02) (0, 2.33410030412561697588e-01) (1, 2.40872204847791621107e-01) (2, 2.37685570936397305708e-01) (3, 3.95914595301011544848e+01) (4, 2.38574359126598856129e-01)
33
+ neurons (num_inputs, activation_function, activation_steepness)=(0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (3, 14, 1.00000000000000000000e+00) (4, 3, 1.00000000000000000000e+00) (5, 5, 5.00000000000000000000e-01)
34
+ connections (connected_to_neuron, weight)=(0, 1.86109735793926978076e+00) (1, 1.53457642869428334542e+00) (2, 1.57379632519913137401e+00) (0, -1.63855205202685857979e-02) (1, -4.37714446815499758081e-02) (2, -1.79293283324296588432e+01) (3, -3.03416410098376498894e-01) (0, 1.77185261840735880368e-01) (1, 1.41681920756182133658e-01) (2, 2.22790414769918176940e-01) (3, 4.00602073083754319782e+01) (4, -7.43623769268710044233e-02)
data/xor_float.net CHANGED
@@ -31,4 +31,4 @@ cascade_activation_steepnesses=2.50000000000000000000e-01 5.00000000000000000000
31
31
  layer_sizes=3 4 2
32
32
  scale_included=0
33
33
  neurons (num_inputs, activation_function, activation_steepness)=(0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (0, 0, 0.00000000000000000000e+00) (3, 5, 1.00000000000000000000e+00) (3, 5, 1.00000000000000000000e+00) (3, 5, 1.00000000000000000000e+00) (0, 5, 1.00000000000000000000e+00) (4, 5, 1.00000000000000000000e+00) (0, 5, 1.00000000000000000000e+00)
34
- connections (connected_to_neuron, weight)=(0, 1.27441270422940866602e+00) (1, -1.22426116781974170244e+00) (2, -1.77359115369454456435e+00) (0, 1.75865469280423880605e+00) (1, 5.81083794776469098053e-01) (2, -7.07551379257807533385e-01) (0, 2.55797944565093970937e+00) (1, 2.45367366963896449406e+00) (2, 2.60478211460055675275e+00) (3, 3.76234015577947022990e+00) (4, -4.63506819515176449187e+00) (5, 4.70207528005021035966e+00) (6, -6.14161507194542544141e-01)
34
+ connections (connected_to_neuron, weight)=(0, 2.82674709981290295246e+00) (1, 1.83285679199681794671e+00) (2, 1.79351510444946171674e+00) (0, 1.30190337108136544586e+00) (1, 2.12157151948249156348e+00) (2, -1.35178282494634038891e+00) (0, -1.40745923743137546502e+00) (1, 1.66503130606607463449e+00) (2, -2.25816505377594189952e+00) (3, 3.96208974962423310373e+00) (4, -4.07142363835370790781e+00) (5, 2.94122805959320210434e+00) (6, -8.99181418321290504281e-01)
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: ruby-fann
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.6
7
- date: 2008-01-14 00:00:00 -06:00
6
+ version: 0.7.7
7
+ date: 2008-01-23 00:00:00 -06:00
8
8
  summary: Bindings to use FANN from within ruby/rails environment.
9
9
  require_paths:
10
10
  - lib