ruby-fann 1.0.3 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +2 -0
- data/Rakefile +3 -3
- data/config/hoe.rb +1 -1
- data/ext/ruby_fann/Makefile +77 -53
- data/ext/ruby_fann/config.h +65 -0
- data/ext/ruby_fann/fann_augment.h +13 -11
- data/ext/ruby_fann/neural_network.c +21 -17
- data/ext/ruby_fann/ruby_compat.h +12 -0
- data/lib/ruby_fann/neurotica.rb +2 -2
- data/lib/ruby_fann/version.rb +1 -1
- data/neurotica1.png +0 -0
- data/neurotica2.vrml +11 -11
- data/script/txt2html +3 -3
- data/test/test_ruby_fann.rb +19 -13
- data/website/index.html +3 -2
- data/website/index.txt +2 -1
- data/xor_cascade.net +2 -2
- data/xor_float.net +1 -1
- metadata +51 -10
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -8,9 +8,11 @@ config/requirements.rb
|
|
8
8
|
ext/ruby_fann/MANIFEST
|
9
9
|
ext/ruby_fann/Makefile
|
10
10
|
ext/ruby_fann/extconf.rb
|
11
|
+
ext/ruby_fann/ruby_compat.h
|
11
12
|
ext/ruby_fann/fann_augment.h
|
12
13
|
ext/ruby_fann/neural_network.c
|
13
14
|
ext/ruby_fann/doublefann.h
|
15
|
+
ext/ruby_fann/config.h
|
14
16
|
ext/ruby_fann/fann_error.h
|
15
17
|
ext/ruby_fann/fann_activation.h
|
16
18
|
ext/ruby_fann/fann_data.h
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'config/requirements'
|
2
|
-
require 'config/hoe' # setup Hoe + all gem configuration
|
3
|
-
|
1
|
+
require 'config/requirements'
|
2
|
+
require 'config/hoe' # setup Hoe + all gem configuration
|
3
|
+
|
4
4
|
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
data/config/hoe.rb
CHANGED
@@ -58,7 +58,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
58
58
|
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
59
59
|
|
60
60
|
# == Optional
|
61
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
61
|
+
#p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
62
62
|
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
63
63
|
|
64
64
|
p.spec_extras = {:extensions => "ext/ruby_fann/extconf.rb"} # A hash of extra values to set in the gemspec.
|
data/ext/ruby_fann/Makefile
CHANGED
@@ -4,67 +4,81 @@ SHELL = /bin/sh
|
|
4
4
|
#### Start of system configuration section. ####
|
5
5
|
|
6
6
|
srcdir = .
|
7
|
-
topdir = /
|
8
|
-
hdrdir =
|
9
|
-
|
7
|
+
topdir = /usr/local/include/ruby-1.9.1
|
8
|
+
hdrdir = /usr/local/include/ruby-1.9.1
|
9
|
+
arch_hdrdir = /usr/local/include/ruby-1.9.1/$(arch)
|
10
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
11
|
+
prefix = $(DESTDIR)/usr/local
|
10
12
|
exec_prefix = $(prefix)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
14
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
15
|
+
rubyhdrdir = $(includedir)/$(RUBY_INSTALL_NAME)-$(ruby_version)
|
16
|
+
vendordir = $(libdir)/$(RUBY_INSTALL_NAME)/vendor_ruby
|
17
|
+
sitedir = $(libdir)/$(RUBY_INSTALL_NAME)/site_ruby
|
18
|
+
mandir = $(datarootdir)/man
|
16
19
|
localedir = $(datarootdir)/locale
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
libdir = $(exec_prefix)/lib
|
21
|
+
psdir = $(docdir)
|
22
|
+
pdfdir = $(docdir)
|
23
|
+
dvidir = $(docdir)
|
20
24
|
htmldir = $(docdir)
|
21
|
-
|
25
|
+
infodir = $(datarootdir)/info
|
26
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
27
|
+
oldincludedir = $(DESTDIR)/usr/include
|
22
28
|
includedir = $(prefix)/include
|
23
|
-
|
24
|
-
|
29
|
+
localstatedir = $(prefix)/var
|
30
|
+
sharedstatedir = $(prefix)/com
|
25
31
|
sysconfdir = $(prefix)/etc
|
26
|
-
|
27
|
-
sbindir = $(exec_prefix)/sbin
|
28
|
-
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
29
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
30
|
-
dvidir = $(docdir)
|
31
|
-
vendordir = $(libdir)/ruby/vendor_ruby
|
32
|
+
datadir = $(datarootdir)
|
32
33
|
datarootdir = $(prefix)/share
|
33
|
-
|
34
|
+
libexecdir = $(exec_prefix)/libexec
|
35
|
+
sbindir = $(exec_prefix)/sbin
|
36
|
+
bindir = $(exec_prefix)/bin
|
37
|
+
rubylibdir = $(libdir)/$(ruby_install_name)/$(ruby_version)
|
34
38
|
archdir = $(rubylibdir)/$(arch)
|
35
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
36
|
-
datadir = $(datarootdir)
|
37
|
-
localstatedir = $(prefix)/var
|
38
39
|
sitelibdir = $(sitedir)/$(ruby_version)
|
40
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
41
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
42
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
39
43
|
|
40
44
|
CC = gcc
|
41
|
-
|
45
|
+
CXX = g++
|
46
|
+
LIBRUBY = $(LIBRUBY_A)
|
42
47
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
43
48
|
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
44
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
|
49
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
50
|
+
OUTFLAG = -o
|
51
|
+
COUTFLAG = -o
|
45
52
|
|
46
53
|
RUBY_EXTCONF_H =
|
47
|
-
|
48
|
-
|
54
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
55
|
+
optflags = -O2
|
56
|
+
debugflags = -g
|
57
|
+
warnflags = -Wall -Wno-parentheses
|
58
|
+
CFLAGS = -fno-common $(cflags) -pipe -fno-common
|
59
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
49
60
|
DEFS =
|
50
61
|
CPPFLAGS = -DHAVE_DOUBLEFANN_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
|
51
|
-
CXXFLAGS = $(CFLAGS)
|
52
|
-
ldflags = -L. -
|
62
|
+
CXXFLAGS = $(CFLAGS) $(cxxflags)
|
63
|
+
ldflags = -L. -L/usr/local/lib
|
53
64
|
dldflags =
|
54
65
|
archflag =
|
55
66
|
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
|
56
|
-
LDSHARED = cc -
|
67
|
+
LDSHARED = cc -dynamic -bundle -undefined suppress -flat_namespace
|
68
|
+
LDSHAREDXX = $(LDSHARED)
|
57
69
|
AR = ar
|
58
70
|
EXEEXT =
|
59
71
|
|
60
72
|
RUBY_INSTALL_NAME = ruby
|
61
73
|
RUBY_SO_NAME = ruby
|
62
|
-
arch =
|
63
|
-
sitearch =
|
64
|
-
ruby_version = 1.
|
65
|
-
ruby = /
|
74
|
+
arch = i386-darwin10.2.0
|
75
|
+
sitearch = i386-darwin10.2.0
|
76
|
+
ruby_version = 1.9.1
|
77
|
+
ruby = /usr/local/bin/ruby
|
66
78
|
RUBY = $(ruby)
|
67
79
|
RM = rm -f
|
80
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
81
|
+
RMDIRS = $(RUBY) -run -e rmdir -- -p
|
68
82
|
MAKEDIRS = mkdir -p
|
69
83
|
INSTALL = /usr/bin/install -c
|
70
84
|
INSTALL_PROG = $(INSTALL) -m 0755
|
@@ -81,14 +95,15 @@ DEFFILE =
|
|
81
95
|
|
82
96
|
CLEANFILES = mkmf.log
|
83
97
|
DISTCLEANFILES =
|
98
|
+
DISTCLEANDIRS =
|
84
99
|
|
85
100
|
extout =
|
86
101
|
extout_prefix =
|
87
102
|
target_prefix =
|
88
103
|
LOCAL_LIBS =
|
89
|
-
LIBS =
|
90
|
-
SRCS = neural_network.c
|
91
|
-
OBJS = neural_network.o
|
104
|
+
LIBS = -lpthread -ldl -lobjc
|
105
|
+
SRCS = neural_network.c doublefann.c
|
106
|
+
OBJS = neural_network.o doublefann.o
|
92
107
|
TARGET = neural_network
|
93
108
|
DLLIB = $(TARGET).bundle
|
94
109
|
EXTSTATIC =
|
@@ -98,22 +113,31 @@ BINDIR = $(bindir)
|
|
98
113
|
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
99
114
|
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
100
115
|
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
116
|
+
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
117
|
+
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
101
118
|
|
102
119
|
TARGET_SO = $(DLLIB)
|
103
|
-
CLEANLIBS = $(TARGET).bundle
|
104
|
-
CLEANOBJS = *.o
|
120
|
+
CLEANLIBS = $(TARGET).bundle
|
121
|
+
CLEANOBJS = *.o *.bak
|
105
122
|
|
106
|
-
all:
|
107
|
-
static:
|
123
|
+
all: $(DLLIB)
|
124
|
+
static: $(STATIC_LIB)
|
108
125
|
|
109
|
-
clean
|
126
|
+
clean-rb-default::
|
127
|
+
clean-rb::
|
128
|
+
clean-so::
|
129
|
+
clean: clean-so clean-rb-default clean-rb
|
110
130
|
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
111
131
|
|
112
|
-
distclean
|
132
|
+
distclean-rb-default::
|
133
|
+
distclean-rb::
|
134
|
+
distclean-so::
|
135
|
+
distclean: clean distclean-so distclean-rb-default distclean-rb
|
113
136
|
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
114
137
|
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
138
|
+
@-$(RMDIRS) $(DISTCLEANDIRS)
|
115
139
|
|
116
|
-
realclean:
|
140
|
+
realclean: distclean
|
117
141
|
install: install-so install-rb
|
118
142
|
|
119
143
|
install-so: $(RUBYARCHDIR)
|
@@ -134,24 +158,24 @@ site-install-rb: install-rb
|
|
134
158
|
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
135
159
|
|
136
160
|
.cc.o:
|
137
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
161
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
138
162
|
|
139
163
|
.cxx.o:
|
140
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
164
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
141
165
|
|
142
166
|
.cpp.o:
|
143
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
167
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
144
168
|
|
145
169
|
.C.o:
|
146
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
170
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
147
171
|
|
148
172
|
.c.o:
|
149
|
-
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
|
173
|
+
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
150
174
|
|
151
|
-
$(DLLIB): $(OBJS)
|
152
|
-
@-$(RM)
|
175
|
+
$(DLLIB): $(OBJS) Makefile
|
176
|
+
@-$(RM) $(@)
|
153
177
|
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
154
178
|
|
155
179
|
|
156
180
|
|
157
|
-
$(OBJS): ruby.h defines.h
|
181
|
+
$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/* src/include/config.h. Generated by configure. */
|
2
|
+
/* config.in. Generated from configure.in by autoheader. */
|
3
|
+
|
4
|
+
/* Define to 1 if you have the <dlfcn.h> header file. */
|
5
|
+
#define HAVE_DLFCN_H 1
|
6
|
+
|
7
|
+
/* Define to 1 if you have the `gettimeofday' function. */
|
8
|
+
#define HAVE_GETTIMEOFDAY 1
|
9
|
+
|
10
|
+
/* Define to 1 if you have the <inttypes.h> header file. */
|
11
|
+
#define HAVE_INTTYPES_H 1
|
12
|
+
|
13
|
+
/* Define to 1 if you have the <memory.h> header file. */
|
14
|
+
#define HAVE_MEMORY_H 1
|
15
|
+
|
16
|
+
/* Define to 1 if you have the <stdint.h> header file. */
|
17
|
+
#define HAVE_STDINT_H 1
|
18
|
+
|
19
|
+
/* Define to 1 if you have the <stdlib.h> header file. */
|
20
|
+
#define HAVE_STDLIB_H 1
|
21
|
+
|
22
|
+
/* Define to 1 if you have the <strings.h> header file. */
|
23
|
+
#define HAVE_STRINGS_H 1
|
24
|
+
|
25
|
+
/* Define to 1 if you have the <string.h> header file. */
|
26
|
+
#define HAVE_STRING_H 1
|
27
|
+
|
28
|
+
/* Define to 1 if you have the <sys/stat.h> header file. */
|
29
|
+
#define HAVE_SYS_STAT_H 1
|
30
|
+
|
31
|
+
/* Define to 1 if you have the <sys/types.h> header file. */
|
32
|
+
#define HAVE_SYS_TYPES_H 1
|
33
|
+
|
34
|
+
/* Define to 1 if you have the <unistd.h> header file. */
|
35
|
+
#define HAVE_UNISTD_H 1
|
36
|
+
|
37
|
+
/* Name of package */
|
38
|
+
#define PACKAGE "fann"
|
39
|
+
|
40
|
+
/* Define to the address where bug reports for this package should be sent. */
|
41
|
+
#define PACKAGE_BUGREPORT ""
|
42
|
+
|
43
|
+
/* Define to the full name of this package. */
|
44
|
+
#define PACKAGE_NAME ""
|
45
|
+
|
46
|
+
/* Define to the full name and version of this package. */
|
47
|
+
#define PACKAGE_STRING ""
|
48
|
+
|
49
|
+
/* Define to the one symbol short name of this package. */
|
50
|
+
#define PACKAGE_TARNAME ""
|
51
|
+
|
52
|
+
/* Define to the version of this package. */
|
53
|
+
#define PACKAGE_VERSION ""
|
54
|
+
|
55
|
+
/* Define to 1 if you have the ANSI C header files. */
|
56
|
+
#define STDC_HEADERS 1
|
57
|
+
|
58
|
+
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
59
|
+
#define TIME_WITH_SYS_TIME 1
|
60
|
+
|
61
|
+
/* Version number of package */
|
62
|
+
#define VERSION "2.1.0"
|
63
|
+
|
64
|
+
/* Define to empty if `const' does not conform to ANSI C. */
|
65
|
+
/* #undef const */
|
@@ -1,3 +1,5 @@
|
|
1
|
+
#include "ruby.h"
|
2
|
+
#include "ruby_compat.h"
|
1
3
|
|
2
4
|
FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train_from_rb_ary2(
|
3
5
|
unsigned int num_data,
|
@@ -19,9 +21,9 @@ FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train_from_rb_ary(
|
|
19
21
|
unsigned int i, j;
|
20
22
|
fann_type *data_input, *data_output;
|
21
23
|
struct fann_train_data *data = (struct fann_train_data *)malloc(sizeof(struct fann_train_data));
|
22
|
-
unsigned int num_input =
|
23
|
-
unsigned int num_output =
|
24
|
-
unsigned int num_data =
|
24
|
+
unsigned int num_input = RARRAY_LEN(RARRAY_PTR(inputs)[0]);
|
25
|
+
unsigned int num_output =RARRAY_LEN(RARRAY_PTR(outputs)[0]);
|
26
|
+
unsigned int num_data = RARRAY_LEN(inputs);
|
25
27
|
|
26
28
|
if(data == NULL) {
|
27
29
|
fann_error(NULL, FANN_E_CANT_ALLOCATE_MEM);
|
@@ -72,29 +74,29 @@ FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train_from_rb_ary(
|
|
72
74
|
data->input[i] = data_input;
|
73
75
|
data_input += num_input;
|
74
76
|
|
75
|
-
inputs_i =
|
76
|
-
outputs_i =
|
77
|
+
inputs_i = RARRAY_PTR(inputs)[i];
|
78
|
+
outputs_i = RARRAY_PTR(outputs)[i];
|
77
79
|
|
78
|
-
if(
|
80
|
+
if(RARRAY_LEN(inputs_i) != num_input)
|
79
81
|
{
|
80
82
|
rb_raise (
|
81
83
|
rb_eRuntimeError,
|
82
84
|
"Number of inputs at [%d] is inconsistent: (%d != %d)",
|
83
|
-
i,
|
85
|
+
i, RARRAY_LEN(inputs_i), num_input);
|
84
86
|
}
|
85
87
|
|
86
|
-
if(
|
88
|
+
if(RARRAY_LEN(outputs_i) != num_output)
|
87
89
|
{
|
88
90
|
rb_raise (
|
89
91
|
rb_eRuntimeError,
|
90
92
|
"Number of outputs at [%d] is inconsistent: (%d != %d)",
|
91
|
-
i,
|
93
|
+
i, RARRAY_LEN(outputs_i), num_output);
|
92
94
|
}
|
93
95
|
|
94
96
|
|
95
97
|
for(j = 0; j != num_input; j++)
|
96
98
|
{
|
97
|
-
data->input[i][j]=NUM2DBL(
|
99
|
+
data->input[i][j]=NUM2DBL(RARRAY_PTR(inputs_i)[j]);
|
98
100
|
}
|
99
101
|
|
100
102
|
data->output[i] = data_output;
|
@@ -102,7 +104,7 @@ FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train_from_rb_ary(
|
|
102
104
|
|
103
105
|
for(j = 0; j != num_output; j++)
|
104
106
|
{
|
105
|
-
data->output[i][j]=NUM2DBL(
|
107
|
+
data->output[i][j]=NUM2DBL(RARRAY_PTR(outputs_i)[j]);
|
106
108
|
}
|
107
109
|
}
|
108
110
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "ruby.h"
|
2
|
+
#include "ruby_compat.h"
|
2
3
|
#include "doublefann.h"
|
3
4
|
#include "fann_data.h"
|
4
5
|
#include "fann_augment.h"
|
@@ -18,6 +19,7 @@ Check_Type(attr_name, T_FIXNUM); \
|
|
18
19
|
struct fann* f; \
|
19
20
|
Data_Get_Struct(self, struct fann, f); \
|
20
21
|
fann_fn(f, NUM2INT(attr_name)); \
|
22
|
+
return 0;
|
21
23
|
|
22
24
|
#define RETURN_FANN_UINT(fn) \
|
23
25
|
struct fann* f; \
|
@@ -29,6 +31,7 @@ Check_Type(attr_name, T_FIXNUM); \
|
|
29
31
|
struct fann* f; \
|
30
32
|
Data_Get_Struct(self, struct fann, f); \
|
31
33
|
fann_fn(f, NUM2UINT(attr_name)); \
|
34
|
+
return 0;
|
32
35
|
|
33
36
|
// Converts float return values to a double with same precision, avoids floating point errors.
|
34
37
|
#define RETURN_FANN_FLT(fn) \
|
@@ -275,7 +278,7 @@ static VALUE fann_initialize(VALUE self, VALUE hash)
|
|
275
278
|
Check_Type(num_outputs, T_FIXNUM);
|
276
279
|
|
277
280
|
// Initialize layers:
|
278
|
-
unsigned int num_layers=
|
281
|
+
unsigned int num_layers=RARRAY_LEN(hidden_neurons) + 2;
|
279
282
|
unsigned int layers[num_layers];
|
280
283
|
|
281
284
|
// Input:
|
@@ -285,7 +288,7 @@ static VALUE fann_initialize(VALUE self, VALUE hash)
|
|
285
288
|
// Hidden:
|
286
289
|
int i;
|
287
290
|
for (i=1; i<=num_layers-2; i++) {
|
288
|
-
layers[i]=NUM2UINT(
|
291
|
+
layers[i]=NUM2UINT(RARRAY_PTR(hidden_neurons)[i-1]);
|
289
292
|
}
|
290
293
|
|
291
294
|
ann = fann_create_standard_array(num_layers, layers);
|
@@ -347,19 +350,19 @@ static VALUE fann_train_data_initialize(VALUE self, VALUE hash)
|
|
347
350
|
rb_raise (rb_eRuntimeError, "[desired_outputs] must be present when [inputs] used.");
|
348
351
|
}
|
349
352
|
|
350
|
-
if (
|
353
|
+
if (RARRAY_LEN(inputs) < 1)
|
351
354
|
{
|
352
355
|
rb_raise (rb_eRuntimeError, "[inputs/desired_outputs] must contain at least one value.");
|
353
356
|
}
|
354
357
|
|
355
358
|
// The data is here, start constructing:
|
356
|
-
if(
|
359
|
+
if(RARRAY_LEN(inputs) != RARRAY_LEN(desired_outputs))
|
357
360
|
{
|
358
361
|
rb_raise (
|
359
362
|
rb_eRuntimeError,
|
360
363
|
"Number of inputs must match number of outputs: (%d != %d)",
|
361
|
-
|
362
|
-
|
364
|
+
(int)RARRAY_LEN(inputs),
|
365
|
+
(int)RARRAY_LEN(desired_outputs));
|
363
366
|
}
|
364
367
|
|
365
368
|
train_data = fann_create_train_from_rb_ary(inputs, desired_outputs);
|
@@ -1067,11 +1070,11 @@ static VALUE run (VALUE self, VALUE inputs)
|
|
1067
1070
|
fann_type* outputs;
|
1068
1071
|
|
1069
1072
|
// Convert inputs to type needed for NN:
|
1070
|
-
unsigned int len =
|
1073
|
+
unsigned int len = RARRAY_LEN(inputs);
|
1071
1074
|
fann_type fann_inputs[len];
|
1072
1075
|
for (i=0; i<len; i++)
|
1073
1076
|
{
|
1074
|
-
fann_inputs[i] = NUM2DBL(
|
1077
|
+
fann_inputs[i] = NUM2DBL(RARRAY_PTR(inputs)[i]);
|
1075
1078
|
}
|
1076
1079
|
|
1077
1080
|
|
@@ -1391,12 +1394,12 @@ static VALUE set_cascade_activation_functions(VALUE self, VALUE cascade_activati
|
|
1391
1394
|
struct fann* f;
|
1392
1395
|
Data_Get_Struct (self, struct fann, f);
|
1393
1396
|
|
1394
|
-
unsigned int cnt =
|
1397
|
+
unsigned int cnt = RARRAY_LEN(cascade_activation_functions);
|
1395
1398
|
enum fann_activationfunc_enum fann_activation_functions[cnt];
|
1396
1399
|
int i;
|
1397
1400
|
for (i=0; i<cnt; i++)
|
1398
1401
|
{
|
1399
|
-
fann_activation_functions[i] = sym_to_activation_function(
|
1402
|
+
fann_activation_functions[i] = sym_to_activation_function(RARRAY_PTR(cascade_activation_functions)[i]);
|
1400
1403
|
}
|
1401
1404
|
|
1402
1405
|
fann_set_cascade_activation_functions(f, fann_activation_functions, cnt);
|
@@ -1444,6 +1447,7 @@ static VALUE get_cascade_num_candidate_groups(VALUE self)
|
|
1444
1447
|
static VALUE set_cascade_num_candidate_groups(VALUE self, VALUE cascade_num_candidate_groups)
|
1445
1448
|
{
|
1446
1449
|
SET_FANN_UINT(cascade_num_candidate_groups, fann_set_cascade_num_candidate_groups);
|
1450
|
+
return 0;
|
1447
1451
|
}
|
1448
1452
|
|
1449
1453
|
/** The cascade activation steepnesses array is an array of the different activation functions used by
|
@@ -1454,12 +1458,12 @@ static VALUE set_cascade_activation_steepnesses(VALUE self, VALUE cascade_activa
|
|
1454
1458
|
struct fann* f;
|
1455
1459
|
Data_Get_Struct (self, struct fann, f);
|
1456
1460
|
|
1457
|
-
unsigned int cnt =
|
1461
|
+
unsigned int cnt = RARRAY_LEN(cascade_activation_steepnesses);
|
1458
1462
|
fann_type fann_activation_steepnesses[cnt];
|
1459
1463
|
int i;
|
1460
1464
|
for (i=0; i<cnt; i++)
|
1461
1465
|
{
|
1462
|
-
fann_activation_steepnesses[i] = NUM2DBL(
|
1466
|
+
fann_activation_steepnesses[i] = NUM2DBL(RARRAY_PTR(cascade_activation_steepnesses)[i]);
|
1463
1467
|
}
|
1464
1468
|
|
1465
1469
|
fann_set_cascade_activation_steepnesses(f, fann_activation_steepnesses, cnt);
|
@@ -1549,8 +1553,8 @@ void Init_neural_network ()
|
|
1549
1553
|
rb_define_method(m_rb_fann_standard_class, "get_num_output", get_num_output, 0);
|
1550
1554
|
rb_define_method(m_rb_fann_standard_class, "get_total_connections", get_total_connections, 0);
|
1551
1555
|
rb_define_method(m_rb_fann_standard_class, "get_total_neurons", get_total_neurons, 0);
|
1552
|
-
rb_define_method(m_rb_fann_standard_class, "get_train_error_function", get_train_error_function, 0);
|
1553
|
-
rb_define_method(m_rb_fann_standard_class, "set_train_error_function", set_train_error_function, 1);
|
1556
|
+
// rb_define_method(m_rb_fann_standard_class, "get_train_error_function", get_train_error_function, 0);
|
1557
|
+
// rb_define_method(m_rb_fann_standard_class, "set_train_error_function", set_train_error_function, 1);
|
1554
1558
|
rb_define_method(m_rb_fann_standard_class, "print_connections", print_connections, 0);
|
1555
1559
|
rb_define_method(m_rb_fann_standard_class, "print_parameters", print_parameters, 0);
|
1556
1560
|
rb_define_method(m_rb_fann_standard_class, "randomize_weights", randomize_weights, 2);
|
@@ -1611,7 +1615,7 @@ void Init_neural_network ()
|
|
1611
1615
|
rb_define_method(m_rb_fann_shortcut_class, "set_activation_function", set_activation_function, 3);
|
1612
1616
|
rb_define_method(m_rb_fann_shortcut_class, "set_activation_function_hidden", set_activation_function_hidden, 1);
|
1613
1617
|
rb_define_method(m_rb_fann_shortcut_class, "set_activation_function_layer", set_activation_function_layer, 2);
|
1614
|
-
rb_define_method(
|
1618
|
+
rb_define_method(m_rb_fann_shortcut_class, "get_activation_function", get_activation_function, 2);
|
1615
1619
|
rb_define_method(m_rb_fann_shortcut_class, "set_activation_function_output", set_activation_function_output, 1);
|
1616
1620
|
rb_define_method(m_rb_fann_shortcut_class, "get_activation_steepness", get_activation_steepness, 2);
|
1617
1621
|
rb_define_method(m_rb_fann_shortcut_class, "set_activation_steepness", set_activation_steepness, 3);
|
@@ -1648,8 +1652,8 @@ void Init_neural_network ()
|
|
1648
1652
|
rb_define_method(m_rb_fann_shortcut_class, "get_num_output", get_num_output, 0);
|
1649
1653
|
rb_define_method(m_rb_fann_shortcut_class, "get_total_connections", get_total_connections, 0);
|
1650
1654
|
rb_define_method(m_rb_fann_shortcut_class, "get_total_neurons", get_total_neurons, 0);
|
1651
|
-
rb_define_method(m_rb_fann_shortcut_class, "get_train_error_function", get_train_error_function, 0);
|
1652
|
-
rb_define_method(m_rb_fann_shortcut_class, "set_train_error_function", set_train_error_function, 1);
|
1655
|
+
// rb_define_method(m_rb_fann_shortcut_class, "get_train_error_function", get_train_error_function, 0);
|
1656
|
+
// rb_define_method(m_rb_fann_shortcut_class, "set_train_error_function", set_train_error_function, 1);
|
1653
1657
|
rb_define_method(m_rb_fann_shortcut_class, "print_connections", print_connections, 0);
|
1654
1658
|
rb_define_method(m_rb_fann_shortcut_class, "print_parameters", print_parameters, 0);
|
1655
1659
|
rb_define_method(m_rb_fann_shortcut_class, "randomize_weights", randomize_weights, 2);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// For Pre-1.9 ruby:
|
2
|
+
#ifndef RUBY_19
|
3
|
+
#ifndef RFLOAT_VALUE
|
4
|
+
#define RFLOAT_VALUE(v) (RFLOAT(v)->value)
|
5
|
+
#endif
|
6
|
+
#ifndef RARRAY_LEN
|
7
|
+
#define RARRAY_LEN(v) (RARRAY(v)->len)
|
8
|
+
#endif
|
9
|
+
#ifndef RARRAY_PTR
|
10
|
+
#define RARRAY_PTR(v) (RARRAY(v)->ptr)
|
11
|
+
#endif
|
12
|
+
#endif
|
data/lib/ruby_fann/neurotica.rb
CHANGED
@@ -48,8 +48,8 @@ module RubyFann
|
|
48
48
|
fillcolor = "transparent" # : "khaki3"
|
49
49
|
layer = neuron[:layer]
|
50
50
|
fillcolor = case layer
|
51
|
-
when 0
|
52
|
-
when max_layer
|
51
|
+
when 0 then @input_layer_color
|
52
|
+
when max_layer then @output_layer_color
|
53
53
|
else; @hidden_layer_colors[(layer-1) % @hidden_layer_colors.length]
|
54
54
|
end
|
55
55
|
|
data/lib/ruby_fann/version.rb
CHANGED
data/neurotica1.png
CHANGED
Binary file
|
data/neurotica2.vrml
CHANGED
@@ -4,7 +4,7 @@ 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
|
7
|
+
# node 2152233720
|
8
8
|
Transform {
|
9
9
|
translation 6.000 47.000 0.000
|
10
10
|
scale 1.800 1.800 1.800
|
@@ -24,7 +24,7 @@ Transform {
|
|
24
24
|
}
|
25
25
|
]
|
26
26
|
}
|
27
|
-
# node
|
27
|
+
# node 2152233020
|
28
28
|
Transform {
|
29
29
|
translation 50.000 7.000 0.000
|
30
30
|
scale 1.800 1.800 1.800
|
@@ -44,7 +44,7 @@ Transform {
|
|
44
44
|
}
|
45
45
|
]
|
46
46
|
}
|
47
|
-
# edge
|
47
|
+
# edge 2152233720 -> 2152233020
|
48
48
|
Group { children [
|
49
49
|
Transform {
|
50
50
|
children [
|
@@ -79,7 +79,7 @@ Transform {
|
|
79
79
|
translation 24.000 17.000 0.000
|
80
80
|
}
|
81
81
|
] }
|
82
|
-
# node
|
82
|
+
# node 2152233580
|
83
83
|
Transform {
|
84
84
|
translation 28.000 47.000 0.000
|
85
85
|
scale 1.800 1.800 1.800
|
@@ -99,7 +99,7 @@ Transform {
|
|
99
99
|
}
|
100
100
|
]
|
101
101
|
}
|
102
|
-
# edge
|
102
|
+
# edge 2152233580 -> 2152233020
|
103
103
|
Group { children [
|
104
104
|
Transform {
|
105
105
|
children [
|
@@ -134,7 +134,7 @@ Transform {
|
|
134
134
|
translation 35.000 17.000 0.000
|
135
135
|
}
|
136
136
|
] }
|
137
|
-
# node
|
137
|
+
# node 2152233440
|
138
138
|
Transform {
|
139
139
|
translation 50.000 47.000 0.000
|
140
140
|
scale 1.800 1.800 1.800
|
@@ -154,7 +154,7 @@ Transform {
|
|
154
154
|
}
|
155
155
|
]
|
156
156
|
}
|
157
|
-
# edge
|
157
|
+
# edge 2152233440 -> 2152233020
|
158
158
|
Group { children [
|
159
159
|
Transform {
|
160
160
|
children [
|
@@ -189,7 +189,7 @@ Transform {
|
|
189
189
|
translation 46.000 17.000 0.000
|
190
190
|
}
|
191
191
|
] }
|
192
|
-
# node
|
192
|
+
# node 2152233300
|
193
193
|
Transform {
|
194
194
|
translation 72.000 47.000 0.000
|
195
195
|
scale 1.800 1.800 1.800
|
@@ -209,7 +209,7 @@ Transform {
|
|
209
209
|
}
|
210
210
|
]
|
211
211
|
}
|
212
|
-
# edge
|
212
|
+
# edge 2152233300 -> 2152233020
|
213
213
|
Group { children [
|
214
214
|
Transform {
|
215
215
|
children [
|
@@ -244,7 +244,7 @@ Transform {
|
|
244
244
|
translation 57.000 17.000 0.000
|
245
245
|
}
|
246
246
|
] }
|
247
|
-
# node
|
247
|
+
# node 2152233160
|
248
248
|
Transform {
|
249
249
|
translation 94.000 47.000 0.000
|
250
250
|
scale 1.800 1.800 1.800
|
@@ -264,7 +264,7 @@ Transform {
|
|
264
264
|
}
|
265
265
|
]
|
266
266
|
}
|
267
|
-
# edge
|
267
|
+
# edge 2152233160 -> 2152233020
|
268
268
|
Group { children [
|
269
269
|
Transform {
|
270
270
|
children [
|
data/script/txt2html
CHANGED
@@ -22,9 +22,9 @@ class Fixnum
|
|
22
22
|
return 'th' if (10..19).include?(self % 100)
|
23
23
|
# others
|
24
24
|
case self % 10
|
25
|
-
when 1
|
26
|
-
when 2
|
27
|
-
when 3
|
25
|
+
when 1 then return 'st'
|
26
|
+
when 2 then return 'nd'
|
27
|
+
when 3 then return 'rd'
|
28
28
|
else return 'th'
|
29
29
|
end
|
30
30
|
end
|
data/test/test_ruby_fann.rb
CHANGED
@@ -317,39 +317,39 @@ class RubyFannTest < Test::Unit::TestCase
|
|
317
317
|
end
|
318
318
|
|
319
319
|
def test_cascade_output_change_fraction
|
320
|
-
verify_fann_attribute(:cascade_output_change_fraction, 0.222)
|
320
|
+
verify_fann_attribute(:cascade_output_change_fraction, 0.222, true)
|
321
321
|
end
|
322
322
|
|
323
323
|
def test_cascade_output_stagnation_epochs
|
324
|
-
verify_fann_attribute(:cascade_output_stagnation_epochs, 4)
|
324
|
+
verify_fann_attribute(:cascade_output_stagnation_epochs, 4, true)
|
325
325
|
end
|
326
326
|
|
327
327
|
def test_cascade_candidate_change_fraction
|
328
|
-
verify_fann_attribute(:cascade_candidate_change_fraction, 0.987)
|
328
|
+
verify_fann_attribute(:cascade_candidate_change_fraction, 0.987, true)
|
329
329
|
end
|
330
330
|
|
331
331
|
def test_cascade_candidate_stagnation_epochs
|
332
|
-
verify_fann_attribute(:cascade_candidate_stagnation_epochs, 5)
|
332
|
+
verify_fann_attribute(:cascade_candidate_stagnation_epochs, 5, true)
|
333
333
|
end
|
334
334
|
|
335
335
|
def test_cascade_weight_multiplier
|
336
|
-
verify_fann_attribute(:cascade_weight_multiplier, 0.754)
|
336
|
+
verify_fann_attribute(:cascade_weight_multiplier, 0.754, true)
|
337
337
|
end
|
338
338
|
|
339
339
|
def test_cascade_candidate_limit
|
340
|
-
verify_fann_attribute(:cascade_candidate_limit, 0.222)
|
340
|
+
verify_fann_attribute(:cascade_candidate_limit, 0.222, true)
|
341
341
|
end
|
342
342
|
|
343
343
|
def test_cascade_cascade_max_out_epochs
|
344
|
-
verify_fann_attribute(:cascade_max_out_epochs, 77)
|
344
|
+
verify_fann_attribute(:cascade_max_out_epochs, 77, true)
|
345
345
|
end
|
346
346
|
|
347
347
|
def test_cascade_max_cand_epochs
|
348
|
-
verify_fann_attribute(:cascade_max_cand_epochs, 66)
|
348
|
+
verify_fann_attribute(:cascade_max_cand_epochs, 66, true)
|
349
349
|
end
|
350
350
|
|
351
351
|
def test_cascade_num_candidate_groups
|
352
|
-
verify_fann_attribute(:cascade_num_candidate_groups, 6)
|
352
|
+
verify_fann_attribute(:cascade_num_candidate_groups, 6, true)
|
353
353
|
end
|
354
354
|
|
355
355
|
def test_cascade_num_candidates
|
@@ -428,10 +428,16 @@ class RubyFannTest < Test::Unit::TestCase
|
|
428
428
|
|
429
429
|
private
|
430
430
|
# Set & get fann attribute & verify:
|
431
|
-
def verify_fann_attribute(attr, val)
|
432
|
-
fann =
|
433
|
-
|
434
|
-
|
431
|
+
def verify_fann_attribute(attr, val, shortcut=false)
|
432
|
+
fann = nil
|
433
|
+
if shortcut
|
434
|
+
fann = RubyFann::Shortcut.new(:num_inputs=>1, :num_outputs=>1)
|
435
|
+
else
|
436
|
+
fann = RubyFann::Standard.new(:num_inputs=>1, :hidden_neurons=>[3, 4, 3, 4], :num_outputs=>1)
|
437
|
+
end
|
438
|
+
fann.send("set_#{attr}", val)
|
439
|
+
retrieved_val = fann.send("get_#{attr}")
|
440
|
+
assert_equal(val, retrieved_val)
|
435
441
|
end
|
436
442
|
|
437
443
|
end
|
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">1.
|
36
|
+
<a href="http://rubyforge.org/projects/ruby-fann" class="numbers">1.1.3</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
|
<h2>Documentation</h2>
|
@@ -59,6 +59,7 @@
|
|
59
59
|
<h2>Unit Tests:</h2>
|
60
60
|
<p>ruby-fann Gem has full complement of unit tests that are executed before the gem is deployed/redeployed to RubyForge.</p>
|
61
61
|
<h2>Demonstration of usage</h2>
|
62
|
+
<p><em>Note: this example was segfaulting in <span class="caps">IRB</span>, but not when run as a regular ruby program. It has been fixed in the 1.0.3 version.</em></p>
|
62
63
|
<p><pre class='syntax'>
|
63
64
|
<span class="ident">require</span> <span class="punct">'</span><span class="string">rubygems</span><span class="punct">'</span>
|
64
65
|
<span class="ident">require</span> <span class="punct">'</span><span class="string">ruby_fann/neural_network</span><span class="punct">'</span>
|
@@ -103,7 +104,7 @@ end
|
|
103
104
|
<h2>Contact</h2>
|
104
105
|
<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>
|
105
106
|
<p class="coda">
|
106
|
-
<a href="steven@7bpeople.com">Steven Miers</a>,
|
107
|
+
<a href="steven@7bpeople.com">Steven Miers</a>, 24th December 2009<br>
|
107
108
|
</p>
|
108
109
|
</div>
|
109
110
|
|
data/website/index.txt
CHANGED
@@ -29,7 +29,8 @@ h2. Unit Tests:
|
|
29
29
|
ruby-fann Gem has full complement of unit tests that are executed before the gem is deployed/redeployed to RubyForge.
|
30
30
|
|
31
31
|
h2. Demonstration of usage
|
32
|
-
|
32
|
+
|
33
|
+
_Note: this example was segfaulting in IRB, but not when run as a regular ruby program. It has been fixed in the 1.0.3 version._
|
33
34
|
|
34
35
|
<pre syntax="ruby">
|
35
36
|
require 'rubygems'
|
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,
|
34
|
-
connections (connected_to_neuron, weight)=(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, 5.00000000000000000000e-01) (4, 3, 5.00000000000000000000e-01) (5, 5, 5.00000000000000000000e-01)
|
34
|
+
connections (connected_to_neuron, weight)=(0, 3.10708883886891351622e+00) (1, 3.10338071470814691466e+00) (2, 7.65357121957630642806e-02) (0, -1.09105405579982245312e-01) (1, 1.38516815257072739564e-01) (2, -5.57924056685979294912e+01) (3, 4.27822468842962849722e-02) (0, 2.60853981357382913586e-01) (1, 2.64955208099198424865e-01) (2, 2.30283002889318688666e-01) (3, 3.95939688330888941437e+01) (4, 2.43605282094651487412e-01)
|
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, 2.
|
34
|
+
connections (connected_to_neuron, weight)=(0, -2.73488929137393732560e+00) (1, 2.62393843594422904175e+00) (2, -1.89478715786915508090e+00) (0, 1.95305696104393855528e+00) (1, -1.84806794977636967836e+00) (2, -1.61445312371210136781e+00) (0, 1.75384548885381619243e+00) (1, -1.73045722542488666917e+00) (2, -1.31898702062678485625e+00) (3, 4.47716800493138489259e+00) (4, 1.34492352041529561468e+00) (5, 3.05774558646827809838e+00) (6, 3.68831561498669424637e+00)
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-fann
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
version: 1.1.3
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Steven Miers
|
@@ -9,19 +14,51 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-03-15 00:00:00 -05:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
21
|
+
name: rubyforge
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 0
|
30
|
+
- 4
|
31
|
+
version: 2.0.4
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: gemcutter
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
- 5
|
44
|
+
- 0
|
45
|
+
version: 0.5.0
|
17
46
|
type: :development
|
18
|
-
|
19
|
-
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: hoe
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
20
52
|
requirements:
|
21
53
|
- - ">="
|
22
54
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
55
|
+
segments:
|
56
|
+
- 2
|
57
|
+
- 5
|
58
|
+
- 0
|
59
|
+
version: 2.5.0
|
60
|
+
type: :development
|
61
|
+
version_requirements: *id003
|
25
62
|
description: Bindings to use FANN from within ruby/rails environment.
|
26
63
|
email: steven@7bpeople.com
|
27
64
|
executables: []
|
@@ -45,9 +82,11 @@ files:
|
|
45
82
|
- ext/ruby_fann/MANIFEST
|
46
83
|
- ext/ruby_fann/Makefile
|
47
84
|
- ext/ruby_fann/extconf.rb
|
85
|
+
- ext/ruby_fann/ruby_compat.h
|
48
86
|
- ext/ruby_fann/fann_augment.h
|
49
87
|
- ext/ruby_fann/neural_network.c
|
50
88
|
- ext/ruby_fann/doublefann.h
|
89
|
+
- ext/ruby_fann/config.h
|
51
90
|
- ext/ruby_fann/fann_error.h
|
52
91
|
- ext/ruby_fann/fann_activation.h
|
53
92
|
- ext/ruby_fann/fann_data.h
|
@@ -104,18 +143,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
143
|
requirements:
|
105
144
|
- - ">="
|
106
145
|
- !ruby/object:Gem::Version
|
146
|
+
segments:
|
147
|
+
- 0
|
107
148
|
version: "0"
|
108
|
-
version:
|
109
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
150
|
requirements:
|
111
151
|
- - ">="
|
112
152
|
- !ruby/object:Gem::Version
|
153
|
+
segments:
|
154
|
+
- 0
|
113
155
|
version: "0"
|
114
|
-
version:
|
115
156
|
requirements: []
|
116
157
|
|
117
158
|
rubyforge_project: ruby-fann
|
118
|
-
rubygems_version: 1.3.
|
159
|
+
rubygems_version: 1.3.6
|
119
160
|
signing_key:
|
120
161
|
specification_version: 3
|
121
162
|
summary: Bindings to use FANN from within ruby/rails environment.
|