AI-ANN

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision History for ANN

0.008     2011-06-13 06:52:38 UTC
          Add support for an Inline::C version of AI::ANN::Neuron::Execute.
          This is the default.

          Fix a few extra errors because of uninitialized values being sent to
          the C code. If you're using the inline::c stuff, be careful that 
          you don't skip any necessary inputs.

0.007     2011-06-12 04:44:46 UTC
          Add backprop, not tested.

          Evolver now allows you to pass a coderef for mutation_amount. It 
          will be evaluated with no arguments. If you pass a number instead, 
          it will be coerced into a uniform random value up to +/- your value.

_Inline/build/AI/ANN/Neuron_6185/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

_Inline/build/AI/ANN/Neuron_6185/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   Neuron_6185.xs > Neuron_6185.xsc && mv Neuron_6185.xsc Neuron_6185.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/t -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC...
Neuron_6185.xs: In function ‘_execute_internals’:
Neuron_6185.xs:21: error: redefinition of ‘v1’
Neuron_6185.xs:9: note: previous definition of ‘v1’ was here
Neuron_6185.xs:22: error: redefinition of ‘v2’
Neuron_6185.xs:10: note: previous definition of ‘v2’ was here
make: *** [Neuron_6185.o] Error 1

examples/_Inline/build/benchmark_pl_03a5/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_03a5/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_03a5.xs > benchmark_pl_03a5.xsc && mv benchmark_pl_03a5.xsc benchmark_pl_03a5.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_03a5.xs: In function ‘generate_globals’:
benchmark_pl_03a5.xs:11: error: array subscript is not an integer
benchmark_pl_03a5.xs:12: error: array subscript is not an integer
benchmark_pl_03a5.xs:12: error: invalid type argument of ‘unary *’ (have ‘int’)
make: *** [benchmark_pl_03a5.o] Error 1

examples/_Inline/build/benchmark_pl_3d06/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_3d06/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_3d06.xs > benchmark_pl_3d06.xsc && mv benchmark_pl_3d06.xsc benchmark_pl_3d06.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_3d06.xs: In function ‘generate_globals’:
benchmark_pl_3d06.xs:12: error: invalid type argument of ‘unary *’ (have ‘int’)
make: *** [benchmark_pl_3d06.o] Error 1

examples/_Inline/build/benchmark_pl_6dc1/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_6dc1/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_6dc1.xs > benchmark_pl_6dc1.xsc && mv benchmark_pl_6dc1.xsc benchmark_pl_6dc1.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_6dc1.xs: In function ‘generate_globals’:
benchmark_pl_6dc1.xs:12: error: invalid type argument of ‘unary *’ (have ‘int’)
benchmark_pl_6dc1.xs: In function ‘afunc_c’:
benchmark_pl_6dc1.xs:16: error: expected expression before ‘int’
benchmark_pl_6dc1.xs: In function ‘dafunc_c’:
benchmark_pl_6dc1.xs:19: error: expected expression before ‘int’
make: *** [benchmark_pl_6dc1.o] Error 1

examples/_Inline/build/benchmark_pl_ac1b/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_ac1b/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_ac1b.xs > benchmark_pl_ac1b.xsc && mv benchmark_pl_ac1b.xsc benchmark_pl_ac1b.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_ac1b.xs: In function ‘generate_globals’:
benchmark_pl_ac1b.xs:12: error: invalid type argument of ‘unary *’ (have ‘int’)
make: *** [benchmark_pl_ac1b.o] Error 1

examples/_Inline/build/benchmark_pl_b832/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_b832/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_b832.xs > benchmark_pl_b832.xsc && mv benchmark_pl_b832.xsc benchmark_pl_b832.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_b832.xs:5: fatal error: libm/math.h: No such file or directory
compilation terminated.
make: *** [benchmark_pl_b832.o] Error 1

examples/_Inline/build/benchmark_pl_b905/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_b905/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_b905.xs > benchmark_pl_b905.xsc && mv benchmark_pl_b905.xsc benchmark_pl_b905.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_b905.xs: In function ‘generate_globals’:
benchmark_pl_b905.xs:12: error: invalid type argument of ‘unary *’ (have ‘int’)
benchmark_pl_b905.xs: In function ‘afunc_c’:
benchmark_pl_b905.xs:16: error: array subscript is not an integer
benchmark_pl_b905.xs: In function ‘dafunc_c’:
benchmark_pl_b905.xs:19: error: array subscript is not an integer
make: *** [benchmark_pl_b905.o] Error 1

