ruby-fann 0.7.1 → 0.7.2
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 +5 -0
- data/Manifest.txt +1 -0
- data/lib/ruby_fann/version.rb +1 -1
- data/script/txt2html +1 -1
- data/website/index.html +36 -9
- data/website/index.txt +25 -5
- data/website/template.rhtml +1 -2
- metadata +2 -1
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/lib/ruby_fann/version.rb
CHANGED
data/script/txt2html
CHANGED
@@ -14,7 +14,7 @@ require 'erb'
|
|
14
14
|
require File.dirname(__FILE__) + '/../lib/ruby_fann/version.rb'
|
15
15
|
|
16
16
|
version = RubyFann::VERSION::STRING
|
17
|
-
download = 'http://rubyforge.org/projects/
|
17
|
+
download = 'http://rubyforge.org/projects/ruby-fann'
|
18
18
|
|
19
19
|
class Fixnum
|
20
20
|
def ordinal
|
data/website/index.html
CHANGED
@@ -31,28 +31,56 @@
|
|
31
31
|
<div id="main">
|
32
32
|
|
33
33
|
<h1>ruby-fann</h1>
|
34
|
-
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/
|
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/
|
36
|
+
<a href="http://rubyforge.org/projects/ruby-fann" class="numbers">0.7.2</a>
|
37
37
|
</div>
|
38
|
-
<
|
38
|
+
<h2>What</h2>
|
39
39
|
|
40
40
|
|
41
|
-
<
|
41
|
+
<p>Bindings to use <span class="caps">FANN</span> (Fast Artificial Neural Network) from within ruby/rails environment.</p>
|
42
42
|
|
43
43
|
|
44
44
|
<h2>Installing</h2>
|
45
45
|
|
46
46
|
|
47
|
-
<
|
47
|
+
<ul>
|
48
|
+
<li>First, Go here & install <span class="caps">FANN</span> for your platform:
|
48
49
|
|
50
|
+
<p><a href="http://leenissen.dk/fann/">http://leenissen.dk/fann/</a></p>
|
51
|
+
</li>
|
52
|
+
<li>Then, install the ruby bindings:
|
53
|
+
<pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">ruby</span><span class="punct">-</span><span class="ident">fann</span></pre></li>
|
54
|
+
</ul>
|
49
55
|
|
50
|
-
|
56
|
+
|
57
|
+
<h2>Requirements:</h2>
|
58
|
+
|
59
|
+
|
60
|
+
<ul>
|
61
|
+
<li><span class="caps">FANN 2</span>.1 or greater (preferably in /usr/local/lib)</li>
|
62
|
+
<li>Ruby 1.8.6 or greater.</li>
|
63
|
+
<li>gnu make tools or equiv for native code in ext</li>
|
64
|
+
</ul>
|
51
65
|
|
52
66
|
|
53
67
|
<h2>Demonstration of usage</h2>
|
54
68
|
|
55
69
|
|
70
|
+
<p><pre class='syntax'>
|
71
|
+
<span class="ident">require</span> <span class="punct">'</span><span class="string">ruby_fann/neural_network</span><span class="punct">'</span>
|
72
|
+
<span class="ident">training_data</span> <span class="punct">=</span> <span class="constant">RubyFann</span><span class="punct">::</span><span class="constant">TrainData</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span>
|
73
|
+
<span class="symbol">:inputs=</span><span class="punct">>[[</span><span class="number">0.3</span><span class="punct">,</span> <span class="number">0.4</span><span class="punct">,</span> <span class="number">0.5</span><span class="punct">],</span> <span class="punct">[</span><span class="number">0.1</span><span class="punct">,</span> <span class="number">0.2</span><span class="punct">,</span> <span class="number">0.3</span><span class="punct">]],</span>
|
74
|
+
<span class="symbol">:desired_outputs=</span><span class="punct">>[[</span><span class="number">0.7</span><span class="punct">],</span> <span class="punct">[</span><span class="number">0.8</span><span class="punct">]])</span>
|
75
|
+
<span class="ident">neural_network</span> <span class="punct">=</span> <span class="constant">RubyFann</span><span class="punct">::</span><span class="constant">Standard</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span>
|
76
|
+
<span class="symbol">:num_inputs=</span><span class="punct">></span><span class="number">5</span><span class="punct">,</span>
|
77
|
+
<span class="symbol">:hidden_neurons=</span><span class="punct">>[</span><span class="number">2</span><span class="punct">,</span> <span class="number">8</span><span class="punct">,</span> <span class="number">4</span><span class="punct">,</span> <span class="number">3</span><span class="punct">,</span> <span class="number">4</span><span class="punct">],</span>
|
78
|
+
<span class="symbol">:num_outputs=</span><span class="punct">></span><span class="number">1</span><span class="punct">)</span>
|
79
|
+
<span class="ident">neural_network</span><span class="punct">.</span><span class="ident">train_on_data</span><span class="punct">(</span><span class="ident">training_data</span><span class="punct">,</span> <span class="number">1000</span><span class="punct">,</span> <span class="number">10</span><span class="punct">,</span> <span class="number">0.1</span><span class="punct">)</span>
|
80
|
+
<span class="ident">outputs</span> <span class="punct">=</span> <span class="ident">neural_network</span><span class="punct">.</span><span class="ident">run</span><span class="punct">([</span><span class="number">3.0</span><span class="punct">,</span> <span class="number">2.0</span><span class="punct">,</span> <span class="number">3.0</span><span class="punct">])</span>
|
81
|
+
</pre></p>
|
82
|
+
|
83
|
+
|
56
84
|
<h2>Forum</h2>
|
57
85
|
|
58
86
|
|
@@ -65,7 +93,7 @@
|
|
65
93
|
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
66
94
|
|
67
95
|
|
68
|
-
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/
|
96
|
+
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/ruby-fann/trunk</code> for anonymous access.</p>
|
69
97
|
|
70
98
|
|
71
99
|
<h2>License</h2>
|
@@ -79,8 +107,7 @@
|
|
79
107
|
|
80
108
|
<p>Comments are welcome. Send an email to <a href="mailto:steven@7bpeople.com">Steven Miers</a> email via the <a href="http://groups.google.com/group/ruby_fann">forum</a></p>
|
81
109
|
<p class="coda">
|
82
|
-
<a href="
|
83
|
-
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
110
|
+
<a href="steven@7bpeople.com">Steven Miers</a>, 18th December 2007<br>
|
84
111
|
</p>
|
85
112
|
</div>
|
86
113
|
|
data/website/index.txt
CHANGED
@@ -1,20 +1,40 @@
|
|
1
1
|
h1. ruby-fann
|
2
2
|
|
3
|
-
h1. → 'ruby-fann'
|
4
|
-
|
5
|
-
|
6
3
|
h2. What
|
7
4
|
|
5
|
+
Bindings to use FANN (Fast Artificial Neural Network) from within ruby/rails environment.
|
6
|
+
|
8
7
|
|
9
8
|
h2. Installing
|
10
9
|
|
10
|
+
* First, Go here & install FANN for your platform:
|
11
|
+
|
12
|
+
"http://leenissen.dk/fann/":http://leenissen.dk/fann/
|
13
|
+
* Then, install the ruby bindings:
|
11
14
|
<pre syntax="ruby">sudo gem install ruby-fann</pre>
|
12
15
|
|
13
|
-
h2.
|
16
|
+
h2. Requirements:
|
17
|
+
|
18
|
+
* FANN 2.1 or greater (preferably in /usr/local/lib)
|
19
|
+
* Ruby 1.8.6 or greater.
|
20
|
+
* gnu make tools or equiv for native code in ext
|
14
21
|
|
15
22
|
|
16
23
|
h2. Demonstration of usage
|
17
24
|
|
25
|
+
<pre syntax="ruby">
|
26
|
+
require 'ruby_fann/neural_network'
|
27
|
+
training_data = RubyFann::TrainData.new(
|
28
|
+
:inputs=>[[0.3, 0.4, 0.5], [0.1, 0.2, 0.3]],
|
29
|
+
:desired_outputs=>[[0.7], [0.8]])
|
30
|
+
neural_network = RubyFann::Standard.new(
|
31
|
+
:num_inputs=>5,
|
32
|
+
:hidden_neurons=>[2, 8, 4, 3, 4],
|
33
|
+
:num_outputs=>1)
|
34
|
+
neural_network.train_on_data(training_data, 1000, 10, 0.1)
|
35
|
+
outputs = neural_network.run([3.0, 2.0, 3.0])
|
36
|
+
</pre>
|
37
|
+
|
18
38
|
h2. Forum
|
19
39
|
|
20
40
|
"http://groups.google.com/group/ruby_fann":http://groups.google.com/group/ruby_fann
|
@@ -23,7 +43,7 @@ h2. How to submit patches
|
|
23
43
|
|
24
44
|
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
25
45
|
|
26
|
-
The trunk repository is <code>svn://rubyforge.org/var/svn/
|
46
|
+
The trunk repository is <code>svn://rubyforge.org/var/svn/ruby-fann/trunk</code> for anonymous access.
|
27
47
|
|
28
48
|
h2. License
|
29
49
|
|
data/website/template.rhtml
CHANGED
@@ -37,8 +37,7 @@
|
|
37
37
|
</div>
|
38
38
|
<%= body %>
|
39
39
|
<p class="coda">
|
40
|
-
<a href="
|
41
|
-
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
40
|
+
<a href="steven@7bpeople.com">Steven Miers</a>, <%= modified.pretty %><br>
|
42
41
|
</p>
|
43
42
|
</div>
|
44
43
|
|
metadata
CHANGED
@@ -3,7 +3,7 @@ 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
|
+
version: 0.7.2
|
7
7
|
date: 2007-12-18 00:00:00 -06:00
|
8
8
|
summary: Bindings to use FANN from within ruby/rails environment.
|
9
9
|
require_paths:
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- Rakefile
|
38
38
|
- config/hoe.rb
|
39
39
|
- config/requirements.rb
|
40
|
+
- doc
|
40
41
|
- ext/ruby_fann/extconf.rb
|
41
42
|
- ext/ruby_fann/fann_augment.h
|
42
43
|
- ext/ruby_fann/neural_network.c
|