Why not adopt me?
NAME
AI::ANN - an artificial neural network simulator
VERSION
version 0.001
SYNOPSIS
use AI::ANN; my $network = new AI::ANN ( $inputcount, \@neuron_definition ); my $outputs = $network->execute( \@inputs );
METHODS
new
ANN::new( $inputcount, [{ iamanoutput => 0, inputs => {$inputid => $weight, ...}, neurons => {$neuronid => $weight}}, ...] )
Inputcount is number of inputs. The arrayref is an arrayref of neuron definitions. The first neuron with iamanoutput=1 is output 0. The second is output 1. I hope you're seeing the pattern...
execute
$network->execute( [$input0, $input1, ...] )
Runs the network for as many iterations as necessary to achieve a stable network, then returns the output. We store the current state of the network in two places - once in the object, for persistence, and once in $neurons, for simplicity. This might be wrong, but I couldn't think of a better way.
get_state
$network->get_state()
Returns three arrayrefs, [$input0, ...], [$neuron0, ...], [$output0, ...], corresponding to the data from the last call to execute(). Intended primarily to assist with debugging.
get_input_count
$network->get_input_count()
Returns the number of inputs as a scalar.
get_internals
$network->get_internals()
Returns the weights in a not-human-consumable format.
readable
$network->readable()
Returns a human-friendly and diffable description of the network.
AUTHOR
Dan Collins <DCOLLINS@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Dan Collins.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007