examples/_Inline/build/benchmark_pl_c51b/Makefile  view on Meta::CPAN

#     PREREQ_PM => {  }
#     TYPEMAPS => [q[/usr/share/perl/5.10/ExtUtils/typemap]]
#     VERSION => q[0.00]

# --- MakeMaker post_initialize section:


# --- MakeMaker const_config section:

# These definitions are from config.sh (via /usr/lib/perl/5.10/Config.pm).
# They may have been overridden via Makefile.PL or on the command line.
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
EXE_EXT = 
FULL_AR = /usr/bin/ar
LD = cc
LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector

examples/_Inline/build/benchmark_pl_c51b/out.make  view on Meta::CPAN

/usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp  -typemap /usr/share/perl/5.10/ExtUtils/typemap   benchmark_pl_c51b.xs > benchmark_pl_c51b.xsc && mv benchmark_pl_c51b.xsc benchmark_pl_c51b.c
cc -c  -I/home/st47/sit-bmelab-labview/EANN/ANN/examples -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\...
benchmark_pl_c51b.xs: In function ‘generate_globals’:
benchmark_pl_c51b.xs:12: error: invalid type argument of ‘unary *’ (have ‘int’)
benchmark_pl_c51b.xs: In function ‘afunc_c’:
benchmark_pl_c51b.xs:16: error: expected expression before ‘int’
benchmark_pl_c51b.xs: In function ‘dafunc_c’:
benchmark_pl_c51b.xs:19: error: expected expression before ‘int’
make: *** [benchmark_pl_c51b.o] Error 1

gpl.txt  view on Meta::CPAN


  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

gpl.txt  view on Meta::CPAN

or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we

gpl.txt  view on Meta::CPAN

to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of

gpl.txt  view on Meta::CPAN

procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for

gpl.txt  view on Meta::CPAN

not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the

lib/AI/ANN.pm  view on Meta::CPAN

				$net->[$i]->{'done'} = 1;
				$progress++;
			}
		}
	} while ($progress); # If the network is feed-forward, we are now finished.
	
	my @notdone = grep {not (defined $net->[$_]->{'done'} &&
							 $net->[$_]->{'done'} == 1)} 0..$lastneuron;
	my @neuronstemp = ();
	if ($#notdone > 0) { #This is the part where we deal with loops and bad things
		my $maxerror = 0;
		my $loopcounter = 1;
		while (1) {
			foreach my $i (@notdone) { # Only bother iterating over the
									   # ones we couldn't solve exactly
				# We don't care if it's ready now, we're just going to interate
				# until it stabilizes.
				if (not defined $neurons[$i] && $i <= $lastneuron) {
					# Fixes warnings about uninitialized values, but we make 
					# sure $i is valid first.
					$neurons[$i] = 0;
				}
				my $potential = $net->[$i]->{'object'}->execute($inputs, \@neurons);
                $self->{'rawpotentials'}->[$i] = $potential;
				$potential = &{$self->{'afunc'}}($potential);
				$potential = $self->{'maxvalue'} if $potential > $self->{'maxvalue'};
				$potential = $self->{'minvalue'} if $potential < $self->{'minvalue'};
				$neuronstemp[$i] = $net->[$i]->{'state'} = $potential;
				# We want to know the absolute change
				if (abs($neurons[$i]-$neuronstemp[$i])>$maxerror) {
					$maxerror = abs($neurons[$i]-$neuronstemp[$i]);
				}
			}
			foreach my $i (0..$lastneuron) { 
				# Update $neurons, since that is what gets passed to execute
				$neurons[$i] = $neuronstemp[$i];
			}
			if (($maxerror < 0.0001 && $loopcounter >= 5) || $loopcounter > 250) {last}
			$loopcounter++;
			$maxerror=0;
		}
	}

	# Ok, hopefully all the neurons have happy values by now.
	# Get the output values for neurons corresponding to outputneurons
	my @output = map {$neurons[$_]} @{$self->{'outputneurons'}};
	return \@output;
}




( run in 1.469 second using v1.01-cache-2.11-cpan-49f99fa48dc )