AI-NeuralNet-SOM
view release on metacpan or search on metacpan
lib/AI/NeuralNet/SOM.pm view on Meta::CPAN
I<$label> = I<$nn>->label (I<$x>, I<$y>)
I<$nn>->label (I<$x>, I<$y>, I<$label>)
Set or get the label for a particular neuron. The neuron is addressed via its coordinates.
The label can be anything, it is just attached to the position.
=cut
sub label {
my $self = shift;
my ($x, $y) = (shift, shift);
my $l = shift;
return defined $l ? $self->{labels}->[$x]->[$y] = $l : $self->{labels}->[$x]->[$y];
}
=pod
=item I<as_string>
print I<$nn>->as_string
This methods creates a pretty-print version of the current vectors.
=cut
sub as_string { die; }
=pod
=item I<as_data>
print I<$nn>->as_data
This methods creates a string containing the raw vector data, row by
row. This can be fed into gnuplot, for instance.
=cut
sub as_data { die; }
=pod
=back
=head1 HOWTOs
=over
=item I<using Eigenvectors to initialize the SOM>
See the example script in the directory C<examples> provided in the
distribution. It uses L<PDL> (for speed and scalability, but the
results are not as good as I had thought).
=item I<loading and saving a SOM>
See the example script in the directory C<examples>. It uses
C<Storable> to directly dump the data structure onto disk. Storage and
retrieval is quite fast.
=back
=head1 FAQs
=over
=item I<I get 'uninitialized value ...' warnings, many of them>
There is most likely something wrong with the C<input_dim> you
specified and your vectors should be having.
=back
=head1 TODOs
=over
=item maybe implement the SOM on top of PDL?
=item provide a ::SOM::Compat to have compatibility with the original AI::NeuralNet::SOM?
=item implement different window forms (bubble/gaussian), linear/random
=item implement the format mentioned in the original AI::NeuralNet::SOM
=item add methods as_html to individual topologies
=item add iterators through vector lists for I<initialize> and I<train>
=back
=head1 SUPPORT
Bugs should always be submitted via the CPAN bug tracker
L<https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=AI-NeuralNet-SOM>
=head1 SEE ALSO
Explanation of the algorithm:
L<http://www.ai-junkie.com/ann/som/som1.html>
Old version of AI::NeuralNet::SOM from Alexander Voischev:
L<http://backpan.perl.org/authors/id/V/VO/VOISCHEV/>
Subclasses:
L<AI::NeuralNet::Hexa>
L<AI::NeuralNet::Rect>
L<AI::NeuralNet::Torus>
=head1 AUTHOR
Robert Barta, E<lt>rho@devc.atE<gt>
=head1 COPYRIGHT AND LICENSE
( run in 0.715 second using v1.01-cache-2.11-cpan-5a3173703d6 )