AI-NNFlex
view release on metacpan or search on metacpan
The backprop calculation was nailed to 1-y*y, which is the
derivative of tanh, so only tanh hidden layers would work.
Thats now been removed, and a function in linear & tanh called
<activation function>_slope implemented, which returns the
slope. I haven't implemented a slope function in sigmoid, for
the simple reason that I need to learn how to integrate the
function to find out what the slope is!
This version introduces a new, friendlier constructor. Instead
of the pair of anonymous hashes previously required, the
constructor now takes fairly normal looking parameters. Layers
are added to a network using the add_layer method. This combines
a more intuitive approach with more flexibility.
The original constructor is not deprecated. Parameter names with
spaces in on the other hand ('activation function') are. They
should be replaced by the same parameter name without any spaces.
The new constructor will convert old format parameter names, but
its at the users risk.
See xor.pl or the perldoc & readme for examples.
lib/AI/NNFlex.pm view on Meta::CPAN
$outputLayer = ${$$network{'layers'}}[$params{'layer'}]
}
else
{
$outputLayer = $finalLayer
}
my $output = AI::NNFlex::layer::layer_output($outputLayer);
# Round outputs if required
if ($network->{'round'})
{
foreach (@$output)
{
if ($_ > 0.5)
{
$_ = 1;
}
elsif ($_ < -0.5)
{
( run in 0.738 second using v1.01-cache-2.11-cpan-8780591d54d )