You are on page 1of 518

UNIVERSIDAD PONTIFICIA COMILLAS

ESCUELA TCNICA SUPERIOR DE INGENIERA (ICAI)


INGENIERO EN INFORMATICA

PROYECTO FIN DE CARRERA

FRAMEWORK PARA
REDES NEURONALES EN JAVA

AUTOR:

MIGUEL LARA ENCABO


MADRID, Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Autorizada la entrega del proyecto del alumno/a:


MIGUEL LARA ENCABO
..........................................................

EL DIRECTOR DEL PROYECTO


JUAN CARLOS ESQUIVEL DAZ
Fdo.: ........................

Fecha: ....../ ....../ ......

Vo Bo del Coordinador de Proyectos


MIGUEL NGEL SANZ BOBI
Fdo.: ........................

Fecha: ....../ ....../ ......

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

FRAMEWORK PARA REDES NEURONALES EN JAVA


Autor: Lara Encabo, Miguel.
Director: Esquivel Daz, Juan Carlos.
Entidad Colaboradora: ICAI Universidad Pontificia Comillas

RESUMEN DEL PROYECTO


Se desea construir una solucin completa que permita a desarrolladores de software
crear, educar y utilizar Redes Neuronales Artificiales (RNAs) en proyectos de reales
de Java. Para lograrlo se propone el desarrollo de dos elementos: JCortex, framework
para Redes Neuronales Artificiales en Java; y JCortexBuilder, entorno grfico de
desarrollo para JCortex.
Desde el comienzo del diseo y estudio de este proyecto, se prest gran atencin a la
combinacin de framework y entorno de desarrollo; ya que es imprescindible para su
futuro contar con un IDE (Entorno Integrado de Desarrollo) fcil de usar y potente
que pueda complementar a JCortex.
El objetivo principal en el desarrollo del framework ha sido lograr un sistema
prctico, que pueda ser utilizado por la comunidad de programadores de Java para
resolver exigencias reales de sus aplicaciones. Para ello el framework ha de permitir
desarrollar sobre l soluciones basadas en RNAs con distintos niveles de profundidad
segn el tipo de usuario, personalizar las redes y su funcionamiento, recurrir a los
modelos ms habituales de RNAs ya implantados, poder aadir cmodamente
nuevos modelos, etc. Adems se debe permitir un entorno que enmascare las bases
matemticas a los usuarios que prefieran ignorarlas. El fin ltimo es lograr que
sobreviva el fin de carrera y se convierta en un proyecto de cdigo abierto que
contine su crecimiento y evolucin. Para ello se ha habilitado la direccin
http://www.jcortex.com desde la que se puede acceder a las ltimas versiones,
manuales y tutoriales.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

II

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

El anlisis de viabilidad del proyecto dio un resultado positivo. Estudiando el estado


de la tecnologa, se puede advertir que existe tanto la oportunidad como la necesidad
de proporcionar un sistema de creacin de RNAs dirigida a desarrolladores de
software. Estos usuarios exigen las mejores prestaciones de un framework desde el
punto de vista de la ingeniera de software, pero en general desconocen o no tienen
inters en conocer las bases y teora detrs de las soluciones de RNAs. Siempre
manteniendo abierta la posibilidad de que haya un usuario que desee adentrarse. Este
es un nicho de oportunidad que otras soluciones ya existentes como JOONE o Matlab
no alcanzan a cubrir. Al ser ste un proyecto de investigacin bsica no tiene muchas
tablas para defenderse ante un anlisis de viabilidad econmico. Sin embargo,
considerando que se enmarca dentro del mbito de un proyecto acadmico no
remunerado, no es despreciable.

Entrando en el diseo e implantacin del framework JCortex, se parte de la idea de


que la riqueza del mismo no radica en proporcionar un gran nmero de
funcionalidades completas y soluciones cerradas. Lo realmente importante es ofrecer
una estructura slida sobre la que se puedan construir soluciones basadas en RNAs.
Para crear un framework de Java con las mximas garantas, se han marcado unas
normas metodolgicas que pasan por seguir estrictamente el Principio AbiertoCerrado (facilitado con el Principio de Inversin de Dependencias), el Principio de
Segregacin de Interfaces y la Ley de Demeter, en la medida en que sta no afecte en
exceso al rendimiento. La incorporacin de Patrones de Diseo de Orientacin a
Objetos (Gang of Four, GoF) proporciona una seguridad adicional. En el framework
se emplean entre otros Template Method, Observer, Singleton, Composite A su vez
se ha definido una metodologa estricta para el trabajo con datos de configuracin en
XML, al ser este un entorno predispuesto a soluciones no demasiado correctas.
Para lograr un sistema slido, verstil y til se recurri a un modelo conceptual
modular que evolucion hasta el sistema definitivo en el que las funciones estn
repartidas en mdulos (clases o interfaces) que tienen su contrato, responsabilidad,
interfaz y funcionalidades claramente definidos. En el paquete com.jcortex se
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

III

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


recogen las interfaces y clases abstractas generales, as como las constantes y
utilidades comunes. Se puede destacar como principales las clases abstractas:
NeuralNetwork que recoge el funcionamiento y estructura interna de la red, Neuron
para formar las estructuras de la red, Teacher para educar la red mediante algoritmos
supervisados o no supervisados Tambin recoge el sistema de estadsticas de los
entrenamientos, que gira en torno a la clase Statistics, y a los ProgressAnalyzers que
se encargan de estudiar los valores registrados con el fin de detener un entrenamiento
antes de que se alcance el sobreaprendizaje. A partir del paquete com.jcortex se van
aadiendo el resto que forma la jerarqua del framework. En lo que se podra
encontrar el ncleo del framework encontramos com.jcortex.activationFunctions,
.distanceFunctions, .networkFunctions y .translators, que recogen las funciones
matemticas y los traductores de entrada y salida bsicos distribuidos con JCortex.
Las redes no estn restringidas a su uso exclusivo, sino que se pueden crear nuevas
funciones y traductores extendiendo las interfaces presentes en el paquete principal.
JCortex soporta la internacionalizacin y localizacin a travs de Resource Bundles.
Entre los modelos de red distribuidos con el framework se encuentran los que se han
considerado ms dispares y ms utilizados en el mundo real: las Redes de Hopfield,
los Mapas de Kohonen y a partir de las redes Feed-Forward el modelo Perceptrn y
el Perceptrn Multicapa con el mecanismo de retropropagacin. Estas redes se
incluyen en los paquetes de modelos com.jcortex.hopfield, .kohonen, .feedForward
y .backPropagation. Un desarrollador puede crear sus propios modelos de red
extendiendo, al menos, las clases NeuralNetwork y Teacher, y opcionalmente Neuron
si fuera necesario. Todos estos modelos de red han sido completamente implantados,
recurriendo a una metodologa de pruebas continuas de eficacia y posteriormente de
eficiencia realizando un profiling de la ejecucin de sus entrenamientos. Con esta
optimizacin se procuraba obtener el doble beneficio de afinar el ncleo framework al
mximo, y distribuir modelos realmente tiles

El entorno de desarrollo JCortexBuilder fue construido bajo la premisa de no lastrar


en modo alguno el funcionamiento del framework. Se puede considerar este entorno
como la prueba de fuego de JCortex. JCortexBuilder permite crear redes neuronales
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

IV

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


de los modelos ofrecidos, gestionar mltiples entrenamientos simultneos, almacenar
la red en formato XML, exportarla a su proyecto Java definitivo e incluso documentar
de forma grfica la red diseada. Y lo ms importante: es lo suficientemente dinmico
y ofrece las funcionalidades necesarias para ser personalizado y absorber los nuevos
modelos de red y mdulos que cree el usuario. Todas las clases y paquetes del entorno
cuelgan

del

paquete com.jcortex.builder. El

sistema est completamente

internacionalizado con localizaciones gestionadas mediante Resource Bundles.

Desde el punto de vista puramente tcnico se puede considerar que el proyecto ha


sido un xito, ya que cumple con los objetivos iniciales, a pesar de que algunos
objetivos secundarios hayan tenido que ser relegados para versiones futuras en favor
de una mejor consecucin del primario.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

NEURAL NETWORKS FRAMEWORK FOR JAVA

The aim to build a complete solution for that will allow software developers to create,
educate and use Artificial Neural Networks (ANNs) in real-life Java projects. To
achieve this goal two elements will be developed: JCortex, an Artificial Neural
Network framework for Java; and JCortexBuilder, the graphic environment for
developing solutions on JCortex.
Right from the beginning of the design and study process, great attention was devoted
to the combination of framework and developing environment; as it is essential for its
future to have a IDE easy to use and powerful that can complete JCortex.
The main objective on the development of the framework has been to achieve a
useful system that can be used by the Java community of Java programmers to
comply with their applications real demands. For this the framework must allow the
to develop on top of it ANN-based solutions at different levels of depth, according to
the kind of user, customize the networks and how they work, use the most common
ANN models already provided, conveniently add new models, etc. Moreover, it must
allow an environment that can hide the mathematic basis from the users who prefer to
ignore them. The final objective is to create a project that can survive the End-ofDegree assignment in order to become an open-source project that can continue its
growth and evolution. The online site http://www.jcortex.com has been created so it
can become the headquarters from which the latest versions, manuals and tutorials can
be obtained.

The projects Feasibility Analysis produced a positive result. Studying state-of-the-art


technology available in these areas, it can be noticed that both the need and the
opportunity exists for providing a ANN creation system aimed at software developers.
These users demand the best performance from a framework from the point of view
of software engineering, but in the general picture they have no idea or have no
interest in knowing the basis the theory behind ANN solutions. Yet the possibility

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

VI

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


must remain open that there can be a user who really wants to get into it. This is an
opportunity niche that other present solutions such as JOONE and Matlab do not
really fulfil. As this is a basic-technology investigation project it has little strength to
stand against an Economic Feasibility Analysis. Anyhow, considering it is framed
inside a non-remunerated academic project, it is not despisable.

Looking into the design and programming of the JCortex framework, we start from
the idea that it richness does not stand in the possibility of offering a large number of
complex and closed solutions. What is really important is to offer a strong structure
on which ANN based solutions can be built upon. To create a Java framework with
the highest guarantees some methodology rules have been set. These cover the strict
use of the Open-Close Principle (helped by the Dependency Inversion Principle), the
Interface Segregation Principle and Demeters Law to an extend in which it does not
hurt too much performance. The inclusion of Object Oriented Design Patters (Gang of
Four, GoF) offers an additional safety. In the framework can be found among many
others Template Method, Observer, Singleton, Composite At the same time, a
strict methodology for working with XML configuration data has been defined, as this
is an environment predispose to not-very-correct solutions.
In order to obtain a solid, versatile and useful system a modular conceptual model was
chosen. The modular paradigm evolved until it became the final architecture in which
functions are divided into modules (classes and interfaces) that have clearly defined
contracts, responsibilities, interface and functionalities. The package com.jcortex
collects all common interfaces and abstract classes, as well as the constants and
utilities used throughout the whole framework. The most important abstract classes
can be pointed out: NeuralNetwork covers how the network works and its inner
structure, Neuron to make up the networks structure, Teacher to train the red with
supervised or non-supervised algorithms It also gathers the training statistics
system that is centred on the class Statistics, and the ProgressAnalyzers in charge of
studying the values recorded so they can stop the training before the network learns
too much. Hung from the main package, com.jcortex, the rest of the frameworks
hierarchy is grown. The frameworks kernel holds com.jcortex.activationFunctions,
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

VII

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


.distanceFunctions,

.networkFunctions

and

.translators,

that

collect

the

mathematical functions as well as the input and output translators distributed with
JCortex. Networks are not tied to their exclusive use, but new functions and
translators can be created to meet the users needs, by extending the interfaces from
the main package. JCortex supports internationalization and localization through
Resource Bundles.
Among the network models distributed with the framework are the ones that have
been considered the most different and the most widely used in the real world: the
Hopfield Networks, Kohonen Maps and, granted by the Feed-Forward model, the
Perceptron Network and the Multilayer Perceptron Network with the backpropagation mechanism. These networks are included in the models packages
com.jcortex.hopfield, .kohonen, .feedForward and .backPropagation. A developer
can create its own network models extending, at least, NeuralNetwork and Teacher
classes, and optionally Neuron if it is required. All these network models have been
fully programmed using a method of continuous effectiveness tests and later
efficiency tests, making a profile of the trainings executions. Through this
optimization process we expect to achieve the double benefit of tuning the
frameworks kernel to the maximum, and distributing really useful network models.

The JCortexBuilder developing environment has been built under the premise of not
lumbering the frameworks work. This environment can be considered as the acid test
of JCortex. JCortexBuilder simplifies the creation of neural networks for the given
models, manages multiple simultaneous trainings, stores the network in XML files,
exports the working result into the users Java project and it even helps graphically
documenting the designed network. And, above all, it is dynamic enough to offer the
required facilities for its customization and to absorb the new network models and any
user-created module. All the environments classes and packages are hung from the
main package com.jcortex.builder. The system is completely internationalized and
localized using Resource Bundles.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006 VIII

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


From the purely technical point of view, it can be considered that the project has been
a success., as it accomplishes the initial objectives, although some of the secondary
aims have had to be left behind for future versions, in favour of a better achievement
of the primary objectives.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

IX

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

ndice del documento


1. Descripcin del proyecto ....................................................................................... 6
2. Objetivos............................................................................................................... 7
3. Motivaciones......................................................................................................... 8
4. Estudio de viabilidad ............................................................................................. 9
4.1. Anlisis de necesidad y oportunidad ............................................................... 9
4.1.1 Alternativas ya existentes.......................................................................... 9
4.2. Anlisis econmico....................................................................................... 10
4.4. Planificacin................................................................................................. 11
4.3. Conclusin de los anlisis de viabilidad........................................................ 13
5. Desarrollo del framework JCortex ....................................................................... 14
5.1 Descripcin del Framework JCortex .............................................................. 15
5.2. Metodologa de desarrollo ............................................................................ 16
5.2.1. Uso de Patrones de Diseo O.O. ............................................................ 17
5.2.2. Optimizacin iterativa de los modelos de red ......................................... 18
5.2.3. Metodologa de trabajo con XML .......................................................... 20
a) Mtodos para el almacenamiento de la configuracin (Store)................... 21
b) Mtodos para la recuperacin de la configuracin (Load) ........................ 23
c) Formato bsico de los documentos XML generados por JCortex.............. 24
5.3. Modelo Conceptual de Redes Neuronales ..................................................... 26
5.4. Modelo Lgico del framework...................................................................... 28
5.4. El sistema de paquetes com.jcortex.*. .................................................. 30
5.5. Paquetes del ncleo ...................................................................................... 31
5.5.1. Estructura esencial de la Red Neuronal .................................................. 35
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


a. Propagacin en una Red Neuronal............................................................ 37
b. Exportar una Red Neuronal en XML........................................................ 38
5.5.2. Relacin entre AxonSource, AxonReceiver, Sensor y Neuron. 40
a) Puntualizaciones sobre las neuronas (Neuron) ....................................... 42
b) Sensores y neuronas desde el punto de vista de NeuralNetwork ......... 42
5.5.3. Los Traductores ..................................................................................... 44
5.5.4. Las Funciones........................................................................................ 47
a)

Funciones de Activacin....................................................................... 48

b)

Funciones de Activacin para Back-Propagation ................................. 50

c)

Funciones de Distancia ......................................................................... 51

d)

Funciones de Red ................................................................................. 52

5.5.6. El Maestro (Teacher).......................................................................... 53


a) La clase abstracta Teacher.................................................................... 53
b) Mtodo educateNetwork() Genrico............................................... 55
c) Mtodo educateNetwork() Iterativo ................................................ 56
d) Reparto de los conjuntos de ejemplos ...................................................... 58
5.5.7. Recogida y anlisis de Estadsticas......................................................... 62
a) El Modelo de Datos de las Estadsticas .................................................... 63
b) Recogida de datos estadsticos ................................................................. 65
c) Las Estadsticas y sus Analizadores ......................................................... 66
d) Estructura de los Analizadores de Estadsticas ......................................... 66
e) Analizador ValueDecreaseAnalyzer.............................................. 67
f) Analizador ValueVariationAnalyzer............................................ 69
g) Analizador ComposedProgressAnalyzer ...................................... 70
h) Informacin sobre la parada..................................................................... 71
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


h) El modelo de StatisticListener ................................................... 71
5.5.8. Internacionalizacin y localizacin ........................................................ 73
5.5.9. Utilidades en el paquete bsico .............................................................. 74
a) Utilidades en ConsoleUtilities...................................................... 74
b) Utilidades en LoadAndStoreUtilities .......................................... 74
5.6. Paquetes de Modelos de red.......................................................................... 76
5.6.1. Indicaciones de construccin para modelos de Redes Neuronales
artificiales en JCortex ...................................................................................... 78
5.6.2. Redes de Hopfield (com.jcortex.hopfield)............................... 79
a. Descripcin de la Red .............................................................................. 79
b. Diseo del modelo ................................................................................... 79
c.- Propagacin en la red de Hopfield .......................................................... 81
d. Entrenamiento de una Red de Hopfield.................................................... 85
e. Serializacin en XML .............................................................................. 87
5.6.3. Mapas de Kohonen (com.jcortex.kohonen) ................................. 89
a. Descripcin de la Red .............................................................................. 89
b. Diseo del modelo ................................................................................... 89
c. Propagacin ............................................................................................. 98
d. Maestro DefaultKohonenTeacher ................................................ 100
e. Clculo de los Vecindarios..................................................................... 102
f. Construccin de las Matrices de Conexin Directa ................................. 105
g. Serializacin en XML ............................................................................ 114
5.6.4. Modelo Genrico Feed-Forward.......................................................... 116
a. Descripcin de la red genrica................................................................ 116
b. Diseo del modelo de propagacin - ToDoList ...................................... 116

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


5.6.4. Modelo Perceptrn (com.jcortex.feedForward) ...................... 123
a. Descripcin de la Red ............................................................................ 123
b. Diseo del modelo ................................................................................. 123
c. Propagacin ........................................................................................... 123
d. Maestro DefaultPerceptronTeacher ......................................... 124
f. Serializacin en XML............................................................................. 125
5.6.5. Modelo Preceptrn Multicapa (com.jcortex.backPropagation)
...................................................................................................................... 127
a. Descripcin de la Red ............................................................................ 127
b. Diseo del modelo ................................................................................. 128
c. Propagacin ........................................................................................... 130
d. Maestro DefaultMultilayerPerceptronTeacher .................. 130
e. Serializacin en XML ............................................................................ 132
5.7. Estudio de Optimizacin............................................................................. 134
5.7.1. Entrenamiento de un Perceptrn Multicapa ......................................... 134
5.7.2. Entrenamiento de un Mapa de Kohonen.............................................. 135
5.7.3. Resultados de los anlisis mostrados ............................................... 136
6. Desarrollo del IDE JCortexBuilder .................................................................... 138
6.1. El IDE JCortexBuilder................................................................................ 139
6.2. Diseo del Entorno de Desarrollo JCortexBuilder....................................... 140
6.1.1. Adaptacin de un modelo de red a JCortexBuilder ............................... 144
6.1.2. Archivo de configuracin..................................................................... 145
6.2. Formato de los archivos de Datos ............................................................... 147
6.2. Visita guiada a JCortexBuilder ................................................................... 148
6.2.1. Principales elementos de la interfaz...................................................... 148
6.2.2. Ejemplo de entrenamiento Perceptrn Multicapa ................................. 149
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


7. Planificacin y Seguimiento .............................................................................. 158
8. Conclusiones del Proyecto................................................................................. 164
9. Bibliografa, materiales y aplicaciones............................................................... 165
Anexo A: Documentacin de la API JCortex...................................................... 166
Anexo B: Ejemplos de uso..................................................................................... 423
Modelo de Redes de Hopfield............................................................................ 423
Modelo de Mapas de Kohonen .......................................................................... 435
Modelo de Red Perceptrn ................................................................................ 472
Modelo de Redes Perceptrn Multicapa............................................................. 476
Archivo de ejemplos aFuncion2variables.txt...................................................... 480
Archivo de ejemplos aNumbers.txt.................................................................... 497
Archivo de ejemplos aPromoters.txt .................................................................. 498

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

1. Descripcin del proyecto


Se desea construir una solucin completa que permita a desarrolladores de
software crear, educar y utilizar Redes Neuronales Artificiales en proyectos reales de
Java. Para lograrlo se propone el desarrollo de dos elementos:

JCortex: framework para Redes

JCortexBuilder: entorno grfico

Neuronales Artificiales en Java.

de desarrollo para JCortex.

En el documento del Anexo A, presentado en junio del 2005, se enunciaba la


siguiente descripcin del proyecto:
Diseo y construccin de un framework en Java que
facilitara la creacin, entrenamiento, etc. de sistemas basados
en redes neuronales. Podra incluirse tambin un sistema
basado en dicho framework con un interfaz grfico para la
creacin de las redes, su entrenamiento, etc.

A partir de esta descripcin, el Proyecto Fin de Carrera se fue perfilando


durante los meses de julio y agosto. En este intervalo no slo se analiz la tecnologa
disponible y las bases tericas, sino que se fueron definiendo las prioridades. Se lleg
a la conclusin de que si bien la importancia de este proyecto se encuentra en el
framework que lo sustenta que ha de ofrecer las mximas garantas y posibilidades
de extensin su xito en el mundo real depende en gran medida de contar con un
entorno de desarrollo sencillo, potente y, ante todo, til.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

2. Objetivos
El objetivo principal en el desarrollo del framework ha sido lograr un sistema
prctico, que pueda ser utilizado por la comunidad de programadores de Java
para resolver exigencias reales de sus aplicaciones.
A continuacin se enumeran los objetivos secundarios que han establecido las
guas de desarrollo del framework JCortex.

El framework ha de permitir desarrollar sobre l soluciones basadas en


Redes Neuronales Artificiales a distintos niveles de profundidad. Habr
usuarios que quieran acceder a soluciones inmediatas y sin complicaciones,
mientras que otros desearn tener acceso, a fondo, a los parmetros y ajustes
de las Redes Neuronales creadas.

Obtener un framework que pueda ser personalizado, tanto el modelado de


las redes como su funcionamiento y entrenamiento. La riqueza de un
framework no radica tanto en su funcionalidad implantada como en las
facilidades y posibilidades que ofrece para su personalizacin. Con este
objetivo en mente, adems, se aseguran las posibilidades de evolucin futura
del sistema.

Implantar en el framework los modelos de Redes Neuronales Artificiales


ms utilizados. De tal forma que se permita su uso inmediato como solucin
de creacin, entrenamiento y uso de Redes Neuronales Artificiales.

Cmoda extensin del framework para incluir nuevos modelos


personalizados segn las necesidades futuras del proyecto JCortex o los
desarrollos propios de sus usuarios (programadores).

Obtener un entorno de desarrollo grfico JCortexBuilder que facilite la


creacin, entrenamiento, uso y traslado de las redes creadas sobre el
framework JCortex a los proyectos software en los que trabaja el usuario.
El entorno de desarrollo ha de enmascarar la complejidad del framework
JCortex para el usuario que no desee profundizar en esta tecnologa. Ha de
estar preparado para crecer y evolucionar de forma dinmica junto con el
framework.

En la lista anterior se han obviado los objetivos clsicos de cualquier proyecto


de desarrollo de software: eficacia, eficiencia, potencia y versatilidad.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

3. Motivaciones
A continuacin se enumeran los tres factores que han motivado la propuesta,
eleccin y realizacin de este proyecto.

Proporcionar una forma fcil y sencilla para que los programadores puedan
implantar soluciones basadas en Redes Neuronales para sus proyectos en Java.

Aprovechar una de las pocas oportunidades disponibles para embarcarse en


proyecto de investigacin bsica. Una de las grandes ventajas de este campo,
es la posibilidad que abre a la investigacin de nuevas vas de funcionamiento
y nuevos mtodos.

Realizar una aportacin a la comunidad Java a travs de un sistema con


aspiraciones de convertirse en un proyecto Open Source.

Aprovechar el tirn de la inteligencia artificial y de las Redes Neuronales, en


especial para dar respuesta a problemas complejos y sistemas no lineales.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

4. Estudio de viabilidad
4.1. Anlisis de necesidad y oportunidad
La tecnologa de Redes Neuronales Artificiales es un campo de la Inteligencia
Artificial que no parece que reciba todo el inters que se merece, ni se materializa
todo el rendimiento del que es capaz.
Analizando la situacin actual, parece bastante claro que es necesario un
sistema fcil y accesible orientado hacia los programadores, para conseguir
generalizar de forma definitiva el uso de estas soluciones. Una gran cantidad de
ingenieros de software y todo tipo de especialistas involucrados en el desarrollo de
aplicaciones nunca han adquirido una base acadmica sobre Redes Neuronales
Artificiales, o lo que pudieran saber ha quedado relegado al olvido con el paso del
tiempo. En esta situacin, es muy improbable que una red neuronal sea la solucin
propuesta y desarrollada para un problema complejo. Ms si se mantiene la idea de
que la creacin, el entrenamiento y el afinado de una Red Neuronal Artificial es una
tarea dura, larga y tediosa.
Hay hueco en este entorno, por tanto, para conjunto de framework y entorno
de desarrollo que permita crear soluciones basadas en Redes Neuronales Artificiales
de la forma ms sencilla posible. Este sistema ha de ser fiable y eficiente para ser
tomado en cuenta a la hora de disear un proyecto software. Ha de enmascarar,
siempre que el usuario (programador) lo considere necesario, las bases tericas y
matemticas, funcionando como una caja negra. Ha de simplificar, facilitar y en la
medida de lo posible hacer incluso agradable el proceso de creacin, entrenamiento
y puesta en produccin de una red neuronal.

4.1.1 Alternativas ya existentes


A continuacin se describen las principales alternativas a JCortex como
sistema de creacin, entrenamiento y uso de redes neuronales artificiales mostrando
las ventajas que propone JCortex frente a los mismos.
Ya existe un framework para redes neuronales en JAVA llamado JOONE
(Java Object-Oriented Neural Engine). La primera impresin que ofrece este entorno
es de gran complejidad, e incluso se podra considerar menos accesible para su
extensin y personalizacin. Otro factor a tener en cuenta es que JOONE no est
pensado para almacenar y recuperar una red al completo, con todos sus parmetros y
ajustes, algo esencial para su uso habitual en aplicaciones.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Matlab es una aplicacin tpica en el mundo de la ingeniera que dispone de
un mdulo para trabajar con Redes Neuronales Artificiales. Es posible exportar a
JAVA cdigo escrito en el lenguaje de programacin matemtica de Matlab. Frente a
esta alternativa tan extendida, JCortex permite un sistema ms rpido y simple,
apoyado en un entorno de desarrollo grfico. Adems, como framework abierto, el
usuario/programador tiene grandes facilidades para extender y personalizar el
funcionamiento del sistema.

4.2. Anlisis econmico


Al ser ste un proyecto de investigacin bsica nacido del mundo acadmico,
no tiene muchas tablas para defenderse adecuadamente ante un anlisis de viabilidad
econmico. En Espaa, no ya a nivel empresarial sino incluso acadmico, se valoran
ms los resultados econmicos inmediatos de los proyectos que el avance que su
investigacin pueda aportar. De ah que la mayor parte de los proyectos de
investigacin sean de aplicaciones para su uso concreto y a corto o medio plazo, ms
que la investigacin en nuevas tecnologas y campos ms bsicos. Sin embargo, son al
final estos campos los que mejores rditos proporcionan al entorno socioeconmico.
El tiempo dedicado a su diseo, desarrollo y documentacin sobrepasa
ampliamente las 300 horas, a la vez que no se espera del mismo un retorno de la
inversin econmico. Sin embargo el rendimiento inmaterial que se puede obtener (y
se ha obtenido del mismo) compensa ampliamente el tiempo y recursos dedicados.

A la hora de disear la Planificacin Definitiva, que se presenta en el captulo


7. Planificacin y Seguimiento, se realiz tambin una acercamiento a la
presupuestacin del proyecto. Se puede considerar que el nico coste representativo
es la mano de obra. Las aplicaciones informticas empleadas son de distribucin
gratuita o ya estaban disponibles antes de comenzar este proyecto, y la literatura a la
que se ha recurrido es perfectamente genrica (ver 9. Bibliografa, materiales y
aplicaciones) o bien est disponible a travs de Internet. JAVA es un lenguaje
tremendamente agradecido en este aspecto ya que posee una comunidad de
desarrolladores muy activa que mantiene en forma este lenguaje extremadamente
abierto.
El nico recurso empleado en las tareas de la planificacin es el autor. Su
consumo se mide por el tiempo dedicado a las actividades del proyecto, con
independencia de la naturaleza de las mismas. Teniendo en cuenta un coste de 20! por
hora (programador junior) se ha calculado un presupuesto aproximado de
8.625,00!, revisado a 8.676,61! a mitad de proyecto.
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

10

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


S que se puede decir en su defensa que, ignorando el coste de la mano de obra
dedicada, ste es trata de un proyecto barato en comparacin con los resultados que se
espera obtener. Es preciso tener en cuenta el amplio espectro de problemas que
podrn ser resueltos de forma efectiva e innovadora con un framework hecho a
medida para programadores.

4.4. Planificacin
La primera planificacin de las actividades del proyecto se realiz en el mes
de agosto. A la vista de las modificaciones e imprevistos que han surgido durante la
realizacin del proyecto, se puede entender claramente la falta de conciencia de la
dimensin real del trabajo a realizar. Adems el trabajo acadmico del ltimo curso,
especialmente en la primera mitad del ao acadmico, releg cualquier intento de
avanzar con el proyecto.

Tabla 1: Fases de desarrollo previstas en la planificacin inicial descartada


Inicio

Finalizacin

1 Agosto 2005

23 Diciembre 2005

Framework

5 Septiembre 2005

27 Noviembre 2005

IDE

2 Diciembre 2005

7 Enero 2006

Ejemplos

8 Enero 2006

27 Enero 2006

Framework

1 Marzo 2006

7 Mayo 2006

IDE

5 Marzo 2006

23 Abril 2006

Ejemplos

14 Mayo 2006

2 Junio 2006

7 Mayo 2006

...

Fase
Formacin y Anlisis

ALFA01

ALFA02

Cierre y Documentacin

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

11

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


September2005
WBS

Activity Name
1 Formacin
1.1
Aprendizaje bsico sobre RNA por cuenta propia
1.2

Teora sobre RNA en clase

1.3

Teora de Back Propagation

1.4

Ejercicos en Clase

Start Date

Finish Date

1/9/05

22/10/05

24/10/05

29/12/05

31/10/05

6/11/05

28/11/05

29/12/05

2 Anexo B
2.1
Realizacin del Anexo B

22/10/05

27/10/05

2.2

27/10/05

1/11/05

Aceptacin Anexo B

2.3

Entrega del Anexo B

2.4

Realizacin diapositivas Anexo B

2.5

Presentacin del Anexo B

3 Framework
3.1
Modelo de propagacin genrico
3.2

Modelo Perceptrn

5/9/05
19/9/05

7/10/05

4.2

Prototipado
Enlace entre Framework y Prototipo

5 Ejemplos Bsicos (pruebas del IDE y framework


ALFA)
6 Presentacin de Febrero
7 Framework BETA
7.1
Aadir modelos adicionales
7.1.1
Mapas de Kohonen
7.1.2
Otras redes competitivas
7.1.3
Radial Basis Network
7.2
Optimizar algoritmos y mejorar su elegancia
7.3
Tantear soluciones JNI
8 IDE BETA
8.1
Mejora del IDE con los nuevos modelos
9 Documentacin Detallada
10 Ejemplos Avanzados (pruebas del IDE y framework
BETA)
11 Preparar Proyecto para su Presentacin

March2006

April2006

May2006

June2006

18/9/05

27/11/05

4.3

February2006

2/10/05

19/11/05

Modelo de Aprendizaje General con Alg. Genricos

January2006

1/11/05

3/10/05

Aprendizaje por Back-Propagation

Replantear la estructura del Framework. Nuevo


anlisis y correccin.
4 IDE
4.1
Anlisis sobre la resolucin de Problemas

December2005

2/11/05

Modelo Perceptrn Multicapa


Clases bsicas Perceptrn Multicapa

3.4

November2005

2/11/05
27/10/05

3.3
3.3.1
3.3.2

3.5

October2005

T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

8/10/05

30/10/05

5/11/05

18/11/05

2/12/05

18/12/05

19/12/05
2/1/06

1/1/06
8/1/06

9/1/06

27/1/06

20/2/06

28/2/06

1/3/06
13/3/06
20/3/06
27/3/06

12/3/06
19/3/06
26/3/06
8/4/06

24/4/06

7/5/06

5/3/06

23/4/06

7/5/06

1/6/06

14/5/06

2/6/06

5/6/06

1/7/06

Convocatoria de Exmenes de
Febrero

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Ilustracin 1: Diagrama de Gantt de la planificacin inidial descartada

La planificacin inicial con la que se realiz el estudio de viabilidad comenz


a mostrarse inviable durante los primeros dos meses de desarrollo. No ya por
problemas con los objetivos propuestos, sino por el escaso tiempo y lo impredecible
de los condicionantes acadmicos y profesionales. En su lugar se construy una nueva
planificacin mucho ms realista, adaptable a las circunstancias y concreta, que se
muestra en detalle en el captulo 7. Planificacin y Seguimiento.

Los cambios que sufri la planificacin inicial son los siguientes:

Reduccin del tiempo en el primer cuatrimestre del ao acadmico (de


octubre a enero).

Uso intenso del periodo de exmenes de febrero que se haba dejado libre.

Se simplific los modelos de red a implantar con el fin de otorgar una


mayor importancia al objetivo de obtener un ncleo de framework slido,
fiable y eficiente. Se consider que el objetivo del proyecto radica ms en
una buena base que en una gran variedad de modelos.

Se adelant la implantacin del entorno de desarrollo con el fin de poder


realizar de forma ms eficaz las pruebas del framework y los modelos
implantados.

Se incluyeron las pruebas de rendimiento con profilers, no recogidas en la


planificacin inicial.

Se simplific el sistema de versiones, optando por un desarrollo ms


continuado.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

12

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

4.3. Conclusin de los anlisis de viabilidad


A la vista de los anlisis anteriores, se puede concluir que el proyecto es
viable. La tecnologa, las necesidades y la oportunidad son claramente favorable a
este respecto.
El nico punto oscuro podra ser el anlisis puramente econmico. Sin
embargo, si se lo considera dentro del mbito de un Proyecto Fin de Carrera no
remunerado, es plenamente satisfactorio. Esta decisin no estara tan clara en caso de
enmarcarse en un anlisis puramente empresarial.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

13

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5. Desarrollo del framework JCortex

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

14

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.1 Descripcin del Framework JCortex


El framework desarrollado para este Proyecto Fin de Carrera, proporciona la
estructura bsica sobre la que construir soluciones basadas en Redes Neuronales
Artificiales.
El paquete bsico a partir del cual se organiza el framework es
com.jcortex. Esta estructura es nica ya que jcortex.com es un dominio
registrado para este proyecto.
JCortex es un framework, por lo que la riqueza del mismo no radica en
proporcionar un gran nmero de funcionalidades completas y soluciones cerradas. Lo
realmente importante es su estructura: ofrecer una estructura slida sobre la que un
programador de JAVA pueda desarrollar sus soluciones basadas en redes neuronales.
Ha de proporcionar la seguridad de que los desarrollos realizados sobre l y
siguiendo las indicaciones y precauciones facilitadas son slidos y fiables. De este
modo el framework proporciona los siguientes servicios:

El contrato de los elementos bsicos de una Red Neuronal Artificial.

La descripcin del comportamiento bsico de cada elemento.

La funcionalidad bsica, comn o accesible para cualquier modelo de


Red Neuronal Artificial.

Herramientas genricas para el almacenamiento y recuperacin


(Load&Store en XML) de las redes creadas, escritura en consola

Una implantacin completa de los modelos de Redes Neuronales


Artificiales ms comunes en los proyectos informticos.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

15

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.2. Metodologa de desarrollo


Una correcta metodologa de desarrollo es siempre una garanta para un
producto software fiable. Un framework ha de ser tratado como un elemento crtico,
dada su importancia en las aplicaciones como substrato tecnolgico. Por lo general se
entiende que un framework til (o utilizable) no slo ha de tener un diseo correcto
sino que adems ha de ser eficiente, fcil de comprender, ampliar y personalizar. La
metodologa utilizada en el desarrollo ha de garantizar que las clases creadas y el
sistema completo formen un conjunto que cumpla los requisitos indicados
anteriormente: formar una base slida, probada, pura e independiente de sus usos
concretos para soluciones basadas en Redes Neuronales Artificiales.
Es importante reforzar a lo largo de todo el proceso de diseo y desarrollo la
necesidad de crear un ncleo genrico, independiente de los modelos de red
concretos. Es este ncleo el que realmente aportar las bondades del framework y
sobre el que se ha de volcar todo el esfuerzo posible.
Por lo ya expuesto anteriormente es imprescindible tener en cuenta las
siguientes normas bsicas para el correcto diseo de ste y, en principio, de cualquier
otro framework orientado a objetos:

Seguir estrictamente el Principio Abierto-Cerrado (Open-Close


Principle - OCP). Aplicndolo, los mdulos tendrn que disearse de
forma que su comportamiento pueda extenderse sin requerir ser
modificados.

El principio de Inversin de Dependencias se utiliza principalmente para


facilitar el Principio Abierto-Cerrado.

En la medida de lo posible hay que asegurar el Principio de Segregacin


de Interfaces (Interface Segregation Principle ISP), con el fin de
proporcionar la mayor flexibilidad a la extensin y posteriores desarrollos
sobre la base del framework. Aplicndolo, los clientes no deben ser
forzados a depender de interfaces que no utilizan. Un ejemplo de este
principio se puede hallar en la segregacin de las responsabilidades de los
entes pensantes de una Red Neuronal en AxonSource y
AxonReceiver (ver: 5.5.2. Relacin entre AxonSource,
AxonReceiver, Sensor y Neuron).

La Ley de Demeter se aplicar en la medida en la que merezca la pena


renunciar a cierto rendimiento, con el fin de disminuir el grado de
acoplamiento. Con el fin de dar mayores libertades para la optimizacin,
no se utilizar la Ley de Demeter cuando las cadenas de objetos
referenciados son interfaces o clases abstractas pertenecientes al ncleo del

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

16

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


framework y, por tanto, es seguro que su contrato no vare en el futuro; o
cuando el rendimiento se vea seriamente afectado por esta restriccin.

En el fondo, el Sentido Comn es el principio ms til a la hora de


disear e implantar un framework.

Una oportunidad que surge en el panorama del hardware es la cada vez mayor
accesibilidad de sistemas multiprocesador, ya sea por compartir varios ncleos en el
mismo chip, distintos procesadores trabajando juntos en el mismo entorno o incluso
en mquinas distintas. Es imprescindible tener en mente, a la hora de disear y
desarrollar el framework, futuros desarrollos por la va del paralelismo. Esta
preocupacin ha de verse reflejada en el manejo y eleccin de estructuras de datos, as
como en la concurrencia en los datos, clculos y mtodos.

5.2.1. Uso de Patrones de Diseo O.O.


El uso intensivo de Patrones de Diseo Orientado a Objetos garantiza el
correcto diseo de cualquier proyecto. Ms importante resulta, si cabe, en el caso del
desarrollo de un framework concebido para ser utilizado en una gran diversidad de
aplicaciones.
La utilidad de los patrones de diseo es doble: por un lado se disean
soluciones orientadas a objetos ampliamente probadas, y por otro la presencia de un
patrn de diseo suele ser autoexplicativo. Cualquier programador de un lenguaje
orientado a objetos con nociones de patrones entender la finalidad y el
funcionamiento del diseo.
Patrones de Gang of Four utilizados en el desarrollo del framework y del
entorno desarrollo. Para ms informacin ver el Anexo C con la documentacin de la
API:

Template Method

Observer

Composite

Singleton & Factory Method

Adapter

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

17

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.2.2. Optimizacin iterativa de los modelos de red


Se ha partido de la siguiente premisa: optimizar los modelos de red implica
optimizar al mximo el framework al completo. No es posible llegar a realizar pruebas
directamente sobre un framework que slo proporciona las estructuras y funcionalidad
esenciales para poder construir sobre el mismo. Siguiendo esta idea, se plante la
integracin de una serie de modelos de red dentro del paquete bsico. Si bien estos
modelos no llegan a formar parte del ncleo del framework, ofrecen una
funcionalidad completa aunque bsica con visos de ser extendida y personalizada
as como la oportunidad de probar a fondo el sistema subyacente. Se ha procurado
seleccionar los modelos de Red Neuronal Artificial ms utilizados, y a la vez ms
distintos entre si, con el fin de poder realizar una optimizacin global de las clases del
framework.

Diagrama de Actividad 1

El proceso de desarrollo, mejora y pruebas se ejecutar segn se muestra en el


Diagrama de Actividad 1. Las pruebas consisten en realizar una serie de ejecuciones
del modelo sobre una herramienta de profiling que no slo mide el tiempo de
ejecucin, sino que adems permite hacer un anlisis del tiempo y el nmero de
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

18

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


iteraciones a nivel de mtodo, lneas de cdigo e incluso instrucciones de bajo nivel.
Un proceso se considera optimizado si su tiempo de ejecucin viene determinado
exclusivamente por los clculos matemticos e iteraciones ineludibles, propios del
sistema de propagacin y de aprendizaje. Lo ms importante en todo caso es que las
tareas de gestin de estructuras de datos, de control de flujo o de tratamiento de
estadsticas no representen tiempos de ejecucin representativos.
Para ms informacin sobre las pruebas consultar el apartado: 5.7. Estudio de
Optimizacin.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

19

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.2.3. Metodologa de trabajo con XML


XML (eXtensible Markup Language, lenguaje de marcado ampliable o
extensible) es un lenguaje extensible de etiquetas desarrollado por el World Wide
Web Consortium (W3C). Es un meta-lenguaje que permite definir otros lenguajes de
marcado adecuados para usos determinados en este caso el almacenamiento de
instancias de Redes Neuronales artificiales , mediante una sintaxis personalizada, y
basado en archivos de texto plano.
El inters de asegurar mediante XML la perdurabilidad de las instancias
creadas y entrenadas utilizando las herramientas que proporciona el framework
JCortex viene dado por los siguientes motivos:

Es un formato de almacenamiento de informacin universal, de forma que


el mismo archivo de informacin puede ser compartido entre distintas
plataformas e incluso inspeccionado por aplicaciones creadas con
lenguajes de programacin distintos.

Est enormemente extendido en el entorno de la programacin orientada a


objetos, y con gran fuerza en JAVA.

Permite al ser humano realizar una lectura fcil y comprensible, incluso


cuando se inspecciona el archivo manualmente con un editor de texto.

El volcado y recuperacin de las Redes Neuronales (y sus componentes)


modeladas con este framework, es uno de sus aspectos ms oscuros. En especial, la
creacin de una instancia de Red Neuronal a partir del archivo XML en el que se ha
almacenado su configuracin, suele ser un proceso complejo en el que son necesarias
varias pasadas con construcciones parciales para finalmente recuperar el sistema
almacenado.
Por tanto, es interesante establecer una metodologa clara para la serializacin
y deserializacin de los elementos que forman una red en XML. Ambos procesos se
apoyan insistentemente en el patrn de diseo Template-Method (GoF). A
continuacin se describen los mtodos establecidos en la metodologa de trabajo con
XML. Estos mtodos son de implantacin obligatoria en todos los elementos
susceptibles de contener datos de configuracin que tengan que ser preservados. Las
interfaces y clases abstractas del ncleo de la aplicacin son las encargadas de
asegurar que se implanten en los objetos. Hay que sealar que esta metodologa es de
aplicacin general en todo el framework, no se est describiendo la implantacin
concreta para un elemento o modelo de red.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

20

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Para la creacin e inspeccin de los documentos XML se va a emplear el
entorno DOM creado por el W3C para Java. Este framework se distribuye con la
versin estndar J2SE, y tiene su raz en el paquete: org.w3c.dom.

a) Mtodos para el almacenamiento de la configuracin (Store)


A continuacin se describen los mtodos genricos empleados en el
almacenamiento de la configuracin de un elemento del framework JCortex.

+
final
export2XMLDocument()
:Document Mtodo
implantado por todos los elementos que pueden ser almacenados como un
documento. De hecho, el resultado de este mtodo ha de ser una instancia de
documento XML, con el rbol de nodos que recogen la configuracin. El
mtodo es final ya que es imprescindible que todos los documentos
almacenados tengan la misma estructura bsica en sus primeros nodos.

+ final [clase]2XML(padre :Node, :Document) ste


mtodo ha de estar implantado en la superclase abstracta, que defina la
categora, de los elementos que pueden ser almacenados. Todos los elementos
que van a ser almacenados en XML pertenecen a clases que heredan de una
clase abstracta. Se desea que todos los nodos generados por los hijos de una
misma superclase compartan una serie de elementos bsicos comunes e
iguales. Al menos el nombre del nodo XML generado para contener su
configuracin. Por ejemplo, la clase NeuralNetwork implanta el mtodo
neuralNetwork2XML(), pero no as sus subclases como puede ser
KohonenNeuralNetwork. Este mtodo recibe como parmetros el nodo
raz del que tendr que colgar el nodo creado para contener la informacin de
este elemento. A continuacin se describen las acciones que lleva a cabo este
mtodo y que se ilustran en el Diagrama de Actividad 2.
o Crea el nodo que contendr la configuracin del elemento almacenado.
o Aade como atributos o hijos del nodo XML creado, los atributos
recogidos que son conocidos desde la superclase.
o Es posible que deba incluir un atributo especial llamado class, en el
que se indique la clase concreta a la que pertenece la instancia cuya
informacin se est almacenando. (Este mtodo se mueve
exclusivamente en el mbito de la clase abstracta que define la
categora.)
o Llama al Template Method specific2XML() para que complete
el nodo con la informacin propia, slo conocida por la clase
particular.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

21

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

+
abstract
specific[Clase]2XML(raiz
:Node,
:Document) Mtodo encargado de volcar en el nodo creado la
informacin especfica de la subclase concreta sobre la que ha sido invocado.
Este mtodo tendr que ser nico y encontrarse en la ltima subclase, o al
menos recoger toda la informacin desde la ltima subclase.

Cabe llamar la atencin a cerca de una diferencia sutil entre los dos ltimos
mtodos. A pesar de recibir ambos como parmetro argumento de llamada una
instancia de la clase Node, este nodo tiene distinto significado. En el primer mtodo,
[clase]2XML(), ste es el nodo raz de nivel superior al que se ha de aadir
como hijo el nuevo nodo XML con la informacin de instancia sobre la que se est
invocando. En el segundo caso, specific[Clase]2XML(), el nodo para la
instancia a almacenar ya ha sido creado, y slo hay que aadir los atributos y los
objetos especficos de la subclase concreta.

Diagrama de Actividad 2: Almacenamiento de un elemento en XML

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

22

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

b) Mtodos para la recuperacin de la configuracin (Load)


A continuacin se describen los mtodos genricos empleados para la
recuperacin de la informacin almacenada dentro de un documento XML. La carga
de datos desde un archivo XML siempre se lleva a cabo con el objetivo de reconstruir
la Red Neuronal Artificial creada previamente por el usuario, con todos sus
elementos. Normalmente no se recuperar tan solo la instancia propia de la red
neuronal (NeuralNetwork), sino que ser necesario recuperar al menos la
configuracin de sus neuronas y maestro.
Los mtodos mas importantes en este proceso son los constructores de las
clases a recuperar. Su funcionamiento en el lenguaje Java va a marcar con fuerza el
mecanismo de carga y construccin. Este proceso se complica, en la medida en la que
en mltiples ocasiones la dependencia entre objetos conocidos y atributos obligar a
realizar varias pasadas sobre el documento XML, llevando a cabo construcciones
parciales hasta llegar a la definitiva.

La primera accin de un constructor es invocar al constructor de la


superclase a la que extiende. De esta forma la secuencia de creacin bajar
desde las superclases hasta las clases concretas.

Un constructor slo puede finalizar su ejecucin devolviendo la instancia


que ha creado, o saltando por una excepcin.

Las interfaces no tienen constructores al poder poseer nicamente atributos


estticos y definiciones de mtodos.

A continuacin se describen los mtodos que participan de la carga de los


datos de una Red Neuronal desde un documento XML.

+ ConstructorSuperclase(:Node) El constructor de la
superclase es el primer mtodo en ser completado. Es imprescindible que
todas las superclases susceptibles de ser almacenadas implanten, aunque
sea en vaco {}, un constructor cuyo atributo sea una instancia de Node.
Cada superclase ha de recoger y almacenar en la instancia creada los
atributos e hijos que ella se encarg de volcar en el nodo. Es posible que
en la creacin de una instancia, sea necesario atravesar ms de una
superclase con su respectivo constructor.

+ ConstructorClaseConcreta(:Node) El constructor de la
clase concreta es el ltimo en ejecutarse, y por lo tanto el que ha de volcar
toda la informacin que falta en la instancia, extrayndola del nodo.
Pudiera darse la situacin en la que este constructor no pudiera tener
acceso a todos los datos necesarios para la creacin completa de la

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

23

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


instancia. Por ejemplo, puede desconocer la direccin de la instancia de un
elemento al que est relacionado pero que todava no ha sido creado.
Es probable que durante la ejecucin de los constructores, sea necesaria la
creacin de nuevas instancias a partir de hijos del nodo procesado.
Hay que tener en cuenta que, a pesar de que el proceso parece pesado y
costoso, la carga de una Red Neuronal Artificial es una accin que se lleva a cabo no
muy a menudo y para la que el usuario est dispuesto a aguardar un corto espacio de
tiempo. Es por esto que se ha decidido mantener una estructura que puede llegar a
pecar de recargada.

c) Formato bsico de los documentos XML generados por JCortex


En la Tabla 2 se describen los nodos bsicos que forman los archivos XML de
configuracin de Redes Neuronales Artificiales en JCortex. La Tabla 3 presenta una
serie de normas de estilo a utilizar en los nombre de los atributos aplicables a
cualquier nodo de cualquier elemento en cualquier modelo.

Tabla 2: Anidamiento de los nodos en los archivos de configuracin


<com.jcortex />

! <neuralNetwork />

Nodo raz de los documentos generados por el


framework JCortex.
Configuracin de una red neuronal.

! <neuron />

Configuracin de una neurona.

! <teacher />

Configuracin de un maestro.

Ejemplo de la estructura de un archivo de configuracin generado por el


framework JCortex para almacenar una Red Neuronal entrenada:

<?xml version="1.0" encoding="UTF-8"?>


<com.jcortex>
<neuralNetwork ... >
<!-- Nodos propios de la configuracin de la red que no necesitan
hacer referencia a las neuronas. -->
...

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

24

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


<!-- Listado de las neuronas. -->
<neuron ... >
<!-- Configuracin de las neuronas. -->
</neuron>
<!-- Nodos propios de la configutacin de la red que necesitan la
definicin previa de las neuronas. -->
...
<!-- Configuracin del maestro -->
<teacher ... />
</neuralNetwork>
</com.jcortex>

Tabla 3: Atributos comunes en los nodos XML de configuracin


class =

Atributo que indica la clase concreta con la que se implanta un


elemento.

id =

Atributo que indica la identificacin numrica o alfanumrica de


un elemento. Este atributo se utilizar tanto en la descripcin de la
informacin del elemento, como en las referencias que se hagan al
elemento concreto desde cualquier otro nodo.

ix =

Atributo que indica una posicin en una tabla o estructura. Ha de


ser un valor numrico.

size =

Atributo que indica el tamao de una estructura de datos o el


nmero de elementos recogidos como hijos de un nodo.

value =

Atributo que recoge un valor numrico de cualquier tipo.

weight =

Atributo que recoge un valor numrico que ejerce como peso en la


configuracin de una Red Neuronal o un elemento de la Red.

Los atributos de los nodos anteriores, as como el resto de nodos necesarios


para la construccin de cada modelo concreto de Red Neuronal Artificial, se
describirn en futuros apartados. Es importante advertir que, en ltima instancia, el
nombre de los nodos y de sus atributos est determinado por las entidades a las que
hacen referencia en el diseo lgico y fsico de la aplicacin.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

25

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.3. Modelo Conceptual de Redes Neuronales


El reto de desarrollar un framework de Redes Neuronales radica en conseguir
una estructura que cumpla los siguientes requisitos:

Solidez para afianzar la fiabilidad de las Redes Neuronales basadas en ella.

Versatilidad para poder adaptarse a cualquier modelo de Red Neuronal.

Que sea til, esto es, fcil de aplicar para resolver los problemas reales a los
que se enfrenta un programador de JAVA en sus proyectos de desarrollo.

Para cumplir estas exigencias, se ha optado por un modelo modular (ver


Ilustracin 2) que segmenta una Red Neuronal genrica en unidades mdulos que
tienen perfectamente definidas su funcionalidad, su interfaz, su accesibilidad y su
interconexin. Este modelo de red es aplicable tanto a las redes de propagacin hacia
delante (feed-forward), las de retropropagacin (back-propagation), redes recursivas,
redes competitivas Este modelo lo que fija son los elementos de los que dispone la
red para alojar su funcionalidad, y los elementos necesarios para que la red pueda ser
utilizada en una aplicacin real.

Ilustracin 2: Diseo conceptual de la Red Neuronal Artifical

Red Neuronal: contiene el resto de mdulos estableciendo la estructura de


cada modelo de red concreto, el conocimiento de todos los elementos que la
componen, y sus mecanismos de pensamiento (entrada de informacin,
propagacin y salida). Es, por tanto, el elemento que aporta el funcionamiento
diferencial de cada modelo de red y cohesiona el resto de unidades de acuerdo
con las necesidades del mismo.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

26

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Traductor de Entrada: realiza la traduccin entre los objetos utilizados como


entradas para la Red Neuronal y el vector de nmeros reales con los que
trabaja el modelo matemtico. Los Traductores de Entrada no son especficos
para un modelo de red concreto, sino que dependen del problema abordado. Si
el problema versa sobre coches, la Red Neuronal recibir como entrada una
instancia de la clase Coche que tendr que ser traducida a sus factores
numricos representativos, como puede ser: la potencia del motor, velocidad
mxima, tiempo de aceleracin

Sensores: estos elementos actan como un buffer, almacenando durante el


proceso de pensamiento los datos numricos de entrada para que puedan ser
accedidos por el resto de elementos internos de la Red Neuronal. Se alimentan
a partir de los valores numricos generados por el Traductor de Entrada.

Neuronas: son los elementos pensantes en el ms amplio sentido de la


palabra. Con esta unidad se pueden identificar multitud de elementos que
participan en el manejo de la informacin dentro de la Red Neuronal. Pueden
ser neuronas de McCullock-Pitts, neuronas Adaline, retardadores, etc. Puede
que incluso no sea necesario contar con estos elementos para redes simples.

Traductor de Salida: realiza la traduccin de los valores numricos reales


producidos por el modelo matemtico, y los objetos que son la salida de la
Red Neuronal. Los Traductores de Salida, al igual que los de Entrada, no son
especficos para un modelo de red concreto, sino que dependen del problema
abordado.

Maestro: contiene los mecanismos para educar un modelo concreto de Red


Neuronal. Una red puede admitir ms de un Maestro, aunque difcilmente un
mismo Maestro sea capaz de tratar distintos modelos de red. El Maestro
trabaja con la Red Neuronal para realizar el aprendizaje, modificando los
pesos y otros parmetros de clculo en los elementos de la red.
o Analizadores: En general, un Maestro necesitar hacer uso de unos
Analizadores que trabajarn sobre una serie de Estadsticas que sern
rellenadas a medida que avance el entrenamiento. Estos Analizadores
modelan la evolucin de la Red Neuronal, indicando cundo el
Maestro ha de detener el entrenamiento.
o Estadsticas: Para alimentar a los analizadores de progreso del
maestro, ser necesario recoger estadsticas que reflejen la evolucin
de parmetros muy diversos de la red.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

27

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.4. Modelo Lgico del framework


El modelo lgico fue construido siguiendo las pautas marcadas por el modelo
conceptual: un sistema modular en el que los mdulos indicados anteriormente han
evolucionado hasta convertirse en clases con sus atributos, relaciones, mtodos y
responsabilidades:

Tabla 4: Traduccin del modelo conceptual


Elemento Conceptual

Clase OO

Indicaciones

Red Neuronal

NeuralNetwork

Clase Abstracta

Traductor de Entrada

InputTranslator

Interfaz

Sensores

Sensor

Clase Completa

AxonSource

Interfaz

AxonReceiver

Interfaz

Traductor de Salida

OutputTranslator

Interfaz

Maestro

Teacher

Clase Abstracta

Neuronas

En la figura Diagrama de Clases 1 se muestra la relacin entre las clases que


forman el modelo lgico de este framework. Se observa como las instancias de
NeuralNetwork son las que concentran los mdulos que forman cada red. En los
siguientes apartados se describe y discute, en detalle, el diseo de cada uno de los
mdulos.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

28

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Clases 1: Visin simple de los mdulos de NeuralNetwork

Aunque aparentemente no haya conexin entre las clases abstractas Teacher


y ProgressAnalyzer, la primera puede hacer uso de la segunda. Si un Teacher
conoce una o ms instancias de ProgressAnalyzer , no lo har a nivel de
atributo, sino dentro de su mtodo pureThink(). Lo habitual es que en el proceso
de aprendizaje se maneje un nico ProgressAnalyzer, que puede ser de tipo
compuesto. Sin embargo, nada impide que un programador decida implantar un
sistema con varios analizadores independientes.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

29

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.4. El sistema de paquetes com.jcortex.*.


El framework se distribuye con una estructura de paquetes que se ramifican a
partir de com.jcortex.*. Es en estos paquetes dnde se recoge exclusivamente
las clases estndar que forman parte del framework. El usuario/programador puede en
cualquier momento extender el funcionamiento del framework (de hecho debe hacerlo
para que se adapte a su problema concreto), pero sus clases propias tendrn que estar
fuera de la estructura com.jcortex.*. Esta norma tpica busca mantener la
integridad y estabilidad de las distribuciones de este framework (tratado como
librera).
El paquete principal, com.jcortex, est acompaado por una serie de
paquetes que se pueden resumir en dos categoras que se describen en los apartados
siguientes: los Paquetes del Ncleo y los Paquetes de Modelos de Red. En el
Diagrama de Clases 2 se muestran los paquetes de cada uno de los grupos, as como la
relacin entre los mismos.

Diagrama de Clases 2: Paquetes del framework y su interrelacin

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

30

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5. Paquetes del ncleo


Los paquetes del ncleo son los que forman la estructura bsica del
framework, proporcionando servicios para cualquier modelo de Red Neuronal
Artificial o solucin que se desee construir sobre l.

Ilustracin 3: Paquetes del Ncleo

En la Ilustracin 3 se han representado las dependencias entre los paquetes


mediante flechas. Todas ella apuntan a com.jcortex ya que el resto de paquetes
son meras colecciones de clases que implementan o extienden las interfaces y clases
abstractas en l definidas. Las funciones y traductores recogidos en estas colecciones
son las ms habituales en los modelos de Redes Neuronales Artificiales. Ninguna de
ellas es de uso exclusivo, sino que el usuario puede crear las suyas propias, tomando
las herencias pertinentes. En la tabla siguiente se muestra el contenido de cada
paquete, junto con una descripcin de su funcin en el framework.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

31

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

com.jcortex
Contiene la estructura bsica del framework: interfaces, clases abstractas...

Definicin del contrato de los elementos bsicos: Productores y receptores de


valores, Traductores, Funciones, Maestros

Elementos invariables: Sensor, Excepciones.

Herramientas estadsticas y analizadores de progreso.

Utilidades genricas.

ActivationFunction

Clase abstracta que establece el contrato para


las Funciones de Activacin.

AxonReceiver

Interfaz que establece el contrato para la


funcin de receptor de valores, de los
elementos interconectados para formar la Red
Neuronal Artificial.

AxonSource

Interfaz que establece el contrato para la


funcin de generador de valores, de los
elementos interconectados para formar la Red
Neuronal Artificial.

AxonSourceEntry

Clase que asocia una instancia AxonSource


en un AxonReceiver, con un peso
numrico.

BackPropagationActivation
Function

Clase abstracta que establece el contrato para


las Funciones de Activacin utilizadas en la
redes de Retropropagacin.

ComposedProgressAnalyzer

Analizador encargado de recoger el resultado


de una serie de analizadores, y ofrecer el
resultado de su anlisis conjunto.

ConsoleUtilities

Coleccin de herramientas para mostrar


informacin en forma de texto. El medio
principal ser una interfaz por lnea de
comandos.

DistanceFunction

Clase abstracta que establece el contrato para


las funciones de clculo de distancias.

InputTranslator

Interfaz que establece el contrato para los


traductores de entrada a la red.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

32

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

JCortexConstants

Coleccin de constantes cuyo mbito de uso


es la totalidad de las clases desarrolladas.

LoadAndStoreUtilities

Coleccin de herramientas para almacenar y


recuperar valores almacenados en forma de
archivos.

Messages

Clase encargada de recabar los mensajes


localizados en los Resource Bundles.

NetworkFunction

Clase abstracta que establece el contrato para


las Funciones de Red.

NeuralNetwork

Clase abstracta que establece el contrato y la


funcionalidad comn para las instancias de
Redes Neuronales Artificiales.

Neuron

Clase abstracta que establece el contrato y la


funcionalidad comn para las neuronas
(recoge la funcionalidad de AxonSource y
AxonReceiver).

OutputTranslator

Interfaz que establece el contrato para los


traductores de salida de la red.

ProgressAnalyzer

Interfaz que establece el contrato para los


analizadores del progreso del entrenamiento
de una red.

ReadingException

Excepcin lanzada cuando ha habido


problemas cargando la configuracin de un
elemento de la red, desde un archivo XML.

Sensor

Clase que modela el comportamiento de


sensor: un buffer unitario de entrada a la red.

Statistics

Clase encargada de la recogida de estadsticas


durante el entrenamiento de una red.

StatisticsEvent

Evento lanzado a los mtodos de


StatisticsListeners.

StatisticsListener

Interfaz que establece el contrato de un


elemento que es alertado ante cambios de
estado de las estadsticas.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

33

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

StatsMeasure

Clase que modela una dimensin o medida en


la recogida de estadsticas

StatsRegister

Clase que modela cada registro de estadsticas


recogido durante el proceso de aprendizaje.
Incluye el valor medido y la iteracin en la
que se realiz la muestra.

Teacher

Clase abstracta que establece el contrato y la


funcionalidad comn para los maestros de una
red neuronal.

ValueDecreaseAnalyzer

Analizador encargado de determinar si un


valor diferencial proporcionado, decrece de
forma correcta.

ValueVariationAnalyzer

Analizador encargado de determinar si un


valor proporcionado vara lo suficiente.

com.jcortex.activationFunctions
Contiene las Funciones de Activacin ms habituales en los modelos de redes. Todas
las clases implementan la interfaz ActivationFunction y algunas de ellas
BackPropagationActivationFunction.
GaussianFunction

Implantacin de la Funcin de Gauss.

HyperbolicTangentFunction

Implantacin de la Funcin Tangente


Hiperblica (preparada para
retropropagacin).

IdentityFunction

Implantacin de la Funcin Identidad


(preparada para retropropagacin).

SigmoidalFunction

Implantacin de la Funcin Sigmoidal


(preparada para retropropagacin).

SignFunction

Implantacin de la Funcin Signo.

StepFunction

Implantacin de la Funcin Umbral.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

34

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

com.jcortex.distanceFunctions
Contiene las Funciones de Distancia ms habituales en los modelos de redes. Todas
las clases implementan la interfaz DistanceFunction.
EuclideanDistanceFunction

Implantacin de la distancia Eucldea.

com.jcortex.networkFunctions
Contiene las Funciones de Red ms habituales en los modelos de redes. Todas las
clases implementan la interfaz NetworkFunction.
LinearBasisFunction

Implantacin de la Linear Basis Function.

RadialBasisFunction

Implantacin de la Radial Basis Function.

com.jcortex.translators
Contiene los traductores ms habituales. Todas las clases implementan o bien la
interfaz InputTranslator o bien OutputTranslator.
SingleBooleanOutputTranslator
TransparentInputTranslator
TransparentOutputTranslator

5.5.1. Estructura esencial de la Red Neuronal


En el Diagrama de Clases 3 se desarrolla una visin de cmo se han
implantado los mdulos definidos para una Red Neuronal Artificial genrica en
modelo conceptual y su posterior refinamiento en el modelo lgico. El elemento de
mayor importancia es la clase NeuralNetwork que concentra el resto de los
elementos del modelo y aporta su estructura interna y capacidad de pensamiento.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

35

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Clases 3: Descomposicin de NeuralNetwork

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

36

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

a. Propagacin en una Red Neuronal


La propagacin de un estmulo a travs de una red neuronal, se modela en la
clase NeuralNetwork. El mtodo + think(inputData : Object) :
Object, que recoge esta funcionalidad, est definido al nivel de la clase abstracta
por lo que es comn a todos los modelos de Redes Neuronales Artificiales.
En realidad este mtodo se responsabiliza nicamente de realizar la traduccin
de los datos de entrada y de los obtenidos como resultado de la propagacin en la red.
La responsabilidad de ejercer la funcin de propagacin (" pensamiento) recae
sobre el Template Method (GoF) + pureThink(inputData : float[]) :
float. Este ltimo mtodo es el que es realmente capaz de realizar la propagacin,
partiendo de trminos matemticos propios de las Redes Neuronales Artificiales. La
definicin de este mtodo forma parte del contrato de NeuralNetwork, obligando
su implantacin para cada modelo de red.
El recorrido completo de este mtodo se puede ver con ms detalle en el
Diagrama de Secuencia 1. Para ms informacin a cerca del proceso de los
traductores ver el apartado 5.5.3. Los Traductores.

Diagrama de Secuencia 1: Propagacin en una Red Neuronal genrica

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

37

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

b. Exportar una Red Neuronal en XML


El proceso de exportar una red neuronal sigue las indicaciones metodolgicas
marcadas en el apartado a) Mtodos para el almacenamiento de la configuracin
(Store).
En el Diagrama de Secuencia 2 se puede ver como se produce la secuencia de
mensajes entre los distintos elementos que han de volcar su informacin de
configuracin en el rbol XML de la Red Neuronal. Es obvio que una red no se puede
almacenar como un nico elemento por si mismo, sino que habr que almacenar uno a
uno los mdulos a los que esta tiene acceso. Se incluyen de este modo las neuronas y
el maestro.

Diagrama de Secuencia 2: Proceso de exportacin a XML genrico

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

38

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


El mtodo + export2XMLDocument() : Document es implementado
por la clase NeuralNetwork, de forma que una instancia de red neuronal puede
automticamente ser serializada en un documento XML. Lo habitual ser recurrir a
este mtodo cada vez que se desee asegurar la permanencia de una red neuronal en
forma de archivo.
El nodo XML creado para esta instancia de la red, se descarga en el nodo raz
del documento creado, utilizando el mtodo + neuralNetwork2(docRoot
:Node, doc :Document). Como se describe en la metodologa, este mtodo
almacena los datos de configuracin accesibles desde el mbito de la clase abstracta
NeuralNetwork,
e
invoca
al
mtodo
+
specificNeuralNetwork2(nnRoot :Node, doc :Document) de la
clase concreta para volcar la informacin propia del modelo de red especfico. Se est
utilizando el patrn de diseo Template Method (GoF).

Ejemplo de la estructura de un archivo de configuracin generado por el


framework JCortex para almacenar una Red Neuronal entrenada:

<?xml version="1.0" encoding="UTF-8"?>


<com.jcortex>
<neuralNetwork ... >
<!-- Nodos propios de la configuracin de la red que no necesitan
hacer referencia a las neuronas. -->
...
<!-- Listado de las neuronas. -->
<neuron ... >
<!-- Configuracin de las neuronas. -->
</neuron>
<!-- Nodos propios de la configutacin de la red que necesitan la
definicin previa de las neuronas. -->
...
<!-- Configuracin del maestro -->
<teacher ... />
</neuralNetwork>
</com.jcortex>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

39

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.2. Relacin entre


Sensor y Neuron

AxonSource,

AxonReceiver,

Mediante estos tres elementos, se pretende modelar la funcionalidad de lo que


se ha denominado anteriormente elementos pensantes de la red neuronal. Es
importante sealar que no todos los mdulos que participan en el proceso de
propagacin de un estmulo dentro de una red han de ser neuronas (en el sentido de
instancias de la clase Neuron). Segn los modelos de red y sus necesidades pueden
aparecer otra serie de elementos como retardadores, bufferes
Para reforzar el Principio de Segregacin de Interfaces, se ha dividido en dos
interfaces la funcionalidad de estos elementos de red. Como metfora de su actividad
se ha recurrido al smil biolgico del Axn (prolongacin filiforme de la clula
nerviosa, a travs de la cual viaja el impulso nervioso de forma unidireccional, y que
establece contacto con otra neurona).

AxonReceiver. Interfaz que cubre la funcionalidad de recibir un valor


desde uno o ms AxonSources.

AxonSource. Interfaz que cubre la funcionalidad de producir un valor


destinado a ser recogido por uno o ms AxonReceivers.

Habr clases, como la abstracta Neuron, que implemente ambas interfaces,


mientras que otras como Sensor slo necesitan un repertorio de funcionalidades en
su contrato. A continuacin se describen estas dos, que forman parte de las clases del
ncleo:

Neuron. Clase abstracta que implementa tanto la interfaz


AxonReceiver, porque recibe los estmulos de otros elementos
(neuronas, sensores), y la interfaz AxonSource ya que a su vez es
fuente de valores. Adems esta clase implanta un mtodo +
produceAxonValue() :float que genera los valores ofertados por
la neurona a partir de los estmulos recibidos. En su contrato obliga y
recoge la funcionalidad necesaria (a nivel de clase abstracta) para volcar su
configuracin a un nodo XML.

Sensor. Clase concreta, que hace las veces de buffer para el estmulo de
entrada a la red. Implementa la interfaz AxonSource de cara al resto de
elementos de la red neuronal. Este estmulo se realizar mediante un
vector numrico, y cada instancia de Sensor se har cargo de una de las
posiciones de este vector. Se ha implantado como una clase completa
dentro del ncleo de la aplicacin ya que esta labor es comn para todas

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

40

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


los modelos de Redes Neuronales Artificiales, y es improbable que tenga
que sufrir alguna alteracin para adaptarse a las mismas.
Para permitir la mxima versatilidad del framework de cara a los distintos
modelos de red que se puedan implantar, se hace referencia en la medida de lo posible
a los elementos segn la funcionalidad a la que estn obligados. Los sensores por ser
invariantes siempre sern de clase Sensor; segn se necesite una u otro repertorio de
funciones se utilizar las interfaces AxonReceiver o AxonSource, y en el caso
de que ambas sean necesarias de forma conjunta se recurrir a la clase abstracta
Neuron.
La relacin entre las cuatro clases anteriormente descritas se puede ver con
claridad en el Diagrama de Clases 4. Cada modelo de red es libre de extender las
clases que considere necesarias y utilizarlas en su proceso interno.

Diagrama de Clases 4: Relacin entre Neuron, Sensor y sus interfaces

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

41

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

a) Puntualizaciones sobre las neuronas (Neuron)


La clase abstracta Neuron se encuentra disponible en el ncleo del framework
JCortex para permitir su implantacin, siempre que sea necesario, en los modelos de
red concretos.
Modela las entidades que, adems de tener obligada la funcionalidad del
contrato de las interfaces AxonReceiver y AxonProducer, han de reaccionar
ante los estmulos del entorno. El entorno de una neurona son todas aquellas fuentes
de valores a las que tenga acceso como AxonReceiver que es.
En el caso concreto de las neuronas Feed-Forward (ver 5.6.4. Modelo
Genrico Feed-Forward) la reaccin ante los estmulos se produce invocando el
mtodo + synapse() :Collection. Las funciones de este mtodo son:

Calcular el nuevo estado de la neurona. En principio se apoyar sobre el


mtodo + produceAxonValue() :float obligado por el contrato
de la interfaz AxonSource.

Devolver el conjunto de neuronas que son afectadas por esta neurona.


Esto es, que estn conectadas a esta neurona corriente abajo. Si la neurona
no cambia de estado ante el nuevo clculo realizado, ninguna neurona se
ver afectada, de forma que la coleccin estar vaca (o ser null para no
tener que crear una instancia vaca).

Se ha comprobado que el uso de un mtodo que es invocado cuando se


considere necesario logra un rendimiento mucho mayor que el uso de un patrn
Observer (GoF) en el que la Neurona fuera reaccionando ante los estmulos de sus
fuentes AxonProducer. Si bien este ltimo caso se asemeja mucho ms al original
biolgico, provoca una explosin exponencial de llamadas. Este hecho se puede
apreciar con mayor calidad en el caso de las redes Feed-Forward (ver: 5.6.4. Modelo
Genrico Feed-Forward ).

b) Sensores y neuronas desde el punto de vista de NeuralNetwork


Cada red neuronal tiene la obligacin de conocer todos los elementos que la
conforman, esto incluye el almacenamiento de sus neuronas (Neuron) y sensores
(Sensor). La primera distincin que se realiza entre los elementos de ambos tipos es
su almacenamiento con estructuras de datos diferentes dentro de las instancias de la
clase NeuralNetwork.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

42

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Las neuronas (instancias de alguna subclase de Neuron) se almacenan


en una estructura java.util.ArrayList, accesible como
java.util.List. Esta es la mejor opcin ya que se prima la facilidad
de aadir nuevos elementos de forma rpida, recurriendo en muy pocas
ocasiones a un acceso directo por ndice. Para asegurar su correcto
entrenamiento en entornos de concurrencia, se ha optado por recurrir a una
envoltura de sincronizacin creando la lista con el cdigo this.neurons =
Collections.synchronizedList(new ArrayList(neuronCount));.

Los sensores (instancias de la clase Sensor) se almacenan en un array de


tipo Sensor[]. Es la estructura ms simple y que ofrece la accesibilidad
ms rpida a travs de un ndice. No es necesario permitir el crecimiento
de esta estructura ya que una vez se ha definido el nmero de entradas en
la creacin de la red, no tiene sentido que vare.

Ambos elementos exigen la asignacin de un identificador numrico que


pueda ser accedido a travs del mtodo + getId() : int definido tanto en el
contrato de AxonSource como en el de AxonReceiver. Otra distincin entre
sensores y neuronas es el rango de estos identificadores:

Las neuronas (instancias de alguna subclase de Neuron), reciben


identificadores numricos enteros en el rango [0, +inf], en orden
creciente. No ha de haber huecos vacos en la asignacin de
identificadores. Su identificador puede ser utilizado para acceder
directamente a ellas utilizndolo como ndice para contra la estructura de
datos List.

Los sensores (instancias de la clase Sensor), reciben identificadores


numricos enteros en el rango [-inf, 0), en orden decreciente. No ha de
haber huecos vacos en la asignacin de identificadores. Si el identificador
no puede ser utilizado de forma directa como ndice para acceder a la
matriz de sensores descrita previamente, es necesario realizar la siguiente
transformacin: ndice = "identificador "1
dentificador

-1

-2

-3

-n

!
ndice

n-1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

43

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.3. Los Traductores


Los traductores son los encargados de conectar el algoritmo matemtico que
forma la Red Neuronal Artificial, con el mundo real de la aplicacin desarrollada por
el programador. Los traductores son el nico mdulo de todo el framework que
depende nicamente de la naturaleza del problema y el tipo de objetos que entren en
juego en l. En ningn caso variarn segn el modelo de red elegido para afrontar el
problema.
Hay dos tipos de traductores, para cada uno de los cuales se ha definido una
interfaz, como se muestra en el Diagrama de Clases 5.

Diagrama de Clases 5: Traductores

A continuacin se describen los dos tipos de traductores en detalle:

Los traductores de entrada implementan la clase InputTranslator.


El nico mtodo de su contrato es el responsable de traducir una instancia
de la clase Object en un vector de nmeros enteros, que es con lo que
puede trabajar un algoritmo matemtico como son las Redes Neuronales
Artificiales. La instancia de Object recibida puede ser un objeto o
conjunto de objetos de una clase que tiene sentido dentro del mbito del
problema a resolver. (Si la aplicacin versa sobre coches, ser necesario
traducir los atributos de un coche determinado en un vector de nmeros
reales). La traduccin lleva implcita un proceso de normalizacin de los
valores numricos recibidos. Los pasos a seguir son los siguientes:
i) Realizar un downcasting sobre la instancia de Object recibida
para poder tratarlo segn el mbito del problema.
ii) Descomponer la instancia o instancias concretas en los atributos
representativos para el problema. Es importante tener en cuenta
que cuantos ms atributos se utilicen ms compleja y pesada ser la

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

44

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


red y ms tiempo requerirn los procesos de pensamiento y
entrenamiento.
iii) Traducir y/o normalizar los atributos recogidos en valores
numricos reales. Se recomienda que los de valores finales estn
dentro del rango [0,1] [-1,1] dependiendo del modelo de red.
iv) Repartir los atributos traducidos en un vector de nmeros reales
que ser el que finalmente reciba la Red Neuronal.

Los
traductores
de
entrada
implementan
la
clase
OutputTranslator. Estos traductores incluyen dos mtodos en su
contrato que se encargan de realizar cada uno la transformacin
complementaria
al
otro.
El
mtodo
+getOutputTranslation(:float) : Object construye una
instancia de la clase que deseamos como salida, a partir del vector de
nmeros reales obtenidos. As como en la traduccin de entrada es
conveniente prescindir de todos los atributos que no sean relevantes, aqu
es necesario contar con toda la informacin necesaria para construir
completamente la instancia. Puede que parte de los atributos de la nueva
clase puedan ser calculados, deducidos o solicitados al usuario, pero lo
habitual es que la informacin numrica recibida sea suficiente para llevar
a
cabo
la
traduccin.
El
mtodo
+
getOutputBackTranslation(:Object)
:
float[] es
requerido por los maestros, abordan el entrenamiento como un aprendizaje
supervisado. Aunque no es necesario con otros tipos de maestro, siempre
es recomendable desarrollarlo con vistas a su utilizacin con otros
modelos de Red Neuronal Artificial. La labor de este mtodo es similar a
la del InputTranslator, pero con la restriccin aadida de que ha de
casar con los resultados obtenidos con la traduccin de salida. Es
imprescindible que este mtodo realice la operacin inversa del anterior de
la forma ms precisa posible y lo ms ajustado que pueda, ya que de esta
traduccin depender la labor del maestro que entrene la red. Lo ideal sera
que: " = getOutputBackTranslation(getOutputTranslation(" )) .

!Se ha decidido separar como entidades diferenciadas ambos traductores ya


que, por norma general, las entidades que entran a una red neuronal son de distinto
tipo que los resultados esperados. En el caso de que la entrada coincidiera con la
salida, se recomienda construir una clase conjunta Traductor que implemente
ambas interfaces y aproveche cdigo en la medida de lo posible.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

45

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Traductores de entrada incluidos (implementan InputTranslator):


TransparentInputTranslator

Recoge un array de nmeros enteros


(float[]) como instancia de Object, y
simplemente realiza un casting a
float[].
ste es el traductor de entrada por
defecto para el framework.

Traductores de salida incluidos (implementan OutputTranslator):


SingleBooleanOutputTranslator Inspecciona el primer nmero (ndice 0)
del array de reales recibido (float[]); el
resultado ser una instancia de
Boolean que arropa el valor true si el
nmero es mayor que 0, false en caso
contrario. Realiza la traduccin inversa
con los valores 1 y -1.
TransparentOutputTranslator

Realiza un upcasting sobre el array de


nmeros enteros recibidos (float[]) para
tratarlo como una instancia de
Object. Tambin realiza la
conversin inversa.
ste es el traductor de salida por
defecto para el framework.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

46

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.4. Las Funciones


Existe multitud de posibles funciones dentro del modelo matemtico de las
Redes Neuronales Artificiales.
Las instancias de las clases de tipo funcin no almacenan datos, como se
podra suponer de sus parmetros, entradas o resultados. Estas clases son puramente
funcionales y no son susceptibles de cambiar de estado. La idea detrs de esta
decisin es que se pueda compartir una misma instancia entre varios elementos sin
incurrir en problemas de concurrencia, aunque hilos de ejecucin paralelos invoquen
el mtodo para obtener la solucin al mismo tiempo.
Las interfaces que definen el contrato de los distintos tipos de funcin, se
localizan en el paquete central com.jcortex, y son las mostradas en la figura
Diagrama de Clases 6. Cada realizacin concreta incluida en el framework de
estas clases se almacenan, segn su tipo, en los paquetes del ncleo descritos.

Diagrama de Clases 6: Interfaces de funcin

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

47

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

a) Funciones de Activacin
Las funciones de activacin son las encargadas, en ciertos modelos de red, de
decidir el estado de una neurona de forma matemtica.
Las funciones de este tipo han
de heredar de
com.jcortex.ActivationFunction que define dos mtodos:

la

interfaz

+ getDefaultParameterSet () : float[] Obtiene el


conjunto de parmetros por defecto para la Funcin de Activacin. De
forma general se pueden considerar como genricos aquellos que no
modifican el valor final producido por la red.

+ getNumberOfActivationParameters() : int Obtiene el


nmero de parmetros con los que trabaja la funcin. No se ha
representado de forma esttica ya que se invoca conociendo una instancia
de esta funcin y no la clase de la que proviene.

+ getSolution(networkResult : float,
activationParams : float[]) :_float Mtodo principal
que obtiene el resultado de la funcin de activacin para un valor de red y
un conjunto de parmetros. Las funciones han de exigir que el vector de
parmetros tenga al menos en nmero de elementos obtenidos desde el
mtodo anterior. Sin embargo han admitir que la lista de parmetros tenga
un tamao superior al valor numrico requerido (aunque sea ignorando los
que no sean necesarios).

Funciones incluidas en el framework y recogidas en el paquete


com.jcortex.activationFunctions:

Funcin Gaussiana
GaussianFunction

( )
f a,b (x) = a " e
# xb

!
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

48

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Funcin Identidad
IdentityFunction

f a (x) = a
"x f a (x) = a #1

!
Funcin Sigmoidal
SigmoidalFunction

f a (x) =

1
1+ e"a# x

!
Funcin Signo
SignFunction

$x > 0 " 1
&
f (x) = % x = 0 " 0
& x < 0 " #1
'

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

49

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Funcin Tangente Hiperblica


HyperbolicTangentFunction

1" e"x
f (x) =
1+ e"x

!
Funcin Umbral
StepFunction

$x " a # 1
f a (x) = %
&x < a # 0

b) Funciones de Activacin para Back-Propagation


Las funciones de activacin para Back-Propagation son, como su propio
nombre indica, una especializacin de las Funciones de Activacin descritas en el
apartado anterior. Estas funciones poseen los mecanismos para determinar, en ciertos
modelos de red, el estado de una neurona de forma matemtica. Sobre esta base, se
aaden funcionalidades adicionales necesarias en el proceso de aprendizaje por BackPropagation.
Las funciones de Activacin para Back-Propagation han de heredar de la
interfaz com.jcortex.BackPropagationActivationFunction. Adems
de los mtodos propios de las Funciones de Activacin descritos anteriormente, se
define un mtodo nuevo:
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

50

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

+ getDerivateSolution(neuron :
com.jcortex.backPropagation.BackPropagationNeuron
) : float Obtiene el resultado de sustituir el valor final, dentro de la
derivada de la funcin representada por la clase. Al ser posible simplificar
estos clculos con productos ya almacenados en la neurona, sta se utiliza
como parmetro de entrada de la funcin.

Al ser tambin funciones de activacin comunes, las funciones de Activacin


para Back-Propagation incluidas en el framework estn recogidas tambin en el
paquete com.jcortex.activationFunctions:

Funcin Sigmoidal

f 'a (y i,n ) = a " y i,n " (1# y i,n )

SigmoidalFunction

Funcin Tangente Hiperblica

HyperbolicTangentFunction

f 'a (x) = 2 " f a (x) " [1# f a (x)]

!
c) Funciones de Distancia
Las funciones de distancia cuantifican a travs de distintas mtricas
dependiendo de cada implantacin concreta la diferencia entre dos vectores de
nmeros reales.
Las funciones de este tipo han
de heredar
com.jcortex.DistanceFunction que define el mtodo:

de

la

interfaz

+ getDistance(entries : AxonSource[], weights :


float[]) : float Mtodo principal que cuantifica la diferencia
(distancia) entre dos vectores de nmeros reales. Este mtodo lanzar
una excepcin cuando tenga que comparar vectores de distinto tamao.

Funciones incluidas en el framework y recogidas en el paquete


com.jcortex.distanceFunctions:

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

51

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Distancia Eucldea
EuclideanDistanceFunction

D(a,b) =

# (a " b)

!
d) Funciones de Red
Las funciones de red recogen el valor de cada una de las entradas de un
elemento pensante (neurona) y las pondera para obtener un valor que represente el
conjunto de todas las entradas.
Las funciones de este tipo han
de heredar
com.jcortex.NetworkFunction que define el mtodo:

de

la

interfaz

+ getSolution(axonSourceEntries : Collection) :
float Mtodo principal que obtiene la valoracin conjunta de las
entradas. Las entradas se suministran como una coleccin de instancias de
la clase AxonSourceEntry (una para cada entrada).

Funciones incluidas en el framework y recogidas en el paquete


com.jcortex.networkFunctions:

Linear Basis Function


LinearBasisFunction

Radial Basis Function

LinearBasisFunction

t n = # (y i " w ij )

tn =

#[

( y i " wij )

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

52

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.6. El Maestro (Teacher)


a) La clase abstracta Teacher
Las instancias de la clase Teacher, son las encargadas llevar a cabo el
entrenamiento de las redes neuronales artificiales construidas con el framework
JCortex. Cada modelo de red ha de tener al menos una implantacin de la clase
Teacher capaz de entrenarlo.
La clase abstracta Teacher implanta los mtodos genricos necesarios para
todos los tipos de Maestro, a la vez que define el contrato de obligatorio
cumplimiento para todas ellas.
Para cada algoritmo de aprendizaje se crear una clase distinta que extienda
Teacher que ha de implantar los siguientes mtodos:

+
educateNetwork(nn
:NeuralNetwork,
exampleIObjects
:Object[],
exampleDObjects
:Object[])!: Statistics . Mtodo encargado de llevar a cabo el
entrenamiento de la red neuronal. Aunque en principio, por su contrato,
acepte cualquier instancia de NeuralNetwork, tpicamente slo podr
ser aplicado a un modelo de red concreto. En caso de error ha de lanzar
una excepcin del tipo IllegalArgumentException.

+ createStatsSchema() :Statistics . Crea la instancia de


Statistics a ser utilizada por este maestro. En este mtodo se definen
las medidas estadsticas que van a ser recogidas durante el proceso de
entrenamiento. Acta como Template Method (GoF) para el mtodo
getStats() de esta clase abstracta. Tpicamente, su implantacin
tendr el siguiente aspecto, en el cual se proporciona un array de cadenas
de texto con los nombres de las medidas estadsticas y el nmero mximo
de iteraciones a previstas (no tiene que ser necesariamente el exacto):
public Statistics createStatsSchema()
{
return new Statistics(new String[]{Medida1, },
maxIteraciones);
}

#
specificTeacher2xml(teacherRoot
:Element,
document :Document) . Este mtodo acta como Template Method
(GoF) en el proceso de exportar la configuracin de la instancia de
Teacher
a
un
documento
XML.
(Ver:

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

53

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


5.2.3. Metodologa de trabajo con XML)

+ stopTraining() . Mtodo invocado cuando se desea detener el


proceso de entrenamiento de una Red Neuronal Artificial. Siempre y
cuando esto sea posible por la naturaleza del algoritmo de aprendizaje,
dejando el sistema en situacin estable. En los mtodos iterativos es
habitual incluir una variable booleana que acte como flag en el bloque
condicional del bucle. De esta manera detener el entrenamiento es tan
simple como cambiar el valor de este flag. Este mtodo est pensado para
entornos de multiproceso (o multiproceso por hilos).

+ toHTMLString() :String . Este mtodo ha de mostrar la


configuracin de la instancia de Teacher, en forma de texto con tags de
HTML para definir su estilo.

+ getAnalyzer() :ProgressAnalyzer . Mtodo a travs del


cual se obtendr el analizador de mayor nivel utilizado para el
entrenamiento. Para ms informacin ver 5.5.7. Recogida y anlisis de
Estadsticas.

La clase abstracta Teacher implanta a su vez una serie de mtodos comunes


para cualquiera de sus subclases.

+ synchronized getStats() : Statistics. Mtodo


encargado de proporcionar al instancia de la clase Statistics en la que
se almacenan las estadsticas de un entrenamiento. Esta instancia ser
creada en el caso de que no exista con anterioridad1. Este mtodo que
acta de una forma similar al patrn de diseo Singleton (GoF), si bien
slo de cara a una instancia concreta de la clase Teacher. Utiliza a modo
de Template Method (GoF) el mtodo createStatsSchema() de
implantacin obligatoria en cada uno de los maestros concretos.

+ static translateAndClassifyExamples(). Este mtodo


esttico se explica en detalle en este apartado, en el subapartado d) Reparto
de los conjuntos de ejemplos.

El funcionamiento del mtodo getStats() es una de las escasas concesiones que


se ha proporcionado en el framework JCortex para su uso en el entorno de desarrollo
JCortexBuilder. En l es necesario disponer de las estadsticas a ser utilizadas antes
de que se inicie el proceso de entrenamiento.
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

54

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Se recomienda que todas las instancias de la clase Teacher se comporten
como beans (mtodos getter y setter obligatorios) con todos sus parmetros de
aprendizaje. De esta forma se muestra con claridad cules son los atributos que han de
ser establecidos por el usuario y cules son auxiliares para el algoritmo de
aprendizaje.

b) Mtodo educateNetwork() Genrico


En el Diagrama de Actividad 3: Mtodo educateNetwork() genrico se
muestran los pasos a dar antes y despus de lanzar el algoritmo de entrenamiento
matemtico. Se sealan tambin los objetos principales que participan en un proceso
de entrenamiento genrico, y su relacin con las actividades detalladas.

Diagrama de Actividad 3: Mtodo educateNetwork() genrico

Cabe destacar el papel que toman las estadsticas (Statistics) y sus


analizadores (ProgressAnalyzer) en el proceso de entrenamiento. En primer
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

55

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


lugar, estos elementos tendrn que ser creados e inicializados para que despus el
algoritmo matemtico actualice en su progreso las estadsticas. Las estadsticas son
analizadas con el fin de determinar en qu momento ha de detenerse el proceso de
entrenamiento. La relacin entre el objeto de la clase Statistics y el de la clase
ProgressAnalyzer no se ha representado en el diagrama anterior.

c) Mtodo educateNetwork() Iterativo


La mayor parte de los algoritmos de aprendizaje para Redes Neuronales
Artificiales se basan en la realizacin de sucesivas iteraciones sobre un conjunto de
ejemplos de entrenamiento. Es en el transcurso de estas iteraciones cuando la red
evoluciona y su bondad se representa mediante los estadsticos indicados en el
apartado anterior.
En el Diagrama de Actividad 4: Mtodo educateNetwork() iterativo, se
muestran los pasos que ha de recorrer cualquier mtodo de aprendizaje que funcione a
base de iteraciones. sta figura parte del Diagrama de Actividad 3: Mtodo
educateNetwork() genrico, mostrando en detalle el desarrollo de la actividad
con el estereotipo <<algoritmo particular>>.
En primer lugar se pueden distinguir el bucle para las iteraciones, que cubre
gran parte del diagrama. Dentro de este se puede aislar dos fases:

La primera fase, la de entrenamiento, incluye el aprendizaje propiamente


dicho. En ella se recorren todos los ejemplos recogidos dentro del conjunto
de entrenamiento. Estos ejemplos son utilizados por cada algoritmo
particular para variar los pesos por la red, una vez que se ha propagado el
estmulo a travs de la misma.

La segunda fase, la de validacin, no es necesario que se ejecute para


cada una de las iteraciones de entrenamiento. Por motivos de rendimiento
es recomendable saltarse dos o ms iteraciones de entrenamiento entre dos
pruebas de validacin consecutivas.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

56

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Actividad 4: Mtodo educateNetwork() iterativo

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

57

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

d) Reparto de los conjuntos de ejemplos


En la gran mayora de los entrenamientos, es conveniente que el conjunto total
de ejemplos se divida en dos partes:

El conjunto de ejemplos de entrenamiento (training), utilizados para


alimentar a la red durante el proceso de aprendizaje y de los cuales
extraer el conocimiento.

El conjunto de ejemplo de validacin (validation), utilizados para


comprobar que la red evoluciona de forma correcta, generalizando el
conocimiento adquirido y no incurriendo en el problema clsico del
sobreaprendizaje2.

El reparto entre un conjunto y otro es una tarea comn para un gran nmero de
Maestros. Esta accin se proporciona a travs de un mtodo esttico implantado en la
clase Teacher, + static translateAndClassifyExamples()
:void. Sus parmetros se describen a continuacin en orden:

exampleIObjects :Object[] Array con la lista de objetos que


representan las entradas de los ejemplos suministrados para el aprendizaje.
Estos objetos tendrn que ser traducidos a una representacin numrica
con el InputTranslator de la red neuronal. Cada una de estas
entradas ha de tener su salida correspondiente, en su misma posicin, en la
lista exampleDObjects.

exampleDObjects :Object[] Array con la lista de objetos que


representan las salidas deseadas de los ejemplos suministrados para el
aprendizaje. Estos objetos tendrn que ser traducidos a una representacin
numrica con el OutputTranslator de la red neuronal. Cada una de
estas salidas ha de tener su entrada correspondiente, en su misma posicin,
en la lista exampleIObjects.

inputTranslator :InputTranslator Las entradas de los


ejemplos proporcionados para el aprendizaje tienen la forma de objetos
con sentido para el mbito del problema. Estos objetos han de ser
traducidos, mediante un InputTranslator, a un formato numrico

El sobreaprendizaje se produce cuando la red ha aprendido bien los ejemplos del


conjunto de entrenamiento pero es incapaz de generalizar o responder adecuadamente
a los ejemplos que no pertenezcan al conjunto empleado para entrenarla.
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

58

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


que pueda ser tratado por los algoritmos matemticos de las redes
neuronales artificiales.

outputTranslator :OutputTranslator Las salidas de los


ejemplos proporcionados para el aprendizaje tienen la forma de objetos
con sentido para el mbito del problema. Estos objetos han de ser
traducidos, mediante un OutputTranslator, a un formato numrico
que pueda ser tratado por los algoritmos matemticos de las redes
neuronales artificiales.

trainingI :float[][] Array en el que se devolver la lista con


las entradas del conjunto de ejemplos, para el entrenamiento de la red.
Cada float[i] representa un array de nmeros reales con los valores
de la entrada de un ejemplo.

trainingD :float[][] Array en el que se devolver la lista con


las salidas deseadas del conjunto de ejemplos, para el entrenamiento de la
red. Cada float[i] representa un array de nmeros reales con los
valores de la salida deseada para un ejemplo.

validationI :float[][] Array en el que se devolver la lista


con las entradas del conjunto de ejemplos, para la validacin del
entrenamiento de la red. Cada float[i] representa un array de nmeros
reales con los valores de la entrada de un ejemplo.

validationD :float[][] Array en el que se devolver la lista


con las salidas deseadas del conjunto de ejemplos, para la validacin del
entrenamiento de la red. Cada float[i] representa un array de nmeros
reales con los valores de la salida deseada para un ejemplo.

validationPercent :float Valor real entre [0,1] que indica la


proporcin de elementos que formar cada uno de los conjuntos. Tambin
se emplea como indicador de la probabilidad en el reparto aleatorio de los
ejemplos entre ambos conjuntos. En el caso del nmero de elemento de
cada conjunto, el clculo se realiza de acuerdo con la frmula siguiente:
ejemplosValidacin = #totalEjemplos " validationPercent$

ejemplosEntrenamiento = totalEjemplos % ejemplosValidacin

Antes de realizar la invocacin del mtodo descrito, se recomienda el uso del


cdigo descrito a continuacin para crear los arrays que contendrn los conjuntos de
ejemplos:
// Obtains the number of examples devoted to each list
int validationCount = (int) (exampleIObjects.length * validationPercent);

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

59

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


int trainingCount = exampleIObjects.length - validationCount;
// The example and validation arrays
float[][] trainingI = new float[trainingCount][];// Training inputs
float[][] trainingD = new float[trainingCount][];// Training desired outputs
float[][] validationI = new float[validationCount][]; // Validation inputs!
float[][] validationD = new float[validationCount][]; // Validation
outputs
// Translates and classifies the examples between training and validation
Teacher.translateAndClassifyExamples(exampleIObjects, exampleDObjects,!
inputTranslator, outputTranslator,
trainingI, trainingD,
validationI, validationD,
validationPercent);

En el Diagrama de Actividad 5: Algoritmo de reparto pseudo-aleatorio de los


ejemplos, se muestra como se lleva a cabo el proceso de separacin de los ejemplos
proporcionados en los dos conjuntos descritos anteriormente. Es enormemente
arriesgado presuponer que los ejemplos proporcionados estn de por si repartidos de
manera uniforme. Lo normal es que los conjuntos de ejemplo sean proporcionados de
acuerdo con una ordenacin previa. Para evitar esto, todo el proceso de reparto se
realiza ejemplo a ejemplo, de forma aleatoria. Ha de respetarse la correspondencia
entre la entrada y salida del mismo ejemplo.
El reparto, en primera instancia, distribuye los elementos en ambos conjuntos
de acuerdo con la proporcin indicada a travs del validationPercent. Si un
ejemplo es asignado a una lista llena, se decidir de forma aleatoria si el nuevo
ejemplo se aade directamente al otro conjunto, o sustituye a un ejemplo ya presente,
trasfirindolo a la otra lista. De esta manera se procura asegurar la mayor dispersin
posible de todos los ejemplos del conjunto proporcionado, con independencia de que
se encuentren estos al principio o al final.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

60

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Actividad 5: Algoritmo de reparto pseudo-aleatorio de los ejemplos

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

61

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.7. Recogida y anlisis de Estadsticas


El anlisis de las estadsticas de progreso recogidas a lo largo del
entrenamiento es imprescindible para el sistema de decisin que detenga el
aprendizaje de una red antes de incurrir en un sobreaprendizaje. ste es uno de los
apartados ms complejos del framework, por lo que se ha recurrido al uso de Patrones
de Diseo OO en concreto a Composite y Observer. El Diagrama de Clases 7 ofrece
una visin general de todas las clases que forman este sistema, as como de su
interrelacin.

Diagrama de Clases 7: Sistema de Estadsticas

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

62

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

a) El Modelo de Datos de las Estadsticas


Las estadsticas han de cumplir los requisitos de modularidad exigido para que
pueda ser aplicado a cualquier maestro de cualquier modelo de Red Neuronal
Artificial. El modelo de datos de las estadsticas se ha diseado con tres tipos de datos
principales cuya composicin se muestra en el Diagrama de Datos 1.

Statistics. Elemento central de almacenamiento. La recomendacin


es crear una instancia para cada uno de los entrenamientos, si bien no hay
limitaciones tcnicas que restrinjan el uso de ms de una coleccin de
estadsticas para un entrenamiento.

StatsMeasure. Modela las medidas o dimensiones para las cuales se


recopilan los datos estadsticos. Cada medida se identifica con un String
que sirve a la vez de breve descripcin. Este nombre ha de ser nico para
cada instancia de esta clase dentro de la instancia de StatsMeasure.
Cada instancia de esta clase mantiene sus propias estadsticas sobre los
registros que almacenan. Se incluye el valor mximo almacenado, el valor
mnimo y el valor medio. El clculo de estos valores es inmediato ya que
se va realizando a medida que se van aadiendo las instancias de
StatsRegister.

StatsRegister. Modela los registros concretos que contienen cada


valor estadstico. Cada vez que se desee almacenar un valor en la
coleccin de estadsticas se crear una instancia de StatsRegister que
refleja tanto el valor medido como la iteracin en la que se ha registrado.

Lo normal es contar con una nica instancia de la clase Statistics, tantas


intancias de la clase StatsMeasure como medidas de progreso se desee estudiar, y
una instancia de StatsRegister en principio para cada una de las muestras
registradas. A continuacin se describen las estructuras utilizadas en cada nivel de
agrupacin:

La coleccin de instancias StatsMeasure que posee una instancia de


Statistics se modela mediante un HashMap y es accedido a travs de
su la interfaz Map, ambos recogidos en el paquete java.util. Un mapa
parece la estructura ms lgica, teniendo en cuenta que cada dimensin
(instancia de StatsMeasure) se identifica por un String descriptivo.
Esta estructura de datos est preparada para trabajar en entornos de
concurrencia
ya
que
se
crea
como
measures
=
Collections.synchronizedMap(new HashMap()); Si bien esta medida
puede suponer una ralentizacin del acceso, ser esencial para preservar la
correcta organizacin de los accesos.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

63

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Los registros recogidos en forma de instancias de StatsRegister se


almacenan en la instancia de StatsMeasure para la que han sido
muestreados dentro de una estructura LinkedList, que es ofrecida a
travs de su interfaz List. Esta clase, recogida en el paquete
java.util. Se eligi esta realizacin de la interfaz List en concreto para
aprovechar las propiedades de una lista doblemente enlazada: que pueda
crecer fcilmente y sin estar condicionada por un espacio. No se ha
considerado necesario convertir esta estructura en thread-safe, ya que slo
ser accedida para lectura por un nico hilo cada vez. Multitud de hilos
con operaciones de lectura pueden concurrir de forma simultnea sin
problemas. Al tratarse de datos estadsticos, no hay inconvenientes en que
las lecturas sean sucias, en el caso en que coincidiera una lectura con
una escritura concurrente. Es ms, interesa que el proceso sea lo ms
rpido posible, y asegurar la concurrencia es una tara muy costosa. El
acceso a esta lista se suele llevar a cabo de forma secuencial y no
directamente a un valor determinado. Es necesario puntualizar que
StatsMeasure se encarga de mantener la referencia al ltimo registro
que ha recibido.

Diagrama de Datos 1: Relacin entre los tipos de objetos estadsticos

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

64

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

b) Recogida de datos estadsticos


El proceso de recogida de datos estadsticos depender de la naturaleza del
modelo de red neuronal y el funcionamiento de cada algoritmo de aprendizaje en
concreto. Una muestra de los puntos de recogida de datos estadsticos puede verse en
el Diagrama de Actividad 4: Mtodo educateNetwork() iterativo.
Como se ha descrito anteriormente, es necesario definir para cada proceso de
entrenamiento una serie de Medidas o Dimensiones que se materializarn como
instancias de StatsMeasure recogidas en una instancia de Statistics. Estas
medidas se han de definir a travs del mtodo obligado por el contrato de la clase
Teacher para sus subclases: createStatsSchema() (ver: 5.5.6. El Maestro
(Teacher) > a) La clase abstracta Teacher). Por lgica, los valores estadsticos se
recogern al finalizar una iteracin o un anlisis completo, como ocurre en el caso de
las pruebas de validacin.
Si bien las instancias de StatsMeasure dependen en exclusiva de la
naturaleza de la red y el funcionamiento del algoritmo de aprendizaje, se puede
sealar las ms habituales:

Variacin de los pesos de los elementos de la red.

Error de Entrenamiento (Cuadrtico Medio).

Error de Validacin (Cuadrtico Medio).

El almacenamiento de las muestras dentro del repositorio de estadsticas, se ha


encapsulado a nivel de instancia de la clase Statistics. De esta forma el Maestro
slo tendr que tratar un nico objeto. En la interfaz de esta instancia se recoge el
mtodo addRegister(measure :String, iteration :long, value
:float) que se encarga de todo el proceso de crear la instancia de
StatsRegister de la muestra con valor value tomada en la iteracin
iteration; y almacenarla en la dimensin estadstica measure.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

65

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

c) Las Estadsticas y sus Analizadores


Ya se ha indicado que cada proceso de entrenamiento mantendr su propio
sistema de estadsticas, materializado en una instancia de la clase Statistics. Sin
embargo, es imprescindible resaltar que estos valores estadsticos recogidos tienen de
por si una utilidad clara: detener el entrenamiento cuando la red haya aprendido lo
suficiente y sin haber incurrido an en un sobreaprendizaje que degrade su capacidad
de generalizacin.
Los valores en bruto, recogidos para las distintas dimensiones estadsticas, no
proporcionan ninguna pista a cerca del avance del entrenamiento. Es necesario
realizar un anlisis sobre los registros recogidos para dar pie a una decisin. En
conclusin: a cada instancia de StatsMeasure que se desee observar se asociar al
menos un Analizador de Progreso. Ser a estos analizadores a los que se les pedir
un veredicto a cerca de la calidad del entrenamiento, y si este debe o no continuar.

d) Estructura de los Analizadores de Estadsticas


El sistema de analizadores se ha articulado en torno al patrn de diseo
Composite (GoF). De esta forma es posible crear una estructura arbrea tan compleja
como se desee con el fin de organizar y agrupar los distintos analizadores particulares.
La superclase principal es ProgressAnalyzer, que define el contrato que ha de
cumplir cada uno de los analizadores. El mtodo ms importante en un analizador es
+ isProgressGoodEnough() :boolean, con el que se solicita el veredicto
al analizador. En el Diagrama de Clases 8: Analizadores de Progreso, se puede
observar la estructura que garantiza esta funcionalidad.

Diagrama de Clases 8: Analizadores de Progreso


Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

66

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Se recomienda aprovechar la capacidad de agrupamiento de los analizadores


para que el Maestro slo tenga que manejar una nica instancia de analizador. En la
mayor parte de los casos ms de un parmetro tendr que ser estudiado, por lo que
ser un ComposedProgressAnalyzer el analizador al que el Maestro pida su
veredicto.
Se ha considerado que proporcionar esta versatilidad en la organizacin de los
analizadores ser imprescindible para futuros desarrollos de Maestros. Pudiera darse
el caso de que un Maestro realizara varios entrenamientos en paralelo, cuyos
resultados se cruzaran peridicamente. En el modelo no slo sera importante conocer
el veredicto conjunto del analizador, sino adems el veredicto compuesto para cada
uno de los aprendizajes. Con una estructura arbrea es muy sencillo analizar el
progreso a distinto nivel y con distinta granularidad.

e) Analizador ValueDecreaseAnalyzer
Analiza si un valor estadstico decrece de forma adecuada. Actualmente su
implantacin dista mucho de ser la ms inteligente, en el sentido de ser la que mejor
calidad de veredicto ofrece. Se podra incluso indicar que peca de prudente,
deteniendo el entrenamiento a la ms mnima indicacin de crecida del valor de los
errores.
En el primer anlisis que se llev a cabo de este problema, se plante el
muestreo de tres puntos, dentro de una franja dimensionada segn el parmetro
studyWindowSize (atributo de esta clase). El punto n se toma en la ltima
instancia registrada, o en el extremo contrario de la ventana, y m el punto medio entre
ambos. Estudiando los posibles valores de estos tres puntos y su proyeccin sobre los
datos de evolucin, se dibujaron las grficas siguientes.
En este anlisis se favorecen las evoluciones de pendiente descendiente. Slo
se permiten repechos de subida, como paso anterior a otra bajada.
En ellas se presenta la evolucin de un valor de error en lnea gris continua,
discontinua cuando es un valor futuro que an no ha tenido lugar, y los puntos
descritos anteriormente con sus proyecciones sobre las curvas. Sobre estas grficas se
decidi en qu casos se deba recomendar finalizar el entrenamiento, y en qu casos
este deba continuar.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

67

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Utilizando los valores descritos por las grficas, se dise el siguiente conjuto
de pruebas matemticas para determinar si un entrenamiento evoluciona de forma
correcta (good). El parmetro ! (en el cdigo OVERFLOW_GIFT_GRACE),
proporciona un cierto margen de regalo para que sea ms fcil cumplir con las
exigencias del analizador:
om " {ao # ( am $ % )}
nm " {am > ( an $ % )}
on " {ao # ( an $ % )}

) (

good = nm & om ' on & om ' (on & nm)

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006
!

68

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

En anlisis posteriores se demostr como la eficacia del sistema anterior no


era demasiado grande. Gracias a la tabla de verdad mostrada a continuacin se puede
ver claramente como las pruebas mostradas anteriormente equivalen a comprobar si la
proyeccin de m es mayor o menor que n. (Para ello se considera como caso
afirmativo el suceso imposible marcado con *).

a[o] < a[m]

a[o] >= a[m]

a[m] < a[n] a[m] >= a[n] a[m] < a[n] a[m] >= a[n]
a[o] < a[n]
a[o] >= a[n]

Imposible *
Imposible

Una propuesta para futuras versiones consiste en lograr un conjunto de


datos de entrenamiento y de ejemplos suficientemente grande como para poder
entrenar una red neuronal Perceptrn Multicapa. Esta red podra rpidamente
muestrear los registros estadsticos recogidos, para ofrecer una medida de confianza
sobre el progreso de la red. El usuario podra calibrar esta certeza sobre la evolucin
de la red de acuerdo con sus necesidades o segn el rendimiento de los aprendizajes.

f) Analizador ValueVariationAnalyzer
El ValueVariationAnalyzer ofrece su veredicto a cerca de la variacin
de los valores de una medida estadstica. Esta medida es, por regla general, la
diferencia entre el valor de un parmetro entrenado y el mismo en una iteracin
anterior. En este anlisis se priman los valores altos, considerndose que si las
variaciones de valores de los parmetros se mantiene baja durante demasiadas
iteraciones es que la red ha alcanzado un estado estable.
Para el funcionamiento de este analizador se definen dos parmetros:

constantVariation: nmero real que indica el valor de la variacin


por debajo del cual se considera que los parmetros de una red no estn

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

69

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


cambiando. Gracias a este parmetro, no es necesario esperar a que una
red alcance la variacin 0 para considerar que no est evolucionando.

constantWindow: nmero entero que indica el tamao de la meseta


(plateau) que se ha de mantener antes de que se considere que la red
definitivamente no evoluciona lo suficiente.

El progreso se considerar adecuado siempre que el valor de variacin


registrado para la ltima iteracin est por encima del lmite inferior marcado por
constantVariation; y si est por debajo, que lleve en esta situacin un nmero
de iteraciones menor a las indicadas por constantWindow. El entrenamiento se
detendr cuando el valor de variacin registrado se halle por debajo del lmite inferior
durante un periodo de iteraciones (plateau) menor que constantWindow.

g) Analizador ComposedProgressAnalyzer
El analizador ComposedProgressAnalyzer recoge el resultado de otros
analizadores y proporciona una decisin de compromiso entre todos ellos.
El sistema de decisin se basa en que, cada vez que se requiere la opinin de
este analizador con el mtodo + isProgressGoodEnough() :boolean, ste
pedir la opinin a los analizadores que lo componen invocando este mismo mtodo

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

70

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


sobre ellos. Si alguno de los analizadores proporciona una respuesta negativa, el
ComposedProgressAnalyzer recomendar que se detenga el entrenamiento.

h) Informacin sobre la parada


Todos los analizadores han de ser a su vez capaces de informar al usuario de la
razn por la que han votado para detener el entrenamiento (o porqu no la han
tomado). De esta forma al finalizar un proceso de entrenamiento se puede obtener un
mensaje como el que se muestra a continuacin (localizado en Espaol). Con esta
informacin se puede valorar el proceso de aprendizaje a fondo.
Este informe sobre la actividad se obtiene a travs del mtodo +
getReasonToStop() :String, obligado por el contrato de la interfaz
ProgressAnalyzer.

Razones de parada de los analizadores aglutinados:


{
....Error de Entrenamiento (Cuadrtico Medio) no ha encontrado razones hasta ahora
para detener el entrenamiento.
....Detenido porque Error de Validacin (Cuadrtico Medio) no decreca suficientemente
bien.
a[o] = 0.5487105; a[m] = 0.5487105; a[n] = 0.6852519
....Variacin de Pesos (Media Abs.) no ha encontrado razones hasta ahora para detener
el entrenamiento.
}

Este ejemplo proviene del entrenamiento de una red Perceptrn Multicapa, en


la que concurren cuatro analizadores. Tres de los analizadores actan con el papel de
hojas del patrn Composite (GoF) dos ValueDecreaseAnalyzers y un
ValueVariationAnalyzer. Finalmente, los analizadores anteriores estn
recogidos en un cuarto, un ComposedProgressAnalyzer, que ofrece la
conclusin final al Maestro. Es a esta ltima instancia a la cual se ha invocado el
mtodo getReasonToStop(), que ha sido el encargado de recavar la informacin
de sus analizadores mediante la misma invocacin.

h) El modelo de StatisticListener
Implantacin del patrn de diseo Observer (GoF). El modelo de
StatisticListers permite que elementos ajenos a la red neuronal y al maestro
sean informados del progreso de un entrenamiento. Para ello, el elemento que quiera
recibir las notificaciones ante los eventos ha de implantar la interfaz

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

71

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


StatisticsListener y suscribirse en la instancia Statistics que desee
observar3. que incluye los dos mtodos siguientes:

+ statsUpdate(statisticsEvent :StatisticsEvent).
Mtodo invocado por la instancia de Statistics observada, cada cierto
nmero de actualizaciones de sus registros estadsticos. No todas las
actualizaciones son notificadas ya que, al actuar de forma sncrona con las
invocaciones, la carga administrativa sera demasiado fuerte para el
proceso de entrenamiento. En concreto, se notifica una de cada
Statistics.NOTIFICATION_GAP actualizaciones.

+ statsClosed(statisticsEvent :StatisticsEvent).
Mtodo invocado por la instancia de Statistics observada una vez
que se ha finalizado el proceso de entrenamiento.

Las instancias de la clase StatisticsEvent viajan como parmetros del


mtodo de notificacin invocado. El nico contenido de las instancias de esta clase es
el Source u origen del evento. De esta manera, un elemento que pudiera estar suscrito
a diferentes estadsticas de entrenamiento puede llegar a distinguir de cul de ellas
proviene la notificacin.

Es a causa de esta suscripcin, para permitir el acceso a las estadsticas antes de que
comience el entrenamiento, por lo que se ha independizado la creacin de las
instancias de Statistics del mtodo de aprendizaje educateNetwork(). Para
ms referencias ver: 5.5.6. El Maestro (Teacher) > a) La clase abstracta Teacher.
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

72

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.8. Internacionalizacin y localizacin


Toda la carga de internacionalizacin y localizacin recae en la clase
Messages que se encarga del acceso a los Resource Bundles proporcionados con el
framework. Esta clase acceder a la localizacin del archivo de Resource Bundle
messages.properties, de la localizacin indicada por la configuracin de la
mquina virtual. La localizacin proporcionada por defecto es la inglesa (EN). Para
acceder a la localizacin de Espaol Castellano se acceder al archivo
messages_es.properties.
El framework incluye un nico Resource Bundle, situado en el paquete
com.jcortex, para almacenar los textos localizados. Este ser el nico archivo
para localizacin dentro de la distribucin estndar de JCortex. Extensiones
desarrolladas y proyectos que utilicen JCortex tendrn que establecer sus propios
archivos de localizacin. Se recomienda en estos casos, que se duplique la clase
Messages para tener acceso a todas las funcionalidades que ofrece.

Dentro de la clase Messages se proporciona una serie de mtodos estticos


que facilitan la obtencin de los textos localizados:

+ getString(key :String) :String. Mtodo por defecto


que adquiere el texto localizado indexado por la clave key.

+ getString(key :String, arg1 :Object,):String.


Mtodo que adquiere el texto localizado indexado por la clave key.
Adems sustituye en el mismo los placeholder (marcas) para los que se
ofrecen argumentos de tipo Object de forma explcita. Las marcas se
encuentran en el texto localizado y se indican con la cadena {i}
para el argumento i (" i # 0). Esta clase proporciona mtodos que
utilizan de 1 a 4 argumentos a ser sustituidos. Es importante sealar
que estos argumentos han de ser objetos sobre los que se puede invocar
el mtodo toString().

+ getString(key :String, args :Object[]):String.


Mtodo que adquiere el texto localizado indexado por la clave key.
Adems sustituye en el mismo los placeholder (marcas) para los que se
ofrecen argumentos de tipo Object a travs del array.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

73

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.5.9. Utilidades en el paquete bsico


Como apoyo al framework se incluyen dos clases con utilidades. En ellas se
recogen tareas que son necesarias en distintos puntos del framework, pero sin llegar a
formar parte de su actividad principal o a desempear un papel realmente
significativo. Ninguna de las acciones recogidas dentro de las utilidades son
determinantes en el rendimiento, bien sea por su uso poco frecuente o por su
simplicidad. Estas actividades no tienen cabida dentro de una de las clases antes
descritas en el paquete del ncleo, en la mayora de los casos porque pueden ser
utilizadas en diversos puntos del framework, sin corresponder exclusivamente a
ninguno.

a) Utilidades en ConsoleUtilities
Esta clase recoge las utilidades de apoyo al framework relacionadas con la
generacin de mensajes de texto para su presentacin por la interfaz de lnea de
comando.

+ static arrayToString(:float[]) :String. Representa


un vector de nmeros reales en forma de texto.

+ static arrayToString(:float[][]) :String.


Representa una matriz de nmeros reales en forma de texto.

+ static arrayToString(:boolean[]) :String.


Representa un vector de valores booleanos en forma de matriz.

+ static arrayToString(:boolean[][]) :String.


Representa una matriz de valores booleanos en forma de texto.

b) Utilidades en LoadAndStoreUtilities
Esta clase recoge las utilidades de apoyo al framework relacionadas con el
almacenamiento y recuperacin de la configuracin de los elementos del framework
en archivos XML.

+ static writeXMLFile(filepath :String, xmlDoc


:Document) :File. Almacena un documento XML en el archivo
indicado por su direccin lgica en el sistema de archivos.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

74

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

+ static writeXMLFile(file :File, xmlDoc


:Document) :File. Almacena un documento XML en el archivo
indicado por la instancia de la clase File.

+ static readXMLNeuralNetwork(filePath :String)


:NeuralNetwork. Carga desde un archivo XML una instancia de
NeuralNetwork. El archivo con la configuracin es pasado en forma de
direccin lgica en el sistema de archivos.

+ static static readXMLNeuralNetwork(file :File)


:NeuralNetwork. Carga desde un archivo XML una instancia de
NeuralNetwork. El archivo con la configuracin es pasado en forma de
instancia de la clase File.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

75

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6. Paquetes de Modelos de red


Los modelos de red no forman parte realmente del ncleo del framework, si
bien su participacin es imprescindible para desarrollar la estructura y el diseo del
ncleo, mostrar la potencia del framework, servir de ejemplo para otros desarrollos,
proporcionar una utilidad inmediata sin necesidad de programar nada de Redes
Neuronales Artificiales
Se ha procurado implantar modelos diferentes entre si para probar la
versatilidad del framework, a la vez que se ha buscado que estos sean los modelos
ms utilizados en proyectos reales. Los modelos proporcionados han de verse ms
desde el punto de vista de una plantilla de desarrollo que un desarrollo completo.
Funcionan al completo, si bien caben mejoras en cuanto a la calidad de sus resultados
y prestaciones.

Los distintos modelos de red del framework se agrupan en paquetes, dentro de


la estructura del framework com.jcortex. En la Ilustracin 4: Paquetes de
Modelos de Red se muestran los paquetes incluidos actualmente en el framework
JCortex. En los apartados siguientes se describen los aspectos ms relevantes de la
implantacin de cada uno de los modelos de red incluidos en el framework. Para
poder acceder a una explicacin detallada, ver Anexo A: Documentacin de la API
JCortex (en Ingls).

Ilustracin 4: Paquetes de Modelos de Red

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

76

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

com.jcortex.backPropagation
BackPropagationNeuron
DefaultMultilayerPerceptronTeacher
MultilayerPerceptronNeuralNetwork

Contiene clases genricas para los


modelos de red basados en el
mecanismo de Retropropagacin, as
como el modelo Perceptrn Multicapa
completo. Se basa en el Feed-Forward.

com.jcortex.feedForward
DefaultPerceptronTeacher
FeedForwardNeuralNetwork
FeedForwardNeuron
NeuronInTheList
PerceptronNeuralNetwork
ToDoList

Contiene clases genricas para los


modelos de red basados en el
mecanismo de propagacin hacia
delante, Feed-Forward. Incluye una
implantacin verstil del modelo
Perceptrn.

com.jcortex.hopfield
DefaultHopfieldTeacher
HopfieldNeuralNetwork

Contiene clases necesarias para la


implantacin de las redes de Hopfield.

com.jcortex.kohonen
CylinderHexKMap
CylinderSquareKMap
CylinderStarKMap

Contiene clases necesarias para la


implantacin del modelo de red de
Mapas de Kohonen.

Default2DKMap
DefaultKohonenTeacher
KohonenMap
KohonenNeuralNetwork
KohonenNeuron
SheetHexKMap
SheetSquareKMap
SheetStarKMap
ToroidHexKMap
ToroidSquareKMap
ToroidStarKMap

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

77

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6.1. Indicaciones de construccin para modelos de Redes


Neuronales artificiales en JCortex
Los modelos propuestos en el framework no son los nicos posibles. Es ms,
JCortex est pensado para que un usuario pueda implantar sus propios algoritmos,
modelos y funcionalidades. Se recomienda que todas las clases que participan en un
mismo modelo de red se encuentren juntas, en un nico paquete. Este paquete no ha
de estar obligatoriamente dentro de la jerarqua com.jcortex esta est reservada
exclusivamente para los modelos de red distribuidos con el framework sino que
puede situarse donde el usuario la necesite. Es recomendable que varios modelos de
red no compartan el mismo paquete.
Los modelos de red se pueden implantar de dos formas distintas. Una
implantacin pura, partiendo de las interfaces y clases abstractas del paquete
com.jcortex. O bien extendiendo un modelo de red ya implantado dentro del
framework o fuera de l.

El contenido habitual del paquete de un modelo de red es el siguiente:

Ha de haber una clase que extienda a NeuralNetwork, directamente o a


travs de otras clases intermedias. En esta clase se ha de modelar tanto la
estructura interna como el funcionamiento del modelo de red neuronal. El
nombre de esta clase tendr la forma *NeuralNetwork.

Opcionalmente puede haber una o ms clases que hereden de Neuron,


segn la naturaleza del modelo. Las instancias de estas clases sern las que
constituyan la estructura de la red. El nombre de estas clases tendr la
forma *Neuron.

Es imprescindible la presencia de al menos una clase que extienda a


Teacher. En ella residir la funcionalidad de entrenar las redes
generadas con el modelo de red. El nombre de estas clases tendr la forma
*Teacher.

Pueden ser necesarias otras clases propias del funcionamiento o


naturaleza de la red que tambin tendrn que ser recogidas dentro del
paquete del modelo.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

78

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6.2. Redes de Hopfield (com.jcortex.hopfield)


a. Descripcin de la Red
Las redes de Hopfield son redes de adaptacin probabilstica, recurrentes,
funcionalmente entraran en la categora de las memorias autoasociativas, es decir,
que aprenden a reconstruir los patrones de entrada que memorizaron durante el
entrenamiento. Son arquitecturas de una capa con interconexin total, funciones de
activacin booleana de umbral (cada unidad puede tomar dos estados, 0 o 1,
dependiendo de si la estimulacin total recibida supera determinado umbral),
adaptacin probabilstica de la activacin de las unidades, conexiones recurrentes y
simtricas, y regla de aprendizaje no supervisado.
Las Redes de Hopfield han sido seleccionadas para ser implantadas en JCortex
por su naturaleza distintiva respecto a otros modelos de red estructurados alrededor de
unidades pensantes.

b. Diseo del modelo


El enfoque tomado para la implantacin de este modelo es completamente
distinto al resto de los recogidos en el framework. En lugar de disponer de una
estructura interna constituida por neuronas, toda la informacin de la red neuronal se
recoge en una matriz numrica.
La Matriz de Pesos es una matriz cuadrada que contiene la informacin
aprendida por la red. Su tamao est determinado por el nmero de entradas o
atributos de los patrones a ser aprendidos. Esta matriz cuadrada est representada
como un array de arrays de nmeros reales. Es de resear que la recomendacin
realizada por Hopfield es que el nmero mximo de patrones no correlacionados que
se puede almacenar en una red es el 15% del nmero de sus neuronas, el decir, del
nmero de atributos registrados.
La implantacin de este modelo ha sido extremadamente simple, como se
muestra en el Diagrama de Clases 9: Modelo de Red de Hopfield, gracias a su
carencia de estructura interna. La clase HopfieldNeuralNetwork es
autocontenida no requiere de otros elementos para llevar a cabo el procesado de los
datos de entrada , por lo que nicamente necesita poseer una clase de tipo Teacher
HopfielTeacher que sepa entrenarla.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

79

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Clases 9: Modelo de Red de Hopfield

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

80

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

c.- Propagacin en la red de Hopfield


La propagacin de un estmulo a travs de una Red de Hopfield es un proceso
recursivo. El patrn de entrada para cada iteracin se obtiene, bien del estmulo
recibido por la red, bien de la salida de la iteracin anterior. En origen, el patrn de
entrada es el estmulo inicial que recibe la red que, supuestamente, es uno de los
patrones almacenados que puede estar afectado por un cierto ruido o desfase.
En cada una de las iteraciones, el patrn de entrada (X) sufre una serie de
transformaciones que deberan aproximarle cada vez ms a un estado estable de la red
de Hopfield. Este estado ser, idealmente, el patrn sin ruido almacenado en la red, al
cual est relacionada la entrada. El procesado del patrn de entrada se ha modelado
mediante una operacin entre vectores y matrices, siguiendo las ecuaciones:

Y '= X " Weights # Bias


Y = FuncinSignoHopfield(Y ')
Vistos en detalle los elementos que forman las estructuras matemticas:

# w1,1
%
w1,2
L xi ) " %
% M
%
$ w j,1

( y'1

y'2 L y'i ) = ( x1

( y1

y 2 L y i ) = FuncionSignoHopfield( y'1

x2

Smbolo Descripcin
X

Patrn de entrada de la iteracin.

y'2 L y'i )

Elemento

Variable

xi

float[] iterationInput

wi,j

float[][] weights

Vector de Bias.

bi

float[] bias

Patrn de salida de la iteracin.

yi

float[] iterationOutput

Weights Matriz con los pesos con la


configuracin de la red de
Hopfield.
Bias

L w1,i &
(
L w1,i (
) (b1 b2 L bi )
O M (
(
L w j,i '

w1,2
w 2,2
M
w j,2

La Funcin Signo definida por Hopfield, se implanta utilizando el mtodo


esttico
+
static
hopfieldSignFunction(iterationsInput
:float[], functionsInput :float[]) : float[] de la clase
HopfieldNeuralNetwork. A continuacin se muestra la definicin de la
funcin:
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

81

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

FuncionSignoHopfield( y'1

y'2

$ y'i > 0 "1


&
L y'i ) = % y'i = 0 " x i
& y' < 0 " #1
' i

Para controlar el proceso iterativo, se ha empleado la definicin de la Energa


de Hopfield (eH). Hopfield demostr que en cada iteracin el patrn de salida
evoluciona hacia una energa menor o igual que la de su patrn de entrada.
Para que se cumpla este comportamiento descrito por Hopfield, la
construccin de la matriz ha de asegurar una serie de condiciones:

La matriz ha de ser simtrica (wa,b = wb,a). Es decir, la conexin entre la


supuesta neurona i y la supuesta neurona j ha de tener el mismo peso que la
conexin entre la j y la i.

La matriz ha de tener toda su diagonal a 0 (wa,a = 0 ). De forma figurada, esto


se traducira en que una neurona de Hopfield no ha de estar conectada a si
misma.

La Ecuacin de la Energa del Hopfield se encapsula dentro del mtodo +


static
hopfieldEnergy(pattern
:float[],
weights
:float[][],
bias
:float[])
:float
de
la
clase
HopfieldNeuralNetwork. La energa se calcula siguiendo la funcin:

EnergaHopfield( X,Weights,Bias) = "

1
$ $ w j,i # x i # x j + $ x i # bi
2 i j%i
i

Aprovechando la caracterstica imprescindible de simetra, se puede reducir


considerablemente el nmero de operaciones. Slo es necesario calcular el producto
de los binomios que forman los elementos de la diagonal superior, omitiendo la
divisin entre 2. De esta manera se logra el cdigo compacto:
float energy = 0; int attributeCount = pattern.length;!int i,j;
for(i = 0; i < attributeCount; i++){
for(j = i+1; j < attributeCount; j++){
energy -= weights[i][j] * pattern[i] * pattern[j];
}!
energy += pattern[i] * bias[i];
}

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

82

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


A lo largo de la iteracin de propagacin, se mantiene almacenada en una
variable la energa del patrn de entrada. Al finalizar la iteracin, sta se compara con
la energa del patrn de salida obtenido. Pueden darse tres opciones:

eH del patrn de Entrada > eH del patrn de Salida: el caso ms


habitual. En l la red ha evolucionado hacia un patrn ms estable, es
decir, de menor energa.

eH del patrn de Entrada < eH del patrn de Salida: en este caso, la


red evoluciona hacia una situacin inestable, de mayor energa. El
entrenamiento se detiene antes de que empeore an ms, devolviendo
como patrn reconocido, el patrn de entrada de esta ltima iteracin. Es
de suponer que este patrn sea el que posea la energa mnima. El
entrenamiento ha finalizado en una situacin inestable.

eH del patrn de Entrada = eH del patrn de Salida: ser preciso


considerar dos escenarios:
o El patrn de Entrada es igual que el de Salida: el entrenamiento
habr finalizado en una situacin estable. El patrn habr sido
reconocido, y por tanto podr ser devuelto como respuesta al
estmulo introducido en la red.
o El patrn de Entrada es distinto que el de Salida: el
entrenamiento ha de continuar ya que puede ser el paso previo a
otro descenso de energa en una iteracin futura. El patrn no ha
sido reconocido.

Es importante sealar que no se est evitando un posible bucle en la


evolucin, entre patrones de igual eH. Tampoco se est controlando si se est
convergiendo en un mnimo local, en lugar de en el patrn almacenado que se
buscaba. En los casos anteriores, se ha de suponer que el usuario (programador) ha
dispuesto el vector de bias correcto para evitar situaciones anmalas.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

83

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Actividad 6: Propagacin en la Red de Hopfield

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

84

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

d. Entrenamiento de una Red de Hopfield


El maestro por defecto proporcionado con el framework, no tiene un
comportamiento recursivo, por lo que no tiene sentido llevar a cabo un seguimiento
de sus estadsticas. El proceso, tal y como ha sido modelado, responde a un algoritmo
matemtico con el cual los patrones de referencia se almacenan dentro de la matriz de
pesos de la red.
Como ya se ha visto en apartados anteriores, esta matriz ha de ser simtrica
respecto a su diagonal principal que, a su vez, ha de ser 0. El mtodo matemtico
propuesto por Hopfield observa la siguiente ecuacin, conocido como Aprendizaje de
Hebb:

Weights =

p
)
1&
P
"
P'
$
p
%
I
(# k
+
k
N ' k=1
*

Vistos en detalle los elementos que forman las estructuras matemticas:

" w1,1
$
$ w1,2
$ M
$
# w j,1

w1,2
w 2,2
M
w j,2

+L +

L w1,i %
'
L w1,i ' 1 1
= (x
O M ' N 1
'
L w j,i &

1 p
( x1
N

x 2p

x12

" x11 %
$ 1'
x
1
1
L x i ) ( $ 2 ' + ( x12
$M' N
$ 1'
# xi &

" x1p %
"1
$ p'
$
x 2 ' p $0
p
$
L xi ) (
) *
$ M ' N $M
$ p'
$
#0
# xi &

Smbolo Descripcin

x 22

" x12 %
$ 2'
x
2
L xi ) ( $ 2 ' +
$M'
$ 2'
# xi &

0 L 0%
'
1 L 0'
M O M'
'
0 L 1&
Elemento

Variable

El nmero de atributos de cada


patrn.

attributeCount

Pk

Vector de atributos de un patrn.

xk i

float[][] weights

i=1N
k=1p
p

El nmero de patrones que van a


ser almacenados en la red.

Matriz identidad.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

85

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Aprovechando la simetra de la matriz y las estructuras de datos propias
implantadas, se puede llegar a simplificar en gran medida el aparato matemtico
mostrado:

Slo es necesario calcular el valor de los elementos de un lado de la


diagonal. El otro lado puede ser copiado por simetra una vez los primeros
hayan sido completamente calculados.

Es posible extraer el cociente 1/N como factor comn del producto


vectorial de cada patrn. De esta forma slo es necesario realizar una nica
divisin por cada atributo.

La finalidad del ltimo trmino con la Matriz Identidad (I) es asegurar que
la diagonal de la matriz resultante sea 0. Esta operacin se puede resolver
con una simple asignacin (1 por cada atributo). Prescindiendo as de un
recorrido completo por la matriz.

A continuacin se describe en pseudocdigo el proceso de construccin de la matriz


numrica, en el que se han aplicado las optimizaciones expuestas anteriormente.
1. Inicializar la matriz de pesos float[][] weights.
1.1. Inicializar uno a uno los arrays float[] que cuelgan de weights[].
2. Clculo de los elemenos de la diagonal superior de la matriz.
for(k = 0; k < patterns.length; k++){
// k->pattern
for(i = 0; i < attributeCount; i++){ // i->lines
for(j = i+1; j < attributeCount; j++){
//j->columns
weights[i][j] += patterns[k][i] * patterns[k][j];
}
}
}
3. Recorre la diagonal y los elementos sobre la diagonal de la matriz,
realizando diversas operaciones: se asegura de que los elementos en la
diagonal tienen valor 0, divide el resto de los elementos de la diagonal
superior entre N, y copia su valor en la posicin simtrica.
for(i = 0; i < attributeCount; i++){
// i->lines
for(j = i+1; j < attributeCount; j++){ //j->columns
if(i != j){
weights[i][j] = weights[i][j]/attributeCount;
weights[j][i] = weights[i][j];
// Copies under the diagonal
}
else{
weights[i][i] = 0;
// 0 on the diagonal}
}
}

El maestro por defecto no calcula el vector de bias adecuado para la red


neuronal, aunque su uso s que est recogido dentro del funcionamiento descrito para
la Red de Hopfield. Por defecto, el maestro construir un vector de bias con todos los
atributos a 0. Esta configuracin implica que el bias no modifica en principio los
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

86

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


valores generados con el clculo matricial. Ser responsabilidad del usuario
(programador) establecer un bias personalizado, utilizando el mtodo de la clase
HopfieldNeuralNetwork, + setBias(:float[]).

e. Serializacin en XML
La mayor carga del almacenamiento en formato XML de la configuracin de
una red de Hopfield reside en la serializacin de la matriz de pesos.

<neuralNetwork class="com.jcortex.hopfield.HopfieldNeuralNetwork"
neuronCount="0" sensorCount="0"
inputTranslator="com.jcortex.translators.TransparentInputTranslator"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
attributeCount="24">
<weights>
<weight row="0" col="0" value="0.0"/>
<weight row="0" col="1" value="-0.083333336"/>
<weight row="0" col="2" value="-0.25"/>
<weight row="0" col="3" value="0.41666666"/>
<weight row="0" col="4" value="-0.16666667"/>
<weight row="0" col="5" value="0.083333336"/>
<weight row="0" col="6" value="0.083333336"/>
<weight row="0" col="7" value="-0.083333336"/>
<weight row="0" col="8" value="0.0"/>
<weight row="0" col="9" value="0.16666667"/>
<weight row="0" col="10" value="-0.083333336"/>
<weight row="0" col="11" value="0.083333336"/>
<weight row="0" col="12" value="-0.083333336"/>
<weight row="0" col="13" value="0.083333336"/>
<weight row="0" col="14" value="-0.083333336"/>
<weight row="0" col="15" value="-0.083333336"/>
<weight row="0" col="16" value="0.0"/>
<weight row="0" col="17" value="0.16666667"/>
<weight row="0" col="18" value="0.083333336"/>
<weight row="0" col="19" value="-0.083333336"/>
<weight row="0" col="20" value="0.16666667"/>
<weight row="0" col="21" value="-0.16666667"/>
<weight row="0" col="22" value="-0.25"/>
<weight row="0" col="23" value="0.083333336"/>
<weight row="1" col="0" value="-0.083333336"/>
! Se ha omitido el resto de parmetros de las filas 1 a la 23.
<weight row="23" col="23" value="0.0"/>
</weights>
<biasVector>
<bias ix="0" value="0.0"/>
<bias ix="1" value="0.0"/>
<bias ix="2" value="0.0"/>
<bias ix="3" value="0.0"/>
<bias ix="4" value="0.0"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

87

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


<bias ix="5" value="0.0"/>
<bias ix="6" value="0.0"/>
<bias ix="7" value="0.0"/>
<bias ix="8" value="0.0"/>
<bias ix="9" value="0.0"/>
<bias ix="10" value="0.0"/>
<bias ix="11" value="0.0"/>
<bias ix="12" value="0.0"/>
<bias ix="13" value="0.0"/>
<bias ix="14" value="0.0"/>
<bias ix="15" value="0.0"/>
<bias ix="16" value="0.0"/>
<bias ix="17" value="0.0"/>
<bias ix="18" value="0.0"/>
<bias ix="19" value="0.0"/>
<bias ix="20" value="0.0"/>
<bias ix="21" value="0.0"/>
<bias ix="22" value="0.0"/>
<bias ix="23" value="0.0"/>
</biasVector>
<teacher class="com.jcortex.hopfield.DefaultHopfieldTeacher"/>
</neuralNetwork>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

88

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6.3. Mapas de Kohonen (com.jcortex.kohonen)


a. Descripcin de la Red
Son redes autoorganizadas capaces de codificar y luego reconocer modelos de
rasgos caractersticos de un entorno.
Una vez entrenada, la red puede ser utilizada para la clasificacin de patrones
de entrada similares en un espacio n-dimensional. Una clase o grupo de patrones
similares tiende a controlar una neurona especfica, que representar el centro de una
esfera n-dimensiona. Esa neurona ser la ms activa frente a patrones similares a su
vector de pesos.
Despus del aprendizaje, la clasificacin consiste en presentar una entrada y
seleccionar la unidad ms activa, la ganadora, aplicando la funcin de Distancia. La
neurona ganadora ser la ms cercana al patrn de entrada.

b. Diseo del modelo


La clase principal del modelo es KohonenNeuralNetwork que hereda de
la clase abstracta NeuralNetwork. El principal problema de este tipo de red es la
gran diversidad de mapas de neuronas que es capaz de admitir. El diseo de un
framework ampliable y abierto exige que este modelo de red sea capaz de trabajar
sobre cualquier configuracin de mapa interno. Para permitir este paso, se ha
recurrido a la creacin de una nueva interfaz: KohonenMap.
En el diseo de este modelo de red se ha aislado la configuracin, de la
estructura interna de la clase KohonenNeuralNetwork. Esta ltima clase es la
que tradicionalmente tendra que poseer la estructura, al heredar de
NeuralNetwork. En su lugar, la red almacena una instancia de KohonenMap.
Son las realizaciones de esta clase abstracta las que contienen la funcionalidad y la
informacin asociada a la estructura de la red.
Este hecho es transparente para el usuario externo ya que la clase
KohonenNeuralNetwork proporciona un interfaz nico de acceso a la
informacin y los mtodos obligados de la instancia de KohonenMap asociada,
cumpliendo con el contrato de NeuralNetwork.
La estrecha relacin entre un mapa y la red a la que se encuentra asociado
obliga a llevar a cabo un proceso de integracin entre ambos, recogido en el mtodo +
integrateWithNeuralNetwork(KohonenNeuralNetwork
knn) de
KohonenMap. En este proceso se incluyen todas las neuronas del mapa dentro de la

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

89

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


coleccin mantenida por la red; y se trasladan las referencias a las instancias de
Sensor de la red al mapa, conectando red y mapa en la propagacin.

A la hora de describir la estructura de un Mapa de Kohonen es preciso


identificar dos atributos imprescindibles:

La Forma de la Neurona o del Vecindario. Dentro del smil geomtrico,


la forma de las neuronas que forman el mapa, determina la vecindad de
stas con las neuronas adyacentes. No slo variar el nmero de clulas
vecinas, sino incluso la distribucin de esta vecindad. En el conjunto de
mapas propuesto se recogen las siguientes formas:
o Cuadrada. Las neuronas poseen 4 vecinas, que se distribuyen de
acuerdo con las aristas de una neurona de geometra cuadrada.
o Hexagonal. Las neuronas poseen 6 vecinas, que se distribuyen de
acuerdo con las aristas de una neurona de geometra hexagonal.
o Estrellada. Las neuronas poseen 8 vecinas, que se distribuyen de
acuerdo con los vrtices y las aristas de una neurona de geometra
cuadrada.

Ilustracin 5: Formas de Vecindad4

En la figura, los nmeros de las neuronas de los mapas representan el radio de


vecindad ms bajo en el que la neurona entra en contacto con la central.
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

90

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

La Forma del Mapa. Si bien este parmetro posee una traslacin bastante
ilustrativa al mundo geomtrico, en realidad hace referencia al wrapping o
envoltura que realiza un mapa sobre si mismo. Se est definiendo de esta
manera el comportamiento de las neuronas del borde del mapa. En el
conjunto de mapas propuesto se recogen las siguientes formas:
o Fila. Este es un trmino ficticio, que realmente hace referencia a un
mapa de forma plana compuesto por una nica hilera de neuronas.
o Plana (Sheet). Las neuronas de los bordes del mapa no adquieren
ningn comportamiento especial. Sus nicas vecinas sern aquellas
que se encuentren contiguas a ellas mismas en el borde o hacia el
interior del mapa.
o Cilndrica. Las neuronas de los bordes verticales mantienen la
misma independencia que en la forma plana, mientras que las
neuronas de los extremos horizontales interpretan como vecinas
aquellas que se encuentran en el borde opuesto al suyo propio.
o Toroide. No slo las neuronas de los bordes horizontales
interpretan como vecinas la neuronas que se encuentran en el
extremo opuesto del mapa (como es el caso de la forma cilndrica),
sino que adems las neuronas verticales cumplen con el mismo
comportamiento aadido.

Tabla 5: Conjugacin de las Formas de Neurona y Mapa


Forma de Mapa
Cilndrica

Toroide

Hexagonal

Cuadrada

Plano (Sheet)

Estrellada

Forma de Neurona

Fila

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

91

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

La disposicin de las neuronas de forma geomtrica cuadrada (neuronas


cuadradas y estrelladas), sigue una matriz de n filas por m columnas. En la
Ilustracin 6: Distribucin de neuronas Cuadradas y Estrelladas se muestra el ejemplo
de distribucin y localizacin de estas neuronas en una red de 6x5.

C.1 C.2 C.3 C.4 C.5 C.6


Fila 1

10

15

20

25

Fila 2

11

16

21

26

Fila 3

12

17

22

27

Fila 4

13

18

23

28

Fila 5

14

19

24

29

Ilustracin 6: Distribucin de neuronas Cuadradas y Estrelladas

La disposicin de las neuronas de forma hexagonal sigue la orientacin de las


aristas para encajar como un panal de abejas. Al no poseer ngulos rectos, las filas se
organizan de acuerdo con una secuencia de zig-zag en un ngulo de 120, tal y como
se muestra en la Ilustracin 7: Distribucin de neuronas Hexagonales. Las columnas
mantienen su disposicin habitual.

Ilustracin 7: Distribucin de neuronas Hexagonales

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

92

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Para el sistema de wrapping o envoltura de los bordes de la red, se suponen las


vecindades mostradas en la Ilustracin 8: Wrapping de neuronas Cuadradas y la
Ilustracin 9: Wrapping de neuronas Hexagonales, ambas sobre una red de ejemplo de
6x5 neuronas.

29

14

19

24

29

25

10

15

20

25

26

11

16

21

26

27

12

17

22

27

28

13

18

23

28

29

14

19

24

29

25

10

15

20

25

Ilustracin 8: Wrapping de neuronas Cuadradas

Ilustracin 9: Wrapping de neuronas Hexagonales

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

93

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Tomando como base la Ilustracin 9: Wrapping de neuronas Hexagonales se
puede comprender fcilmente el porqu de la orientacin particular de la envoltura
cilndrica. Lo habitual hubiera sido optar por una envoltura en horizontal, dejando los
bordes verticales libres. Sin embargo, dada la naturaleza geomtrica de estas
neuronas, el nmero de columnas del mapa tendra que haber sido par. Con el fin de
imponer el mnimo nmero de restricciones, se ha reservado la envoltura horizontal
para la forma de mapa toroide.

Todas los modelos de mapas proporcionados con el framework JCortex


comparten gran nmero de caractersticas, ms all de las generalizadas al nivel de
abstraccin de KohonenMap. Es por ello que se ha creado un nivel de abstraccin
intermedio que resuelve, en la clase Default2DKMap, el almacenamiento de las
neuronas en una lista de elementos, sobre la que se aplican dos dimensiones: filas y
columnas. Proporciona a su vez la interfaz para la gestin del conjunto de neuronas.
En el Diagrama de Clases 10: KohonenMap y Default2DKMap se muestra el reparto
de responsabilidades entre ambas clases abstractas.

Diagrama de Clases 10: KohonenMap y Default2DKMap

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

94

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


La Tabla 6: Subclases de KohonenMap, muestra en qu clases se ha traducido
cada una de las posibles combinaciones de la Forma de la Neurona y la Envoltura del
Mapa. Cabe describir la nomenclatura recomendada para las distintas subclases de
KohonenMap:

Forma-del-Mapa + Forma-de-la-Neurona + KMap


(Se recomienda dar los nombres de las caractersticas en ingls.)

Hexagonal
Estrellada

Forma de la Neurona

Cuadrada

Tabla 6: Subclases de KohonenMap


Envoltura Mapa

Subclase de KohonenMap

Fila

SheetSquareKMap

Plana (Sheet)

SheetSquareKMap

Cilndrica

CylinderSquareKMap

Toroidal

ToroidSquareKMap

Fila

SheetHexKMap

Sheet

SheetHexKMap

Cilndrica

CylinderHexKMap

Toroidal

ToroidHexKMap

Fila

SheetStarKMap

Plana (Sheet)

SheetStarKMap

Cilndrica

CylinderStarKMap

Toroidal

ToroidStarKMap

Ilustacin

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

95

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


En el Diagrama de Clases 11: Modelo de Mapas de Kohonen se ha
representado el contenido completo del paquete com.jcortex.kohonen,
distribuido con el framework. Se han incluido las interfaces y clases abstractas bsicas
del paquete principal que definen el contrato de los elementos de la red neuronal en
JCortex.

Diagrama de Clases 11: Modelo de Mapas de Kohonen

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

96

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Las neuronas de los mapas de Kohonen se representan a travs de la clase
KohonenNeuron. Las instancias de esta clase cumplen las siguientes funciones:

Almacenar la configuracin propia de la neurona. Esto es, un vector de


pesos en el que se codifica un patrn que identifica a un grupo de
ejemplos. Los valores de los pesos se almacenan en el atributo de la
instancia - float[] weights. Este array posee tantas posiciones
como atributos tenga la entrada a la red (que equivale al nmero de
sensores de la misma). Se ha elegido esta estructura ya que el tamao de
entrada a una red es fijo, exigindose adems un rpido acceso directo a
los valores almacenados, con un coste de almacenamiento mnimo.

La sinapsis de la neurona se realiza directamente sobre el mtodo +


produceAxonValue() :float, ya que en las redes de Kohonen no
hay neuronas hijas conectadas. Este mtodo utiliza la instancia de
DistanceFunction almacenada en la neurona para obtener su valor de
similitud. Ser este valor el que determine si esta neurona es la ganadora
en la propagacin.

Gestionar la eleccin de la clase a la que pertenece la neurona, a partir de


los resultados de excitarla con un conjunto de ejemplos de entrenamiento.
Para este proceso es necesario almacenar las clases de los ejemplos para
los cuales esta neurona ha resultado ser la ganadora, y el nmero de
ejemplos de cada clase que han cado en la neurona. Est no es una accin
que se lleve a cabo a menudo, slo como ltimo paso del proceso de
entrenamiento, o en los sondeos estadsticos sobre la calidad del mismo. El
almacenamiento de una clase se lleva a cabo a utilizando del mtodo +
registerLastExampleClass(lastExampleClass:Object).
El resultado de la gestin se puede averiguar utilizando los mtodos:
o + getDominantClass() :Object. Para obtener la clase
dominante en la neurona.
o + getClusterSuccesses() :int. Para obtener el nmero
de ejemplos para los cuales esta neurona ha sido la ganadora, y
cuya clase coincide con la clase dominante en la neurona.
o + getClusterErrors() :int. Para obtener el nmero de
ejemplos para los cuales esta neurona ha sido la ganadora, y cuya
clase no coincide con la clase dominante en la neurona.

La dificultad que exige crear todos los mecanismos de gestin de las clases
recogidas en una neurona es que la neurona no puede conocer a priori el nmero de
clases posibles recogidas en el conjunto de entrenamiento. Ser necesario ir
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

97

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


recogiendo de forma dinmica en la neurona ganadora la clase y el nmero de
ejemplos que la avalan. Esta es la nica manera de poder decidir al finalizar el
entrenamiento qu clase representa cada neurona.
Para la gestin de las clases recogidas en una neurona se ha utilizado la
estructura de datos java.util.Hashtable. Cada una de las clases (atencin: son
instancias de Object) de los ejemplos recogidos en la neurona, se almacenar en la
tabla Hash como la clave. El contenido direccionado con esta clave ser una instancia
de Integer que envuelve el nmero de ejemplos de esta clase para los cuales esta
neurona ha sido la vencedora.

c. Propagacin
Los Mapas de Kohonen son redes competitivas en las que las neuronas pugnan
por ser seleccionadas como ganadora, es decir, aquella cuyo vector de pesos guarde
mayor similitud con el estmulo recibido.
La red neuronal extiende el mtodo Template Method +
pureThink(input :float) :float[], al que est obligada por ser una
instancia de NeuralNetwork. Sin embargo, este mtodo no se utiliza desde este
nivel, ya que se ha sobrecargado el mtodo + think(inputData :Object)
:Object de NeuralNetwork a nivel de KohonenNeuralNetwork. Es
necesario reconstruir este mtodo ya que la salida obtenida de excitar la red no es un
vector de valores numricos que ha de pasar por un traductor, sino que ser la clase
dominante de la neurona vencedora. Esta clase se trata directamente como una
instancia de Object.
El proceso de propagacin consiste en, una vez se han almacenado los valores
de la entrada dentro de los sensores de la red (instancias de Sensor), recorrer todas
las neuronas del mapa inducindolas a aplicar la funcin de distancia entre el vector
recibido y el vector de pesos caracterstico de la propia neurona. La funcin de
distancia utilizada es la almacenada en la neurona de Kohonen como una instancia de
DistanceFunction. Si bien no tiene sentido que haya distintas funciones de
distancia en un mismo mapa, el modelo actual permite su coexistencia. El valor de la
distancia calculada por la neurona es almacenado como su axon value.
Para el recorrido de las neuronas del mapa se utiliza el Iterator que ha de
generarse desde todas los modelos de mapa concretos, tal y como exige el contrato de
KohonenMap. A medida que se lleva a cabo la sinapsis en las neuronas, se mantiene
el registro de cul ha sido la mejor hasta el momento, esto es, aquella cuya distancia
entre vector de entrada y vector de pesos sea menor.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

98

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


El cdigo bsico es el siguiente:
// Inicializacin
KohonenNeuron kNeuron = null;
KohonenNeuron bestNeuron = null;
// Generates an iterator an starts using it to go though all the neurons
Iterator it = map.iterator();
// The first one is taken as the best straight away
if(it.hasNext()){
bestNeuron = (KohonenNeuron) it.next();
bestNeuron.produceAxonValue();
}
// The whole lot further from the first one
while(it.hasNext()){
// Makes the neuron work out its distance
kNeuron = (KohonenNeuron) it.next();
kNeuron.produceAxonValue();
// Keeps the best distance
if(kNeuron.getAxonValue() < bestNeuron.getAxonValue()){
bestNeuron = kn;
}
}

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

99

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

d. Maestro DefaultKohonenTeacher
El maestro propuesto por defecto para el entrenamiento de los Mapas de
Kohonen es una interpretacin simple, aunque rpida, del propuesto en el modelo
terico. A grandes rasgos, el algoritmo recorre los siguiente pasos:
1. Obtener la instancia de KohonenNeuralNetwork a entrenar y los atributos
necesarios de la misma.
2. Obtener las estadsticas y generar los analizadores.
3. Traducir el conjunto de ejemplos de entrenamiento.
4. Generar los vecindarios para su uso posterior.
5. Iterar sobre el conjunto de ejemplos de aprendizaje hasta que los
analizadores indiquen que se debe detener el entrenamiento. Para cada
iteracin sobre el conjunto de ejemplos:
5.1. Inicializar los contadores estadsticos.
5.2. Procesar el ejemplo:
5.2.1. Propagar el ejemplo a travs del mapa de Kohonen.
5.2.2. Registrar la neurona ganadora.
5.2.3. Obtener el vecindario de la neurona ganadora.
5.2.4. Entrenar las neuronas del vecindario.
5.3. Registrar los resultados estadsticos.
5.4. Consultar a los analizadores de progreso.
6. Finalizar cerrando las estadsticas.

Slo las neuronas que se encuentran dentro del radio de vecindad de la


neurona ganadora son las que obtienen como premio aprender del ejemplo. De esta
manera, a medida que fluyan las iteraciones, se irn perfilando zonas que agrupen
neuronas con la misma clase dominante. La ley de aprendizaje aplicada, se muestra en
la siguiente frmula:

W i (N + 1) = W i (N) + " # [ Input i $ W i (N)]


En esta expresin # representa el Factor de Aprendizaje. Su funcin es ajustar la
variacin que sufren los pesos de la neurona para permitir que aprenda de forma ms
!
suave, sin saltos. El valor del Factor de Aprendizaje no es el mismo para todas las
neuronas a entrenar. Slo en la neurona ganadora # ser el Factor de Aprendizaje
completo definido como parmetro de aprendizaje. Para el resto de las neuronas que
pertenecen al vecindario de la ganadora se aplica un modificador que reduce # para
reducir el efecto del aprendizaje sobre las mismas. En forma matemtica:

% Ganadora # FactorAprendizaje
" =&
' NoGanadora # FactorAprendizaje $
Siendo 0$%$1, definida en la clase DefaultKohonenTeacher como la variable
esttica DefaultKohonenTeacher.I_AM_NOT_THE_WINNER.
!
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

100

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Tabla 7: Parmetros de aprendizaje de DefaultKohonenTeacher
Parmetro

Tipo

Valor por
Defecto

Descripcin

analysisWindow

int

Tamao de la ventana utilizada por


los analizadores para tomar
decisiones sobre el progreso del
entrenamiento.

10

constantVariation

float

Margen bajo el cual una variacin se


considera constante.

0.0001f

learningRate

float

Factor de Aprendizaje propio de los 0.6f


algoritmos basados en aprendizaje
supervisado a partir de errores.

maxIterations

long

Nmero de iteraciones mximo.

1000

maxMisplacedPercent float

Nivel de error mximo aceptable para 0.05f


detener el entrenamiento.

neighbourhoodRadius int

Radio de Vecindad de la neurona.

Tabla 8: Analizadores no compuestos de DefaultKohonenTeacher


Analizador
(DefaultKohonenTeacher.)

Tipo

Descripcin
Porcentaje de
errores de
clasificacin. Esto
es, el nmero de
ejemplos que
tuvieron como
neurona ganadora
una en la cual la
clase dominante no
es la suya.

MISPLACED_EXAMPLES

ValueDecreaseAnalyzer

WEIGHT_VARIATION

ValueVariationAnalyzer Variacin absoluta


de los pesos de las
neuronas del mapa.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

101

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

e. Clculo de los Vecindarios


Una pieza clave en el aprendizaje de los Mapas de Kohonen es determinar los
vecindarios de las neuronas ya que mal manejado se hubiera podido convertir en una
de las tareas ms costosas en tiempo y recursos.

En la descripcin del proceso de aprendizaje se ha visto como es necesario


consultar por el vecindario de una neurona (la ganadora) por cada uno de los ejemplos
del conjunto de entrenamiento, para cada una de las iteraciones. Es muy probable que
la consulta se realice repetidas veces sobre la misma neurona. La nica forma de
minimizar el tiempo de consulta de este gran nmero de peticiones seguramente
repetitivas es precalcular los conjuntos de vecindad. Esta operacin se lleva a cabo
utilizando el mtodo + prepareNeighbourhoods(neighbourhoodRadius
:int) implantado en la clase abstracta KohonenMap.

El sistema de clculo de conjuntos de vecindad se basa en clculos lgicos


bsicos entre un vector y una matriz booleana.
La Matriz de Conexin Directa del Mapa es una matriz booleana que posee
una fila y una columna por cada una de las neuronas que forman el Mapa de
Kohonen. El cruce entre una neurona y otra se marca como true, si ambas neuronas
estn conectadas entre si en un vecindario de radio 1. En caso contrario se marcar
con false. Se obtiene de esta manera una matriz simtrica respecto a su diagonal
principal, cuyos elementos siempre estarn a true: una neurona por lgica ha de ser
vecina de si misma.
El Vector Vecindario de una Neurona es un vector que posee un valor
booleano por cada uno de las neuronas que forman el Mapa de Kohonen. Este vector
tendr siempre asociado un Radio de Vecindad. Un valor true para una posicin
representar que la neurona asociada a la posicin se encuentra en el vecindario de la
neurona a la que pertenece el vector; false en caso contrario. De esta forma el
Vector de Vecindad de radio 0 slo tendr sealada a true la posicin de la propia
neurona.5
La operacin matrixANDvector (Operador $) aplica clculos lgicos sobre
el Vector Vecindario de radio r de una neurona con la Matriz de Conexin Directa del

Las posiciones de una neurona en el vector y la matriz se corresponden con su


identificador numrico, obtenido por getId(), tomado como ndice.
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

102

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


mapa, para obtener el Vector de Vecindario de radio r+1 de la neurona. En forma
matemtica:
vectorr +1 (n) = vectorr (n) "

matriz

Visto en detalle:
!

"v1n,r +1 % " v1n,r %


" m1,1 m1,2 L m1, j
L m1,N %
$ n,r +1 ' $ n,r '
$
'
$v 2 ' $ v 2 '
$ m2,1 m2,2 L m2, j L m2,N '
$ M ' $ M '
$ M
M
O
M
M '
$ n,r +1 ' = $ n,r ' ( $
'=
$v j ' $ v j '
$ mi,1 mi,2 L mi, j= j,i L mi,N '
$ M ' $ M '
$ M
M
M
O
M '
$ n,r +1 ' $ n,r '
$
'
# mN ,1 mN ,2 L mN , j L mN ,N &
#v N & # v N &
" v n,r +1 = (v n,r ) m ) * (v n,r ) m ) *L* (v n,r ) m ) *L* (v n,r ) m ) %
1
1
1,1
1
2,1
1
i,1
1
N ,1
$ n,r
'
+1
n,r
n,r
n,r
n,r
$ v 2 = (v 2 ) m1,2 ) * (v1 ) m2,2 ) *L* (v1 ) mi,2 ) *L* (v 2 ) mN ,2 ) '
$
'
M
'
= $ n,r +1
n,r
n,r
n,r
n,r
$ v j = (v j ) mi, j ) * (v j ) mi, j ) *L* (v j ) mi, j ) *L* (v j ) mN , j ) '
$
'
M
$$ n,r +1
''
n,r
n,r
n,r
n,r
v
=
v
)
m
*
v
)
m
*L*
v
)
m
*L*
v
)
m
(
)
(
)
(
)
(
)
N
N
i,N
N
i,N
N
i,N
N
N
,N
#
&

Smbolo

Descripcin

matriz

Variable

vjn,r

cVector

El nmero de atributos de cada


patrn.

Matriz de Conexiones Directas del


mapa.

mi,j

cMatrix

vectorr(n) Vector de Vecindad de la neurona


n para el radio de vecindad r.
N

Elemento

De forma textual, cada vez que se aplique el operador $ entre un Vector de


Vecindad y la Matriz de Conexiones Directas lo que se est haciendo es marcar como
vecinas (true en el vector) las neuronas que se encuentran en la vecindad directa de
aquellas que ya estn marcadas en el vector. En el framework, se define en el mtodo
esttico de la clase KohonenMap - static matrixANDvector(matrix
:boolean[][], vector :boolean[]) :boolean[]. El cdigo de la
operacin es el siguiente:
private static boolean[] matrixANDvector(boolean[][]matrix,boolean[]vector)
{

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

103

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


int i,j;
boolean op;
boolean[] result = new boolean[vector.length];
// Goes through all the neurons in the vector.
for(i = 0; i < vector.length; i++){
op = false;
for(j = 0; !op && j < vector.length; j++){
op = matrix[i][j] && vector[j];
// Basic operation
}
result[i] = op;
}
return result;
}

La aplicacin sucesiva de esta operacin sobre el vector resultante, permiten


escalar el vecindario hasta cualquier Radio de Vecindad, a partir del radio ms simple
e inmediato de obtener: el radio 0, en el que slo est a true la propia neurona.

El nico inconveniente que se plantea es la creacin de la Matriz de


Conexin Directa para el mapa. La conexin directa entre neuronas depende por
completo de la estructura de cada mapa. Es por ello que se genera a nivel de estancia
concreta de KohonenMap, utilizando el mtodo Template Method (GoF) exigido por
el
contrato
de
esta
clase
abstracta
+
createConnectionMatrix(neuronCount :int) :boolean[][]. Los
mecanismos seguidos en cada uno de los modelos se describen en el apartado
siguiente.

Se opt por una aproximacin matricial al clculo de los vecindarios, en lugar


de emplear el algoritmo recursivo que resultara evidente, por su mejor rendimiento.
Un enfoque recursivo hubiera disparado tiempos de ejecucin y consumo de recursos.
Cada una de las llamadas a la funcin podra desencadenar en 4, 6 o hasta 8 llamadas
recursivas en los modelos de red incluidos con el sistema (neuronas cuadradas,
hexagonales o estrelladas respectivamente). La complejidad de este proceso tendra
un crecimiento cercano al exponencial con el aumento del nmero de neuronas en el
mapa, mxime si se introducen opciones de envoltura.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

104

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

f. Construccin de las Matrices de Conexin Directa


A continuacin se muestran las matrices y las pruebas que se llevaron a cabo
para determinar el proceso concreto de su creacin en cada uno de los tipos de mapa.
En cada caso se propone un ejemplo con 30 neuronas, repartidas en 5 filas y 6
columnas. Los esquemas de los mapas se corresponden con los diseos mostrados en
Ilustracin 8: Wrapping de neuronas Cuadradas y Ilustracin 9: Wrapping de
neuronas Hexagonales, segn sea la forma de la neurona.
En estas matrices las casillas a 1 (verde) representan aquellas en las que una
neurona se encuentra en la vecindad de otra. Las casillas con 0 o vacas (blanco)
representan neuronas que no se encuentran en vecindad mutua. Bajo cada una de las
tablas se representa el proceso de propagacin del vecindario de una neurona desde su
Vector de Vecindad de radio 0, hasta el 5.
Hexagonal - Sheet (sin wrapping)
0
1
2
3
4
5
6
7
8
9

0
1
1

1
1
1
1

1
1

2
1
1
1

1
1
1

4
0

1
1
0

1
1

1
1

10
11
12
13
14

1
1
0

5
1
1

6
1
1

1
1

0
1
1

1
1
1

1
1
1

0
1
1

1
1

1
1
1

1
1
0

1
1

1
1

1
1

1
0

1
1

1
1

1
2

1
1

1
1

0
1
1

1
1
1

1
1

1
4

1
5

1
1

0
1
1
1

15
16
17
18
19

1
3

1
1
1

1
1
0

1
1

1
1

20
21
22
23
24

1
1
0

1
1

1
6

1
1

1
7

1
1

0
1
1

1
1
1

1
1
1

0
1
1

1
8

1
9

1
1

1
1
1

1
1
0

1
1

1
1

1
1

2
1

1
1

1
0

1
1

1
2

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
3
1
1
1
1
1
1

1
1

2
3

1
1

0
1
1

2
2

1
1
1

1
1

2
4

2
5

1
1

0
1
1
1

25
26
27
28
29

IN
1
2
3
4
5

2
0

1
1
1

1
1
0

1
1

1
1

1
1

2
6

1
1

2
7

1
1

0
1
1

1
1

1
1
1

1
1
1

2
8

2
9

1
1

1
1
1

1
1

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
0
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

105

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Hexagonal - Cylinder
0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

2
1
1
1

1
1
1

1
1
1

1
1

1
1
0

1
1

1
1

10
11
12
13
14

1
1
0

1
1

1
1
1

1
1

1
0

1
1

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

1
1
1

1
1
1

1
1

1
1

1
1

15
16
17
18
19

1
1

1
1

1
1
1

1
1
1

2
1

1
1

2
2

2
3

2
4

2
5

1
1

2
6

2
7

2
8

2
9

1
1

1
1

1
1
1

1
1
1

1
1
1

1
1
0

1
1

1
1

20
21
22
23
24

1
1
0

1
1

1
1
1

1
1

0
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1

1
1

1
1

25
26
27
28
29

IN
1
2
3
4
5

2
0

1
1

1
1
1

1
1
1

9
1

1
1

0
1
1

1
1

1
1

1
1
1

1
1
1

1
1
1
1

1
1

1
1

1
1
1

0
1
1

1
1

1
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

9
1
1
1
1
1
1

1
1

1
1

1
1
1

1
1

0
1
1

1
1

1
1
1

1
1

1
1

1
1
1

1
1
1

1
1

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
0
1
1

0
0
1
1
1

0
0
1
1
1

0
0
0
1
1

0
0
0
1
1

0
0
0
1
1

0
0
0
1
1

0
0
0
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

106

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Hexagonal - Toroid
0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

2
1
1
1

1
1
1

1
1
1

1
1

1
1
0

1
1

1
1

10
11
12
13
14

1
1
0

1
1

1
1
1

1
1

1
0

1
1

1
2

1
3

1
1
1

1
1
1

1
1
1

1
1

1
1

1
1

15
16
17
18
19

1
1

1
1

1
1

1
1
1

1
1
1

1
1
1

1
1

1
1

IN
1
2
3
4
5

1
1
1

1
1
1

1
1
0

1
1

1
1

20
21
22
23
24
25
26
27
28
29

1
4

1
1
0

1
1

1
5

1
6

1
7

1
8

1
9

2
0

1
1

1
1

2
2

2
3

2
4

2
5

1
1

2
6
1
1

2
7

1
1

2
8

2
9

1
1

0
1
1

1
1
1

1
1

0
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1

1
1

1
1

1
1

1
1

1
1

1
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1

1
1

2
1

1
1

1
1
1

9
1

1
1

0
1
1

1
1
1

1
1
0

1
1

1
1

0
1
1

1
1
1

1
1

0
1
1

1
1

1
1
1

1
1

1
1

1
1
1

1
1
1

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
0
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

1
1
2
9
1
1
1
1
1
1

107

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Square - Sheet (no wrapping)


0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1

1
1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1
1
1

10
11
12
13
14

1
1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1
1
1

15
16
17
18
19

1
1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1
1
1

20
21
22
23
24

1
1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1
1
1

25
26
27
28
29

IN
1
2
3
4
5

2
0

1
1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1
1

1
0

1
1

1
2

0
0
0
0
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
3
1
1
1
1
1
1

1
1
1

1
1

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
0
0
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
0
0
0

0
0
0
0
1

0
0
0
1
1

0
0
1
1
1

0
0
0
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

108

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Square - Cylinder
0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

2
1
1
1

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1

10
11
12
13
14

1
1
1
1

1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1

15
16
17
18
19

1
1
1
1

1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1

20
21
22
23
24

1
1
1
1

1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1

25
26
27
28
29

IN
1
2
3
4
5

2
0

1
1
1
1

1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
0

1
1

1
2

0
0
0
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
3
1
1
1
1
1
1

1
1
1
1

1
1
1

1
1

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
0
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
0
0
1

0
0
0
0
1

0
0
0
1
1

0
0
1
1
1

0
0
0
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

109

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Square - Toroid
0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

2
1
1
1

1
0

1
1

1
2

1
3

1
4

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

1
1
1

2
6

0
1

1
1

1
1
1

1
1

2
9

1
1

1
1

2
8

1
1

1
1

2
7

1
1
1
1

1
1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1

15
16
17
18
19

1
1
1
1

1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1

20
21
22
23
24

IN
1
2
3
4
5

1
6

10
11
12
13
14

25
26
27
28
29

1
5

1
1
1
1

1
1

1
1
1

1
1
1
0

1
0
1
1

1
1
1
1

1
1
1

1
1
1
1

1
1
1
1

1
1

1
1
1
0

1
1

1
0
1
1

1
1

1
1
1
1

1
1

1
0

1
1

1
2

0
0
0
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
3
1
1
1
1
1
1

1
1
1
1

1
1
1

1
1

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
0
0
1
1

0
0
0
1
1

0
0
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
0
0
1

0
0
0
0
1

0
0
0
1
1

0
0
1
1
1

0
0
0
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

110

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Star - Sheet (no wrapping)


0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

1
1

2
1
1
1

0
1
1
1

1
1
1

1
1

1
1
1

1
1
0

1
1
1

1
1
1

10
11
12
13
14

1
1
0

7
1
1
1

0
1
1

1
1
1

1
1
1

1
0

1
1
1

1
1

0
1
1
1

0
1
1

1
1
1

1
1
0

1
1
1

1
1
1

15
16
17
18
19

1
1
0

1
1

1
1

1
1
1

1
2

1
1
1

0
1
1

1
1
1

1
1
1

1
4

1
5

1
1
1

1
1

0
1
1
1

0
1
1

1
3

1
1
1

1
1
0

1
1
1

1
1
1

20
21
22
23
24

1
1
0

1
1

1
6

1
1
1

1
7

1
1
1

0
1
1

1
1
1

1
1
1

1
9

2
0

1
1
1

1
1

0
1
1
1

0
1
1

1
8

1
1
1

0
1
1
1

1
1
1

25
26
27
28
29

IN
1
2
3
4
5

1
1

1
1
0

1
0

1
1

1
2

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
3
1
1
1
1
1
1

1
1

2
1

1
1
1

2
2

1
1
1

0
1
1

1
1
1

1
1
1

2
4

2
5

1
1
1

1
1

0
1
1
1

0
1
1

2
3

1
1
1

1
1
0

1
1
1

1
1

2
6

1
1
1

2
7

1
1
1

0
1
1

1
1
1

1
1

1
1
1

2
8

2
9

1
1
1

1
1
0

1
1
1

1
1
1

1
1

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
1
1
1

0
0
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

111

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Star - Cylinder
0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

1
1

2
1
1
1

1
1
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1
1

1
1
1

10
11
12
13
14

1
1
0

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
1
1

1
1
1

1
1
1

1
1
1

15
16
17
18
19

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

1
1
0

0
1
1

1
1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

20
21
22
23
24

1
1
0

0
1
1

1
1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

25
26
27
28
29

IN
1
2
3
4
5

1
9

1
1
1
1

1
1
1

1
1
0

0
1
1

1
1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

0
0
0
1
1

0
0
0
1
1

0
0
0
1
1

0
0
0
1
1

0
0
0
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

2
2
1
1
1
1
1
1

0
1
1

1
1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1

2
3

2
4

2
5

2
6

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1

2
7

2
8

2
9

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

112

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Star - Toroid
0

0
1
2
3
4

1
1

1
1
1

5
6
7
8
9

1
1

2
1
1
1

1
1
1
1

1
1
1

1
1

1
1
1

1
1
1

1
1
1

1
1
1

10
11
12
13
14

1
1
0

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
0

1
1

1
2

1
3

1
1
1

1
1
1

1
1
1

1
1
1

15
16
17
18
19

IN
1
2
3
4
5

1
5

1
6

1
7

1
1
0

1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
0

1
1

1
1
1

1
1
1

1
1

2
1

2
2

2
3

2
4

2
5

2
6

1
1

1
1
1

2
7

2
8

2
9
1

1
1
1

1
1
1

1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
0

1
1
1

2
0

1
1
1
1

1
9

1
1
1
1

1
1

1
8

20
21
22
23
24
25
26
27
28
29

1
4

1
1
1
1

1
1
1

0
1
1

1
1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
0
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

2
2
1
1
1
1
1
1

0
1
1

1
1
1

1
1
1
1

1
1
1

1
1
1

1
1
1

1
1

2
3

2
4

2
5

2
6

1
1
1
1
1

0
1
1
1
1

0
1
1
1
1

1
1
1
1
1

1
1
1

1
1
1

1
1
1

1
1
1

1
1

2
7

2
8

2
9

1
1
1
1
1

1
1
1
1
1

0
1
1
1
1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

113

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

g. Serializacin en XML
La mayor carga de trabajo en la serializacin de las Mapas de Kohonen es el
almacenamiento de los pesos de cada una de las neuronas. Es en el fondo en estos
pesos donde se est almacenando la informacin de la red. Tambin se guardan los
datos de configuracin necesarios para poder reconstruirla, siguiendo la metodologa
de trabajo con XML anteriormente documentada.
<neuralNetwork class="com.jcortex.kohonen.KohonenNeuralNetwork"
neuronCount="24" sensorCount="57"
inputTranslator="com.jcortex.translators.TransparentInputTranslator"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
neighbourhoodShape="1">
<kmap class="com.jcortex.kohonen.CylinderHexKMap" rows="4" columns="6"/>
<neuron class="com.jcortex.kohonen.KohonenNeuron" id="0"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFuncti
on" neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.44997883"/>
<entry entry="-2" weight="0.6483059"/>
<entry entry="-3" weight="0.26400942"/>
<entry entry="-4" weight="0.70277363"/>
<entry entry="-5" weight="0.6560223"/>
<entry entry="-6" weight="0.5321597"/>
<entry entry="-7" weight="0.7569439"/>
<entry entry="-8" weight="0.54573894"/>
<entry entry="-9" weight="0.27227366"/>
<entry entry="-10" weight="0.0851264"/>
<entry entry="-11" weight="0.32600105"/>
<entry entry="-12" weight="0.43089312"/>
<entry entry="-13" weight="0.22756328"/>
<entry entry="-14" weight="0.63259524"/>
<entry entry="-15" weight="0.19224365"/>
<entry entry="-16" weight="0.5933614"/>
<entry entry="-17" weight="0.633659"/>
<entry entry="-18" weight="0.114406504"/>
<entry entry="-19" weight="0.22308083"/>
<entry entry="-20" weight="0.46485943"/>
<entry entry="-21" weight="0.21386817"/>
<entry entry="-22" weight="0.5893505"/>
<entry entry="-23" weight="0.26973826"/>
<entry entry="-24" weight="0.32525367"/>
<entry entry="-25" weight="0.16904715"/>
<entry entry="-26" weight="0.59232694"/>
<entry entry="-27" weight="0.14317566"/>
<entry entry="-28" weight="0.9005484"/>
<entry entry="-29" weight="0.7701142"/>
<entry entry="-30" weight="0.36541304"/>
<entry entry="-31" weight="0.45704892"/>
<entry entry="-32" weight="0.24202602"/>
<entry entry="-33" weight="0.63768333"/>
<entry entry="-34" weight="0.62507075"/>
<entry entry="-35" weight="0.5721791"/>
<entry entry="-36" weight="0.5307817"/>
<entry entry="-37" weight="0.42867833"/>
<entry entry="-38" weight="0.69789916"/>
<entry entry="-39" weight="0.744212"/>
<entry entry="-40" weight="0.65122235"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

114

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


<entry entry="-41" weight="0.3038286"/>
<entry entry="-42" weight="0.88952297"/>
<entry entry="-43" weight="0.40145975"/>
<entry entry="-44" weight="0.7137737"/>
<entry entry="-45" weight="0.3893802"/>
<entry entry="-46" weight="0.34767807"/>
<entry entry="-47" weight="0.49127114"/>
<entry entry="-48" weight="0.90430146"/>
<entry entry="-49" weight="0.63695836"/>
<entry entry="-50" weight="0.39226708"/>
<entry entry="-51" weight="0.21518014"/>
<entry entry="-52" weight="0.30000395"/>
<entry entry="-53" weight="0.60939234"/>
<entry entry="-54" weight="0.25245282"/>
<entry entry="-55" weight="0.775401"/>
<entry entry="-56" weight="0.8400013"/>
<entry entry="-57" weight="0.5092916"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
<examplesClassCount class="0.0" count="3"/>
</examplesInClasses>
</neuron>
! Los datos de las neuronas 1 a 23 han sido omitidos.
<teacher class="com.jcortex.kohonen.DefaultKohonenTeacher"
learningRate="0.4" neighbourhoodRadius="1" maxIterations="500"
avgDistanceAccepted="0.05" constantVariation="1.0E-4"
analysisWindow="100"/>
</neuralNetwork>

La red serializada presenta el siguiente aspecto, tal y como lo representa el


entorno de desarrollo JCortexBuilder.

Ilustracin 10: Ejemplo de Mapa de Kohonen

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

115

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6.4. Modelo Genrico Feed-Forward


a. Descripcin de la red genrica
Modelo genrico que sirve como base para cualquier modelo de Red Neuronal
Artificial en el que el proceso de propagacin se lleve a cabo por el avance de los
estmulos desde las neuronas ms cercanas a los sensores (capa de entrada) hacia
delante (downstream o corriente-abajo). En el caso de redes sin recurrencias, la
propagacin finaliza cuando el estmulo ha alcanzado y activado las ltimas
neuronas de la red, las que no tienen ningn elemento conectado a las mismas (capa
de salida). Este modelo intermedio soporta a su vez la existencia de realimentacin
entre las neuronas de la red. En este caso la propagacin finalizar cuando no se
produzcan ms cambios significativos en los niveles de activacin de las neuronas.
Sobre la arquitectura Feed-Forward, se pueden llegar a crear modelos de red
simples como el ADALINE, complejos como el Perceptrn Multicapa o incluso ms.

b. Diseo del modelo de propagacin - ToDoList


Este modelo genrico carece de Maestros ya que slo interesa plantear la
funcionalidad comn a todas las redes Feed-Forward: su sistema de propagacin. Se
toman las siguientes convenciones de nomenclatura:
Sean dos neuronas, A y B, en una red Feed-Forward. Si la neurona B
toma como entrada el valor de A, asignndole un peso a esta
conexin; A ser una entrada de B, mientras que B ser un hijo de la
neurona A. Por lo tanto, el flujo corriente-abajo fluir desde A hasta
B: de entradas a hijos.

En un primer momento se tante con un sistema de propagacin mucho ms


parecido al modelo biolgico primario: las neuronas seran entidades (instancias) que,
al ser procesadas, activaran las neuronas que estuvieran conectadas a ellas corrienteabajo. Si bien este sistema parece mucho ms intuitivo y paralelizable, presenta
grandes problemas por su tiempo de ejecucin y consumo de recursos. Se puede
llegar a producir una explosin de invocaciones en cadena de una neurona a la
siguiente, y de ah al siguiente nivel de conexin. Lo habitual es que una neurona
tenga ms de una entrada, por lo que la mayor parte de las activaciones seran en
falso: la neurona realizara sus clculos sin disponer de toda la informacin de entrada

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

116

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


estable y actualizada. El problema llega a ser mucho ms grave si se da cabida a la
realimentacin en la red, ya que dara lugar a una explosin de invocaciones sin final.
El denominado Modelo Biolgico fue desechado tras las primeras pruebas
posteriores a su desarrollo al comprobar la gravedad de sus deficiencias en consumo
de recursos y tiempo de ejecucin.

El sistema de propagacin finalmente empleado se bautiz como Modelo


ToDoList. En este sistema, el control de la propagacin gira en torno a una lista de
neuronas a ser procesadas. La ToDoList acta como una cola con una poltica similar
a la FIFO, de la cual se extrae de la cima la siguiente neurona a ser procesada, y se
aade al final (cola) los hijos de las neuronas que han sido procesadas.
Las neuronas Feed-Forward, modeladas a travs de la clase abstracta
FeedForwardNeuron, son capaces de activar conexiones sinpticas. Tal y como
se describe en el 5.5.2. Relacin entre AxonSource, AxonReceiver, Sensor y
Neuron > a) Puntualizaciones sobre las neuronas (Neuron), el mtodo +
synapse() :Collection no slo genera el valor de activacin de la red, sino
que adems obtiene el conjunto de neuronas afectadas. Un final temprano aunque
exitoso se producira en el caso de que la entrada no generara cambios en el valor de
activacin de la neurona (axon value en el modelo AxonSource). Al no verse
afectadas el resto de las neuronas conectadas, estas no tendrn que ser aadidas a la
lista de propagacin ya que, al menos en lo que corresponde a esta entrada, su valor
permanecer inalterable.
La implantacin proporcionada de la clase ToDoList tiene su interfaz y
sistema de trabajo preparado para el uso de prioridades en forma de pesos. Para ello la
lista no trabaja directamente con objetos de la clase Neuron, sino con instancias de
la clase NeuronInTheList que envuelven en una misma entidad la referencia a la
neurona y su peso. Es posible comparar las instancias de NeuronInTheList al
haber implantado los mtodos + compareTo(otherNeuron :Object) :int
y + equals(otherNeuron :Object) :boolean que atienden a la prioridad
e identidad de la neurona. De forma que ordenar una lista de mayor a menor prioridad
es tan simple como ordenar la estructura de datos que contenga las instancias de
NeuronInTheList. El criterio de prioridad se basa en los dos puntos siguientes:

A menor peso, mayor prioridad, por lo tanto ms cerca estar la neurona


de la cima de la ToDoList.

A igualdad de peso, la prioridad se decidir por el menor identificador de


neurona. Para tomar esta decisin se ha partido de la idea de que la
numeracin de las neuronas se produce desde el principio hasta el final de
la red. De esta manera, en situaciones de recursividad se dar prioridad a

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

117

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


las neuronas que estn ms cerca de los sensores, y cuyos cambios sea ms
posible que se propaguen.
Dos instancias de ToDoList sern iguales cuando hagan referencia a la misma
neurona. Para simplificar esta comparacin slo es necesario trabajar con los
identificadores numricos de las instancias de Neuron.

Sin embargo, la implantacin actual ignora el uso de prioridades. La razn


es que en el sistema actual no se considera que un proceso tan costoso en tiempo
como es la ordenacin sistemtica de una estructura de datos sea imprescindible. Ms
cuando esta ordenacin tenga que ser llevada a cabo, en principio, al menos una vez
por neurona para cada propagacin. El consumo es desorbitado, por lo que a estas
alturas compensa tener el sistema preparado, pero ignorar la prioridades y pagar, a
cambio, algunas posibles activaciones adicionales de neuronas que podran haberse
ahorrado.

Un punto importante para el funcionamiento de la ToDoList es que no se


permite la presencia de neuronas duplicadas dentro de ella. En la situacin actual las
neuronas repetidas son ignoradas. Para acelerar este proceso en la implantacin actual
se incluye un vector auxiliar neuronsPresent :boolean[] que mantiene una
posicin para cada una de las neuronas de la red. Si la neurona est ya presente, este
valor ser true y false en caso contrario. En el caso de utilizar una aproximacin
con prioridades, se retendr en la lista la neurona con mayor prioridad (menor peso).
Para ello puede ser ms cmodo que el array auxiliar sea de enteros y contenga el
peso con el que la neurona est presente en la red.

Para facilitar el uso de las instancias de ToDoList, esta clase implementa la


interfaz Iterator. De esta manera es posible avanzar a travs de la lista de
neuronas por ser procesadas empleando nicamente los mtodos + hasNext()
:boolean y + next() :Object. En este ltimo se ha optado por proporcionar
un servicio sincronizado con vistas a futuras implantaciones paralelizadas.

Los pasos a seguir en el trabajo con la ToDoList, utilizando adems


prioridades, son los siguientes:
1. Inicializar ToDoList con la coleccin de First Neurons de la red
neuronal. Son aquellas neuronas que estn directamente conectadas a los
sensores de la red. Peso de las neuronas iniciales 0.
2. Hay ms elementos en la lista?: toDoList.hasNext();
3. Obtener el elemento y realizar la sinapsis.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

118

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


4. Aadir las neuronas devueltas por la sinapsis a la lista con
5. Ordenar la ToDoList
6. Volver al paso 2.

peso +1.

La implantacin actual, ignorando el uso de prioridades es la siguiente:


// The list is prepared
this.toDoList = new ToDoList(this.neurons.size());
// Starts by activating the NeuralStimulus that leads onto the first neurons
this.toDoList.add(this.getConnectedNeurons(), 0);
// Goes deeper into the neuron network
while(this.toDoList.hasNext()){
/* Visits the first element, calculating the new neuron's value, taking
* it out from the toDoList. As a result of the synapse methods it
* obtains the neurons connected to this one and adds them
* on to the list.
*/
Collection thisNeuronsChilds = ((FeedForwardNeuron)
this.toDoList.next()).synapse();
this.toDoList.add(thisNeuronsChilds, -1);// Weight is ignored
}

Para llevar a cabo la sinapsis, las neuronas Feed-Forward utilizan dos


funciones: una Funcin de Red para aglutinar todas las entradas en un valor nico, y
una Funcin de Activacin que determina el estado de activacin de la red. Estas
funciones se configuran en la neurona mediante instancias de NetworkFunction y
ActivationFunction respectivamente. El proceso matemtico utilizado se
describe a continuacin:
v = networkFunction( x1, x 2 ,L, x k )
y = activationFunction(v )

Smbolo

Descripcin

Elemento

Variable

Valor conjunto de las entradas de


red.

float networkResult

El valor de las entradas a la red.

xi

entries.values()

Estado de activacin de la neurona.

float axonValue

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

119

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Ilustracin 11: Ejemplo de Propagacin Feed-Forward - Sin recursividad

ToDoList (cima " cola)

Iteracin

Procesado

0, 1, 2

1, 2, 3, 4

2, 3, 4

3, 4

4, 5

fin

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

120

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Ilustracin 12: Ejemplo de Propagacin Feed-Forward - Con recursividad

ToDoList (cima " cola)

Iteracin

Procesado

0, 1, 2

1, 2, 3, 4

2, 3, 4, 5

3, 4, 5

4, 5, 0, 6

5, 0, 6

0, 6, 2

6, 2, 3, 4

2, 3, 4

3, 4, 5

bucle a partir de
iteracin 2

En el Diagrama de Clases 12: Modelo de Red Feed-Forward y Perceptrn se


ha representado el contenido completo del paquete com.jcortex.feedForward,
distribuido con el framework. Se ha incluido las interfaces y clases abstractas bsicas
del paquete principal que definen el contrato de los elementos de la red neuronal.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

121

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Clases 12: Modelo de Red Feed-Forward y Perceptrn

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

122

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6.4. Modelo Perceptrn (com.jcortex.feedForward)


a. Descripcin de la Red
Las redes Perceptrn, formadas por una nica neurona similar a la de
McCullock-Pitts, se encuentran entre los primeros acercamientos a las Redes
Neuronales Artificiales. Si bien al estar constituido por una nica neurona poco se
podra considerar una red.
El sistema bsico que se proporciona a travs del modelo Feed-Forward se
correspondera ms con una neurona ADALINE, ya que esta ltima es realmente
mucho ms verstil que las Perceptrn tradicionales. Se puede configurar para su uso
con distintas funciones de red y de activacin.

b. Diseo del modelo


Para la creacin de este modelo slo ha sido preciso crear una clase para la red
neuronal (PerceptronNeuralNetwork) y un Maestro capaz de educar las redes
de este modelo (DefaultPerceptronTeacher). Estas clases pueden apreciarse
en el Diagrama de Clases 12: Modelo de Red Feed-Forward y Perceptrn, situado en
el apartado anterior.
El constructor de PerceptronNeuralNetwork se encarga por su cuenta
de crear una neurona Perceptrn pura a partir de la verstil que ofrece el modelo
genrico Feed-Forward. Dentro de las posibilidades que ofrece la neurona
FeedForwardNeuron, la red impone:

Al ser la nica neurona su identificador ser 0.

La Funcin de Red ser una LinearBasisFunction.

La Funcin de Activacin ser una StepFunction con umbral en 0,5.

Esta nica neurona ser a la vez first neuron, por estar conectada a los sensores, y end
neuron por ser la que proporciona la salida a la red.

c. Propagacin
La propagacin se realiza sobre el modelo genrico Feed-Forward del que
heredan todos los elementos de red de este modelo.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

123

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

d. Maestro DefaultPerceptronTeacher
El maestro por defecto suministrado con el framework JCortex emplea, para la
educacin de la red Perceptrn una implantacin del Algoritmo de Adaptacin de
Pesos. Este algoritmo se basa en ajustar los parmetros de la neurona (los pesos
asociados a sus conexiones de entrada) a partir de los errores producidos al paso de un
conjunto de ejemplos.
Para ms informacin consultar la descripcin del mtodo +
educateNetwork(:NeuralNetwork,
:Object[],
:Object[])
:Statistics de la clase DefaultPerceptronTeacher en el Anexo A:
Documentacin de la API JCortex.

Tabla 9: Parmetros de aprendizaje de DefaultPerceptronTeacher


Parmetro

Tipo

Descripcin

Valor por
Defecto

acceptableError

float

Mximo error admisible para finalizar 0.05f


el entrenamiento.

analysisWindow

int

Tamao de la ventana utilizada por


los analizadores para tomar
decisiones sobre el progreso del
entrenamiento.

10

constantVariation

float

Margen bajo el cual una variacin se


considera constante.

0.0001f

learningRate

float

Factor de Aprendizaje propio de los 0.5f


algoritmos basados en aprendizaje
supervisado a partir de errores.

maxIterations

long

Nmero de iteraciones mximo.

1000

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

124

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Tabla 10: Analizadores no compuestos de DefaultPerceptrnTeacher
Analizador
(DefaultPerceptronTeacher.)

Tipo

Descripcin

TRAINING_ERROR

ValueDecreaseAnalyzer

Error cuadrtico
medio de
Entrenamiento.

VALIDATION_ERROR

ValueDecreaseAnalyzer

Error cuadrtico
medio de
Validacin.

WEIGHT_VARIATION

ValueVariationAnalyzer Variacin
absoluta de los
pesos de las
neuronas del
mapa.

f. Serializacin en XML
La serializacin de este modelo de red es muy sencilla y rpida, ya que slo
necesita almacenar la configuracin de una nica neurona.

<neuralNetwork class="com.jcortex.feedForward.PerceptronNeuralNetwork"
inputTranslator="com.jcortex.translators.TransparentInputTranslator"
neuronCount="1"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
sensorCount="2">
<neuron activationFunction="com.jcortex.activationFunctions.StepFunction"
activationParamsCount="1"
class="com.jcortex.feedForward.FeedForwardNeuron" id="0"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="0.5"/>
</parameters>
<entries>
<entry id="-1" weight="-28.797607"/>
<entry id="-2" weight="20.38462"/>
</entries>
</neuron>
<firstNeurons size="1">
<neuronRef id="0"/>
</firstNeurons>
<endNeurons size="1">
<neuronRef id="0"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

125

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


</endNeurons>
<teacher acceptableError="0.05" analysisWindow="10"
class="com.jcortex.feedForward.DefaultPerceptronTeacher"
constantVariation="1.0E-4" learningRate="0.5" maxIterations="500"
validationPercent="0.2"/>
</neuralNetwork>

La red serializada presenta el siguiente aspecto, tal y como lo representa el


entorno de desarrollo JCortexBuilder.

Ilustracin 13: Ejemplo de Red Perceptrn

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

126

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.6.5. Modelo Preceptrn Multicapa


(com.jcortex.backPropagation)
a. Descripcin de la Red
La Red Perceptrn Multicapa es la red Back-Propagation por excelencia. Es
un de los modelos de red ms ampliamente utilizados en la industria.
Formalmente, el Perceptrn Multicapa es una red Feed-Forward a la que se le
han aadido unas funcionalidades especiales para poder realizar un aprendizaje
utilizando retropropagacin. Esto significa que a travs de los elementos de la red
viajarn dos tipos de seales:

Seales de Funcin: seales de entrada que se propagan a lo largo de la


red desde la entrada hasta la salida.

Seales de Error: seales que se originan en la capa de salida y se


propagan hacia la entrada durante el proceso de entrenamiento.

Las neuronas de la red Perceptrn Multicapa se organizan, como su propio


nombre indica, en mltiples capas completamente conectadas entre si en cadena. Una
capa slo tiene acceso a la inmediatamente anterior y la inmediatamente posterior.
Los sensores pueden considerarse como la primera capa, previa a la capa se entrada,
y las end neurons pueden ser consideradas como la capa de salida. El resto de las
capas intermedias se denominan capas ocultas. Este modelo representa una red
completamente conectada (fully-connected), lo que significa que cada neurona toma
como entradas todas las neuronas de la capa anterior, y es a su vez entrada para todas
las neuronas de la capa siguiente.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

127

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

b. Diseo del modelo


La implantacin de este modelo de red neuronal artifical slo requiere tres
clases, que extiendan las proporcionadas por el modelo intermedio Feed-Forward. El
modelo Perceptrn Multicapa no deja de ser un sistema de neuronas de propagacin
hacia delante, con unas funciones e informacin adicionales que les permita propagar
el error en sentido contrario para su aprendizaje. Las clases de este modelo estn
representadas en el Diagrama de Clases 13: Modelo de Red Perceptrn Multicapa, en
el que tambin se representa sus relaciones con las clases Feed-Forward y del paquete
principal.

La
clase
MultilayerPerceptronNeuralNetwork
extiende
FeedForwardNeuralNerwork, lo que le proporciona todas las caractersticas y
atribuciones de NeuralNetwork. El modelo intermedio Feed-Forward proporciona
todas las funcionalidades relacionadas con el funcionamiento y propagacin de la red.
La nica responsabilidad ha de acatar esta clase es la gestin de su estructura interna,
lo que incluye su creacin, almacenamiento y recuperacin.
El sistema de capas en que se organiza la red Perceptrn Multicapa se recoge
dentro
de
la
estructura
de
datos

neuronLayers
:BackPropagationNeuron[][] . El acceso a las neuronas concretas se lleva a
cabo mediante dos ndices [i][j]: el primero indica la capa, mientras que el segundo
identifica a la neurona concreta de la capa. Este esquema de almacenamiento
aprovecha las caractersticas propias del lenguaje JAVA, por el cual la variable
neuronLayer[i]
realmente
hace
referencia
a
un
array
de
tipo
BackPropagationNeuron[] de cualquier dimensin. Es importante resaltar que
al contrario de otros lenguajes cuyas matrices multidimensionales estn forzadas a
poseer el mismo tamao en todas sus conjuntos de elementos (n-1)-dimensionales, en
Java estas estructuras se ajustan al tamao justo, a pesar de trabajar con capas de
tamao muy dispar. Se ha de tomar en consideracin a su vez que la almacenada en la
estructura de capas no es la nica referencia que la red neuronal posee de la neurona.
A nivel de NeuralNetwork las neuronas se almacenan en el interior de una lista
List que permite un acceso directo cuando se requiere una neurona por su
identificador. El propio constructor de la red Perceptron Multicapa se encarga de crear
las neuronas preparadas para la retropropagacin, situarlas en el esquema de capas,
conectarlas completamente con la capa anterior, almacenarlas en la lista conjunta del
nivel superior y dar de alta las ltimas como end neurons.

Las neuronas BackPropagationNeuron extienden tambin el concepto


de neurona implantado a nivel de red Feed-Forward. En este nuevo nivel de
especializacin, la neurona adquiere las caractersticas necesarias para participar del
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

128

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


aprendizaje por retropropagacin. La neurona adquiere la capacidad de calcular su
gradiente y almacenarlo. Para ello se recurre a los siguientes mtodos:

+ getGradient() :float. Obtiene el ltimo valor de gradiente


calculado por la neurona.

+ calculateGradient(desired_output :float) :float.


Calcula el gradiente para las neuronas de la capa de salida. Slo en estas es
posible indicar cul deba haber sido la salida deseada y, con ella, calcular
el error cometido por la neurona. Esta medida de error es la utilizada para
realizar el ajuste de los pesos de la neurona.

+ calculateGradient() :float. Las neuronas que se


encuentran en una de las capas ocultas no pueden conocer durante el
proceso de entrenamiento cul es la salida que se supone deban producir.
Su error ha de ser calculado mediante los gradientes de sus neuronas hijas
para poder tener una pista de qu sentido e intensidad ha de tener el ajuste
de los pesos. ste mtodo no recibe parmetros ya que ha de ser la propia
neurona la que construya su gradiente a partir de los gradientes de aquellas
para las cuales esta es una entrada.

Para poder calcular el gradiente de una neurona, es preciso que su Funcin de


Activacin no sea simplemente una instancia de tipo ActivationFunction, sino
que
ha
de
ser
una
especializacin
de
esta:
BackPropagationActivationFunction. Son estas ltimas las que poseen
los mecanismos necesarios para calcular la derivada de la Funcin de Activacin,
imprescindible para obtener el valor del gradiente.

La clase DefaultMultilayerPerceptronTeacher modela el maestro


por defecto para esta red. Como todos los maestros en JCortex hereda directamente de
la clase Teacher. El proceso de entrenamiento de una red Perceptrn Multicapa es
largo y complejo, como se describe en el apartado d. Maestro
DefaultMultilayerPerceptronTeacher.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

129

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Diagrama de Clases 13: Modelo de Red Perceptrn Multicapa

c. Propagacin
La propagacin se realiza sobre el modelo genrico Feed-Forward del que
heredan todos los elementos de red de este modelo.

d. Maestro DefaultMultilayerPerceptronTeacher
El maestro proporcionado por defecto para el modelo de red Perceptrn
Multicapa es una implantacin del algoritmo de Aprendizaje Supervisado por
Adaptacin de Pesos basado en el mecanismo de Retropropagacin. Este algoritmo
se basa en ajustar los parmetros de la neurona (los pesos asociados a sus conexiones
de entrada) a partir de los errores producidos al paso de un conjunto de ejemplos,
utilizando el mecanismo de retropropagacin para alcanzar las neuronas de las capas
ocultas.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

130

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Para ms informacin consultar la descripcin del mtodo +
educateNetwork(:NeuralNetwork,
:Object[],
:Object[])
:Statistics de la clase DefaultMultilayerPerceptronTeacher en el
Anexo A: Documentacin de la API JCortex.

Tabla 11: Parmetros de aprendizaje de


DefaultMultilayerPerceptronTeacher
Parmetro

Tipo

Valor por
Defecto

Descripcin

acceptableError

float

Mximo error admisible para finalizar 0.05f


el entrenamiento.

analysisWindow

int

Tamao de la ventana utilizada por


los analizadores para tomar
decisiones sobre el progreso del
entrenamiento.

10

constantVariation

float

Margen bajo el cual una variacin se


considera constante.

0.0001f

learningRate

float

Factor de Aprendizaje propio de los 0.5f


algoritmos basados en aprendizaje
supervisado a partir de errores.

maxIterations

long

Nmero de iteraciones mximo.

1000

Tabla 12: Analizadores no compuestos de


DefaultMultilayerPerceptrnTeacher
Analizador
(DefaultMultilayerPerceptronTeacher.)
TRAINING_ERROR

Tipo

ValueDecreaseAnalyzer

Descripcin
Error cuadrtico
medio de
Entrenamiento.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

131

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Error cuadrtico
medio de
Validacin.

VALIDATION_ERROR

ValueDecreaseAnalyzer

WEIGHT_VARIATION

ValueVariationAnalyzer Variacin absoluta


de los pesos de las
neuronas del mapa.

e. Serializacin en XML
Ejemplo de archivo generado para una red neuronal Perceptrn Multicapa de
dos capas con 2 neuronas en la capa de entrada y una neurona en la capa de salida,
representada en la Ilustracin 14. El cdigo XML se muestra sin los nodos raiz
correspondientes a la definicin del documento y descritos en el apartado 5.2.3.
Metodologa de trabajo con XML > c) Formato bsico de los documentos XML
generados por JCortex.

<neuralNetwork
class="com.jcortex.backPropagation.MultilayerPerceptronNeuralNetwork"
inputTranslator="com.jcortex.translators.TransparentInputTranslator"
neuronCount="3"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
sensorCount="2">
<layers count="2">
<layer ix="0" size="2"/>
<layer ix="1" size="1"/>
</layers>
<neuron
activationFunction="com.jcortex.activationFunctions.SigmoidalFunction"
activationParamsCount="1"
class="com.jcortex.backPropagation.BackPropagationNeuron" id="0"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="0.5"/>
</parameters>
<entries>
<entry id="-1" weight="2.7147276"/>
<entry id="-2" weight="0.997935"/>
</entries>
</neuron>
<neuron
activationFunction="com.jcortex.activationFunctions.SigmoidalFunction"
activationParamsCount="1"
class="com.jcortex.backPropagation.BackPropagationNeuron" id="1"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="0.5"/>
</parameters>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

132

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


<entries>
<entry id="-1" weight="2.645915"/>
<entry id="-2" weight="1.3748711"/>
</entries>
</neuron>
<neuron
activationFunction="com.jcortex.activationFunctions.SigmoidalFunction"
activationParamsCount="1"
class="com.jcortex.backPropagation.BackPropagationNeuron" id="2"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="0.5"/>
</parameters>
<entries>
<entry id="1" weight="6.2097344"/>
<entry id="0" weight="6.0428324"/>
</entries>
</neuron>
<firstNeurons size="2">
<neuronRef id="0"/>
<neuronRef id="1"/>
</firstNeurons>
<endNeurons size="1">
<neuronRef id="2"/>
</endNeurons>
<teacher acceptableError="0.05" analysisWindow="50"
class="com.jcortex.backPropagation.DefaultMultilayerPerceptronTeacher"
constantVariation="1.0E-4" learningRate="0.4" maxIterations="500"
validationPercent="0.2"/>
</neuralNetwork>

Ilustracin 14: Ejemplo de Red Perceptrn Multicapa

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

133

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.7. Estudio de Optimizacin


Los estudios de optimizacin realizados a lo largo del proceso de desarrollo
del framework han permitido identificar las actividades ms costosas y minimizar el
tiempo de proceso. Han sido realizados sobre los mtodos de aprendizaje de los
maestros asociados a cada modelo de Red Neuronal Artificial. Esta decisin se tom
con la idea de reducir al mximo el tiempo de la tarea tradicionalmente ms pesada (el
entrenamiento de la red). Adems, un entrenamiento supone a menudo gran cantidad
de pruebas dentro de la red, por lo que los procesos de propagacin pueden ser
estudiados de una manera inmejorable.
Se ha seguido un proceso iterativo en el que se suceda los anlisis de
optimizacin con el rediseo de los mtodos de pensamiento y entrenamiento. Los
resultados generados en los sucesivos estudios resultaron de gran utilidad a la hora de
afinar las estructuras de datos empleadas en las distintas tareas, ajustar los caminos de
ejecucin, y centrar los esfuerzos de optimizacin en las tareas ms repetitivas y
pesadas.
En los apartados siguientes 5.7.1. Entrenamiento de un Perceptrn Multicapa
y 5.7.2. Entrenamiento de un Mapa de Kohonen se muestra el volcado generado por
la herramienta de profile Shark del aprendizaje de estos dos modelos de red. En estos
informes los mtodos no se muestran en orden cronolgico de invocacin, sino de
acuerdo con su tiempo de ejecucin. Ambos anlisis se realizaron sobre una mquina
RISC PowerPC G4 a 1,67GHz con 512 MB de RAM, sobre Mac OS X 10.4. Las
pruebas se realizaron lanzando los procesos de entrenamiento sobre el entorno de
desarrollo JCortexBuilder, por lo que en ocasiones se pueden observar mtodos
ejecutados sobre elementos de la interfaz. Estas llamadas, aunque no sean visibles,
son comunes en las notificaciones de los StatsListeners.

5.7.1. Entrenamiento de un Perceptrn Multicapa


#
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Generated from the visible portion of the outline view


14113.4 ms Thread:run (java.lang)
+ 14113.4 ms TeachInAThread:run (com.jcortex.builder)
| + 14113.4 ms DefaultMultilayerPerceptronTeacher:educateNetwork (...backProp...)
| | + 7470.2 ms BackPropagationNeuron:calculateGradient (...jcortex.backPropagation)
| | | + 5856.0 ms FeedForwardNeuron:getEntryWeight (com.jcortex.feedForward)
| | | |
718.3 ms Hashtable:get (java.util)
| | |
760.4 ms AbstractList:iterator (java.util)
| | |
471.2 ms AbstractList$Itr:hasNext (java.util)
| | |
36.0 ms AbstractList$Itr:next (java.util)
| | |
0.4 ms FeedForwardNeuron:getActivationFunction (com.jcortex.feedForward)
| | + 4804.7 ms FeedForwardNeuralNetwork:pureThink (com.jcortex.feedForward)
| | | + 2445.4 ms Neuron:synapse (com.jcortex)
| | | | + 2403.1 ms FeedForwardNeuron:produceAxonValue (com.jcortex.feedForward)
| | | | | + 1976.7 ms LinearBasisFunction:getSolution (com.jcortex.networkFunctions)
| | | | | | - 692.0 ms Collections$SynchronizedCollection:iterator (java.util)

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

134

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
+
|
|
|

|
|
|
|
+
|
|
|
|
+
|
+
|
|
|

| | - 490.7 ms Hashtable$Enumerator:hasNext (java.util)


| |
363.6 ms Hashtable$Enumerator:next (java.util)
| + 376.3 ms SigmoidalFunction:getSolution (com.jcortex.activationFunctions)
| | - 376.3 ms Math:exp (java.lang)
2133.1 ms ToDoList:add (com.jcortex.feedForward)
471.4 ms AbstractList$Itr:hasNext (java.util)
442.5 ms AbstractList:iterator (java.util)
- 404.4 ms LinkedList:add (java.util)
43.5 ms AbstractList$Itr:next (java.util)
79.9 ms ToDoList:nextElement (com.jcortex.feedForward)
- 77.5 ms LinkedList:remove (java.util)
55.9 ms ToDoList:<init> (com.jcortex.feedForward)
13.7 ms 0x514d1100000138 [unknown] (Unknown Library)
- 6.9 ms Arrays:fill (java.util)
- 0.3 ms LinkedList:<init> (java.util)
14.4 ms ToDoList:hasMoreElements (com.jcortex.feedForward)
6.8 ms AbstractList:iterator (java.util)
5.7 ms Collections$SynchronizedCollection:size (java.util)
1.5 ms AbstractList$Itr:hasNext (java.util)
485.0 ms Collections$SynchronizedCollection:iterator (java.util)
385.4 ms Hashtable$Enumerator:hasNext (java.util)
338.9 ms Hashtable$Enumerator:next (java.util)
138.4 ms Statistics:addRegister (com.jcortex)
+ 137.3 ms Statistics:notifyUpdate2Listeners (com.jcortex)
| - 80.5 ms TrainingProgressRepresentation:statsUpdate (com.jcortex.builder)
| - 37.5 ms StatsMeasureXYGraphJPanel:statsUpdate (...jcortex.builder.reports)
| - 19.3 ms JReportFrame:statsUpdate (com.jcortex.builder)
75.5 ms Statistics:finishedStats (com.jcortex)
+ 75.5 ms Statistics:notifyEnd2Listeners (com.jcortex)
| - 75.5 ms JReportFrame:statsClosed (com.jcortex.builder)
22.4 ms FeedForwardNeuron:getEntries (com.jcortex.feedForward)
13.8 ms ComposedProgressAnalyzer:isProgressGoodEnough (com.jcortex)
+ 13.4 ms ValueDecreaseAnalyzer:isProgressGoodEnough (com.jcortex)
| - 12.6 ms StringBuffer:append (java.lang)
0.3 ms LinkedList$ListItr:hasNext (java.util)

5.7.2. Entrenamiento de un Mapa de Kohonen


+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

11856.0 ms Thread:run (java.lang)


+ 11856.0 ms TeachInAThread:run (com.jcortex.builder)
| + 11856.0 ms DefaultKohonenTeacher:educateNetwork (com.jcortex.kohonen)
| | + 9082.2 ms KohonenNeuralNetwork:pureThink (com.jcortex.kohonen)
| | | + 8764.6 ms KohonenMap:pureThink (com.jcortex.kohonen)
| | | | + 8198.2 ms KohonenNeuron:produceAxonValue (com.jcortex.kohonen)
| | | | |
7972.2 ms EuclideanDistanceFunction:getDistance (...distanceFunctions)
| | | | - 208.4 ms AbstractList$Itr:next (java.util)
| | | |
190.6 ms AbstractList$Itr:hasNext (java.util)
| | | | - 79.1 ms Default2DKMap:iterator (com.jcortex.kohonen)
| |
1971.1 ms KohonenNeuron:learnFromLastInput (com.jcortex.kohonen)
| | + 370.9 ms Statistics:addRegister (com.jcortex)
| | | - 357.1 ms Statistics:notifyUpdate2Listeners (com.jcortex)
| | | + 5.7 ms StatsMeasure:addRegister (com.jcortex)
| | | |
1.3 ms Math:max (java.lang)
| | | |
1.3 ms Vector:add (java.util)

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

135

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
+
|
|
|
+
|
+
|
|
|
|
+
|
|
|
|
|

- 3.1 ms Collections$SynchronizedMap:get (java.util)


1.1 ms StatsRegister:<init> (com.jcortex)
154.3 ms KohonenNeuron:registerLastExampleClass (com.jcortex.kohonen)
34.8 ms Hashtable:put (java.util)
15.0 ms Hashtable:containsKey (java.util)
8.8 ms Hashtable:get (java.util)
110.0 ms Statistics:finishedStats (com.jcortex)
- 110.0 ms Statistics:notifyEnd2Listeners (com.jcortex)
50.9 ms AbstractSequentialList:iterator (java.util)
13.9 ms KohonenNeuron:getClusterErrors (com.jcortex.kohonen)
- 7.0 ms Collections$SynchronizedCollection:iterator (java.util)
3.1 ms Hashtable$Enumerator:next (java.util)
- 1.8 ms Hashtable$Enumerator:hasNext (java.util)
- 0.3 ms KohonenNeuron:getClusterSuccesses (com.jcortex.kohonen)
7.8 ms AbstractList$Itr:next (java.util)
6.4 ms KohonenNeuron:clearExamplesInClasses (com.jcortex.kohonen)
5.7 ms ComposedProgressAnalyzer:isProgressGoodEnough (com.jcortex)
+ 1.9 ms ValueDecreaseAnalyzer:isProgressGoodEnough (com.jcortex)
|
0.9 ms LinkedList:size (java.util)
|
0.3 ms LinkedList:add (java.util)
+ 1.6 ms AbstractSequentialList:iterator (java.util)
| - 1.6 ms AbstractList:listIterator (java.util)
4.1 ms AbstractList$Itr:hasNext (java.util)
+ 2.8 ms KohonenNeuralNetwork:getBestNeighbourhood (com.jcortex.kohonen)
|
2.8 ms KohonenMap:getNeighbours (com.jcortex.kohonen)
- 0.4 ms Collections$SynchronizedCollection:iterator (java.util)

5.7.3. Resultados de los anlisis mostrados


Los ejemplos anteriores muestran una tendencia muy buena en el
entrenamiento de las redes: el proceso de aprendizaje dedica prcticamente la
totalidad de su tiempo a los clculos imprescindibles. Como clculos imprescindibles
se consideran las operaciones matemticas esenciales incluidas en los algoritmos de
aprendizaje, as como las tareas imprescindibles de gestin y avance a travs de listas.
En todo momento se ha procurado evitar que acciones auxiliares absorban el tiempo
de entrenamiento. Como acciones auxiliares pueden ser la recogida de estadsticas,
su anlisis, la seleccin de la clase dominante gestin y consulta de estructuras de
datos, respuesta a las notificaciones, y otras tareas adicionales que no forman parte del
algoritmo matemtico puro.
Es agradable observar como en el caso del Perceptrn Multicapa, el efecto
descrito anteriormente se manifiesta en que las barras de tiempos ms altas con
diferencia son las que recogen el acumulado de los tiempos de propagacin de los
ejemplos por la red y entrenamiento. Es comprensible que el entrenamiento sea una
labor pesada si se tiene en cuenta la complejidad matemtica e iterativa del algoritmo
de retropropagacin del error que requiere una gran carga de clculos. Por otro lado
el tiempo dedicado a las tareas estadsticas y otras auxiliares es ridculo en
comparacin.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

136

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


El mismo efecto se produce en el entrenamiento de los Mapas de Kohonen. En
el ejemplo se muestra como la mayor parte del tiempo se dedica, con diferencia, al
proceso de propagacin del estmulo dentro de la red. Esto se debe a que se ha de
calcular la distancia entre el ejemplo recibido y los pesos de la neurona en todas y
cada una de las neuronas para todas las iteraciones. Este clculo incluye una raz
cuadrada que aade un punto de complejidad al clculo matemtico. En comparacin
el resto de tiempos resulta nfimo. Ms, si se tiene en cuenta que en el acumulado de
Estadsticas&Clase se est recogiendo tambin el proceso de seleccin de la clase
dominante.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

137

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6. Desarrollo del IDE JCortexBuilder

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

138

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.1. El IDE JCortexBuilder


JCortexBuilder es el perfecto compaero para el framework JCortex. Permite
con una interfaz grfica clara e intuitiva crear, educar, utilizar, y exportar a proyectos
de Java soluciones basadas en Redes Neuronales Artificiales.
JCortexBuilder proporciona un gran nmero de ventajas y facilidades para los
desarrolladores de Java. Desde la posibilidad de realizar entrenamientos simultneos
en busca del mejor resultado, personalizar los elementos de desarrollo e, incluso,
facilitar la documentacin de las redes creadas.
Una idea ha de estar muy clara: rara vez un usuario empezar a usar el
framework JCortex por sus bondades (aunque hay que tener cuidado porque seguro
que dejar de hacerlo si considera que tiene defectos), pero s que se podra interesar
por el a la vista de un entorno de desarrollo fcil, dinmico y potente. JCortex
tendr que muy bueno para poder defenderse en entornos muy exigentes, pero
ser JCortexBuilder el que venda el sistema.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

139

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.2. Diseo del Entorno de Desarrollo JCortexBuilder


El entorno de desarrollo JCortexBuilder ha sido creado como una adaptacin
limpia del framework a una interfaz grfica. Limpia significa que en ningn momento
se ha lastrado el framework con responsabilidades que no le pertenecieran slo para
simplificar el funcionamiento del entorno de desarrollo. Se procura mantener un
framework lo ms puro e independiente posible. En contrapartida, se complica el
diseo de JCortexBuilder, necesitando un amplio abanico de adaptadores y clases
intermedias.
El entorno de desarrollo ha sido construido con la idea clara de convertirse en
la prueba de fuego definitiva para el framework. Por sus requisitos, es un entorno muy
exigente que adems ha facilitado en gran medida la creacin misma de JCortex. Sin
un entorno de desarrollo disponible no se hubiera podido llevar a cabo el gran nmero
de pruebas y ensayos recogidos en la planificacin. Ha sido adems concebido con la
idea de ser agradable para un programador especialmente uno de Java que no
desea adentrarse en las interioridades matemticas del sistema.

A continuacin se destacan otras caractersticas relevantes de JCortexBuilder,


ya sea por su utilidad, por las posibilidades que abren, o por su importancia tcnica.

Internacionalizacin y Localizacin. El entorno de desarrollo


JCortexBuilder se encuentra completamente internacionalizado mediante un
sistema de Resource Bundles. Utiliza el mismo sistema recomendado por
JCortex (ver: 5.5.8. Internacionalizacin y localizacin). El bundle principal,
messages.properties, se encuentra en com.jcortex.builder y
contiene la lengua inglesa. La distribucin actual contiene tambin la
localizacin de Espaol-Castellano.

Adaptable a personalizaciones y evolucin de JCortex. JCortexBuilder ha


sido creado para ser capaz de adaptarse a la evolucin del framework JCortex,
as como a las personalizaciones del usuario. Prcticamente todas las listas
disponibles en la interfaz sobre traductores, funciones, maestros, modelos de
red, etc. son gestionables, para que cada usuario pueda aadir y utilizar sus
propias soluciones a travs del framework. Todos pueden ser configurados a
travs del archivo de configuracin XML mantenido por la aplicacin.

Sistema de creacin de asistentes integrado. Una de las mayores


potencialidades de JCortexBuilder reside en la posibilidad de simplificar al
mximo el proceso de creacin de una red empleando para ello un asistente.
De hecho, tambin el proceso de creacin de un asistente es cmodo y sencillo
ya que JCortex ofrece la clase abstracta AbstractAssistanJDialog
que proporciona las funcionalidades bsicas y caractersticas de

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

140

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


personalizacin requeridas para construir rpidamente un asistente integrado
con la aplicacin.

Almacenamiento de imgenes. Todas las imgenes generadas con el entorno


JCortexBuilder pueden ser almacenadas como archivos .png. Esta es una gran
ventaja para los programadores que, una vez que han creado y entrenado una
red, se enfrentan a la obligacin de documentarla y justificarla.

Almacenamiento y recuperacin de Redes Neuronales. JCortexBuilder


exprime al mximo esta caracterstica del framework JCortex, proporcionando
una interfaz sencilla para almacenar e inspeccionar archivos XML que
contengan la configuracin de redes neuronales.

Permite exportar la red neuronal al proyecto de Java. El fin ltimo de este


entorno de desarrollo y este framework es proporcionar soluciones tiles para
problemas reales. Es importante, por tanto, que exista la posibilidad de que el
sistema gue al usuario en el proceso de trasladar el framework y la red
neuronal creada al proyecto en el que ser utilizada.

Todas las clases del entorno de desarrollo JCortexBuilder pueden ser


distribuidas junto con JCortex, dentro del paquete com.jcortex.builder. A
continuacin se muestran los paquetes de esta aplicacin, junto con las clases que los
componen. No se han representado las clases internas ni abstractas muy comunes en
las interfaces grficas.

com.jcortex.builder
AboutTheBox
AbstractAssistantJDialog
AbstractNetworkJSettingsPanel

Contiene clases genricas para las


ventanas y elementos auxiliares.

ConfigParameters
DataReadingUtilities
ExportAssistant
ImageUtilities
InterpretTools
JARTools
JCortexBuilder
JCortexJDesktopPane
JReportFrame
JTeacherSettingsPanel

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

141

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


JToolBoxFrame
JTrainingProgressPanel
JWorkBenchFrame
Messages
NeuralNetworkCanvas
NeuralNetworkModel
ReadAttribute
TaggedElementModel
TaggedElementWrapper
TeachInAThread
TrainingProgressRepresentation

com.jcortex.builder.addons.backPropagation
LayerRow
LayersTableModel
MultilayerPerceptronCanvas
MultilayerPerceptronJSettingsPanel

Contiene las clases de que representan


y adaptan el modelo de red Perceptrn
Multicapa distribuido con el
framework JCortex.

com.jcortex.builder.addons.hopfield
HopfieldCanvas
HopfieldJSettingsPanel

Contiene las clases de que representan


y adaptan el modelo de red de Hopfield
distribuido con el framework JCortex.

com.jcortex.builder.addons.kohonen
KohonenCanvas
KohonenJSettingsPanel

Contiene las clases de que representan


y adaptan el modelo de Mapas de
Kohonen distribuido con el framework
JCortex.

com.jcortex.builder.addons.perceptron
PerceptronCanvas
PerceptronJSettingsPanel

Contiene las clases de que representan


y adaptan el modelo de red Perceptrn
distribuido con el framework JCortex.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

142

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

com.jcortex.builder.gui
AbstractComponentWrapper
BooleanCheckWrapper
FloatTextWrapper

Contiene las elementos y adaptadores


utilizados en las ventanas y otras partes
de la interfaz grfica.

HTMLTextPane
ImageFileFilter
ImagesJPanel
IntegerTextWrapper
JOpenFileComponent
JSaveFileComponent
LongTextWrapper
ShortTextWrapper
SpringUtilities
XMLFileFilter

com.jcortex.builder.reports
AbstractXYGraphJPanel
FloatArrayXYGraphJPanel
StatsMeasureXYGraphJPanel

Clases propias de los informes. Por


ahora contiene exclusivamente las que
conforman el sistema de grficas para
los analizadores de progreso de los
entrenamientos.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

143

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.1.1. Adaptacin de un modelo de red a JCortexBuilder


La adaptacin de un modelo de red neuronal a su uso en JCortexBuilder se
realiza simplemente extendiendo dos clases:

AbstractNetworkJSettingsPanel. Su subclases se encargan de


mostrar el JPanel en el que se definirn los parmetros de creacin de
una red neuronal, para posteriormente extraer la informacin necesaria y
crear la instancia de NeuralNetwork adecuada. Se ha optado por
personalizar la configuracin de una red ya que, si bien es una tarea
aadida importante, ofrece una enorme versatilidad para la comunicacin
y para lograr que el uso del modelo de red sea amigable con el usuario.

NeuralNetworkCanvas. Sus subclases se encargan de dibujar la red


neuronal, es decir, representar la red con la que se est trabajando sobre un
JPanel.

La referencia a estas clases se recoge dentro de JCortexBuilder en una


coleccin de instancias de NeuralNetworkModel. Estas instancias son creadas en
la carga del archivo de configuracin de la aplicacin y definen la red, su informacin
descriptiva, las dos clases anteriormente descritas a las que recurrir la interfaz, y una
lista de maestros disponibles para ese modelo de red.
No es necesario crear una interfaz para los maestros, ya que JCortexBuilder
analizar automticamente los parmetros de entrenamiento de las instancias de
Teacher, mostrando los campos para el tipo requerido en cada caso. Esta
representacin se afronta de forma automatizada ya que requiere menos pericia
artstica que la configuracin de una red y ser habitual el uso de numerosos maestros
distintos para un mismo modelo.

Por defecto, JCortexBuilder soporta los modelos de red y los maestros


proporcionados con el framework JCortex.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

144

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.1.2. Archivo de configuracin


El archivo de configuracin es cargado por la aplicacin en el arranque. En
caso de que no exista, se crea uno nuevo copiando el archivo por defecto contenido en
el paquete com.jcortex.builder. Los modelos de red configurados, las
funciones y los traductores disponibles son los elementos bsicos que forman este
archivo. El archivo de configuracin por defecto tiene la siguiente forma para la
versin ALPHA 0.02:

<JCortexBuilder>
<neuralNetworkModels>
<nnModel name="Hopfield" version="1.0b"
class="com.jcortex.hopfield.HopfieldNeuralNetwork"
settingsPanel="com.jcortex.builder.addons.hopfield.HopfieldJSettings
Panel" canvas="com.jcortex.builder.addons.hopfield.HopfieldCanvas">
<teacherModel name="Default Teacher"
class="com.jcortex.hopfield.DefaultHopfieldTeacher"/>
</nnModel>
<nnModel name="Kohonen" version="1.0b"
class="com.jcortex.kohonen.KohonenNeuralNetwork"
settingsPanel="com.jcortex.builder.addons.kohonen.KohonenJSettingsPa
nel" canvas="com.jcortex.builder.addons.kohonen.KohonenCanvas">
<teacherModel name="Default Teacher"
class="com.jcortex.kohonen.DefaultKohonenTeacher"/>
</nnModel>
<nnModel name="Multilayer Perceptron" version="1.0b"
class="com.jcortex.backPropagation.MultilayerPerceptronNeuralNetwork
"
settingsPanel="com.jcortex.builder.addons.backPropagation.Multilayer
PerceptronJSettingsPanel"
canvas="com.jcortex.builder.addons.backPropagation.MultilayerPercept
ronCanvas">
<teacherModel name="Default Teacher"
class="com.jcortex.backPropagation.DefaultMultilayerPerceptronTea
cher"/>
</nnModel>
<nnModel name="Perceptron" version="1.0b"
class="com.jcortex.feedForward.PerceptronNeuralNetwork"
settingsPanel="com.jcortex.builder.addons.perceptron.PerceptronJSett
ingsPanel"
canvas="com.jcortex.builder.addons.perceptron.PerceptronCanvas">
<teacherModel name="Default Teacher"
class="com.jcortex.feedForward.DefaultPerceptronTeacher"/>
</nnModel>
</neuralNetworkModels>
<activationFunctions>
<function name="Gaussian Function"
class="com.jcortex.activationFunctions.GaussianFunction" />
<function name="Hyperbolic Function"
class="com.jcortex.activationFunctions.HyperbolicTangentFunction" />
<function name="Identity Function"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

145

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


class="com.jcortex.activationFunctions.IdentityFunction" />
<function name="Sigmoidal Function"
class="com.jcortex.activationFunctions.SigmoidalFunction" />
<function name="Sign Function"
class="com.jcortex.activationFunctions.SignFunction" />
<function name="Step Function"
class="com.jcortex.activationFunctions.StepFunction" />
</activationFunctions>
<distanceFunctions>
<function name="Euclidean Distance"
class="com.jcortex.distanceFunctions.EuclideanDistanceFunction" />
</distanceFunctions>
<networkFunctions>
<function name="Linear Basis Function"
class="com.jcortex.networkFunctions.LinearBasisFunction" />
<function name="Radial Basis Function"
class="com.jcortex.networkFunctions.RadialBasisFunction" />
</networkFunctions>
<inputTranslators>
<translator name="Transparent Input Translator"
class="com.jcortex.translators.TransparentInputTranslator" />
</inputTranslators>
<outputTranslators>
<translator name="Single Boolean Output Translator"
class="com.jcortex.translators.SingleBooleanOutputTranslator" />
<translator name="Transparent Output Translator"
class="com.jcortex.translators.TransparentOutputTranslator" />
</outputTranslators>
</JCortexBuilder>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

146

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.2. Formato de los archivos de Datos


Tanto los entrenamientos supervisados como no supervisados requieren el uso
de un gran volumen de ejemplos. Actualmente el sistema de carga de datos es muy
estricto en cuanto a los formatos que admite y los metadatos que requiere. En el
futuro se espera poder aumentar la flexibilidad de este sistema, cargando no slo
nmero reales, sino cadenas de texto y objetos serializados.

La estructura de una archivo de datos:


# Comentario

Se pueden introducir comentarios de una lnea


entera, siempre y cuando esta comience con una
almohadilla. Puede estar en cualquier lugar del
archivo, salvo en la zona de datos.

@structure float[]

Definicin de la estructura de datos que compone


cada ejemplo. Por ahora slo se permiten listas de
nmeros reales. En prximas versiones se espera
emplear otros modificadores como object que
indicara que el ejemplo a cargar es un objeto
serializado.

@input

N1

float

Definicin de uno de los atributos de entrada. (El


orden es importante)

@output

O1

float

Definicin de uno de los atributos de salida. (El


orden es importante)

@data

Indicacin de que en la siguiente lnea comienza la


zona de datos con los ejemplos.

Se pueden encontrar ejemplos de estos archivos al final del Anexo B:


Ejemplos de uso.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

147

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.2. Visita guiada a JCortexBuilder


A continuacin se presentan los pasos, acciones y tareas ms importantes para
trabajar con JCortexBuilder.

6.2.1. Principales elementos de la interfaz

El Work Bench de creacin de


Redes Neuronales artificiales es el
punto de comienzo para la
configuracin y construccin de
redes. Es posible disponer de varios
a la vez con distintas alternativas de
configuracin.

El listado de entrenamientos en
curso y finalizados aparece en una
columna a la izquierda. Puede ser
recogido y desplegado para ahorrar
espacio.

Informe de aprendizaje o
descriptivo de la red (segn si se
est entrenando, ha sido entrenada o
ha sido cargada desde un archivo de
configuracin XML.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

148

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.2.2. Ejemplo de entrenamiento Perceptrn Multicapa

1.

Arranque de la aplicacin con la ventana de bienvenida.

2.

Para crear una nueva red neurona seleccionar el botn iluminado. La opcin de
Nueva Red Neuronal tambin es accesible desde el men Archivo.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

149

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

3.

Seleccionar la red neuronal Multilayer Perceptron v.1.0.b del men


desplegable.

4.

En esta ventana se pueden configurar los parmetros de la red Perceptrn


Multicapa, as como los de su maestro.

En el ejemplo se ha creado una red de dos entradas con una salida. Las neuronas
se organizan en dos capas, todas ellas utilizando como Funcin de Red Lineal
Basis Function y como Funcin de Activacin la Sigmoidal. Se han de
configurar tambin los traductores a utilizar y los parmetros de entrenamiento.
Seleccionamos un traductor de salida transparente y dejamos los parmetros de
entrenamiento por defecto.
Siempre es posible aadir elementos personalizados, accediendo a la opcin
Gestionar de los mens desplegables:

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

150

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Se selecciona el archivo aFuncion2Variables.txt y el maestro por defecto.

La configuracin queda de la siguiente forma:

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

151

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

5.

Comienza el entrenamiento pulsando el botn Crear y Entrenar, con lo que se


despliega la ventana de informe y aparece el entrenamiento en la barra lateral.
Siempre es posible detener un entrenamiento o eliminarlo directamente. Si se
cierra la ventana de informe, puede ser trada de nuevo a travs de su elemento
en el listado lateral.

En este caso el entrenamiento result ser extremadamente rpido. Apenas dos


iteraciones fueron suficientes para situarse por debajo del error mximo exigido.
Se tiene acceso a toda esta informacin a travs de las pestaas.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

152

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Las razones comunicadas por los analizadores para deterner el entrenamiento


son:
Razones de parada de los analizadores aglutinados:
{
....Detenido porque Error de Entrenamiento (Cuadrtico Medio) est por debajo del
error mnimo exigido. Mejor valor = 0,044
....Error de Validacin (Cuadrtico Medio) no ha encontrado razones hasta ahora
para detener el entrenamiento.
....Variacin de Pesos (Media Abs.) no ha encontrado razones hasta ahora para
detener el entrenamiento.
}

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

153

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Se puede conservar el esquema de la red como una imagen .png a travs del
men contextual, e incluso cambiar la escala de la imagen para poder apreciarla
mejor.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

154

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

6.

Se puede probar la red creada, en la ltima pestaa.

7.

Finalmente se puede exportar la red neuronal creada al proyecto de Java


definitivo haciendo clic en Exportar a mi Proyecto. Durante el proceso un
asistente da las indicaciones y explicaciones necesarias, e incluso proporciona el
cdigo a utilizar en la aplicacin.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

155

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

156

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

157

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

7. Planificacin y Seguimiento
A continuacin se muestra en forma de tablas la EDT (Estructura de Divisin
de Trabajo) en la que se reparte el proyecto. Para llevar a cabo la planificacin se ha
considerado un calendario continuo en el que se trabaje todos los das de la semana
1,5 horas (1 hora con 30 minutos). Al final de cada semana, se habr dedicado al
proyecto alrededor de 10,5 horas que en las alrededor de 40 semanas que suma el
proyecto producen un tiempo estimado de unas 420 horas. En la prctica no se dedica
una hora y media diaria, sino que en los momentos en los que el resto de las
obligaciones acadmicas y profesionales lo han permitido, este tiempo se ha agrupado
en jornadas en principio imprevisibles para su planificacin. En la realidad, se puede
comprobar como el tiempo dedicado al proyecto ha sido superior a las 420 horas
supuestas.

Tabla 13: EDT Inicial


EDT
1. Gestin de Proyectos
1.1. Realizacin del Anexo B
1.2. Entrega del Anexo B
1.3. Entrega Final del Proyecto
2. Documentacin y Comunicacin
2.1. Anexo B
2.1.1. Creacin de la presentacin
2.1.2. Presentacin
2.2. Presentacin Marzo
2.2.1. Creacin de la presentacin
2.2.2. Presentacin
2.3. Presentacin Mayo
2.3.1. Creacin de la presentacin
2.3.2. Presentacin
2.4. Creacin del sitio web
www.jcortex.com
2.5. Redactar Memoria Final
2.6. Presentacin Final
3. Formacin
3.1. Aprendizaje bsico sobre RNA por
cuenta propia
3.2. Asignatura IA
4. Framework Jcortex
4.1. Ncleo del Framework
4.1.1. Estudio y Diseo
4.1.2. Clases abstractas e interfaces
4.1.3. Refinado del ncleo
4.2. Modelo de propagacin genrico
4.2.1 Estudio y diseo
4.2.2. Implantacin e integracin
4.3. Modelo Perceptrn

Tiempo
Estimado
243 days
4 days
0 days
0 days
245 days
8 days
7 days
1 day
8 days
7 days
1 day
8 days
7 days
1 day

Fecha
Comienzo
29/10/2005
29/10/2005
02/11/2005
29/06/2006
09/11/2005
09/11/2005
09/11/2005
16/11/2005
22/02/2006
22/02/2006
01/03/2006
26/04/2006
26/04/2006
03/05/2006

Fecha
Comp.
Final
29/06/2006
0%
02/11/2005
0%
02/11/2005
0%
29/06/2006
0%
12/07/2006
0%
16/11/2005
0%
16/11/2005
0%
16/11/2005
0%
01/03/2006
0%
01/03/2006
0%
01/03/2006
0%
03/05/2006
0%
03/05/2006
0%
03/05/2006
0%

2 days

26/04/2006 27/04/2006

0%

!60,00

20 days
31/05/2006 20/06/2006
0 days
12/07/2006 12/07/2006
136 days? 31/08/2005 13/01/2006

0%
0%
0%

!600,00
!0,00
!0,00

80 days?

31/08/2005 18/11/2005

0%

!0,00

54 days?
297 days
53 days
7 days
7 days
14 days
19 days
7 days
12 days
140 days

21/11/2005
01/09/2005
01/09/2005
01/09/2005
08/09/2005
10/10/2005
19/09/2005
19/09/2005
26/09/2005
21/11/2005

0%
0%
0%
0%
0%
0%
0%
0%
0%
0%

!0,00
!5.535,00
!840,00
!210,00
!210,00
!420,00
!570,00
!210,00
!360,00
!540,00

13/01/2006
25/06/2006
23/10/2005
07/09/2005
14/09/2005
23/10/2005
07/10/2005
25/09/2005
07/10/2005
09/04/2006

Coste
Previsto
!120,00
!120,00
!0,00
!0,00
!1.380,00
!240,00
!210,00
!30,00
!240,00
!210,00
!30,00
!240,00
!210,00
!30,00

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

158

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


4.3.1 Estudio y diseo
4.3.2. Implantacin e integracin
4.3.3. Integracin en JCortexBuilder
4.3.4. Pruebas, refinado y mejora
del rendimiento
4.4. Modelo Perceptrn Multicapa
4.4.1 Estudio y diseo
4.4.2. Implantacin e integracin
4.4.3. Integracin en JCortexBuilder
4.4.4. Pruebas, refinado y mejora
del rendimiento
4.5. Mapas de Kohonen
4.5.1 Estudio y diseo
4.5.2. Implantacin e integracin
4.5.3. Integracin en JCortexBuilder
4.5.4. Pruebas, refinado y mejora
del rendimiento
4.6. Redes de Hopfield
4.6.1 Estudio y diseo
4.6.2. Implantacin e integracin
4.6.3. Integracin en JCortexBuilder
4.6.4. Pruebas, refinado y mejora
del rendimiento
4.7. Cierre Framework ALPHA 0.01
4.8. Refinado del Framework en
conjunto
4.9. Redactar JavaDoc
4.9. Cierre Distribucin ALPHA 0.02
5. IDE JCortexBuilder
5.1. Anlisis de la problemtica de las
RNA's y el entorno grfico
5.2. Diseo
5.3. Programacin de la aplicacin
5.4. Mejoras sobre el interfaz

3 days
7 days
1 day

21/11/2005 23/11/2005
24/11/2005 30/11/2005
08/02/2006 08/02/2006

0%
0%
0%

!90,00
!210,00
!30,00

7 days

03/04/2006 09/04/2006

0%

!210,00

107 days
7 days
14 days
3 days

01/12/2005
01/12/2005
08/12/2005
05/02/2006

17/03/2006
07/12/2005
21/12/2005
07/02/2006

0%
0%
0%
0%

!1.140,00
!210,00
!420,00
!90,00

14 days

04/03/2006 17/03/2006

0%

!420,00

94 days
3 days
7 days
2 days

22/12/2005
22/12/2005
25/12/2005
03/02/2006

25/03/2006
24/12/2005
31/12/2005
04/02/2006

0%
0%
0%
0%

!570,00
!90,00
!210,00
!60,00

7 days

19/03/2006 25/03/2006

0%

!210,00

48 days
2 days
4 days
1 day

11/02/2006
11/02/2006
13/02/2006
17/02/2006

30/03/2006
12/02/2006
16/02/2006
17/02/2006

0%
0%
0%
0%

!300,00
!60,00
!120,00
!30,00

3 days

28/03/2006 30/03/2006

0%

!90,00

4 days

22/04/2006 26/04/2006

0%

!120,00

47,5 days

08/05/2006 24/06/2006

0%

!1.425,00

8 days
1 day
112 days

23/05/2006 31/05/2006
24/06/2006 25/06/2006
02/01/2006 23/04/2006

0%
0%
0%

!0,00
!30,00
!1.590,00

4 days

02/01/2006 05/01/2006

0%

!120,00

7 days
21 days
21 days

06/01/2006 12/01/2006
13/01/2006 02/02/2006
03/04/2006 23/04/2006

0%
0%
0%

!210,00
!630,00
!630,00
!8.625,00

A modo de detalle, se incluye en la Ilustracin 15: Histograma del recurso


Miguel Lara Encabo, el nivel de ocupacin del nico recurso humano definido para el
proyecto. En las ltimas fechas, alrededor de la presentacin de mayo y antes de la
entrega final, la ocupacin crece hasta un 200% prcticamente constante. Esto se debe
a que se simultanean las tareas de redaccin de la documentacin, y ltimos retoques,
pruebas y afinaciones sobre el framework y el entorno de desarrollo.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

159

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Ilustracin 15: Histograma del recurso Miguel Lara Encabo

A continuacin, en la Tabla 14: ETD a fecha 01/03/2006 - Presentacin de


Marzo, se muestra una instantnea tomada sobre la planificacin del proyecto,
alrededor del mircoles 1 de marzo del 2006, la fecha en la se llev a cabo la
presentacin intermedia del proyecto. Se puede apreciar como ha hubo actividades
que exigieron mucho ms tiempo del previsto (por ejemplo el clculo de vecindades
en los Mapas de Kohonen). Sin embargo, tambin hubo otras actividades que
resultaron ser ligramente ms rpidas de lo esperado e incluso se haba adelantado
parte de la tarea de algunas actividades futuras.
En este momento del tiempo se llev a cabo un Earned Value Anlisis que
reflej cmo la situacin prevista no estaba demasiado lejos de la realidad
materializada. Para el clculo de costes slo se ha tenido en cuenta el coste que
supone la dedicacin de un recurso humano a la realizacin de las actividades. Se ha
supuesto un coste de 20!/hora, sin variaciones en caso de sobrecarga u horas extra.
Los resultados se muestran en la tabla Tabla 15: Clculo del Earned Value Analysis a
fecha 01/03/2006.

Tabla 14: ETD a fecha 01/03/2006 - Presentacin de Marzo


EDT
1. Gestin de Proyectos
1.1. Realizacin del Anexo B
1.2. Entrega del Anexo B
1.3. Entrega Final del Proyecto
2. Documentacin y Comunicacin
2.1. Anexo B
2.1.1. Creacin de la presentacin
2.1.2. Presentacin
2.2. Presentacin Marzo
2.2.1. Creacin de la presentacin
2.2.2. Presentacin
2.3. Presentacin Mayo
2.3.1. Creacin de la presentacin
2.3.2. Presentacin

Tiempo
Estimado
243 days
4 days
0 days
0 days
245 days
8 days
7 days
1 day
8 days
7 days
1 day
8 days
7 days
1 day

Fecha
Comienzo
29/10/2005
29/10/2005
02/11/2005
29/06/2006
09/11/2005
09/11/2005
09/11/2005
16/11/2005
22/02/2006
22/02/2006
01/03/2006
26/04/2006
26/04/2006
03/05/2006

Fecha
Comp.
Final
29/06/2006 100%
01/11/2005 100%
02/11/2005 100%
29/06/2006 100%
12/07/2006
33%
16/11/2005 100%
15/11/2005 100%
16/11/2005 100%
01/03/2006
88%
28/02/2006 100%
01/03/2006
0%
03/05/2006
0%
03/05/2006
0%
03/05/2006
0%

Coste
Previsto
!120,00
!120,00
!0,00
!0,00
!1.380,00
!240,00
!210,00
!30,00
!240,00
!210,00
!30,00
!240,00
!210,00
!30,00

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

160

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


2.4. Creacin del sitio web
www.jcortex.com
2.5. Redactar Memoria Final
2.6. Presentacin Final
3. Formacin
3.1. Aprendizaje bsico sobre RNA por
cuenta propia
3.2. Asignatura IA
4. Framework Jcortex
4.1. Ncleo del Framework
4.1.1. Estudio y Diseo
4.1.2. Clases abstractas e interfaces
4.1.3. Refinado del ncleo
4.2. Modelo de propagacin genrico
4.2.1 Estudio y diseo
4.2.2. Implantacin e integracin
4.3. Modelo Perceptrn
4.3.1 Estudio y diseo
4.3.2. Implantacin e integracin
4.3.3. Integracin en JCortexBuilder
4.3.4. Pruebas, refinado y mejora
del rendimiento
4.4. Modelo Perceptrn Multicapa
4.4.1 Estudio y diseo
4.4.2. Implantacin e integracin
4.4.3. Integracin en JCortexBuilder
4.4.4. Pruebas, refinado y mejora
del rendimiento
4.5. Mapas de Kohonen
4.5.1 Estudio y diseo
4.5.2. Implantacin e integracin
4.5.3. Integracin en JCortexBuilder
4.5.4. Pruebas, refinado y mejora
del rendimiento
4.6. Redes de Hopfield
4.6.1 Estudio y diseo
4.6.2. Implantacin e integracin
4.6.3. Integracin en JCortexBuilder
4.6.4. Pruebas, refinado y mejora
del rendimiento
4.7. Cierre Framework ALPHA 0.01
4.8. Refinado del Framework en
conjunto
4.9. Redactar JavaDoc
4.9. Cierre Distribucin ALPHA 0.02
5. IDE JCortexBuilder
5.1. Anlisis de la problemtica de las
RNA's y el entorno grfico
5.2. Diseo
5.3. Programacin de la aplicacin
5.4. Mejoras sobre el interfaz

2 days

26/04/2006 27/04/2006

0%

!60,00

20 days
31/05/2006 20/06/2006
0 days
12/07/2006 12/07/2006
136 days? 31/08/2005 13/01/2006

0%
0%
100%

!600,00
!0,00
!0,00

80 days?

31/08/2005 18/11/2005

100%

!0,00

54 days?
297 days
53 days
7 days
12 days
14 days
15 days
7 days
8 days
140 days
3 days
7 days
1 day

21/11/2005
01/09/2005
01/09/2005
01/09/2005
08/09/2005
10/10/2005
19/09/2005
19/09/2005
26/09/2005
21/11/2005
21/11/2005
24/11/2005
08/02/2006

13/01/2006
25/06/2006
23/10/2005
07/09/2005
19/09/2005
23/10/2005
03/10/2005
25/09/2005
03/10/2005
09/04/2006
23/11/2005
30/11/2005
08/02/2006

100%
54%
79%
100%
100%
50%
100%
100%
100%
61%
100%
100%
100%

!0,00
!5.985,00
!990,00
!210,00
!360,00
!420,00
!450,00
!210,00
!240,00
!540,00
!90,00
!210,00
!30,00

7 days

03/04/2006 09/04/2006

0%

!210,00

107 days
7 days
14 days
3 days

01/12/2005
01/12/2005
08/12/2005
05/02/2006

17/03/2006
07/12/2005
21/12/2005
07/02/2006

61%
100%
100%
75%

!1.140,00
!210,00
!420,00
!90,00

14 days

04/03/2006 17/03/2006

0%

!420,00

94 days
3 days
21 days
2 days

22/12/2005
22/12/2005
25/12/2005
03/02/2006

25/03/2006
24/12/2005
14/01/2006
04/02/2006

84%
100%
100%
100%

!990,00
!90,00
!630,00
!60,00

7 days

19/03/2006 25/03/2006

25%

!210,00

48 days
2 days
4 days
1 day

11/02/2006
11/02/2006
13/02/2006
17/02/2006

30/03/2006
12/02/2006
16/02/2006
17/02/2006

78%
100%
100%
100%

!300,00
!60,00
!120,00
!30,00

3 days

28/03/2006 30/03/2006

25%

!90,00

4 days

22/04/2006 26/04/2006

0%

!120,00

47,5 days

08/05/2006 24/06/2006

0%

!1.425,00

8 days
1 day
112 days

23/05/2006 31/05/2006
24/06/2006 25/06/2006
02/01/2006 23/04/2006

25%
0%
69%

!0,00
!30,00
!1.500,00

4 days

02/01/2006 05/01/2006

100%

!120,00

4 days
21 days
21 days

06/01/2006 09/01/2006
13/01/2006 02/02/2006
03/04/2006 23/04/2006

100%
100%
25%

!120,00
!630,00
!630,00
!8.625,00

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

161

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


Tabla 15: Clculo del Earned Value Analysis a fecha 01/03/2006
EDT
1. Gestin de Proyectos
1.1. Realizacin del Anexo B
1.2. Entrega del Anexo B
1.3. Entrega Final del Proyecto
2. Documentacin y Comunicacin
2.1. Anexo B
2.1.1. Creacin de la presentacin
2.1.2. Presentacin
2.2. Presentacin Marzo
2.2.1. Creacin de la presentacin
2.2.2. Presentacin
2.3. Presentacin Mayo
2.3.1. Creacin de la presentacin
2.3.2. Presentacin
2.4. Creacin del sitio web
www.jcortex.com
2.5. Redactar Memoria Final
2.6. Presentacin Final
3. Formacin
3.1. Aprendizaje bsico sobre RNA
por cuenta propia
3.2. Asignatura IA
4. Framework Jcortex
4.1. Ncleo del Framework
4.1.1. Estudio y Diseo
4.1.2. Clases abstractas e
interfaces
4.1.3. Refinado del ncleo
4.2. Modelo de propagacin
genrico
4.2.1 Estudio y diseo
4.2.2. Implantacin e integracin
4.3. Modelo Perceptrn
4.3.1 Estudio y diseo
4.3.2. Implantacin e integracin
4.3.3. Integracin en

PVest 6

PVejc7

AC8

EAC 9

BAC 10

VAC11

120,00 !

120,00 !

120,00 !

120,00 !

120,00 !

0,00 !

120,00 !

120,00 !

120,00 !

120,00 !

120,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

480,00 !

450,00 !

450,00 !

1.380,00 !

1.380,00 !

0,00 !

240,00 !

240,00 !

240,00 !

240,00 !

240,00 !

0,00 !

210,00 !

210,00 !

210,00 !

210,00 !

210,00 !

0,00 !

30,00 !

30,00 !

30,00 !

30,00 !

30,00 !

0,00 !

240,00 !

210,00 !

210,00 !

240,00 !

240,00 !

0,00 !

210,00 !

210,00 !

210,00 !

210,00 !

210,00 !

0,00 !

30,00 !

0,00 !

0,00 !

30,00 !

30,00 !

0,00 !

0,00 !

0,00 !

0,00 !

240,00 !

240,00 !

0,00 !

0,00 !

0,00 !

0,00 !

210,00 !

210,00 !

0,00 !

0,00 !

0,00 !

0,00 !

30,00 !

30,00 !

0,00 !

0,00 !

0,00 !

0,00 !

60,00 !

60,00 !

0,00 !

0,00 !

0,00 !

0,00 !

600,00 !

600,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

3.450,00 !

3.217,50 !

3.247,50 !

5.586,61 !

5.535,00 !

-51,61 !

840,00 !

630,00 !

780,00 !

1.040,00 !

840,00 !

-200,00 !

210,00 !

210,00 !

210,00 !

210,00 !

210,00 !

0,00 !

210,00 !

210,00 !

360,00 !

360,00 !

210,00 !

-150,00 !

420,00 !

210,00 !

210,00 !

420,00 !

420,00 !

0,00 !

570,00 !

570,00 !

450,00 !

450,00 !

570,00 !

120,00 !

210,00 !

210,00 !

210,00 !

210,00 !

210,00 !

0,00 !

360,00 !

360,00 !

240,00 !

240,00 !

360,00 !

120,00 !

330,00 !

330,00 !

330,00 !

540,00 !

540,00 !

0,00 !

90,00 !

90,00 !

90,00 !

90,00 !

90,00 !

0,00 !

210,00 !

210,00 !

210,00 !

210,00 !

210,00 !

0,00 !

30,00 !

30,00 !

30,00 !

30,00 !

30,00 !

0,00 !

Valor Planificado teniendo en cuenta las actividades planificadas para esta fecha.

Valor Planificado teniendo en cuenta las actividades ejecutadas hasta la fecha.

Costes Actuales incurridos en la realizacin de las actividades.

Coste esperado de acuerdo con los datos recogidos.

10

Coste presupuestado.

11

Variacin entre el coste presupuestado y el previsto, por actividad.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

162

Memoria de desarrollo Framework JCortex http://www.jcortex.com/


JCortexBuilder
4.3.4. Pruebas, refinado y mejora
del rendimiento
4.4. Modelo Perceptrn Multicapa
4.4.1 Estudio y diseo
4.4.2. Implantacin e integracin
4.4.3. Integracin en
JCortexBuilder
4.4.4. Pruebas, refinado y mejora
del rendimiento
4.5. Mapas de Kohonen
4.5.1 Estudio y diseo
4.5.2. Implantacin e integracin
4.5.3. Integracin en
JCortexBuilder
4.5.4. Pruebas, refinado y mejora
del rendimiento
4.6. Redes de Hopfield
4.6.1 Estudio y diseo
4.6.2. Implantacin e integracin
4.6.3. Integracin en
JCortexBuilder
4.6.4. Pruebas, refinado y mejora
del rendimiento
4.7. Cierre Framework ALPHA 0.01
4.8. Refinado del Framework en
conjunto
4.9. Redactar JavaDoc
4.9. Cierre Distribucin ALPHA 0.02
5. IDE JCortexBuilder
5.1. Anlisis de la problemtica de las
RNA's y el entorno grfico
5.2. Diseo
5.3. Programacin de la aplicacin
5.4. Mejoras sobre el interfaz

0,00 !

0,00 !

0,00 !

210,00 !

210,00 !

0,00 !

720,00 !

697,50 !

697,50 !

1.140,00 !

1.140,00 !

0,00 !

210,00 !

210,00 !

210,00 !

210,00 !

210,00 !

0,00 !

420,00 !

420,00 !

420,00 !

420,00 !

420,00 !

0,00 !

90,00 !

67,50 !

67,50 !

90,00 !

90,00 !

0,00 !

0,00 !

0,00 !

0,00 !

420,00 !

420,00 !

0,00 !

780,00 !

780,00 !

780,00 !

570,00 !

570,00 !

0,00 !

90,00 !

90,00 !

90,00 !

90,00 !

90,00 !

0,00 !

630,00 !

630,00 !

630,00 !

210,00 !

210,00 !

0,00 !

60,00 !

60,00 !

60,00 !

60,00 !

60,00 !

0,00 !

0,00 !

0,00 !

0,00 !

210,00 !

210,00 !

0,00 !

210,00 !

210,00 !

210,00 !

300,00 !

300,00 !

0,00 !

60,00 !

60,00 !

60,00 !

60,00 !

60,00 !

0,00 !

120,00 !

120,00 !

120,00 !

120,00 !

120,00 !

0,00 !

30,00 !

30,00 !

30,00 !

30,00 !

30,00 !

0,00 !

0,00 !

0,00 !

0,00 !

90,00 !

90,00 !

0,00 !

0,00 !

0,00 !

0,00 !

120,00 !

120,00 !

0,00 !

0,00 !

0,00 !

0,00 !

1.425,00 !

1.425,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

0,00 !

30,00 !

30,00 !

0,00 !

870,00 !

870,00 !

870,00 !

1.590,00 !

1.590,00 !

0,00 !

120,00 !

120,00 !

120,00 !

120,00 !

120,00 !

0,00 !

120,00 !

120,00 !

120,00 !

210,00 !

210,00 !

0,00 !

630,00 !

630,00 !

630,00 !

630,00 !

630,00 !

0,00 !

0,00 !

0,00 !

0,00 !

630,00 !

630,00 !

0,00 !

8.676,61 !

8.625,00 !

El coste del proyecto se ha revisado en 8.676,61!, una cifra nada dispar


respecto al inicialmente presupuestado de 8.625.00!.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

163

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

8. Conclusiones del Proyecto


Desde el punto de vista puramente tcnico se puede considerar que este
proyecto de desarrollo ha sido un xito. A la vista del tiempo disponible y el alcance
de las actividades, est claro que la planificacin inicial estaba mal dimensionada y
era excesivamente optimista. Sin embargo los cambios en el alcance del proyecto no
han alterado el cumplimiento de los requerimientos y objetivos iniciales. Es ms, en
diversas ocasiones se ha reconducido el proyecto con el fin de priorizar el mejor
cumplimiento del objetivo principal: lograr un sistema prctico, que pueda ser
utilizado por la comunidad de programadores de Java para resolver exigencias
reales de sus aplicaciones.
Se ha generado, en definitiva, un sistema til que soporta de forma fiable los
desarrollos de Redes Neuronales Artificiales y aporta las funcionalidades bsicas
imprescindibles para los programadores. Es cierto que an quedan vas para la mejora
que sern exploradas en futuras versiones del framework JCortex y del entorno
de desarrollo JCortexBuilder.
A lo largo del desarrollo del proyecto se han afrontado problemas tcnicos en
el mbito de las Redes Neuronales Artificiales y de la Ingeniera de Software que han
sido resueltos unas veces acudiendo a algoritmos tericos de expertos, y otras
recurriendo a la propia labor de investigacin.

Desde el punto de vista personal, esta ha resultado ser una labor muy
enriquecedora, no exenta de apuros y problemas. Considero muy importante el hecho
de haber podido enfrentarme a problemas de desarrollo reales en un mbito que
podra considerarse fuera de lo acadmico.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

164

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

9. Bibliografa, materiales y aplicaciones


Bibliografa de consulta:
[ISAS04]

Redes Neuronales Artificiales. Un enfoque prctico Pedro Isasi


Viuela e Ins M. Galvn Len Ed. Pearson Prentice Hall
ISBN:84-205-4025-0

[SIER05]

Head First Java Kathy Sierra y Bert Bates Ed. OReilly


ISMB:0-596-00920-8

[PILO00]

UML Pocket Reference Dan Pilone Editorial OReilly ISBN:0596-00497-4

Apuntes de la asignatura de Inteligencia Artificial Miguel ngel


Sanz Bobi 5 IINF, ICAI, Universidad Pontificia Comillas

Apuntes de la asignatura de Ingeniera del Software II Juan Carlos


Esquivel Daz 5 IINF, ICAI, Universidad Pontificia Comillas

Principales aplicaciones utilizadas en el desarrollo:

J2SE SDK 1.4.2 y 1.5.0 http://java.sun.com/

Eclipse 3.1.2 http://www.eclipse.org/

JUDE Community 1.6.2 http://jude.esm.jp/

Shark 4.3.3 CHUD Tools 4.3.3 http://developer.apple.com/

BBEdit 8.1 http://www.barebones.com/

Firefox 1.5.0.3 (lector de XML) http://www.mozilla.org/

Photoshop CS http://www.adobe.es/

Blender 2.4.1 http://www.blender.org/

Principales aplicaciones adicionales para la documentacin del proyecto:

Microsoft Word 2004 para Mac http://www.mactopia.com/

Keynote 3.0.1 http://www.apple.com/es/iwork/keynote/

DocFlex/Doclet para javadoc v1.4.7 http://www.docflex.com

FastTrack Schedule 8.0.8

Grapher 1.0 http://www.apple.com/

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

165

Memoria de desarrollo Framework JCortex http://www.jcortex.com/

Anexo A: Documentacin de la API JCortex


Package Summary

Page

com.jcortex

166

com.jcortex.activationFunctions

258

com.jcortex.backPropagation

277

com.jcortex.distanceFunctions

295

com.jcortex.feedForward

297

com.jcortex.hopfield

332

com.jcortex.kohonen

343

com.jcortex.networkFunctions

413

com.jcortex.translators

416

Package com.jcortex
Interface Summary

Page

ActivationFunction

Interface defining the contract for the


Activation Functions available in the
framework or user-developed.

168

AxonReceiver

Interface defining the contract for an


Axon Receiver element.

170

AxonSource

Interface defining the contract for an


AxonSource element.

173

BackPropagationActivationFunction

Interface defining the contract for a


Back-Propagation Activation Function.

178

DistanceFunction

Interface defining the contract for the


Distance Functions available in the
framework or user-developed.

186

InputTranslator

Interface defining the contract for the


Input Translator available in the
framework or user-developed.

187

JCortexConstants

This class holds the basic constant values


required in the JCortex framework.

188

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

166

Package com.jcortex

NetworkFunction

Interface defining the contract for the


Network Functions available in the
framework or user-developed.

198

OutputTranslator

Interface defining the contract for the


Output Translator available in the
framework or user-developed.

220

StatisticsListener

This interface defines the contract


obliged to any class that wants to be
notified by upgrades and the closing of a
training session's statistics.

236

Class Summary

Page

Class modeling the relationship between an


AxonSource connected to an AxonReceiver and
the weight given to that connection.

175

The instances of this class are responsable for


ComposedProgressAnalyzer taking the decision of when to stop a training,
based on a statistics measure's progression.

179

ConsoleUtilities

Class defining static methods as helpers for this


frameworks classes console reports and String
representations.

183

LoadAndStoreUtilities

An utilities class devoted to hold the methods


which read and write the framework's data on to
the local file system.

190

Messages

Class in charge of obtaining the localized


messages for the JCortex framework.

194

NeuralNetwork

Abstract class that must be extended by all the


specific Artificial Neural Network models.

200

Neuron

bstract class extended to represent the generic


role of a neuron inside a Neural Networ's
structure.

215

ProgressAnalyzer

This is the Component element in the Composite


GoF Desing Pattern.

222

Sensor

The sensor is interface placed between the data


entrance and the neurons or other mechanisms
stored inside the NeuralNetwork.

226

Statistics

Holds the progress statistics for a training


session.

230

AxonSourceEntry

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

167

Package com.jcortex

StatisticsEvent

Event element created in order to send a


notification to a listener.

235

StatsMeasure

This class models the dimensions - or measures


recorded in the statistics.

238

StatsRegister

The StatsRegister is the most basic element in


the training Statistics system.

242

Teacher

The abstract class obliged to all Teachers of


Neural Networks.

246

ValueDecreaseAnalyzer

The instances of this class are responsable for


taking the decision of when to stop a training,
based on a statistics measure's progression.

253

ValueVariationAnalyzer

The instances of this class are responsable for


taking the decision of when to stop a training,
based on a statistics measure's progression.

256

Exception Summary
ReadingException

Page

Exception thrown when there is an exception reading a


local file from the file system.

225

Interface ActivationFunction
com.jcortex

All Known Subinterfaces:

BackPropagationActivationFunction
All Known Implementing Classes:

GaussianFunction,
HyperbolicTangentFunction,
SigmoidalFunction, SignFunction, StepFunction

IdentityFunction,

public interface ActivationFunction


Interface defining the contract for the Activation Functions available in the framework
or user-developed.
This interfaces' implementations must follow the Singleton (GoF) design pattern.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

168

Interface ActivationFunction
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
float[]

getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


int

169

getNumberOfActivationParameters()

Method to obtain the number of activation parameters this


particular function needs.
float

Page

169

getSolution(float networkResult, float[] activationParams)

Calculates and return the solution of the currente function, given


the parameters passed as arguments.

170

Method Detail
getDefaultParameterSet
public float[] getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


Returns:
The default set of parameters.

getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Method to obtain the number of activation parameters this particular function


needs.
Returns:
The number of activation parameters.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

169

Interface ActivationFunction

getSolution
public float getSolution(float networkResult,
float[] activationParams)
throws IllegalArgumentException

Calculates and return the solution of the currente function, given the
parameters passed as arguments.
Parameters:
networkResult

- The result from the network function.

activationParams

- The array of activation parameters needed.

Returns:
The result of calculating the activation function.
Throws:
IllegalArgumentException

Interface AxonReceiver
com.jcortex

All Known Implementing Classes:

BackPropagationNeuron, FeedForwardNeuron, KohonenNeuron, Neuron

public interface AxonReceiver


Interface defining the contract for an Axon Receiver element. An AxonReceiver is an
element that will be child of one or more AxonSource instances. It is capable of
receiving the numeric values offered by its parents. An AxonReceiver is capable of
assigning a weight to each one of its connections with AxonSources.
Author:
Miguel Lara Encabo - miguel@mac.com

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

170

Interface AxonReceiver
Version:
0.1b

Method Summary
void

addEntry(AxonSource entry)

Adds a new neuron connectio to an upper-level axon source,


taking care of the weight choosing.
void

173

getId()

This elemen's ID is obtained.


void

172

getEntryWeight(AxonSource parent)

Getter Method for this neuron's entries' weights


int

172

getEntries()

Getter Method for this neuron's entries collection.


float

171

addEntry(AxonSource entry, float weight)

Adds a new neuron connection to an upper-level axon source,


taking care of the weight choosing.
Collection

Page

171

setEntryWeight(AxonSource parent, float value)

Sets an entry's weight.

172

Method Detail
getId
public int getId()

This elemen's ID is obtained.


Returns:
An integer number with the ID of this element.

addEntry
public void addEntry(AxonSource entry)

Adds a new neuron connectio to an upper-level axon source, taking care of the
weight choosing.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

171

Interface AxonReceiver
Parameters:
entry

- The new axon data source on to which stablish a connection.

addEntry
public void addEntry(AxonSource entry,
float weight)

Adds a new neuron connection to an upper-level axon source, taking care of


the weight choosing.
Parameters:
entry

- The new AxonSource element to be connected as its father.

weight

- The entry's weight

setEntryWeight
public void setEntryWeight(AxonSource parent,
float value)

Sets an entry's weight.


Parameters:
- The parent AxonSource whose entry weighjt we are going to
change.
parent

value

- The float value to be set as this connections weight.

getEntries
public Collection getEntries()

Getter Method for this neuron's entries collection.


Returns:
The entries list.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

172

Interface AxonReceiver

getEntryWeight
public float getEntryWeight(AxonSource parent)

Getter Method for this neuron's entries' weights


Returns:
This receiver's entries' weights

Interface AxonSource
com.jcortex

All Known Implementing Classes:

BackPropagationNeuron, FeedForwardNeuron, KohonenNeuron, Neuron,


Sensor

public interface AxonSource


Interface defining the contract for an AxonSource element. An AxonSource is an
element that will be father of one or more AxonReceiver instances. It is capable of
producing the numeric values offered to its children.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
void

Page

addConnectedNeuron(AxonReceiver child, boolean back_connection)

Adds a new neuron connectio to a lower-lever cell.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

175

173

Interface AxonSource
float

getAxonValue()

The value of the next cell input is obtained through the axon
connection.
int

getId()

This source's ID is obtained.


float

174

174

produceAxonValue()

Internal method made to generate the value that has to be


transmitted through the axon connection.

174

Method Detail
getId
public int getId()

This source's ID is obtained.


Returns:
An integer with the ID of this source;

getAxonValue
public float getAxonValue()

The value of the next cell input is obtained through the axon connection.
Returns:
A float value holding the result of the cell's activation.

produceAxonValue
public float produceAxonValue()
throws IllegalArgumentException

Internal method made to generate the value that has to be transmitted through
the axon connection.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

174

Interface AxonSource
Returns:
An Object holding the result of the cell's activation
Throws:
IllegalArgumentException

- Exception that can be thrown when there


is a problem with the function's parameters.
InvalidParameterException

addConnectedNeuron
public void addConnectedNeuron(AxonReceiver child,
boolean back_connection)

Adds a new neuron connectio to a lower-lever cell.


Parameters:
child

- The child element connected to this AxonSource instance.

back_connection

- Indicates if this neuron has to create the entry in its

child.

Class AxonSourceEntry
com.jcortex
java.lang.Object
com.jcortex.AxonSourceEntry

public class AxonSourceEntry


extends Object
Class modeling the relationship between an AxonSource connected to an
AxonReceiver and the weight given to that connection.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

175

Class AxonSourceEntry
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

AxonSourceEntry(AxonSource axonSource, float weight)

Default constructor for the instances of this class.

Method Summary
AxonSource

177

setAxonSource(AxonSource axonSource)

Sets the AxonSource connected as a parent.


void

176

getWeight()

Obtains the weight given to this connection.


void

Page

getAxonSource()

Obtains the AxonSource connected as parent.


float

176

177

setWeight(float weight)

Set the weight for this connection.

177

Constructor Detail
AxonSourceEntry
public AxonSourceEntry(AxonSource axonSource,
float weight)

Default constructor for the instances of this class.

Method Detail
getAxonSource
public AxonSource getAxonSource()

Obtains the AxonSource connected as parent.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

176

Class AxonSourceEntry
Returns:
The parent AxonSource instance.

setAxonSource
public void setAxonSource(AxonSource axonSource)

Sets the AxonSource connected as a parent.


Parameters:
axonSource

- The AxonSource instance to be connected as parent.

getWeight
public float getWeight()

Obtains the weight given to this connection.


Returns:
The weight's value.

setWeight
public void setWeight(float weight)

Set the weight for this connection.


Parameters:
weight

- The weigh to be set for this connection.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

177

Interface BackPropagationActivationFunction

Interface BackPropagationActivationFunction
com.jcortex

All Superinterfaces:

ActivationFunction
All Known Implementing Classes:

HyperbolicTangentFunction, IdentityFunction, SigmoidalFunction

public interface BackPropagationActivationFunction


extends ActivationFunction
Interface defining the contract for a Back-Propagation Activation Function.
These functions extend as well the ActivationFunction interface, and on top of it they
implement a method to obtain the derivate solution for the current function.
This interfaces' implementations must follow the Singleton (GoF) design pattern.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
float

Page

getDerivativeSolution(BackPropagationNeuron neuron)

Method for calculating the derivate value of this function given the
BackPropagationNeuron's values as an entry.

179

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

178

Interface BackPropagationActivationFunction

Method Detail
getDerivativeSolution
public float getDerivativeSolution(BackPropagationNeuron neuron)

Method for calculating the derivate value of this function given the
BackPropagationNeuron's values as an entry.
Parameters:
- The BackPropagationNeuron instance that homes this
function.
neuron

Returns:
The derivate value calculated.

Class ComposedProgressAnalyzer
com.jcortex
java.lang.Object
com.jcortex.ProgressAnalyzer
com.jcortex.ComposedProgressAnalyzer

public class ComposedProgressAnalyzer


extends ProgressAnalyzer
The instances of this class are responsable for taking the decision of when to stop a
training, based on a statistics measure's progression. This way there will be a instance
for each stats measure that the Teacher instance wants to be monitored for decision.
Its intelligence operates inside the method isEvolutionGoodEnough(). This class is
responsible of storing all progress information that is not reflected in the StatsMeasure
instance associated, such as recen variations...
It is thought best not to implement this class as a StatsListener, as its decision method
isEvolutionGoodEnough() is not necessarily invoked each time a statistic register is
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

179

Class ComposedProgressAnalyzer
recorded, but it will be promptly asked by the Teacher instance at work when a
decision is required.
The Composed Progress Analyzer combines the decision taken by several other
analyzers in order to make the final statement.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

ComposedProgressAnalyzer()

Creates a new instance of this Composed Progress Analyzer by


initialyzing the analyzer collection with a LinkedList.

181

Method Summary

Page

void

add(ProgressAnalyzer analyzer)

Adds a ProgessAnalyzer instance to the compositing list.


ProgressAnalyzer

getInnerAnalyzers(int ix)

Obtains a ProgessAnalyzer instance from the list, given


its index.
String

182

isProgressGoodEnough()

Decides if the progress of the composed ProgessAnalyzer


instances is good enough to continue.
void

182

getReasonToStop()

Obtains the description of the reason why this analyzer has


stopped the training process it was following, if indeed it has.
boolean

181

182

remove(ProgressAnalyzer analyzer)

Removes a
compositing list.

ProgessAnalyzer

instance

from

the

181

Methods inherited from class com.jcortex.ProgressAnalyzer


add, getInnerAnalyzers, getReasonToStop, isProgressGoodEnough, remove

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

180

Class ComposedProgressAnalyzer

Constructor Detail
ComposedProgressAnalyzer
public ComposedProgressAnalyzer()

Creates a new instance of this Composed Progress Analyzer by initialyzing the


analyzer collection with a LinkedList.

Method Detail
add
public void add(ProgressAnalyzer analyzer)

Adds a ProgessAnalyzer instance to the compositing list.


Overrides:
add

in class ProgressAnalyzer

Parameters:
analyzer

- The progress analyzer to be added.

remove
public void remove(ProgressAnalyzer analyzer)

Removes a ProgessAnalyzer instance from the compositing list.


Overrides:
remove

in class ProgressAnalyzer

Parameters:
analyzer

- The progress analyzer to be removed.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

181

Class ComposedProgressAnalyzer
getInnerAnalyzers
public ProgressAnalyzer getInnerAnalyzers(int ix)

Obtains a ProgessAnalyzer instance from the list, given its index.


Overrides:
getInnerAnalyzers

in class ProgressAnalyzer

Parameters:
ix

- The index of the desired analyzer.

Returns:
The requested ProgessAnalyzer instance.

isProgressGoodEnough
public boolean isProgressGoodEnough()

Decides if the progress of the composed ProgessAnalyzer instances is good


enough to continue. The composed progress will be good enough to continue
the training when the progress of each one of the analyzers included is good
enough.
Overrides:
isProgressGoodEnough

in class ProgressAnalyzer

Returns:
A boolean value indicating if the training should continue (true) or not
(false).

getReasonToStop
public String getReasonToStop()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

182

Class ComposedProgressAnalyzer
Obtains the description of the reason why this analyzer has stopped the
training process it was following, if indeed it has. The reason is built by
adding up the reasons of the progress analyzers composed.
Overrides:
getReasonToStop

in class ProgressAnalyzer

Returns:
The reason why this analyzer has decided to stop the training.

Class ConsoleUtilities
com.jcortex
java.lang.Object
com.jcortex.ConsoleUtilities

final public class ConsoleUtilities


extends Object
Class defining static methods as helpers for this frameworks classes console reports
and String representations.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

ConsoleUtilities()

184

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

183

Class ConsoleUtilities
Method Summary
static
String

Page

arrayToString(boolean[] array)

Static method for translating a boolean[] array to its String


representation.
static
String

arrayToString(boolean[][] array)

Static method for translating a boolean[][] array to its String


representation.
static
String

185

arrayToString(float[] array)

Static method for translating a float[] array to its String


representation.
static
String

185

184

arrayToString(float[][] array)

Static method for translating a float[][] array to its String


representation.

184

Constructor Detail
ConsoleUtilities
public ConsoleUtilities()

Method Detail
arrayToString
public static String arrayToString(float[] array)

Static method for translating a float[] array to its String representation.


Parameters:
array

- The array to be translated.

Returns:
The String translation.

arrayToString
public static String arrayToString(float[][] array)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

184

Class ConsoleUtilities
Static method for translating a float[][] array to its String representation.
Internally uses the public static String arrayToString(float[] array)
method.
Parameters:
array

- The array to be translated.

Returns:
The String translation.

arrayToString
public static String arrayToString(boolean[] array)

Static method for translating a boolean[] array to its String representation.


Parameters:
array

- The array to be translated.

Returns:
The String translation.

arrayToString
public static String arrayToString(boolean[][] array)

Static method for translating a boolean[][] array to its String representation.


Internally uses the public static String arrayToString(boolean[] array)
method.
Parameters:
array

- The array to be translated.

Returns:
The String translation.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

185

Interface DistanceFunction

Interface DistanceFunction
com.jcortex

All Known Implementing Classes:

EuclideanDistanceFunction

public interface DistanceFunction


Interface defining the contract for the Distance Functions available in the framework
or user-developed.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
float

Page

getDistance(AxonSource[] entries, float[] weights)

Obtains the distance between the values provided by the


AxonSource an the weights stablished for that connection.

186

Method Detail
getDistance
public float getDistance(AxonSource[] entries,
float[] weights)
throws IllegalArgumentException

Obtains the distance between the values provided by the AxonSource an the
weights stablished for that connection.
Parameters:
- The AxonSource instances that provide the values for the
distance calculation.
entries

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

186

Interface DistanceFunction
- The weights which are to be compared in order to calculate
the distance.
weights

Returns:
The distance between the entries' values and the weights.
Throws:
IllegalArgumentException
InvalidParameterException

- Exception that can be thrown if arrays

have different sizes.

Interface InputTranslator
com.jcortex

All Known Implementing Classes:

TransparentInputTranslator

public interface InputTranslator


Interface defining the contract for the Input Translator available in the framework or
user-developed.
The Input Translator's aim it to serialize the objects you need to use in you application
into a float array numerical representation. Neural Networks are mathematic
algorythms so they can only work with numbers.
You must make sure that the numbers into which an instance is translated are really
representative. It is desirable that each each instance should be univocal with its
float[] representation, but bear in mind this is not a HASH function: intances which
have the same signification for the problem should have similar (or even the same)
number arrays, independent of their exact original values.
On the other side of the Neural Network an Output Translator will be placed
producing an instance from the same class as the input or a different one. This means
that it may not be essential that an input translation should have a straight inverse
operation. In other words, information can be lost in the translation if it is not
necessary.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

187

Interface InputTranslator
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
float[]

Page

getInputTranslation(Object input_value)

Translates the input value given as an object into the numerical


values that can be fed onto the neurons.

188

Method Detail
getInputTranslation
public float[] getInputTranslation(Object input_value)

Translates the input value given as an object into the numerical values that can
be fed onto the neurons.
Parameters:
input_value

- The qualitative Object used in each particular problem.

Returns:
The float array that contains the input for each Neuron.

Interface JCortexConstants
com.jcortex

public interface JCortexConstants


This class holds the basic constant values required in the JCortex framework. It is
made up of static attributes with public access, and some may even be final if they are
never supposed to change in a distribution.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

188

Interface JCortexConstants
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Field Summary
String

FRAMEWORK_MESSAGE

This framework's message, to be posted on the console.


String

189

XML_NEURON_CONSTRUCTOR_ATTRIBUTE_SIGNATURE

A constructor with a two parameters of class org.w3c.dom.Node


and com.jcortex.NeuralNetwork is needed quite a lot in the XML
configuration file loading process.
Class[]

189

FRAMEWORK_VERSION

This framework's version.


Class[]

Page

190

XML_SIMPLE_CONSTRUCTOR_ATTRIBUTE_SIGNATURE

A constructor with a single parameter of class org.w3c.dom.Node


is required quite a lot in the XML configuration file loading process.

190

Field Detail
FRAMEWORK_VERSION
public static final String FRAMEWORK_VERSION

This framework's version.

FRAMEWORK_MESSAGE
public static final String FRAMEWORK_MESSAGE

This framework's message, to be posted on the console.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

189

Interface JCortexConstants
XML_SIMPLE_CONSTRUCTOR_ATTRIBUTE_SIGNATURE
public static final Class[] XML_SIMPLE_CONSTRUCTOR_ATTRIBUTE_SIGNATURE

A constructor with a single parameter of class org.w3c.dom.Node is required


quite a lot in the XML configuration file loading process. The Class[] array
kept in this attribute is required to invoke the method:
#Class#.getConstructor(Class[]);

This static attribute has been stored as a constant so the same Class array
needn't be created each time one of this constructors has to be obtained.

XML_NEURON_CONSTRUCTOR_ATTRIBUTE_SIGNATURE
public static final Class[] XML_NEURON_CONSTRUCTOR_ATTRIBUTE_SIGNATURE

A constructor with a two parameters of class org.w3c.dom.Node and


com.jcortex.NeuralNetwork is needed quite a lot in the XML configuration
file loading process. The Class[] array kept in this attribute is required to
invoke the method: ##Class##.getConstructor(Class[]);
This static attribute has been stored as a constant so the same Class array
needn't be created each time one of this constructors has to be obtained.

Class LoadAndStoreUtilities
com.jcortex
java.lang.Object
com.jcortex.LoadAndStoreUtilities

abstract public class LoadAndStoreUtilities


extends Object
An utilities class devoted to hold the methods which read and write the framework's
data on to the local file system.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

190

Class LoadAndStoreUtilities
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
static
NeuralNetwork

Page

readXMLNeuralNetwork(File xmlFile)

Reads an XML file with a NeuralNetwork configuration


stored and creates with this information a NeuralNetwork instance.
static
NeuralNetwork

readXMLNeuralNetwork(String filePath)

Reads an XML file - from a given path - with a


NeuralNetwork configuration stored and creates with this
information a NeuralNetwork instance.
static File

192

writeXMLFile(File file, org.w3c.dom.Document xmlDoc)

Static method for writing an XML file in the given File


instance.
static File

193

192

writeXMLFile(String filePath, org.w3c.dom.Document xmlDoc)

Static method for writing an XML file at the selected spot.

191

Method Detail
writeXMLFile
public static File writeXMLFile(String filePath,
org.w3c.dom.Document xmlDoc)
throws Exception

Static method for writing an XML file at the selected spot.


This method is based on the (File, Document) implementation included in the
same class.
Parameters:
filePath
xmlDoc

- The file's path on wich the XML document will be written.

- The XML's document content.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

191

Class LoadAndStoreUtilities
Returns:
The written File instance.
Throws:
Exception

- Exceptions can be thrown.

writeXMLFile
public static File writeXMLFile(File file,
org.w3c.dom.Document xmlDoc)
throws Exception

Static method for writing an XML file in the given File instance.
This method uses the DOM implementation as the XML data manager and
uses a DOM tansformet to write the XML file into the file system.
Parameters:
file

- The file on wich the XML document will be written.

xmlDoc

- The XML's document content.

Returns:
The written File instance.
Throws:
Exception

- Exceptions can be thrown.

readXMLNeuralNetwork
public static NeuralNetwork readXMLNeuralNetwork(String filePath)
throws Exception

Reads an XML file - from a given path - with a NeuralNetwork configuration


stored and creates with this information a NeuralNetwork instance.
This method is based on its (File ) implementation included in this class.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

192

Class LoadAndStoreUtilities
Parameters:
filePath

- The XML file with the NeuralNetwork configuration.

Returns:
The NeuralNetwork instance created with the stored configuration.
Throws:
Exception

readXMLNeuralNetwork
public static NeuralNetwork readXMLNeuralNetwork(File xmlFile)
throws Exception

Reads an XML file with a NeuralNetwork configuration stored and creates


with this information a NeuralNetwork instance.
This method makes sure that there is a node as the root of the XML document
and that this node has a child in it. If one of both is lacking, this can't be a
NeuralNetwork configuration file.
This method makes use of the XML-node based instance constructor that mus
appear in all final NeuralNetwork classes.
Parameters:
xmlFile

- The XML file with the NeuralNetwork configuration.

Returns:
The NeuralNetwork instance created with the stored configuration.
Throws:
Exception

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

193

Class Messages

Class Messages
com.jcortex
java.lang.Object
com.jcortex.Messages

public class Messages


extends Object
Class in charge of obtaining the localized messages for the JCortex framework. This
class is based on the use of java.util.ResourceBundle.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary
protected

Messages()

Method Summary
static
String

195

195

getString(String key, Object arg1, Object arg2)

Obtains a localized text for the given key, replacing the


placeholders with the parameters submitted.
static
String

Page

getString(String key, Object arg1)

Obtains a localized text for the given key, replacing the


placeholders with the parameters submitted.
static
String

195

getString(String key)

Obtains a localized text for the given key, from the resource bundle
indicated by RESOURCE_BUNDLE.
static
String

Page

196

getString(String key, Object arg1, Object arg2, Object arg3)

Obtains a localized text for the given key, replacing the


placeholders with the parameters submitted.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

197

194

Class Messages
static
String

getString(String
Object arg4)

key,

Object

arg1,

Object

arg2,

Object

arg3,

Obtains a localized text for the given key, replacing the


placeholders with the parameters submitted.
static
String

197

getString(String key, Object[] args)

Obtains a localized text for the given key, replacing the


placeholders with a variable number of parameters submitted submitted
as an Object array.

198

Constructor Detail
Messages
protected Messages()

Method Detail
getString
public static String getString(String key)

Obtains a localized text for the given key, from the resource bundle indicated
by RESOURCE_BUNDLE.
Parameters:
key

- The key for which the localized text is looked up.

Returns:
The localyzed text with the placeholders replaced.

getString
public static String getString(String key,
Object arg1)

Obtains a localized text for the given key, replacing the placeholders with the
parameters submitted.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

195

Class Messages
This method is really a wrapper for this class' public static String
getString(String key, Object[] args) method. The Object parameters
received are put into a newly created Object[] array.
Parameters:
key

- The key for which the localized text is looked up.

arg1

- The argument that will replace the first placeholder in the text.

Returns:
The localyzed text with the placeholders replaced.

getString
public static String getString(String key,
Object arg1,
Object arg2)

Obtains a localized text for the given key, replacing the placeholders with the
parameters submitted.
This method is really a wrapper for this class' public static String
getString(String key, Object[] args) method. The Object parameters
received are put into a newly created Object[] array.
Parameters:
key

- The key for which the localized text is looked up.

arg1

- The argument that will replace the first placeholder in the text.

arg2

- The argument that will replace the second placeholder in the

text.
Returns:
The localyzed text with the placeholders replaced.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

196

Class Messages
getString
public static String getString(String
Object
Object
Object

key,
arg1,
arg2,
arg3)

Obtains a localized text for the given key, replacing the placeholders with the
parameters submitted.
This method is really a wrapper for this class' public static String
getString(String key, Object[] args) method. The Object parameters
received are put into a newly created Object[] array.
Parameters:
key

- The key for which the localized text is looked up.

arg1

- The argument that will replace the first placeholder in the text.

arg2

- The argument that will replace the second placeholder in the

text.
arg3

- The argument that will replace the third placeholder in the text.

Returns:
The localyzed text with the placeholders replaced.

getString
public static String getString(String
Object
Object
Object
Object

key,
arg1,
arg2,
arg3,
arg4)

Obtains a localized text for the given key, replacing the placeholders with the
parameters submitted.
This method is really a wrapper for this class' public static String
getString(String key, Object[] args) method. The Object parameters
received are put into a newly created Object[] array.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

197

Class Messages
Parameters:
key

- The key for which the localized text is looked up.

arg1

- The argument that will replace the first placeholder in the text.

arg2

- The argument that will replace the second placeholder in the

text.
arg3

- The argument that will replace the third placeholder in the text.

arg4

- The argument that will replace the fourth placeholder in the text.

Returns:
The localyzed text with the placeholders replaced.

getString
public static String getString(String key,
Object[] args)

Obtains a localized text for the given key, replacing the placeholders with a
variable number of parameters submitted submitted as an Object array.
Parameters:
key

- The key for which the localized text is looked up.

args

- The array of arguments that will replace the placeholders.

Returns:
The localyzed text with the placeholders replaced.

Interface NetworkFunction
com.jcortex

All Known Implementing Classes:

LinearBasisFunction, RadialBasisFunction

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

198

Interface NetworkFunction

public interface NetworkFunction


Interface defining the contract for the Network Functions available in the framework
or user-developed.
The Network Function has its origin in the McCullock-Pitts neuron model. This
function merges the neuron's parents' values into a single number.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
float

Page

getSolution(Collection axonSourceEntries)

Calculates the input value to the neuron, from the values provided
its input connections and weights, given all as SourceEntry instances.

199

Method Detail
getSolution
public float getSolution(Collection axonSourceEntries)

Calculates the input value to the neuron, from the values provided its input
connections and weights, given all as SourceEntry instances.
Parameters:
axonSourceEntries

- A Collection of AxonSourceEntry instances.

Returns:
The network value calculated.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

199

Class NeuralNetwork

Class NeuralNetwork
com.jcortex
java.lang.Object
com.jcortex.NeuralNetwork

Direct Known Subclasses:

FeedForwardNeuralNetwork,
KohonenNeuralNetwork

HopfieldNeuralNetwork,

abstract public class NeuralNetwork


extends Object
Abstract class that must be extended by all the specific Artificial Neural Network
models.
This class covers the basic common functionalities and the defines the contract all
Neural Networks must commit to.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Field Summary
protected
InputTranslator

Page

inputTranslator

This network's input translator.


protected List

neurons

This neural network's list of neurons.


protected
OutputTranslator

203

outputTranslator

This network's output translator.


protected
Sensor[]

203

204

sensors

This network's sensor list.


Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

204

200

Class NeuralNetwork
protected
Teacher

teacher
203

This neural network's associated teacher.

Constructor Summary

Page

NeuralNetwork(int
neuronCount,
int
inputsNum,
inputTranslator, OutputTranslator outputTranslator)

InputTranslator
204

Creates brand-new instances of NeuralNetwork.


NeuralNetwork(org.w3c.dom.Node nnRoot)

Creates a NeuralNetwork instance based on its XML representation.

Method Summary
void

Page

addEndNeuron(AxonSource neuron)

Adds a neuron - taken as an AxonSource instance - into


this network's collection of End Neurons.
void

This method encapsulates the whole process of creating


Document with the XML representation of this
NeuralNetwork instance.

205

getConnectedNeurons()

Obtains the collection of the neurons that are directly


connected to this NeuralNetwork instance.
Collection

213

getAttributeCount()

Obtains the number of input attributes this neural


network has been built to.
Collection

205

export2XMLDocument()

a
int

210

createNeuralNetwork(org.w3c.dom.Node nnNode)

Static method that encapsulates the creation of a neural


network from a "neuralNetwork" XML node.
final
org.w3c.dom.Document

210

addNeurons(List neurons_)

Adds a list of Neuron instances to this Neural Network.


static final
NeuralNetwork

208

addNeuron(Neuron neuron)

Adds a Neuron instance to this Neural Network.


void

208

addFirstNeuron(AxonReceiver neuron)

Adds a neuron, considered as its AxonReceiver interface


into the neural network's first-neurons-collection.
void

204

207

getEndNeurons()

Obtains the collection of the ending neurons of this


NeuralNetwork instance.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

207

201

Class NeuralNetwork
InputTranslator

getInputTranslator()
213

Obtains this network's Input Translator.


Neuron

getNeuron(int id)
211

Obtains a neuron, given its ID number.


int

getNeuronCount()

Obtains the number of neurons in the neural network.


List

getNeurons()
207

Obtains the list of neurons hold by this network.


OutputTranslator

getOutputTranslator()
213

Obtains this network's Output Translator.


Sensor

getSensor(int id)
209

Obtains a sensor given its ID number.


int

getSensorCount()

Obtains the number of sensors in this


instance.
Sensor[]

NeuralNetwork 210

getSensors()

Obtains this NeuralNetwork instance's sensor array.


Teacher

NeuralNetwork 211

neuralNetwork2xml(org.w3c.dom.Node
org.w3c.dom.Document document)

Obtains
representation.
abstract float[]

this

NeuralNetwork

docRoot,

instance's

XML

208

setInputTranslator(InputTranslator inputTranslator)

Sets this network's Input Translator.


void

209

setFirtsNeurons(Collection firstNeurons)

Sets the collection of the neurons that are directly


connected to this NeuralNetwork instance.
void

206

setEndNeurons(Collection endNeurons)

Sets the end neuron collection.


void

212

pureThink(float[] inputData)

Makes the specific numerical thinking for each neural


network model.
void

210

getTeacher()

Obtains the teacher associated to this


instance.
final void

205

213

setOutputTranslator(OutputTranslator outputTranslator)

Sets this network's Output Translator.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

214

202

Class NeuralNetwork
void

setTeacher(Teacher teacher)

Sets the teacher associated to this


instance.
protected abstract
void

NeuralNetwork 211

specificNeuralNetwork2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

nnRoot,

A Template Method (GoF) that must be implemented


for every specific kind of NeuralNetwork.
Object

think(Object inputData)

This method encapsulates the "thinking" process of this


neural network's instance.
abstract String

206

toHTMLString()

Abstract method requiring every NeuralNetwork to be


able to produce a String representation of itself with HTML
tags to set its style.
abstract String

212

214

toString()

Abstract method requiring every NeuralNetwork to be


able to produce a String representation of itself.

214

Field Detail
teacher
protected Teacher teacher

This neural network's associated teacher. Its visibility is protected to allow a


quicker use from its subclasses.

neurons
protected List neurons

This neural network's list of neurons. Its visibility is protected to allow a


quicker use from its subclasses.

inputTranslator
protected InputTranslator inputTranslator

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

203

Class NeuralNetwork
This network's input translator. Its visibility is protected to allow a quicker use
from its subclasses.

outputTranslator
protected OutputTranslator outputTranslator

This network's output translator. Its visibility is protected to allow a quicker


use from its subclasses.

sensors
protected Sensor[] sensors

This network's sensor list. Its visibility is protected to allow a quicker use from
its subclasses.

Constructor Detail
NeuralNetwork
public NeuralNetwork(int neuronCount,
int inputsNum,
InputTranslator inputTranslator,
OutputTranslator outputTranslator)

Creates brand-new instances of NeuralNetwork.

NeuralNetwork
public NeuralNetwork(org.w3c.dom.Node nnRoot)
throws ReadingException

Creates a NeuralNetwork instance based on its XML representation.


Throws:
ReadingException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

204

Class NeuralNetwork

Method Detail
createNeuralNetwork
public static final NeuralNetwork createNeuralNetwork(org.w3c.dom.Node nnNod
e)
throws ReadingException

Static method that encapsulates the creation of a neural network from a


"neuralNetwork" XML node.
This method looks into the node in order to obtain the specific NeuralNetwork
subclass that must be instatiated. Once it obtains the class' name, it produces
the Class object and looks for the constructor with the
JCortexConstants.XML_SIMPLE_CONSTRUCTOR_ATTRIBUTE_SIGNATURE signature.
Parameters:
nnNode

- A node with the neural network's configuration.

Returns:
An instance of NeuralNetwork created with the node's configuration.
Throws:
ReadingException

getNeuronCount
public int getNeuronCount()

Obtains the number of neurons in the neural network. This method does not
include sensors in the count.
Returns:
The number of neurons.

getAttributeCount
public int getAttributeCount()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

205

Class NeuralNetwork
Obtains the number of input attributes this neural network has been built to.
Returns:
The number of input attributes.

think
public Object think(Object inputData)
throws IllegalArgumentException

This method encapsulates the "thinking" process of this neural network's


instance.
It receives an object as the input data and translates it to a number
representation. Once translated, this method invokes the pureThink() that must
be developed in each specific neural network model. The result of this method
is passed through the output translator before it is offered back to the invoker.
This method requires the Template Method (GoF) pureThink().
Parameters:
inputData

- The object that serves as input data for the neural network.

Returns:
An object containing the answer given by the neral network.
Throws:
IllegalArgumentException

pureThink
public abstract float[] pureThink(float[] inputData)
throws IllegalArgumentException

Makes the specific numerical thinking for each neural network model.
It behaves as the Template Method (GoF) for the think() method.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

206

Class NeuralNetwork
Parameters:
inputData

- The numerical input data.

Returns:
returns The numerical result of passing the input through the network.
Throws:
IllegalArgumentException

getNeurons
public List getNeurons()

Obtains the list of neurons hold by this network.


Returns:
The list of neurons.

getConnectedNeurons
public Collection getConnectedNeurons()

Obtains the collection of the neurons that are directly connected to this
NeuralNetwork instance. There can be more neurons in the network connected
to these in further layers.
Returns:
A collection with the directly connected neurons.

getEndNeurons
public Collection getEndNeurons()

Obtains the collection of the ending neurons of this NeuralNetwork instance.


These neurons are the ones asked to know the Networks final result.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

207

Class NeuralNetwork
The End Neurons can be known as well as the network's Output Neurons as
their internal state will be considered as the output of the Neural Network.
Returns:
A collections with the last neurons in the network.

addFirstNeuron
public void addFirstNeuron(AxonReceiver neuron)

Adds a neuron, considered as its


network's first-neurons-collection.

AxonReceiver

interface into the neural

This method does not include this neuron inside the collection of all the
neurons in the neural network. It does find out before adding this neuron if it is
already in the fist-neurons-collection.
Parameters:
neuron

- The new neuron to be included in the collection.

setFirtsNeurons
public void setFirtsNeurons(Collection firstNeurons)

Sets the collection of the neurons that are directly connected to this
NeuralNetwork instance. There can be more neurons in the network connected
to these in further layers.
Parameters:
firstNeurons

- The collection of directly connected neurons.

addEndNeuron
public void addEndNeuron(AxonSource neuron)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

208

Class NeuralNetwork
Adds a neuron - taken as an
collection of End Neurons.

AxonSource

instance - into this network's

Parameters:
- The
collection.
neuron

AxonSource

instance to be added to the End Neurons

setEndNeurons
public void setEndNeurons(Collection endNeurons)

Sets the end neuron collection.


Parameters:
endNeurons

- The new end neurons collection.

getSensor
public Sensor getSensor(int id)

Obtains a sensor given its ID number.


The sensors' ID is always a negative number, so it will have to be transformed
in order to be looked up in the array as ann index, according to the following
distribution diagram:
__________________
|-1|-2|-3|-4|...|-n|
|__|__|__|__|___|__|
0
1

...

n-1

Parameters:
id

- The requested sensor's ID number.

Returns:
The Sensor instance requested.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

209

Class NeuralNetwork
getSensors
public Sensor[] getSensors()

Obtains this NeuralNetwork instance's sensor array.


Returns:
An array with this network's sensors.

getSensorCount
public int getSensorCount()

Obtains the number of sensors in this NeuralNetwork instance.


Returns:
The number of sensors.

addNeuron
public void addNeuron(Neuron neuron)

Adds a Neuron instance to this Neural Network.


The instance passed as an argument is placed in this network's neurons list at
the place stated by the neuron's ID number.
Parameters:
neuron

- The Neuron to be added.

addNeurons
public void addNeurons(List neurons_)

Adds a list of Neuron instances to this Neural Network.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

210

Class NeuralNetwork
Each Neuron instance passed is placed in this network's neurons list at the
place stated by the neuron's ID number.

getNeuron
public Neuron getNeuron(int id)

Obtains a neuron, given its ID number.


Parameters:
id

- The requested neuron's id number.

Returns:
The neuron requested.

getTeacher
public Teacher getTeacher()

Obtains the teacher associated to this NeuralNetwork instance.


Returns:
The associated teacher.

setTeacher
public void setTeacher(Teacher teacher)

Sets the teacher associated to this NeuralNetwork instance.


Parameters:
teacher

- The associated teacher.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

211

Class NeuralNetwork
neuralNetwork2xml
public final void neuralNetwork2xml(org.w3c.dom.Node docRoot,
org.w3c.dom.Document document)

Obtains this NeuralNetwork instance's XML representation.


This method is responsable for creating the node for every kind of
NeuralNetwork instance and storing the information it knows at this abstraction
level. * It requires the Template Method (GoF) specificNeuralNetwork2xml()
defined in this abstract class.
Parameters:
- The root node to which this neural network's node has to be
attatched.
docRoot

- The original XML document used for the creation of nodes


and other elements needed for representing this networks
configuration.
document

specificNeuralNetwork2xml
protected abstract void specificNeuralNetwork2xml(org.w3c.dom.Element nnRoot
,
org.w3c.dom.Document docum
ent)

A Template Method (GoF) that must be implemented for every specific kind
of NeuralNetwork. Its specific information must be put - or appended - inside
the XML node provided.
Parameters:
nnRoot

- The networl's node on to which the specific model's info must

be put.
- The original XML document used for the creation of nodes
and other elements needed for representing this networks
configuration.
document

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

212

Class NeuralNetwork
export2XMLDocument
public final org.w3c.dom.Document export2XMLDocument()

This method encapsulates the whole process of creating a Document with the
XML representation of this NeuralNetwork instance.
It calls the neuralNetwork2XML() implemented by this abstract class.
Returns:
A XML document
configuration.

containing

this

NeuralNetwork

instance's

getInputTranslator
public InputTranslator getInputTranslator()

Obtains this network's Input Translator.


Returns:
This network's Input Translator.

setInputTranslator
public void setInputTranslator(InputTranslator inputTranslator)

Sets this network's Input Translator.


Parameters:
inputTranslator

- This network's Input Translator.

getOutputTranslator
public OutputTranslator getOutputTranslator()

Obtains this network's Output Translator.


Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

213

Class NeuralNetwork
Returns:
This network's Output Translator.

setOutputTranslator
public void setOutputTranslator(OutputTranslator outputTranslator)

Sets this network's Output Translator.


Parameters:
outputTranslator

- This network's Output Translator.

toString
public abstract String toString()

Abstract method requiring every NeuralNetwork to be able to produce a String


representation of itself.
Overrides:
toString

in class Object

Returns:
A String representation of this NeuralNetwork instance.

toHTMLString
public abstract String toHTMLString()

Abstract method requiring every NeuralNetwork to be able to produce a String


representation of itself with HTML tags to set its style.
Make it cute & smart as it will be the one shown!

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

214

Class NeuralNetwork
Returns:
A String representation of this NeuralNetwork instance.

Class Neuron
com.jcortex
java.lang.Object
com.jcortex.Neuron

All Implemented Interfaces:

AxonReceiver, AxonSource
Direct Known Subclasses:

FeedForwardNeuron, KohonenNeuron

abstract public class Neuron


extends Object
implements AxonSource, AxonReceiver
bstract class extended to represent the generic role of a neuron inside a Neural
Networ's structure.
To put it simple, a Neuron is an element from a Neural Network that haves both the
role of an AxonSource and an AxonReceiver. Although, this abstract class is much more
than this: it provides the common functionality required by all kinds of Neuron
implementations, and assures its instances' hability to make a synapse().
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

215

Class Neuron
Field Summary

Page

static
final
short

RANDOM_CLOSE_TO_ZERO_VALUE

static
final
short

RANDOM_INITIAL_VALUE

static
final
short

ZERO_INITIAL_VALUE

217

Values are initialized with a low random number.

217

Values are initialized with a random number.

217

Values are initialized with 0.

Constructor Summary

Page

Neuron(int id)
217

Creates a brand new neuron.


Neuron(org.w3c.dom.Node neuronRoot, NeuralNetwork nn)

217

Creates a neuron from its XML representation.

Method Summary
boolean

Page

equals(Object obj)

Compares this neuron with an Axon Source object.


abstract
Collection

getConnectedNeurons()

Gets the AxonReceivers connected to this Neuron.


int

218

neuron2xml(org.w3c.dom.Document document)

Obtains the XML serialized representation of this Neuron.


protected
abstract void

specificNeuron2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

218

neuronRoot,

A template method for putting in the neuron's tag the


specific attributes of each kind of neuron.
String

218

getId()

Obtains this neuron's id number.


final
org.w3c.dom.Node

220

219

toString()

Obtains the String representation of this Neuron.

219

Methods inherited from interface com.jcortex.AxonSource


addConnectedNeuron, getAxonValue, getId, produceAxonValue

Methods inherited from interface com.jcortex.AxonReceiver


addEntry, addEntry, getEntries, getEntryWeight, getId, setEntryWeight

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

216

Class Neuron

Field Detail
ZERO_INITIAL_VALUE
public static final short ZERO_INITIAL_VALUE

Values are initialized with 0.

RANDOM_INITIAL_VALUE
public static final short RANDOM_INITIAL_VALUE

Values are initialized with a random number.

RANDOM_CLOSE_TO_ZERO_VALUE
public static final short RANDOM_CLOSE_TO_ZERO_VALUE

Values are initialized with a low random number.

Constructor Detail
Neuron
public Neuron(int id)

Creates a brand new neuron.

Neuron
public Neuron(org.w3c.dom.Node neuronRoot,
NeuralNetwork nn)

Creates a neuron from its XML representation.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

217

Class Neuron

Method Detail
getId
public int getId()

Obtains this neuron's id number.


Specified by:
getId

in interface AxonSource

getId

in interface AxonReceiver

Returns:
The id number.

getConnectedNeurons
public abstract Collection getConnectedNeurons()

Gets the AxonReceivers connected to this Neuron.


Returns:
A Collection instance if there are any, null if no neurons can be
connected.

neuron2xml
public final org.w3c.dom.Node neuron2xml(org.w3c.dom.Document document)

Obtains the XML serialized representation of this Neuron.


This method requires the Template Method (GoF) specificNeuron2xml()
method required by this abstract class's contract for all the specific neural
network implementations.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

218

Class Neuron
Parameters:
document

- The XML document needed to create the nodes and

elements.
Returns:
The XML node with this neuron's configuration.

specificNeuron2xml
protected abstract void specificNeuron2xml(org.w3c.dom.Element neuronRoot,
org.w3c.dom.Document document)

A template method for putting in the neuron's tag the specific attributes of
each kind of neuron.
This method acts as a Template Method (GoF) for this class'
method.

neuron2xml()

Parameters:
neuronRoot
document

- The XML node that contains this neuron's configuration.

- The XML document used for the creation of new elements.

toString
public String toString()

Obtains the String representation of this Neuron.


Overrides:
toString

in class Object

Returns:
The String representation of this Neuron.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

219

Class Neuron
equals
public boolean equals(Object obj)

Compares this neuron with an Axon Source object.


Overrides:
equals

in class Object

Returns:
True if both objects are AxonSources and have the same id number.

Interface OutputTranslator
com.jcortex

All Known Implementing Classes:

SingleBooleanOutputTranslator, TransparentOutputTranslator

public interface OutputTranslator


Interface defining the contract for the Output Translator available in the framework or
user-developed.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
float[]

Page

getOutputBackTranslation(Object desired_output)

Translates a desired result into the numerical value it should have


produced.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

221

220

Interface OutputTranslator
Object

getOutputTranslation(float[] input_value)

Translates the numerical value given out by neurons as an object


that can be taken as the qualitative result given by the network.

221

Method Detail
getOutputTranslation
public Object getOutputTranslation(float[] input_value)

Translates the numerical value given out by neurons as an object that can be
taken as the qualitative result given by the network.
Parameters:
input_value

- The float array that is the result of the neural network's

process.
Returns:
The Object returned as a qualitative response from the neural network.

getOutputBackTranslation
public float[] getOutputBackTranslation(Object desired_output)

Translates a desired result into the numerical value it should have produced.
Parameters:
desired_output

- The object that is the desired output for an example.

Returns:
The Object returned as a qualitative response from the neural network.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

221

Class ProgressAnalyzer

Class ProgressAnalyzer
com.jcortex
java.lang.Object
com.jcortex.ProgressAnalyzer

Direct Known Subclasses:

ComposedProgressAnalyzer,
ValueVariationAnalyzer

ValueDecreaseAnalyzer,

abstract public class ProgressAnalyzer


extends Object
This is the Component element in the Composite GoF Desing Pattern.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

ProgressAnalyzer()

223

Method Summary

Page

void

add(ProgressAnalyzer analyzer)

Adds a ProgessAnalyzer to this composite node.


ProgressAnalyzer

getInnerAnalyzers(int ix)

Obtains a ProgessAnalyzer instance from the list, given


its index.
abstract String

223

224

getReasonToStop()

Obtains the description of the reason why this analyzer has


stopped the training process it was following, if indeed it has.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

224

222

Class ProgressAnalyzer
abstract boolean

isProgressGoodEnough()

Decides if the progress monitored


ProgessAnalyzer is good enough to continue.
void

by

this

224

from

this

223

remove(ProgressAnalyzer analyzer)

Removes a
compositing node.

ProgessAnalyzer

instance

Constructor Detail
ProgressAnalyzer
public ProgressAnalyzer()

Method Detail
add
public void add(ProgressAnalyzer analyzer)

Adds a ProgessAnalyzer to this composite node.


By default, an empty implementation is supplied.
Parameters:
analyzer

- The progress analyzer to be added.

remove
public void remove(ProgressAnalyzer analyzer)

Removes a ProgessAnalyzer instance from this compositing node.


By default, an empty implementation is supplied.
Parameters:
analyzer

- The progress analyzer to be removed.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

223

Class ProgressAnalyzer
getInnerAnalyzers
public ProgressAnalyzer getInnerAnalyzers(int ix)

Obtains a ProgessAnalyzer instance from the list, given its index.


By default, an empty implementation is supplied.
Parameters:
ix

- The index of the desired analyzer.

Returns:
The requested ProgessAnalyzer instance.

isProgressGoodEnough
public abstract boolean isProgressGoodEnough()

Decides if the progress monitored by this ProgessAnalyzer is good enough to


continue.
Returns:
A boolean value indicating if the training should continue (true) or not
(false).

getReasonToStop
public abstract String getReasonToStop()

Obtains the description of the reason why this analyzer has stopped the
training process it was following, if indeed it has.
Returns:
The reason why this analyzer has decided to stop the training.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

224

Class ReadingException

Class ReadingException
com.jcortex
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.jcortex.ReadingException

All Implemented Interfaces:

Serializable

public class ReadingException


extends Exception
Exception thrown when there is an exception reading a local file from the file system.
It usually happens when loading a NeuralNetwork's XML configuration file.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

ReadingException(String message)

Default constructor for this exception.

225

Constructor Detail
ReadingException
public ReadingException(String message)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

225

Class ReadingException
Default constructor for this exception.

Class Sensor
com.jcortex
java.lang.Object
com.jcortex.Sensor

All Implemented Interfaces:

AxonSource

public class Sensor


extends Object
implements AxonSource
The sensor is interface placed between the data entrance and the neurons or other
mechanisms stored inside the NeuralNetwork.
A Sensor instance is just a buffer element that stores the value set as input for the
NeuralNetwork. Sensor implements the AxonSource interface so its instances will be
able to provide AxonReceiver subclasses the stored value. Both the NeuralNetwork or
the first layer of AxonReceivers (these can be Neurons themselves) can access and
grab the value buffered in the sensor.
A value continues to be stored and provided by the Sensor instance until it is changed
to a new one.
All sensors' ids are negative numbers starting at -1 and decreasing until -inf. By
thesemeans they are distinguished from the Neuron's ids which are positive starting at
0 and increasing to +inf.
Author:
Miguel Lara Encabo - miguel@mac.com

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

226

Class Sensor
Version:
0.1b

Constructor Summary

Page

Sensor(int id, NeuralNetwork parentNetwork)

Complete sensor builder.

Method Summary
void

229

setValue(float value_)

Sets this sensor's buffered value.


String

228

produceAxonValue()

Dummy method as sensors don't really produce any values.


void

228

getId()

Gets this Sensor instance's id.


float

229

getAxonValue()

Gets the value buffered inside the sensor.


int

Page

addConnectedNeuron(AxonReceiver child, boolean connect_back)

Adds a neuron as a child to this sensor.


float

227

228

toString()

Obtains a String representation of this Sensor instance.

229

Methods inherited from interface com.jcortex.AxonSource


addConnectedNeuron, getAxonValue, getId, produceAxonValue

Constructor Detail
Sensor
public Sensor(int id,
NeuralNetwork parentNetwork)

Complete sensor builder.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

227

Class Sensor

Method Detail
setValue
public void setValue(float value_)

Sets this sensor's buffered value.


Parameters:
value_

- The value.

getId
public int getId()

Gets this Sensor instance's id.


Specified by:
getId

in interface AxonSource

Returns:
The id.

getAxonValue
public float getAxonValue()

Gets the value buffered inside the sensor.


Specified by:
getAxonValue

in interface AxonSource

Returns:
The value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

228

Class Sensor
produceAxonValue
public float produceAxonValue()

Dummy method as sensors don't really produce any values. They just buffer
them.
Specified by:
produceAxonValue

in interface AxonSource

Returns:
0f, What d'ya want? Its a dummy!

addConnectedNeuron
public void addConnectedNeuron(AxonReceiver child,
boolean connect_back)

Adds a neuron as a child to this sensor.


The child will be an AxonReceiver implementation. There is no use for the
Sensor instance knowing which AxonReceiver instances are connected to it.
These AxonReceiver instances will really be the first-layer neurons for the
NeuralNetwork: from which the propagation is really started.
Specified by:
addConnectedNeuron

in interface AxonSource

Parameters:
- An AxonReceiver that will be connected as a child to this
AxonSource.
child

connect_back

- If it is

true

this sensor will add itself to its child as an

entry.

toString
public String toString()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

229

Class Sensor
Obtains a String representation of this Sensor instance.
Overrides:
toString

in class Object

Returns:
A String representation of this instance.

Class Statistics
com.jcortex
java.lang.Object
com.jcortex.Statistics

public class Statistics


extends Object
Holds the progress statistics for a training session.
Each instance of the
training session.

Statistics

class serves to collect all the values recorded for a

This classes' instances play their role in the GoF Observer Design Pattern. They are
responsible for managing the list of listeners and notifying them with the relevant
changes.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

230

Class Statistics
Constructor Summary

Page

Statistics()

Default builder for the Statistics system.

232

Statistics(String[] measureList, long aproxMaxIteration)

Default builder for the Statistics system.

Method Summary
void

232

Page

addRegister(String measure, long iteration, float value)

Adds a register to one of the measures


232

This method encapsulates the full Register creation process so


as to simplify the work of the Teacher.
void

addStatisticsListener(StatisticsListener statsListener)

Adds a

StatisticsListener

to the list of listeners syndicated

233

to this Statistics instance.


void

finishedStats()

Method used to close the stats from outside.


StatsMeasure

235

getMeasure(String measure)

Obtains the

Measure

instance associated to the given String

233

key.
float

getProgress()

Evaluates the progress of the training session as the


percentage of iterations done, assuming the maximum iteration
number given as the total ammount of iterations to be done.
Iterator

iterator()

Obtains a Iterator instance that can go though all the values


recorded in this Statistics instance.
protected
void

234

notifyUpdate2Listeners()

This method notifies all syndicated listeners that there has


been an update to the training statistics.
void

233

notifyEnd2Listeners()

This method notifies all syndicated listeners that the training


has finished.
protected
void

235

234

removeStatisticsListener(StatisticsListener statsListener)

Removes a StatisticsListener from the list of listeners


syndicated to this Statistics instance.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

234

231

Class Statistics

Constructor Detail
Statistics
public Statistics()

Default builder for the Statistics system. It creates the Statistics instance still
without knowing the number or names o the StatsMeasures it will have to deal
with.
This method initialyzes the variables and creates the data structures.
Each instance of
training session.

Statistics

serves to collect all the values recorded for a

Statistics
public Statistics(String[] measureList,
long aproxMaxIteration)

Default builder for the Statistics system. It creates the Statistics instance still
for the known the number or names o the StatsMeasures it will have to deal
with.
This method initialyzes the variables and creates the data structures. It creates
as well the StatsMeasure instances submitted as parameters for this
constructor.
Each instance of
training session.

Statistics

serves to collect all the values recorded for a

Method Detail
addRegister
public void addRegister(String measure,
long iteration,
float value)

Adds a register to one of the measures


Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

232

Class Statistics
This method encapsulates the full
the work of the Teacher.

Register

creation process so as to simplify

Parameters:
- The key, and name, of the
register has been recorded.
measure

iteration
value

Measure

instance for which the

- The iteration number at which the register was recorded.

- The value to be recorded in the register.

getMeasure
public StatsMeasure getMeasure(String measure)

Obtains the Measure instance associated to the given String key.


Parameters:
measure

- The key, and name, of the Measure instance requested.

Returns:
The Measure instance requested.

iterator
public Iterator iterator()

Obtains a

instance that can go though all the values recorded in this


Statistics instance.
Iterator

Returns:
The

instance that can go though all the values in this


Statistics instance.
Iterator

addStatisticsListener
public void addStatisticsListener(StatisticsListener statsListener)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

233

Class Statistics
Adds a

to the list of listeners syndicated to this

StatisticsListener

Statistics

instance.

Parameters:
statsListener

- The

StatisticsListener

to be added to the

syndication list.

removeStatisticsListener
public void removeStatisticsListener(StatisticsListener statsListener)

Removes a
Statistics

StatisticsListener

from the list of listeners syndicated to this

instance.

Parameters:
statsListener

- The

StatisticsListener

to be removed from the

syndication list.

notifyUpdate2Listeners
protected void notifyUpdate2Listeners()

This method notifies all syndicated listeners that there has been an update to
the training statistics.
Not all registers added are notified to the listeners. The
NOTIFICATION_GAP dictates the number of updates done to this
Statistics instance, before a change is actually notified.
To make this notification, it invokes the
all StatisticListener instances.

.statsClosed()

method obliged for

notifyEnd2Listeners
protected void notifyEnd2Listeners()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

234

Class Statistics
This method notifies all syndicated listeners that the training has finished.
To make this notification, it invokes the
all StatisticListener instances.

.statsClosed()

method obliged for

finishedStats
public void finishedStats()

Method used to close the stats from outside.


Its only responsability is to call this class' method in charge of notifying all
listeners that the training has ended.

getProgress
public float getProgress()

Evaluates the progress of the training session as the percentage of iterations


done, assuming the maximum iteration number given as the total ammount of
iterations to be done.
Returns:
The training session's progress presented as the percentage of work
done.

Class StatisticsEvent
com.jcortex
java.lang.Object
java.util.EventObject
com.jcortex.StatisticsEvent

All Implemented Interfaces:

Serializable
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

235

Class StatisticsEvent

public class StatisticsEvent


extends EventObject
Event element created in order to send a notification to a listener.
This class plays its role in the GoF Observer Design Pattern by allowing the listener
to know which Statistics instance was the source of a notification.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

StatisticsEvent(Object source)

Creates a statistics event that can be used by the listener to identify the
source of its notifications.

236

Constructor Detail
StatisticsEvent
public StatisticsEvent(Object source)

Creates a statistics event that can be used by the listener to identify the source
of its notifications.

Interface StatisticsListener
com.jcortex

public interface StatisticsListener

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

236

Interface StatisticsListener
This interface defines the contract obliged to any class that wants to be notified by
upgrades and the closing of a training session's statistics.
This part of a GoF Observer Design Pattern implementation (known as listeners in
Java).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Method Summary
void

Page

statsClosed(StatisticsEvent statisticsEvent)

Method use to notify the lister that the training session has ended.
void

237

statsUpdate(StatisticsEvent statisticsEvent)

Method use to notify the lister that a relevant update has taken
place in the Statistics instance, during the training session.

237

Method Detail
statsUpdate
public void statsUpdate(StatisticsEvent statisticsEvent)

Method use to notify the lister that a relevant update has taken place in the
Statistics instance, during the training session.
Parameters:
statisticsEvent

- The event that shows the source of this notification.

statsClosed
public void statsClosed(StatisticsEvent statisticsEvent)

Method use to notify the lister that the training session has ended.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

237

Interface StatisticsListener
Parameters:
statisticsEvent

- The event that shows the source of this notification.

Class StatsMeasure
com.jcortex
java.lang.Object
com.jcortex.StatsMeasure

public class StatsMeasure


extends Object
This class models the dimensions - or measures recorded in the statistics. Each
instance from this class collects all the records from the same kind of measurements.
The measure keeps its own statistics as for its maximum, minimum and accumulate
values, in case these are requested by the
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Constructor Summary

Page

StatsMeasure(String name_)

Instance builder that initializes this measure's name, data structure and its
own statistic values.

239

Method Summary

Page

void

addRegister(StatsRegister sr)

Adds a register to this measure.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

240

238

Class StatsMeasure
float

getAverage()

Obtains the stored registers' average value.


StatsRegister

getLastRegister()

Obtains the last register put into this instance.


float

240

iterator()

Obtains an
stored.
void

241

getRegisters()

Gets the vector of registers recorded for this measure.


Iterator

239

getRegister(int ix)

Gets a certain register, given its index in the list.


List

242

getName()

Obtains this measure's name.


StatsRegister

241

getMin()

Obtains the minimum value recorded


String

242

getMax()

Obtains the maximum value recorded.


float

241

Iterator

instance that can access all the registers

241

setName(String name)

Sets this measure's name.

240

Constructor Detail
StatsMeasure
public StatsMeasure(String name_)

Instance builder that initializes this measure's name, data structure and its own
statistic values.
To start with, the maximum and minimum values set for this measure are the
minimum and maximum values - respectively - that a float type can hold.

Method Detail
getName
public String getName()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

239

Class StatsMeasure
Obtains this measure's name.
Returns:
This measure's name.

setName
public void setName(String name)

Sets this measure's name.


Parameters:
name

- The new name for this measure.

getRegisters
public List getRegisters()

Gets the vector of registers recorded for this measure.


Returns:
The vector of registers recorded.

addRegister
public void addRegister(StatsRegister sr)

Adds a register to this measure. In the process it updates the statistics held for
this measure.
Parameters:
sr

- The new register to be added to the list.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

240

Class StatsMeasure
getRegister
public StatsRegister getRegister(int ix)

Gets a certain register, given its index in the list.


Parameters:
ix

- The requested register's index.

Returns:
The requested register.

iterator
public Iterator iterator()

Obtains an Iterator instance that can access all the registers stored.
This iterator is obtained from the List interface obliged implementation.
Returns:
An iterator for this instance.

getAverage
public float getAverage()

Obtains the stored registers' average value.


Returns:
The average value.

getMax
public float getMax()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

241

Class StatsMeasure
Obtains the maximum value recorded.
Returns:
The maximum value.

getMin
public float getMin()

Obtains the minimum value recorded


Returns:
The minimum value.

getLastRegister
public StatsRegister getLastRegister()

Obtains the last register put into this instance.


Returns:
The last register recorded.

Class StatsRegister
com.jcortex
java.lang.Object
com.jcortex.StatsRegister

All Implemented Interfaces:

Comparable

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

242

Class StatsRegister

public class StatsRegister


extends Object
implements Comparable
The StatsRegister is the most basic element in the training Statistics system. Each
instance of a StatsRegister stores the pair iteration - value that keeps the record of how
the training is going on. The system's relationships work as follows:
_______________
|
|
|
StatsRegister
|_______________|*

______________
|
StatsMeasure
1|______________|*

|
|----|

|----|

____________
|
|
Statistics
|
1|____________|

The idea is that for each statistic measure there will be quite a lot of registers
recorded. There can be several measures in the overall training statistics.

Constructor Summary

Page

StatsRegister(long iteration_, float value_)

Creates a statsitic register storing the value of its measure at the given
iteration.

244

Method Summary

Page

int

compareTo(Object obj)

Compares two StatsRegister instances.


long

getIteration()

Gets the iteration at which this register was recorded.


float

244

setIteration(long iteration)

Sets the iteration at which this register was recorded.


void

244

getValue()

Obtains the value recorded.


void

245

245

setValue(float value)

Sets the value in this register.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

244

243

Class StatsRegister

Constructor Detail
StatsRegister
public StatsRegister(long iteration_,
float value_)

Creates a statsitic register storing the value of its measure at the given
iteration.

Method Detail
getValue
public float getValue()

Obtains the value recorded.


Returns:
The value.

setValue
public void setValue(float value)

Sets the value in this register.


Parameters:
value

- The value to be recorded.

getIteration
public long getIteration()

Gets the iteration at which this register was recorded.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

244

Class StatsRegister
Returns:
The iteration.

setIteration
public void setIteration(long iteration)

Sets the iteration at which this register was recorded.


Parameters:
iteration

- The iteration.

compareTo
public int compareTo(Object obj)

Compares two StatsRegister instances.


The comparison is made on their chronological order, taking the iteration as
the timestamp.
Parameters:
obj

- The other StatsRegister instance to be compared with this one.

Returns:
1 if this register was taken as at a latter iteration than the compared
one. (This register is previous in chronological order.) 0 both registers
are from the same iteration. -1 if this register was taken as at a former
iteration than this one. (The given register one is previous in
chronological order.)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

245

Class Teacher

Class Teacher
com.jcortex
java.lang.Object
com.jcortex.Teacher

Direct Known Subclasses:

DefaultHopfieldTeacher,
DefaultKohonenTeacher,
DefaultMultilayerPerceptronTeacher, DefaultPerceptronTeacher

abstract public class Teacher


extends Object
The abstract class obliged to all Teachers of Neural Networks.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Field Summary
static
int

Page

VALIDATION_JUMP

A validation will be made each VALIDATION_JUMP iterations.

Constructor Summary

247

Page

Teacher()

The default creator is available for a brand new teacher creation.

248

Teacher(org.w3c.dom.Node teacherNode)

An XML creator taken as a placeholder for XML source configurations.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

248

246

Class Teacher
Method Summary
abstract Statistics

Page

createStatsSchema()

Creates the Statistics instance with the specific


progress measures needed by each particular kind of Teacher.
abstract Statistics

educateNetwork(NeuralNetwork
nn,
exampleIObjects, Object[] exampleDObjects)

249

Object[]
248

Takes care of the training of a Neural Network.


abstract
ProgressAnalyzer

getAnalyzer()

Gets the progress analyzer used in this teacher's training.


synchronized
Statistics

getStats()
249

Gets the statistics for this teacher's progress.


protected abstract
void

specificTeacher2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

teacherRoot,

Dumps into the teacher's XML node this specific


Teacher instance's configuration.
abstract void

251

250

stopTraining()

Stops the training if it is in progress, and it is possible to

250

do so.
org.w3c.dom.Element

teacher2xml(org.w3c.dom.Document document)

Dumps into an XML Element instance this teacher's


configuration.
abstract String

toHTMLString()

Produces a String output with


configuration represented with HTML code.
static void

249

this

teacher's

251

translateAndClassifyExamples(Object[]
exampleIObjects,
Object[]
exampleDObjects,
InputTranslator
inputTranslator,
OutputTranslator
outputTranslator,
float[][] trainingI, float[][] trainingD, float[][]
validationI,
float[][]
validationD,
float
251
validationPercent)

Makes a random separation of the examples passed


though the Object[] parameters into the training and validation
sets.

Field Detail
VALIDATION_JUMP
public static int VALIDATION_JUMP

A validation will be made each VALIDATION_JUMP iterations.


Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

247

Class Teacher

Constructor Detail
Teacher
public Teacher()

The default creator is available for a brand new teacher creation.

Teacher
public Teacher(org.w3c.dom.Node teacherNode)

An XML creator taken as a placeholder for XML source configurations.

Method Detail
educateNetwork
public abstract Statistics educateNetwork(NeuralNetwork nn,
Object[] exampleIObjects,
Object[] exampleDObjects)
throws IllegalArgumentException

Takes care of the training of a Neural Network.


Parameters:
nn

- The neural network to be trained.

exampleIObjects

- The example input objects.

exampleDObjects

- The example output objects.

Returns:
The statistics for this training.
Throws:
IllegalArgumentException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

248

Class Teacher
getStats
public synchronized Statistics getStats()

Gets the statistics for this teacher's progress.


In case this teacher's Statistics instance does not exist, it will be created
invoking the Template Method newStatsSchema() that must be implemented
for each kind of Teacher final subclass. This method will be responsible of
creating the Statistics with all the specific measures applicable for each
Teacher, according to their nature.
Returns:
The Statistics instance updated by this teacher's training.

createStatsSchema
public abstract Statistics createStatsSchema()

Creates the Statistics instance with the specific progress measures needed by
each particular kind of Teacher. This is a Template Method (GoF).
This method must be implemented by all final Teacher subclasses. Typically
this method will be like:
public
Statistics
createStatsSchema()
{
return
new
Statistics(new
String[]{"Measure1",
"Measure2",...},
maximumIterationNumber);
}

Returns:
The new Statistics instance with the specific progress measures for this
particular Teacher.

teacher2xml
public org.w3c.dom.Element teacher2xml(org.w3c.dom.Document document)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

249

Class Teacher
Dumps into an XML Element instance this teacher's configuration.
This method creates the XML node that holds this teacher's configuration,
setting its name to and putting in a class attribute with the name of this
specific Teacher intance's class.
The rest of this specific instance's configuration is dumped into the Teacher's
node using the Template Method specificTeacher2xml(Element, Document).
Parameters:
- The Document instance that will be the ultimate root for
this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

Returns:
An XML Element instance holding this teacher's configuration.

specificTeacher2xml
protected abstract void specificTeacher2xml(org.w3c.dom.Element teacherRoot,
org.w3c.dom.Document document)

Dumps into the teacher's XML node this specific


configuration. This is a Template Method (GoF).

Teacher

instance's

Parameters:
- The XML node in which this teacher's configuration
must be dumped.
teacherRoot

- The Document instance that will be the ultimate root for


this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

stopTraining
public abstract void stopTraining()

Stops the training if it is in progress, and it is possible to do so.


Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

250

Class Teacher

toHTMLString
public abstract String toHTMLString()

Produces a String output with this teacher's configuration represented with


HTML code.
Returns:
A String representation of the Teacher's configuration written in
HTML.

getAnalyzer
public abstract ProgressAnalyzer getAnalyzer()

Gets the progress analyzer used in this teacher's training.


Returns:
The progress analyzed used.

translateAndClassifyExamples
public static void translateAndClassifyExamples(Object[] exampleIObjects,
Object[] exampleDObjects,
InputTranslator inputTransla
tor,
OutputTranslator outputTrans
lator,
float[][] trainingI,
float[][] trainingD,
float[][] validationI,
float[][] validationD,
float validationPercent)

Makes a random separation of the examples passed though the Object[]


parameters into the training and validation sets. In the process, these examples
are translated as what we really need is the numerical representation.
The percentage of examples in each group is determined by the
validationPercent parameter for which 0 means all will be taken as training
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

251

Class Teacher
examples, and 1 for all turning out to be validation examples (not much point
on doing so, but it may come useful some how).
For each set, two collections must be created: one with the input values
(ending as *I) and another with the desired output values (ending as *D).
These arrays must be created before invoking this method by using the code:
//
Obtains
the
number
of
examples
devoted
to
each
list
int
validationCount
=
(int)
(exampleIObjects.length
*
validationPercent);
int
trainingCount
=
exampleIObjects.length
validationCount;
//
The
example
and
validation
arrays
float[][]
trainingI
=
new
float[trainingCount][];
//
Training
examples'
inputs
float[][]
trainingD
=
new
float[trainingCount][];
//
Training
examples'
desired
outputs
float[][] validationI = new float[validationCount][]; // Validation
examples'
inputs
float[][] validationD = new float[validationCount][]; // Validation
examples'
desired
outputs
// Translates and classifies the examples between the training and
validation
lists
Teacher.translateAndClassifyExamples(exampleIObjects, exampleDObjects,
inputTranslator,
outputTranslator,
trainingI,
trainingD,
validationI,
validationD,
validationPercent);

Parameters:
- The array with the complete set of untranslated
inputs for the examples.
exampleIObjects

- The array with the complete set of untranslated


desired outputs matchig the input examples.
exampleDObjects

inputTranslator

- The input translator to be applied on the examples.

outputTranslator

- The input translator to be applied on the examples.

- The array where the input values for the training example
set are returned.
trainingI

- The array where the desired output values for the training
example set are returned.
trainingD

- The array where the input values for the validation


example set are returned.
validationI

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

252

Class Teacher
- The array where the desired output values for the
validation example set are returned.
validationD

- [0,1] The percentage that controls the number of


examples in each set.
validationPercent

Class ValueDecreaseAnalyzer
com.jcortex
java.lang.Object
com.jcortex.ProgressAnalyzer
com.jcortex.ValueDecreaseAnalyzer

public class ValueDecreaseAnalyzer


extends ProgressAnalyzer
The instances of this class are responsable for taking the decision of when to stop a
training, based on a statistics measure's progression. This way there will be a instance
for each stats measure that the Teacher instance wants to be monitored for decision.
Its intelligence operates inside the method isEvolutionGoodEnough(). This class is
responsible of storing all progress information that is not reflected in the StatsMeasure
instance associated, such as recen variations...
It is thought best not to implement this class as a StatsListener, as its decision method
isEvolutionGoodEnough() is not necessarily invoked each time a statistic register is
recorded, but it will be promptly asked by the Teacher instance at work when a
decision is required.
The Value Decrease Analyzer takes its decision based on how well the values
observed decrease.
Author:
Miguel Lara Encabo - miguel@mac.com

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

253

Class ValueDecreaseAnalyzer
Version:
0.1b

Field Summary
protected
static
float

Page

OVERFLOW_GIFT_GRACE

Detemines the size of the margin under which an overflow from


the correct progress is considered as acceptable.

Constructor Summary
ValueDecreaseAnalyzer(StatsMeasure statsMeasure, float bottomLimit, int
studyWindowSize)

254

Page

255

The full constructor for the this classes instances.

Method Summary
String

getReasonToStop()

Obtains the reason why this analyzer has suggested to stop, if


indeed it has.
boolean

Page

255

isProgressGoodEnough()

Decides if the progress monitored by this ProgessAnalyzer is


good enough to continue.

255

Methods inherited from class com.jcortex.ProgressAnalyzer


add, getInnerAnalyzers, getReasonToStop, isProgressGoodEnough, remove

Field Detail
OVERFLOW_GIFT_GRACE
protected static float OVERFLOW_GIFT_GRACE

Detemines the size of the margin under which an overflow from the correct
progress is considered as acceptable.
The value must be between [0,1]. With 0 for no margin and 1 for the
maximum margin possible.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

254

Class ValueDecreaseAnalyzer
For more information on this parameter, take a look at the detailed
documentation.

Constructor Detail
ValueDecreaseAnalyzer
public ValueDecreaseAnalyzer(StatsMeasure statsMeasure,
float bottomLimit,
int studyWindowSize)

The full constructor for the this classes instances.


The attributes and the data structures are initialyzed with the given parameters.

Method Detail
isProgressGoodEnough
public boolean isProgressGoodEnough()

Decides if the progress monitored by this ProgessAnalyzer is good enough to


continue.
Studies the sequence of statistic registers generated. For more information
look at the detailed documentation.
Overrides:
isProgressGoodEnough

in class ProgressAnalyzer

Returns:
A boolean value indicating if the training should continue (true) or not
(false).

getReasonToStop
public String getReasonToStop()

Obtains the reason why this analyzer has suggested to stop, if indeed it has.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

255

Class ValueDecreaseAnalyzer
Overrides:
getReasonToStop

in class ProgressAnalyzer

Returns:
The reason.

Class ValueVariationAnalyzer
com.jcortex
java.lang.Object
com.jcortex.ProgressAnalyzer
com.jcortex.ValueVariationAnalyzer

public class ValueVariationAnalyzer


extends ProgressAnalyzer
The instances of this class are responsable for taking the decision of when to stop a
training, based on a statistics measure's progression. This way there will be a instance
for each stats measure that the Teacher instance wants to be monitored for decision.
The Value Decrease Analyzer takes its decision based on the quality of the value
variations experienced by the network's parameters.
A training will be considered to be going on well, when there the variation recorded is
higher than a Constant-Variation. The training will be stopped when for a ConstantWindow lapse of iterations all values registered are bellow the Constant-Variation
imposed.
The Constant-Value is the value bellow which a variation is considered as constant.
This way a variation does not necessarily have to be 0 to be considered insignificant,
although it should be quite close to 0.
Its intelligence operates inside the method isEvolutionGoodEnough(). This class is
responsible of storing all progress information that is not reflected in the StatsMeasure
instance associated, such as recen variations...
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

256

Class ValueVariationAnalyzer
It is thought best not to implement this class as a StatsListener, as its decision method
isEvolutionGoodEnough() is not necessarily invoked each time a statistic register is
recorded, but it will be promptly asked by the Teacher instance at work when a
decision is required.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Constructor Summary
ValueVariationAnalyzer(StatsMeasure
constantVariation, int constantWindow)

Page
statsMeasure,

float
257

This class' basic constructor.

Method Summary
String

getReasonToStop()

Obtains the reason why this analyzer has suggested to stop, if


indeed it has.
boolean

Page

258

isProgressGoodEnough()

Decides if the progress monitored by this ProgessAnalyzer is


good enough to continue.

258

Methods inherited from class com.jcortex.ProgressAnalyzer


add, getInnerAnalyzers, getReasonToStop, isProgressGoodEnough, remove

Constructor Detail
ValueVariationAnalyzer
public ValueVariationAnalyzer(StatsMeasure statsMeasure,
float constantVariation,
int constantWindow)

This class' basic constructor.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

257

Class ValueVariationAnalyzer

Method Detail
isProgressGoodEnough
public boolean isProgressGoodEnough()

Decides if the progress monitored by this ProgessAnalyzer is good enough to


continue.
Studies the sequence of statistic registers generated. For more information
look at the detailed documentation.
Overrides:
isProgressGoodEnough

in class ProgressAnalyzer

Returns:
A boolean value indicating if the training should continue (true) or not
(false).

getReasonToStop
public String getReasonToStop()

Obtains the reason why this analyzer has suggested to stop, if indeed it has.
Overrides:
getReasonToStop

in class ProgressAnalyzer

Returns:
The reason.

Package com.jcortex.activationFunctions
Class Summary
GaussianFunction

Page

The ActivationFunction implementation of the


Gaussian Function.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

259

258

Package com.jcortex.activationFunctions

HyperbolicTangentFunction

The ActivationFunction implementation of the


Hyperbolic Tangent Function.

262

IdentityFunction

The ActivationFunction implementation of the


Identity Function.

265

SigmoidalFunction

The ActivationFunction implementation of the


Sigmoidal Function.

268

SignFunction

The ActivationFunction implementation of the


Sign Function.

272

StepFunction

The ActivationFunction implementation of the


Step Function.

274

Class GaussianFunction
com.jcortex.activationFunctions
java.lang.Object
com.jcortex.activationFunctions.GaussianFunction

All Implemented Interfaces:

ActivationFunction

final public class GaussianFunction


extends Object
implements ActivationFunction
The ActivationFunction implementation of the Gaussian Function. As this class
does not store any specific attributes or parameters it has been buit to work
complaying with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

259

Class GaussianFunction
Method Summary
float[]

Page

getDefaultParameterSet()

Obtains the default parameters for this Activation


Function.
static
GaussianFunction

getInstance()

Obtains the Singleton (GoF) instance for this class.


int

260

getNumberOfActivationParameters()

Obtains the number of parameters required by this


function.
float

260

261

getSolution(float networkResult, float[] activationParams)

Implementation of the Gaussian Function.

261

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Method Detail
getInstance
public static GaussianFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getDefaultParameterSet
public float[] getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


Specified by:
getDefaultParameterSet

in interface ActivationFunction

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

260

Class GaussianFunction
Returns:
The default set of parameters.

getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


Specified by:
getNumberOfActivationParameters

in interface ActivationFunction

Returns:
The number of activation parameters required by this function. [= 2]

getSolution
public float getSolution(float networkResult,
float[] activationParams)

Implementation of the Gaussian Function.


Specified by:
getSolution

in interface ActivationFunction

Parameters:
networkResult

- The result of the network function.

- The function parameters used by this neuron's


function. This function needs two parameters: the dimensional
modifier (array position 0) and another one for its shape (array position
1).
activationParams

Returns:
The result produced by the Gaussian Function

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

261

Class HyperbolicTangentFunction

Class HyperbolicTangentFunction
com.jcortex.activationFunctions
java.lang.Object
com.jcortex.activationFunctions.HyperbolicTangentFunction

All Implemented Interfaces:

ActivationFunction, BackPropagationActivationFunction

final public class HyperbolicTangentFunction


extends Object
implements BackPropagationActivationFunction
The ActivationFunction implementation of the Hyperbolic Tangent Function. As
this class does not store any specific attributes or parameters it has been buit to work
complaying with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Method Summary
float[]

Page
getDefaultParameterSet()

Obtains the default parameters for this Activation


Function.
float

getDerivativeSolution(BackPropagationNeuron neuron)

Derivative Hyperbolic Tangent Function


static
HyperbolicTangentFunction

264

getInstance()

Obtains the Singleton (GoF) instance for this class.


int

263

263

getNumberOfActivationParameters()

Obtains the number of parameters required by this


function.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

264

262

Class HyperbolicTangentFunction
float

getSolution(float
networkResult,
parameter_to_be_ignored)

float[]
264

Hyperbolic Tangent Function

Methods
inherited
from
com.jcortex.BackPropagationActivationFunction

interface

getDerivativeSolution

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Method Detail
getInstance
public static HyperbolicTangentFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getDefaultParameterSet
public float[] getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


Specified by:
getDefaultParameterSet

in interface ActivationFunction

Returns:
The default set of parameters.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

263

Class HyperbolicTangentFunction
getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


Specified by:
getNumberOfActivationParameters

in interface ActivationFunction

Returns:
The number of activation parameters required by this function. [= 0]

getSolution
public float getSolution(float networkResult,
float[] parameter_to_be_ignored)

Hyperbolic Tangent Function


Specified by:
getSolution

in interface ActivationFunction

Parameters:
networkResult

- The result of the network function.

parameter_to_be_ignored

- Not necessary for this function.

Returns:
The result produced by the Activation Function. Any value will be
ingnored.

getDerivativeSolution
public float getDerivativeSolution(BackPropagationNeuron neuron)

Derivative Hyperbolic Tangent Function

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

264

Class HyperbolicTangentFunction
Specified by:
getDerivativeSolution
BackPropagationActivationFunction

in

interface

Parameters:
neuron

- The neuron for which the derivate function is calculated.

Returns:
The result produced by the Activation Function.

Class IdentityFunction
com.jcortex.activationFunctions
java.lang.Object
com.jcortex.activationFunctions.IdentityFunction

All Implemented Interfaces:

ActivationFunction, BackPropagationActivationFunction

final public class IdentityFunction


extends Object
implements BackPropagationActivationFunction
The ActivationFunction implementation of the Identity Function. As this class does
not store any specific attributes or parameters it has been buit to work complaying
with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

265

Class IdentityFunction
Method Summary
float[]

Page

getDefaultParameterSet()

Obtains the default parameters for this Activation


Function.
float

getDerivativeSolution(BackPropagationNeuron neuron)
268

Derivative Simoidal Identity Function


static
IdentityFunction

getInstance()
266

Obtains the Singleton (GoF) instance for this class.


int

getNumberOfActivationParameters()

Obtains the number of parameters required by this


function.
float

266

267

getSolution(float networkResult, float[] activationParams)


267

Implementation of the Identity Function.

Methods
inherited
from
com.jcortex.BackPropagationActivationFunction

interface

getDerivativeSolution

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Method Detail
getInstance
public static IdentityFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getDefaultParameterSet
public float[] getDefaultParameterSet()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

266

Class IdentityFunction
Obtains the default parameters for this Activation Function.
Specified by:
getDefaultParameterSet

in interface ActivationFunction

Returns:
The default set of parameters.

getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


Specified by:
getNumberOfActivationParameters

in interface ActivationFunction

Returns:
The number of activation parameters required by this function. [= 1]

getSolution
public float getSolution(float networkResult,
float[] activationParams)

Implementation of the Identity Function.


Specified by:
getSolution

in interface ActivationFunction

Parameters:
networkResult

- The result of the network function.

- The parameters used by this function. This


function needs only one parameters (array position 0).
activationParams

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

267

Class IdentityFunction
Returns:
The result produced by the Sigmoidal Function

getDerivativeSolution
public float getDerivativeSolution(BackPropagationNeuron neuron)

Derivative Simoidal Identity Function


Specified by:
getDerivativeSolution
BackPropagationActivationFunction

in

interface

Parameters:
neuron

- The neuron on which the deriva activation function has to

work.
Returns:
The result produced by the derivate of the Sigmoidal Function.

Class SigmoidalFunction
com.jcortex.activationFunctions
java.lang.Object
com.jcortex.activationFunctions.SigmoidalFunction

All Implemented Interfaces:

ActivationFunction, BackPropagationActivationFunction

final public class SigmoidalFunction


extends Object
implements BackPropagationActivationFunction

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

268

Class SigmoidalFunction
The ActivationFunction implementation of the Sigmoidal Function. As this class
does not store any specific attributes or parameters it has been buit to work
complaying with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Method Summary
float[]

Page

getDefaultParameterSet()

Obtains the default parameters for this Activation


Function.
float

getDerivativeSolution(BackPropagationNeuron neuron)
271

Derivative Simoidal Tangent Function


static
SigmoidalFunction

getInstance()
270

Obtains the Singleton (GoF) instance for this class.


int

getNumberOfActivationParameters()

Obtains the number of parameters required by this


function.
float

270

getSolution(float
activationParams)

networkResult,

270

float[]
271

Implementation of the Sigmoidal Function.

Methods
inherited
from
com.jcortex.BackPropagationActivationFunction

interface

getDerivativeSolution

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

269

Class SigmoidalFunction

Method Detail
getInstance
public static SigmoidalFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getDefaultParameterSet
public float[] getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


Specified by:
getDefaultParameterSet

in interface ActivationFunction

Returns:
The default set of parameters.

getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


Specified by:
getNumberOfActivationParameters

in interface ActivationFunction

Returns:
The number of activation parameters required by this function. [= 1]

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

270

Class SigmoidalFunction
getSolution
public float getSolution(float networkResult,
float[] activationParams)

Implementation of the Sigmoidal Function.


Specified by:
getSolution

in interface ActivationFunction

Parameters:
networkResult

- The result of the network function.

- The parameters used by this function. This


function needs only one parameters (array position 0). FOR THIS
IMPLEMENTATION THIS SETTING WILL BE IGNORED.
activationParams

Returns:
The result produced by the Sigmoidal Function

getDerivativeSolution
public float getDerivativeSolution(BackPropagationNeuron neuron)

Derivative Simoidal Tangent Function


Specified by:
getDerivativeSolution
BackPropagationActivationFunction

in

interface

Parameters:
neuron

- The neuron on which the deriva activation function has to

work.
Returns:
The result produced by the derivate of the Sigmoidal Function.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

271

Class SignFunction

Class SignFunction
com.jcortex.activationFunctions
java.lang.Object
com.jcortex.activationFunctions.SignFunction

All Implemented Interfaces:

ActivationFunction

final public class SignFunction


extends Object
implements ActivationFunction
The ActivationFunction implementation of the Sign Function. As this class does not
store any specific attributes or parameters it has been buit to work complaying with
the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Method Summary
float[]

Page

getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


static
SignFunction

getInstance()
273

Obtains the Singleton (GoF) instance for this class.


int

getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


float

273

getSolution(float
parameter_to_be_ignored)

networkResult,

273

float[]
274

Sign Function

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

272

Class SignFunction

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Method Detail
getInstance
public static SignFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getDefaultParameterSet
public float[] getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


Specified by:
getDefaultParameterSet

in interface ActivationFunction

Returns:
The default set of parameters.

getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


Specified by:
getNumberOfActivationParameters

in interface ActivationFunction

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

273

Class SignFunction
Returns:
The number of activation parameters required by this function. [= 0]

getSolution
public float getSolution(float networkResult,
float[] parameter_to_be_ignored)

Sign Function
Specified by:
getSolution

in interface ActivationFunction

Parameters:
networkResult

- The result of the network function.

parameter_to_be_ignored

- Not necessary for this function.

Returns:
The result produced by the Sign Function

Class StepFunction
com.jcortex.activationFunctions
java.lang.Object
com.jcortex.activationFunctions.StepFunction

All Implemented Interfaces:

ActivationFunction

final public class StepFunction


extends Object
implements ActivationFunction

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

274

Class StepFunction
The ActivationFunction implementation of the Step Function. As this class does not
store any specific attributes or parameters it has been buit to work complaying with
the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Method Summary
float[]

getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


static
StepFunction

275

getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


float

276

getInstance()

Obtains the Singleton (GoF) instance for this class.


int

Page

276

getSolution(float networkResult, float[] activationParams)

Step Function

276

Methods inherited from interface com.jcortex.ActivationFunction


getDefaultParameterSet, getNumberOfActivationParameters, getSolution

Method Detail
getInstance
public static StepFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

275

Class StepFunction
getDefaultParameterSet
public float[] getDefaultParameterSet()

Obtains the default parameters for this Activation Function.


Specified by:
getDefaultParameterSet

in interface ActivationFunction

Returns:
The default set of parameters.

getNumberOfActivationParameters
public int getNumberOfActivationParameters()

Obtains the number of parameters required by this function.


Specified by:
getNumberOfActivationParameters

in interface ActivationFunction

Returns:
The number of activation parameters required by this function. [= 1]

getSolution
public float getSolution(float networkResult,
float[] activationParams)

Step Function
Specified by:
getSolution

in interface ActivationFunction

Parameters:
networkResult

- The result of the network function.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

276

Class StepFunction
- The function parameters used by this neuron's
function. This function only one parameter (array position 0) that
represents the thresshold.
activationParams

Returns:
The result produced by the Step Function

Package com.jcortex.backPropagation
Pag
e

Class Summary
A

specialization

of

the

class

com.jcortex.feedForward.FeedForwardNeu

BackPropagationNeuron

that adds all the functionalities needed


for a neuron to work inside BackPropagation neural networks.
ron

277

Default Teacher implementation for the


DefaultMultilayerPerceptronTeac
Multilayer Perceptron neural network
her
model.

281

The Multilayer Perceptron Neural


MultilayerPerceptronNeuralNetw
Network Model based on a Feedork
Forward Neural Network.

290

Class BackPropagationNeuron
com.jcortex.backPropagation
java.lang.Object
com.jcortex.Neuron
com.jcortex.feedForward.FeedForwardNeuron
com.jcortex.backPropagation.BackPropagationNeuron

All Implemented Interfaces:

AxonReceiver, AxonSource

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

277

Class BackPropagationNeuron

public class BackPropagationNeuron


extends FeedForwardNeuron
A specialization of the class com.jcortex.feedForward.FeedForwardNeuron that adds
all the functionalities needed for a neuron to work inside Back-Propagation neural
networks.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Fields inherited from class com.jcortex.Neuron


RANDOM_CLOSE_TO_ZERO_VALUE, RANDOM_INITIAL_VALUE, ZERO_INITIAL_VALUE

Constructor Summary
BackPropagationNeuron(int
id,
NetworkFunction
ActivationFunction activationFunction)

Page
networkFunction,
279

The constructor for brand new Back Propagation neurons.


BackPropagationNeuron(org.w3c.dom.Node neuronNode, NeuralNetwork nn)

Constructor based on the XML node representation of this neuron.

Method Summary
float

280

calculateGradient(float desired_output)

Calculates the gradient of those neurons for which the error is


available: the ending layer ones.
float

Page

calculateGradient()

Calculates the gradient of the neuron based on the next layer's


gradient.
float

279

280

getGradient()

Obtains this neuron's gradient.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

280

278

Class BackPropagationNeuron
Methods inherited from class com.jcortex.feedForward.FeedForwardNeuron
addConnectedNeuron,
addEntry,
addEntry,
connectLoadedNeuronWithEntries,
equals,
getActivationFunction,
getActivationParameters,
getAxonValue,
getConnectedNeurons,
getEntries,
getEntryWeight,
getNetworkFunction,
getNetworkResult, instantError, produceAxonValue, setActivationFunction,
setActivationParams, setEntryWeight, setNetworkFunction, specificNeuron2xml,
synapse, toString

Methods inherited from class com.jcortex.Neuron


equals, getConnectedNeurons, getId, neuron2xml, toString

Methods inherited from interface com.jcortex.AxonSource


addConnectedNeuron, getAxonValue, getId, produceAxonValue

Methods inherited from interface com.jcortex.AxonReceiver


addEntry, addEntry, getEntries, getEntryWeight, getId, setEntryWeight

Constructor Detail
BackPropagationNeuron
public BackPropagationNeuron(int id,
NetworkFunction networkFunction,
ActivationFunction activationFunction)

The constructor for brand new Back Propagation neurons. It is based on the
FeedForwardNeuron class' basic constructor.

BackPropagationNeuron
public BackPropagationNeuron(org.w3c.dom.Node neuronNode,
NeuralNetwork nn)
throws ReadingException

Constructor based on the XML node representation of this neuron.


Throws:
ReadingException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

279

Class BackPropagationNeuron

Method Detail
getGradient
public float getGradient()

Obtains this neuron's gradient. It may return 0 if the gradient has not been
calculated yet. If either calculateGradient() methods have not been invoked
recently, this method may produce an old gradient value from a previous
iteration.
Returns:
This neuron's stored gradient value.

calculateGradient
public float calculateGradient(float desired_output)

Calculates the gradient of those neurons for which the error is available: the
ending layer ones.
Parameters:
desired_output

- The output desired to have come out

Returns:
The gradient value found. This is also stored in the class for future use.

calculateGradient
public float calculateGradient()

Calculates the gradient of the neuron based on the next layer's gradient.
Returns:
The gradient value found. This is also stored in the class for future use.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

280

Class DefaultMultilayerPerceptronTeacher

Class DefaultMultilayerPerceptronTeacher
com.jcortex.backPropagation
java.lang.Object
com.jcortex.Teacher
com.jcortex.backPropagation.DefaultMultilayerPerceptronTeacher

final public class DefaultMultilayerPerceptronTeacher


extends Teacher
Default
model.

Teacher

implementation for the Multilayer Perceptron neural network

Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.Teacher


VALIDATION_JUMP

Constructor Summary

Page

DefaultMultilayerPerceptronTeacher()

The default creator for a brand new teacher.

283

DefaultMultilayerPerceptronTeacher(org.w3c.dom.Node teacherNode)

Creates a DefaultMultilayerPerceptronTeacher instance from an XML


node with its configuration.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

283

281

Class DefaultMultilayerPerceptronTeacher
Method Summary
Statistics

Page

createStatsSchema()

Creates the Statistics instance with the specific progress


measures needed by thos particular Teacher.
Statistics

educateNetwork(NeuralNetwork nn, Object[] exampleIObjects,


Object[] exampleDObjects)

Educates a layered Feed-Forward Neural Network using


the Back Propagation Algorithm based on the Error Correction
Algorithm, also known as Delta Rule.
float

285

getAnalysisWindow()
287

Obtains the Analysis Window training parameter.


ProgressAnalyzer

getAnalyzer()
287

Obtains this teacher's associated training analyzer.


float

getConstantVariation()
286

Obtains the Constant Variation training parameter.


float

getLearningRate()
284

Obtains the Learning Rate training parameter.


long

getMaxIterations()

Obtains
parameter.
float

the

Maximum

Iteration

Number

training

285

setMaxIterations(long maximumIterationNumber)

Sets the Maximum Iteration Number training parameter.


void

287

setLearningRate(float learningRate)

Sets the Learning Rate training parameter.


void

287

setConstantVariation(float constantVariation)

Sets the Constant Variation training parameter.


void

285

setAnalysisWindow(int constantVariationWindow)

Obtains the Analysis Window training parameter.


void

285

setAcceptableError(float maximumAcceptableError)

Sets the Acceptable Error training parameter.


void

286

getValidationPercent()

Obtains the Validation Percent training parameter.


void

284

getAcceptableError()

Obtains the Acceptable Error training parameter.


int

288

286

setValidationPercent(float validationPercent)

Sets the Validation Percent training parameter.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

286

282

Class DefaultMultilayerPerceptronTeacher
void

specificTeacher2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

teacherRoot,

Dumps into the teacher's XML node this specific


instance's configuration.
void

Teacher

stopTraining()

Stops the training's progress by interrupting its next


iteration.
String

288

289

toHTMLString()

Produces a String representation of this teacher's


parameters and settings, including HTML tags to enhance it with
styled text.

289

Methods inherited from class com.jcortex.Teacher


createStatsSchema, educateNetwork, getAnalyzer, getStats,
teacher2xml, toHTMLString, translateAndClassifyExamples

stopTraining,

Constructor Detail
DefaultMultilayerPerceptronTeacher
public DefaultMultilayerPerceptronTeacher()

The default creator for a brand new teacher.


All learning parameters are initialized with their default values.

DefaultMultilayerPerceptronTeacher
public DefaultMultilayerPerceptronTeacher(org.w3c.dom.Node teacherNode)

Creates a DefaultMultilayerPerceptronTeacher instance from an XML node


with its configuration.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

283

Class DefaultMultilayerPerceptronTeacher

Method Detail
educateNetwork
public Statistics educateNetwork(NeuralNetwork nn,
Object[] exampleIObjects,
Object[] exampleDObjects)
throws IllegalArgumentException

Educates a layered Feed-Forward Neural Network using the Back Propagation


Algorithm based on the Error Correction Algorithm, also known as Delta
Rule.
Overrides:
educateNetwork

in class Teacher

Parameters:
nn

- The neural network to be trained.

exampleIObjects

- The example input objects.

exampleDObjects

- The example output objects.

Returns:
The statistics for this training.
Throws:
- Exception thrown when an error occured
due to problems with the training's parameters.
IllegalArgumentException

getLearningRate
public float getLearningRate()

Obtains the Learning Rate training parameter.


Returns:
The requested parameter's value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

284

Class DefaultMultilayerPerceptronTeacher
setLearningRate
public void setLearningRate(float learningRate)

Sets the Learning Rate training parameter.


Parameters:
learningRate

- The new value.

getAcceptableError
public float getAcceptableError()

Obtains the Acceptable Error training parameter.


Returns:
The requested parameter's value.

setAcceptableError
public void setAcceptableError(float maximumAcceptableError)

Sets the Acceptable Error training parameter.


Parameters:
maximumAcceptableError

- The new value.

getValidationPercent
public float getValidationPercent()

Obtains the Validation Percent training parameter.


Returns:
The requested parameter's value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

285

Class DefaultMultilayerPerceptronTeacher

setValidationPercent
public void setValidationPercent(float validationPercent)

Sets the Validation Percent training parameter.


Parameters:
validationPercent

- The new parameter's value.

getMaxIterations
public long getMaxIterations()

Obtains the Maximum Iteration Number training parameter.


Returns:
The requested parameter's value.

setMaxIterations
public void setMaxIterations(long maximumIterationNumber)

Sets the Maximum Iteration Number training parameter.


Parameters:
maximumIterationNumber

- The new value.

getConstantVariation
public float getConstantVariation()

Obtains the Constant Variation training parameter.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

286

Class DefaultMultilayerPerceptronTeacher
Returns:
The requested parameter's value.

setConstantVariation
public void setConstantVariation(float constantVariation)

Sets the Constant Variation training parameter.


Parameters:
constantVariation

- The new value.

getAnalysisWindow
public int getAnalysisWindow()

Obtains the Analysis Window training parameter.


Returns:
The requested parameter's value.

setAnalysisWindow
public void setAnalysisWindow(int constantVariationWindow)

Obtains the Analysis Window training parameter.


Parameters:
constantVariationWindow

- The new value.

getAnalyzer
public ProgressAnalyzer getAnalyzer()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

287

Class DefaultMultilayerPerceptronTeacher
Obtains this teacher's associated training analyzer.
Overrides:
getAnalyzer

in class Teacher

Returns:
The training statistics analyzer

createStatsSchema
public Statistics createStatsSchema()

Creates the Statistics instance with the specific progress measures needed by
thos particular Teacher. This method works as a a Template Method (GoF) for
the getStats() method implemented in the Teacher abstract class. The
measures used in the training will be: TRAINING_ERROR, VALIDATION_ERROR and
WEIGHT_VARIATION, all of them defined as static Strings in this class.
Overrides:
createStatsSchema

in class Teacher

Returns:
The new Statistics instance.

specificTeacher2xml
public void specificTeacher2xml(org.w3c.dom.Element teacherRoot,
org.w3c.dom.Document document)

Dumps into the teacher's XML node this specific Teacher instance's
configuration. This is a Template Method (GoF) for the Teacher abstract class.
This teacher's training parameters are stored as attributes in the XML
configuration node.
Overrides:
specificTeacher2xml

in class Teacher

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

288

Class DefaultMultilayerPerceptronTeacher
Parameters:
- The XML node in which this teacher's configuration
must be dumped.
teacherRoot

- The Document instance that will be the ultimate root for


this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

stopTraining
public void stopTraining()

Stops the training's progress by interrupting its next iteration.


For this, it uses a boolan flag - this class' attribute continueTraining and turns
it false so the next time the iteration reaches the condition state, it will surely
jump out of the training loop.
Overrides:
stopTraining

in class Teacher

toHTMLString
public String toHTMLString()

Produces a String representation of this teacher's parameters and settings,


including HTML tags to enhance it with styled text.
Overrides:
toHTMLString

in class Teacher

Returns:
This teacher's String representation.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

289

Class MultilayerPerceptronNeuralNetwork

Class MultilayerPerceptronNeuralNetwork
com.jcortex.backPropagation
java.lang.Object
com.jcortex.NeuralNetwork
com.jcortex.feedForward.FeedForwardNeuralNetwork
com.jcortex.backPropagation.MultilayerPerceptronNeuralNetwork

public class MultilayerPerceptronNeuralNetwork


extends FeedForwardNeuralNetwork
The Multilayer Perceptron Neural Network Model based on a Feed-Forward
Neural Network.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.NeuralNetwork


inputTranslator, neurons, outputTranslator, sensors, teacher

Constructor Summary

Page

MultilayerPerceptronNeuralNetwork(int
inputNum,
int[]
neuronLayers,
InputTranslator
inputTranslator,
OutputTranslator
outputTranslator,
NetworkFunction
networkFunction,
BackPropagationActivationFunction
292
activationFunction)

Constructor for brand-new Multilayer Perceptron Networks.


MultilayerPerceptronNeuralNetwork(org.w3c.dom.Node nnRoot)

Creates a
representation.

MultilayerPerceptronNeuralNetwork

instance from its XML

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

292

290

Class MultilayerPerceptronNeuralNetwork
Method Summary
static int

Page
countNeuronsInLayers(int[] neuronLayers)

Static method that counts the number of neurons


inside the layers.
BackPropagationNeuron[][]

294

getLayers()
293

Obtains the all the neurons in their layers.


void

specificNeuralNetwork2xml(org.w3c.dom.Element
nnRoot, org.w3c.dom.Document document)

Puts into this neural network's XML configuration


node the aditional information it has as being a
MultilayerPerceptronNeuralNetwork instance.
String

toHTMLString()

Produces a String representation of this neural


network enhanced with HTML tags to include styled
text.
String

293

294

toString()

Produces a String representation of this neural


network.

Methods
inherited
from
com.jcortex.feedForward.FeedForwardNeuralNetwork

293

class

pureThink

Methods inherited from class com.jcortex.NeuralNetwork


addEndNeuron, addFirstNeuron, addNeuron, addNeurons, createNeuralNetwork,
export2XMLDocument, getAttributeCount, getConnectedNeurons, getEndNeurons,
getInputTranslator,
getNeuron,
getNeuronCount,
getNeurons,
getOutputTranslator, getSensor, getSensorCount, getSensors, getTeacher,
neuralNetwork2xml,
pureThink,
setEndNeurons,
setFirtsNeurons,
setInputTranslator, setOutputTranslator, setTeacher, think, toHTMLString,
toString

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

291

Class MultilayerPerceptronNeuralNetwork

Constructor Detail
MultilayerPerceptronNeuralNetwork
public MultilayerPerceptronNeuralNetwork(int inputNum,
int[] neuronLayers,
InputTranslator inputTranslator,
OutputTranslator outputTranslator,
NetworkFunction networkFunction,
BackPropagationActivationFunction a
ctivationFunction)

Constructor for brand-new Multilayer Perceptron Networks. Initializes the


network's parameters and creates a Feed-Forward Neuron based on a layered
structure.
This constructor creates a Feed-Forward network of fully-connected layers.
The layer schema is passed to the constructor through an int[] array. Each
position of this array represents a layer, layer 0 is the first layer and will be
fully-connected to the sensors defined by the inputNum parameter, layer 1 the
next, and so on. The int number at each position represents the number of
neurons in that layer. The neurons of last layer (index neuronLayers.lenght-1
will be taken as the network's end neurons. The number of neurons in the
last layer will be the number of values returned by the network as its
output.
This constructor requires as the default Network and Activation functions with
which have the new neurons initiallized. These can later be changed for each
specific neuron.

MultilayerPerceptronNeuralNetwork
public MultilayerPerceptronNeuralNetwork(org.w3c.dom.Node nnRoot)
throws ReadingException

Creates a MultilayerPerceptronNeuralNetwork instance from its XML


representation.
The whole process is based on the appropriate Feed-Forward Neural Network
constructor as this neuron does not add any specific information. The main
issue of this constructor is, once the neurons have been created by the FeedForward network construstor, pour them into the layered schema.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

292

Class MultilayerPerceptronNeuralNetwork
Throws:
ReadingException

Method Detail
getLayers
public BackPropagationNeuron[][] getLayers()

Obtains the all the neurons in their layers.


Returns:
A BackPropagationNeuron[][] array where the fist index is for the
layer and the second index for the neuron in the layer.

specificNeuralNetwork2xml
public void specificNeuralNetwork2xml(org.w3c.dom.Element nnRoot,
org.w3c.dom.Document document)

Puts into this neural network's XML configuration node the aditional
information it has as being a MultilayerPerceptronNeuralNetwork instance.
The only information stored at this level is the layer schema that organizes this
network.
Overrides:
specificNeuralNetwork2xml

in class NeuralNetwork

Parameters:
nnRoot

- This neural network's XML configuration node.

document

- The XML Document needed to create new elements.

toString
public String toString()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

293

Class MultilayerPerceptronNeuralNetwork
Produces a String representation of this neural network.
Overrides:
toString

in class NeuralNetwork

Returns:
A String representation of this neural network.

toHTMLString
public String toHTMLString()

Produces a String representation of this neural network enhanced with HTML


tags to include styled text.
Overrides:
toHTMLString

in class NeuralNetwork

Returns:
A String representation of this neural network.

countNeuronsInLayers
public static int countNeuronsInLayers(int[] neuronLayers)

Static method that counts the number of neurons inside the layers. It has to go
through all the layers to peform this task.
Parameters:
neuronLayers

- The layer structure described in the basic constructor.

Returns:
The number of neurons defined in the layer structure.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

294

Package com.jcortex.distanceFunctions

Package com.jcortex.distanceFunctions
Class Summary

Page

EuclideanDistanceFunction

The DistanceFunction implementation of the


Euclidean Distance.

295

Class EuclideanDistanceFunction
com.jcortex.distanceFunctions
java.lang.Object
com.jcortex.distanceFunctions.EuclideanDistanceFunction

All Implemented Interfaces:

DistanceFunction

public class EuclideanDistanceFunction


extends Object
implements DistanceFunction
The DistanceFunction implementation of the Euclidean Distance. As this class does
not store any specific attributes or parameters it has been buit to work complaying
with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Method Summary
float

Page
getDistance(AxonSource[] entries, float[] weights)

Implementation of the Euclidean Distance between


an AxonSource array and a float array.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

296

295

Class EuclideanDistanceFunction
static
EuclideanDistanceFunction

getInstance()

Obtains the Singleton (GoF) instance for this class.

296

Methods inherited from interface com.jcortex.DistanceFunction


getDistance

Method Detail
getInstance
public static EuclideanDistanceFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getDistance
public float getDistance(AxonSource[] entries,
float[] weights)
throws IllegalArgumentException

Implementation of the Euclidean Distance between an AxonSource array and a


float array. Both arrays must have the same size; otherwise, an
IllegalArgumentException will be thrown.
Specified by:
getDistance

in interface DistanceFunction

Parameters:
- The first reference array with a list of AxonSource instances.
From each AxonSource instance a float value can be obtained.
entries

weights

- The second reference array with a list of float values.

Returns:
The Euclidean distance between the two arrays' values.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

296

Class EuclideanDistanceFunction
Throws:
IllegalArgumentException

- Thrown in case both arrays have different

sizes.

Package com.jcortex.feedForward
Class Summary

Page

DefaultPerceptronTeacher

Default Teacher implementation


Perceptron neural network model.

for

the

FeedForwardNeuralNetwork

This class models a generic kind of Neural


Network: a Feed-Forward Neural Network.

306

FeedForwardNeuron

Class that models the functionalities of a FeedForward neuron giving it as much versatility as
possible.

309

NeuronInTheList

Simple representation of a Neuron that will be


juggled in the ToDoList.

321

PerceptronNeuralNetwork

A Perceptron Neural Network is a specific


kind of Feed-Forward Neural Network

325

ToDoList

A ToDoList instance puts some order into the


stymulus propagation through a Feed-Forward
Neural Network.

329

297

Class DefaultPerceptronTeacher
com.jcortex.feedForward
java.lang.Object
com.jcortex.Teacher
com.jcortex.feedForward.DefaultPerceptronTeacher

final public class DefaultPerceptronTeacher


extends Teacher
Default Teacher implementation for the Perceptron neural network model.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

297

Class DefaultPerceptronTeacher
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.Teacher


VALIDATION_JUMP

Constructor Summary

Page

DefaultPerceptronTeacher()

The default creator for a brand new teacher.

299

DefaultPerceptronTeacher(org.w3c.dom.Node teacherNode)

Creates a DefaultPerceptronTeacher instance from an XML node with its


configuration.

300

Method Summary

Page

Statistics

createStatsSchema()

Creates the Statistics instance with the specific progress


measures needed by thos particular Teacher.
Statistics

educateNetwork(NeuralNetwork nn, Object[] exampleIObjects,


Object[] exampleDObjects)

Educates a pure Feed-Forward Neural Network - such as


the Perceptron model - using the Error Correction Algorithm,
also known as Delta Rule.
float

304

getConstantVariation()

Obtains the Constant Variation training parameter.


float

303

getAnalyzer()

Obtains this teacher's associated training analyzer.


float

301

getAnalysisWindow()

Obtains the Analysis Window training parameter.


ProgressAnalyzer

300

getAcceptableError()

Obtains the Acceptable Error training parameter.


int

304

303

getLearningRate()

Obtains the Learning Rate training parameter.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

302

298

Class DefaultPerceptronTeacher
long

getMaxIterations()

Obtains
parameter.
float

the

Maximum

Iteration

Number

training

getValidationPercent()
301

Obtains the Validation Percent training parameter.


void

setAcceptableError(float maximumAcceptableError)
301

Sets the Acceptable Error training parameter.


void

setAnalysisWindow(int constantWindow)
304

Obtains the Analysis Window training parameter.


void

setConstantVariation(float constantVariation)
303

Sets the Constant Variation training parameter.


void

setLearningRate(float learningRate)
302

Sets the Learning Rate training parameter.


void

setMaxIterations(long maxIterations)

Sets the Maximum Iteration Number training parameter.


void

301

specificTeacher2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

teacherRoot,

Dumps into the teacher's XML node this specific


instance's configuration.
void

Teacher

305

stopTraining()

Stops the training's progress by interrupting its next


iteration.
String

302

setValidationPercent(float validationPercent)

Sets the Validation Percent training parameter.


void

302

305

toHTMLString()

Produces a String representation of this teacher's


parameters and settings, including HTML tags to enhance it with
styled text.

306

Methods inherited from class com.jcortex.Teacher


createStatsSchema, educateNetwork, getAnalyzer, getStats,
teacher2xml, toHTMLString, translateAndClassifyExamples

stopTraining,

Constructor Detail
DefaultPerceptronTeacher
public DefaultPerceptronTeacher()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

299

Class DefaultPerceptronTeacher
The default creator for a brand new teacher.
All learning parameters are initialized with their default values.

DefaultPerceptronTeacher
public DefaultPerceptronTeacher(org.w3c.dom.Node teacherNode)

Creates a DefaultPerceptronTeacher instance from an XML node with its


configuration.

Method Detail
educateNetwork
public Statistics educateNetwork(NeuralNetwork nn,
Object[] exampleIObjects,
Object[] exampleDObjects)
throws IllegalArgumentException

Educates a pure Feed-Forward Neural Network - such as the Perceptron


model - using the Error Correction Algorithm, also known as Delta Rule.
Overrides:
educateNetwork

in class Teacher

Parameters:
nn

- The neural network to be trained.

exampleIObjects

- The example input objects.

exampleDObjects

- The example output objects.

Returns:
The statistics for this training.
Throws:
- Exception thrown when an error occured
due to problems with the training's parameters.
IllegalArgumentException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

300

Class DefaultPerceptronTeacher

getAcceptableError
public float getAcceptableError()

Obtains the Acceptable Error training parameter.


Returns:
The requested parameter's value.

setAcceptableError
public void setAcceptableError(float maximumAcceptableError)

Sets the Acceptable Error training parameter.


Parameters:
maximumAcceptableError

- The new parameter's value.

getValidationPercent
public float getValidationPercent()

Obtains the Validation Percent training parameter.


Returns:
The requested parameter's value.

setValidationPercent
public void setValidationPercent(float validationPercent)

Sets the Validation Percent training parameter.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

301

Class DefaultPerceptronTeacher
Parameters:
validationPercent

- The new parameter's value.

getMaxIterations
public long getMaxIterations()

Obtains the Maximum Iteration Number training parameter.


Returns:
The requested parameter's value.

setMaxIterations
public void setMaxIterations(long maxIterations)

Sets the Maximum Iteration Number training parameter.


Parameters:
maxIterations

- The new parameter's value.

getLearningRate
public float getLearningRate()

Obtains the Learning Rate training parameter.


Returns:
The requested parameter's value.

setLearningRate
public void setLearningRate(float learningRate)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

302

Class DefaultPerceptronTeacher
Sets the Learning Rate training parameter.
Parameters:
learningRate

- The new value.

getConstantVariation
public float getConstantVariation()

Obtains the Constant Variation training parameter.


Returns:
The requested parameter's value.

setConstantVariation
public void setConstantVariation(float constantVariation)

Sets the Constant Variation training parameter.


Parameters:
constantVariation

- The new parameter's value.

getAnalysisWindow
public int getAnalysisWindow()

Obtains the Analysis Window training parameter.


Returns:
The requested parameter's value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

303

Class DefaultPerceptronTeacher
setAnalysisWindow
public void setAnalysisWindow(int constantWindow)

Obtains the Analysis Window training parameter.


Parameters:
constantWindow

- The new value.

getAnalyzer
public ProgressAnalyzer getAnalyzer()

Obtains this teacher's associated training analyzer.


Overrides:
getAnalyzer

in class Teacher

Returns:
The training statistics analyzer

createStatsSchema
public Statistics createStatsSchema()

Creates the Statistics instance with the specific progress measures needed by
thos particular Teacher. This method works as a a Template Method (GoF) for
the getStats() method implemented in the Teachet abstract class. The
measures used in the training will be: TRAINING_ERROR, VALIDATION_ERROR and
WEIGHT_VARIATION, all of them defined as static Strings in this class.
Overrides:
createStatsSchema

in class Teacher

Returns:
The new Statistics instance.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

304

Class DefaultPerceptronTeacher

specificTeacher2xml
public void specificTeacher2xml(org.w3c.dom.Element teacherRoot,
org.w3c.dom.Document document)

Dumps into the teacher's XML node this specific Teacher instance's
configuration. This is a Template Method (GoF) for the Teacher abstract class.
This teacher's training parameters are stored as attributes in the XML
configuration node.
Overrides:
specificTeacher2xml

in class Teacher

Parameters:
- The XML node in which this teacher's configuration
must be dumped.
teacherRoot

- The Document instance that will be the ultimate root for


this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

stopTraining
public void stopTraining()

Stops the training's progress by interrupting its next iteration.


For this, it uses a boolan flag - this class' attribute continueTraining and turns
it false so the next time the iteration reaches the condition state, it will surely
jump out of the training loop.
Overrides:
stopTraining

in class Teacher

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

305

Class DefaultPerceptronTeacher
toHTMLString
public String toHTMLString()

Produces a String representation of this teacher's parameters and settings,


including HTML tags to enhance it with styled text.
Overrides:
toHTMLString

in class Teacher

Returns:
This teacher's String representation.

Class FeedForwardNeuralNetwork
com.jcortex.feedForward
java.lang.Object
com.jcortex.NeuralNetwork
com.jcortex.feedForward.FeedForwardNeuralNetwork

Direct Known Subclasses:

MultilayerPerceptronNeuralNetwork, PerceptronNeuralNetwork

abstract public class FeedForwardNeuralNetwork


extends NeuralNetwork
This class models a generic kind of Neural Network: a Feed-Forward Neural
Network. This neural network is not itself a network model, but an intermediate
entity that provides the functionality common to all Feed-Forward neural network
models.
A Feed-Forward neural network model is characterized for it has a set of neurons
connected upstream and downstream. The connections begin with the Sensor
instances to which the fist neurons are connected, and flow from these downstream.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

306

Class FeedForwardNeuralNetwork
There can be recursive connections to previous neurons. The propagation must move
forward, following the downstream neuron connections.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Fields inherited from class com.jcortex.NeuralNetwork


inputTranslator, neurons, outputTranslator, sensors, teacher

Constructor Summary

Page

FeedForwardNeuralNetwork(int neuronNum, int inputsNum, InputTranslator


inputTranslator, OutputTranslator outputTranslator)

308

The basic constructor for a brand-new Feed Forward Neural Network.


FeedForwardNeuralNetwork(org.w3c.dom.Node nnRoot)

Creates a
representation.

FeedForwardNeuralNetwork

instance based on its XML

Method Summary
float[]

308

Page

pureThink(float[] inputData)

Makes the specific numerical thinking for the Feed-Forward


Neural Network model.

308

Methods inherited from class com.jcortex.NeuralNetwork


addEndNeuron, addFirstNeuron, addNeuron, addNeurons, createNeuralNetwork,
export2XMLDocument, getAttributeCount, getConnectedNeurons, getEndNeurons,
getInputTranslator,
getNeuron,
getNeuronCount,
getNeurons,
getOutputTranslator, getSensor, getSensorCount, getSensors, getTeacher,
neuralNetwork2xml,
pureThink,
setEndNeurons,
setFirtsNeurons,
setInputTranslator, setOutputTranslator, setTeacher, think, toHTMLString,
toString

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

307

Class FeedForwardNeuralNetwork

Constructor Detail
FeedForwardNeuralNetwork
public FeedForwardNeuralNetwork(int neuronNum,
int inputsNum,
InputTranslator inputTranslator,
OutputTranslator outputTranslator)

The basic constructor for a brand-new Feed Forward Neural Network.

FeedForwardNeuralNetwork
public FeedForwardNeuralNetwork(org.w3c.dom.Node nnRoot)
throws ReadingException

Creates a FeedForwardNeuralNetwork
representation.

instance

based

on

its

XML

Throws:
ReadingException

Method Detail
pureThink
public float[] pureThink(float[] inputData)
throws IllegalArgumentException

Makes the specific numerical thinking for the Feed-Forward Neural Network
model. The process is based on a ToDoList instance that is updated with the
neurons that have to be calculated in the propagation's flow.
It behaves as the Template Method (GoF) for the
NeuralNetwork abstract superclass.

think()

method of its

Overrides:
pureThink

in class NeuralNetwork

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

308

Class FeedForwardNeuralNetwork
Parameters:
- The input data already translated to its float[]
representation by an InputTranslator
inputData

Returns:
The result of a Feed-Forward Neural Network's process is the
numerical state of its ending neurons. These values are passed as a
float[] array that will be put into the OutputTranslator.
Throws:
- Exception thrown when an error occured
due to problems with the network's parameters.
IllegalArgumentException

Class FeedForwardNeuron
com.jcortex.feedForward
java.lang.Object
com.jcortex.Neuron
com.jcortex.feedForward.FeedForwardNeuron

All Implemented Interfaces:

AxonReceiver, AxonSource
Direct Known Subclasses:

BackPropagationNeuron

public class FeedForwardNeuron


extends Neuron
Class that models the functionalities of a Feed-Forward neuron giving it as much
versatility as possible. A Feed-Forward neuron can be associated to various
Activation Functions, Network Functions... It stores as well the upstream-connected
neurons as entries associating a value to them, and downstream-connected neurons as
childs.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

309

Class FeedForwardNeuron
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.Neuron


RANDOM_CLOSE_TO_ZERO_VALUE, RANDOM_INITIAL_VALUE, ZERO_INITIAL_VALUE

Constructor Summary

Page

FeedForwardNeuron(int
id,
NetworkFunction
ActivationFunction activationFunction)

networkFunction,
312

Constructor for brand-new instances of this class.


FeedForwardNeuron(org.w3c.dom.Node neuronNode, NeuralNetwork nn)

Creates a
configuration.

FeedForwardNeuron

instance from an XML node with its

Method Summary
void

312

Page

addConnectedNeuron(AxonReceiver
connect_back)

child,

boolean
317

Adds a new child to this neuron instance.


void

addEntry(AxonSource entry)

An AxonSource is added as an entry to this neuron.


void

addEntry(AxonSource entry, float weight)

An AxonSource is added as an entry to this neuron.


void

313

equals(Object obj)

Two neurons will be the same if their identification


numbers are the same one.
ActivationFunction

318

connectLoadedNeuronWithEntries(org.w3c.dom.Node
neuronNode, FeedForwardNeuralNetwork ffnn)

This method connects a Feed-Forward Neuron with this


entries and childs in the Feed-Forward Neural Network
structure, following the indications stated in its XML
description.
boolean

318

321

getActivationFunction()

Obtains this neuron's Activation Function

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

314

310

Class FeedForwardNeuron
float[]

getActivationParameters()

Getter Method for this neuron's activation parameters


float

getAxonValue()

Obtains this neuron's state, represented by a number


locally named Axon Value.
Collection

this

neuron's

entries

(upstream-connected

314

getNetworkResult()

Obtains the last result of combining the various entries


into a unique value that represents the global entry this neuron
instance receives.
float

319

produceAxonValue()

Generates this neuron's state (Axon Value) by combining


all entry values with the Network Function and passing this
value through the Activation Function.
void

316

instantError(float desiredResponse)

Calculates the error incurred by this neuron.


float

315

getNetworkFunction()

Obtains this neuron's Network Function


float

313

getEntryWeight(AxonSource parent)

Obtains the weight associated to an specific entry.


NetworkFunction

317

getEntries()

Obtains
neurons).
float

316

getConnectedNeurons()

Obtains a collection of this neuron's childs (downstreamconnected neurons), for which this instance is an entry.
Collection

315

setActivationFunction(ActivationFunction
activationFunction_)

316

314

Sets this neuron's Activation Function


void

setActivationParams(int ix, float value)


315

Sets this neuron's activation parameters.


void

setEntryWeight(AxonSource parent, float value)


319

Sets the weight associated to a certain entry.


void

setNetworkFunction(NetworkFunction networkFunction_)
314

Sets this neuron's Network Function


void

specificNeuron2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

neuronRoot,

Adds the specific information known to the FeedForward Neuron at this level.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

320

311

Class FeedForwardNeuron
Collection

synapse()

Makes the neuron's calculations.


String

319

toString()

Generates a quick String representation of this neuron.

320

Methods inherited from class com.jcortex.Neuron


equals, getConnectedNeurons, getId, neuron2xml, toString

Methods inherited from interface com.jcortex.AxonSource


addConnectedNeuron, getAxonValue, getId, produceAxonValue

Methods inherited from interface com.jcortex.AxonReceiver


addEntry, addEntry, getEntries, getEntryWeight, getId, setEntryWeight

Constructor Detail
FeedForwardNeuron
public FeedForwardNeuron(int id,
NetworkFunction networkFunction,
ActivationFunction activationFunction)

Constructor for brand-new instances of this class.

FeedForwardNeuron
public FeedForwardNeuron(org.w3c.dom.Node neuronNode,
NeuralNetwork nn)
throws ReadingException

Creates a FeedForwardNeuron instance from an XML node with its


configuration.
Throws:
ReadingException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

312

Class FeedForwardNeuron

Method Detail
connectLoadedNeuronWithEntries
public void connectLoadedNeuronWithEntries(org.w3c.dom.Node neuronNode,
FeedForwardNeuralNetwork ffnn)
throws ReadingException

This method connects a Feed-Forward Neuron with this entries and childs in
the Feed-Forward Neural Network structure, following the indications stated
in its XML description.
An instance can not be fully created from is XML representation in just one
dash. All Feed-Forward Neuron make reference to other neuron instances
either as an entry, a child or both (unless it is a single-layered network).
Parameters:
neuronNode
ffnn

- The XML node with this neuron's configuration.

- The Feed-Forward neural network that holds this neuron.

Throws:
- This exception will be thrown if there is any
problem reading the XML node.
ReadingException

getEntries
public Collection getEntries()

Obtains this neuron's entries (upstream-connected neurons).


Specified by:
getEntries

in interface AxonReceiver

Returns:
The entries in the form of a collection of AxonSourceEntry instances.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

313

Class FeedForwardNeuron
getNetworkFunction
public NetworkFunction getNetworkFunction()

Obtains this neuron's Network Function


Returns:
the neuron's network function

setNetworkFunction
public void setNetworkFunction(NetworkFunction networkFunction_)

Sets this neuron's Network Function


Parameters:
networkFunction_

- the network function to be used by this neuron

getActivationFunction
public ActivationFunction getActivationFunction()

Obtains this neuron's Activation Function


Returns:
the neuron's activation function

setActivationFunction
public void setActivationFunction(ActivationFunction activationFunction_)

Sets this neuron's Activation Function


Parameters:
activationFunction_

- the activation function to be used by this

neuron
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

314

Class FeedForwardNeuron

getEntryWeight
public float getEntryWeight(AxonSource parent)

Obtains the weight associated to an specific entry.


Specified by:
getEntryWeight

in interface AxonReceiver

Parameters:
parent

- The upstream neuron that serves as entry to this instance.

Returns:
The weight associated to this entry.

getActivationParameters
public float[] getActivationParameters()

Getter Method for this neuron's activation parameters


Returns:
the neuron's network function

setActivationParams
public void setActivationParams(int ix,
float value)

Sets this neuron's activation parameters.


Parameters:
ix

- the index of the activation function's params.

value

- the float value to be set as an activation parameter.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

315

Class FeedForwardNeuron
produceAxonValue
public float produceAxonValue()
throws IllegalArgumentException

Generates this neuron's state (Axon Value) by combining all entry values with
the Network Function and passing this value through the Activation Function.
The result or Axon Value is both stored in this neuron's instance, and given
back as this method's return.
Specified by:
produceAxonValue

in interface AxonSource

Returns:
The newly calculated neuron state (Axon Value).
Throws:
IllegalArgumentException

getAxonValue
public float getAxonValue()

Obtains this neuron's state, represented by a number locally named Axon


Value.
Specified by:
getAxonValue

in interface AxonSource

Returns:
This neuron's numerical state - or Axon Value.

getNetworkResult
public float getNetworkResult()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

316

Class FeedForwardNeuron
Obtains the last result of combining the various entries into a unique value that
represents the global entry this neuron instance receives. This value may have
expired as it is the last network result calculated, not the value the neuron's
current situation would have produced.
If you wish to obtain an updated value, you will first have to invoke this class'
produceAxonValue() method.
Returns:
The last network result calculated.

getConnectedNeurons
public Collection getConnectedNeurons()

Obtains a collection of this neuron's childs (downstream-connected neurons),


for which this instance is an entry.
Overrides:
getConnectedNeurons

in class Neuron

Returns:
The collection of child neurons associated to this instance.

addConnectedNeuron
public void addConnectedNeuron(AxonReceiver child,
boolean connect_back)

Adds a new child to this neuron instance.


If the connect_back flag - passed as a parameter - is true, this neuron will in
turn invoke on its new child the addEntry() method with itself. This way it
adds itself as an entry to the child neuron.
Specified by:
addConnectedNeuron

in interface AxonSource

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

317

Class FeedForwardNeuron
Parameters:
- The downstream
AxonSource.
child

AxonReceiver

instance connected to this

- Flag indicating if this neuron must subscribe as an


entry on its child.
connect_back

addEntry
public void addEntry(AxonSource entry)

An AxonSource is added as an entry to this neuron. The associated weight is


initialized with a random value close to zero.
Specified by:
addEntry

in interface AxonReceiver

Parameters:
- The upstream
AxonReceiver.
entry

AxonSource

that will be added as an entry to this

addEntry
public void addEntry(AxonSource entry,
float weight)

An AxonSource is added as an entry to this neuron. The associated weight is


passed as a parameter.
Specified by:
addEntry

in interface AxonReceiver

Parameters:
entry

- The upstream

AxonSource

that will be added as an entry to this

AxonReceiver.
weight

- This entry's associated weight.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

318

Class FeedForwardNeuron

setEntryWeight
public void setEntryWeight(AxonSource parent,
float value)

Sets the weight associated to a certain entry.


Specified by:
setEntryWeight

in interface AxonReceiver

Parameters:
parent
value

- The upstream AxonSource that serves as entry.

- The new value for the associated weight.

synapse
public Collection synapse()
throws IllegalArgumentException

Makes the neuron's calculations.


Returns:
The neurons affected by this neuron's changes. In case no neurons are
affected, or no change has taken place, the synapse can produce a null
result.
Throws:
IllegalArgumentException

instantError
public float instantError(float desiredResponse)

Calculates the error incurred by this neuron.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

319

Class FeedForwardNeuron
Returns:
the numerical value of the instant error incurred by this neuron.

specificNeuron2xml
public void specificNeuron2xml(org.w3c.dom.Element neuronRoot,
org.w3c.dom.Document document)

Adds the specific information known to the Feed-Forward Neuron at this


level.
This method puts the intance attributes known at this level as attributes of the
XML node. Hooks as well the nodes that describes this neuron's activation
parameters and entries - with their weights. (Childs are not stored as this
relationship will be kept by each child as it knows this neuron is one of its
entries).
Overrides:
specificNeuron2xml

in class Neuron

Parameters:
neuronRoot
document

- The neuron's XML configuration node.

- The XML Document used to create new elements.

toString
public String toString()

Generates a quick String representation of this neuron.


Overrides:
toString

in class Neuron

Returns:
A String representation of this neuron.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

320

Class FeedForwardNeuron
equals
public boolean equals(Object obj)

Two neurons will be the same if their identification numbers are the same one.
If the passed Object instance is not an AxonSource, it will be considered
straight away as different (= not equal = false).
Overrides:
equals

in class Neuron

Parameters:
obj

- The other neuron to be compared.

Returns:
A boolean value: true if equal, false if not equal.

Class NeuronInTheList
com.jcortex.feedForward
java.lang.Object
com.jcortex.feedForward.NeuronInTheList

All Implemented Interfaces:

Comparable

public class NeuronInTheList


extends Object
implements Comparable
Simple representation of a Neuron that will be juggled in the ToDoList.
This representation quickly associates a neuron with its priority in the form of a
weight value.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

321

Class NeuronInTheList
Author:
Miguel Lara
Version:
0.1

Constructor Summary

Page

NeuronInTheList(Neuron neuron, int weight)

Constructor for objects of class NeuronInTheList

Method Summary
int

324

equals(Object otherNeuron)

An element of this list is equal to another if it is the placeholder for


the same neuron, regardless of their weight.
int

Page

compareTo(Object otherNeuron)

Instances of the class NeuronInTheList must be able to compare


themselves with other placeholders to correctly sort themselves in the
inner queue.
boolean

322

324

getId()

Obtains the identity of the neuron this instance as a placeholder

323

for.
Neuron

getNeuron()

Obtains the neuron this instance as a placeholder for.


int

getWeight()

The getter method for the neuron's given weight.


void

323

323

updateWeight(int newWeight)

Updates the weight of this placeholder.

323

Constructor Detail
NeuronInTheList
public NeuronInTheList(Neuron neuron,
int weight)

Constructor for objects of class NeuronInTheList

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

322

Class NeuronInTheList

Method Detail
getWeight
public int getWeight()

The getter method for the neuron's given weight.


Returns:
This neuron's weight (priority).

getId
public int getId()

Obtains the identity of the neuron this instance as a placeholder for.


Returns:
This neuron's id.

getNeuron
public Neuron getNeuron()

Obtains the neuron this instance as a placeholder for.


Returns:
The neuron.

updateWeight
public void updateWeight(int newWeight)

Updates the weight of this placeholder. This is not a setter method as the new
weight will only be be set if it gives this neuron a higher priority than the one
it had. If the priority now granted is lower, the neuron will keep the old one.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

323

Class NeuronInTheList
Parameters:
newWeight

- The new weight (priority) granted..

compareTo
public int compareTo(Object otherNeuron)

Instances of the class NeuronInTheList must be able to compare themselves


with other placeholders to correctly sort themselves in the inner queue.
Instances will be sorted according to their associated weight and identification
number. Lower weights - and id's in case of the same weight - will have the
highest priority.
Returns:
A negative integer, zero, or a positive integer as this object is less than,
equal to, or greater than the specified object.

equals
public boolean equals(Object otherNeuron)

An element of this list is equal to another if it is the placeholder for the same
neuron, regardless of their weight.
In case the object passed is not a
considered straight away as not equal.

NeuronInTheList

instance, it will be

Overrides:
equals

in class Object

Parameters:
otherNeuron

- A NeuronInTheList instance to be compared.

Returns:
A boolean value: true if both instances are equal.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

324

Class NeuronInTheList

Class PerceptronNeuralNetwork
com.jcortex.feedForward
java.lang.Object
com.jcortex.NeuralNetwork
com.jcortex.feedForward.FeedForwardNeuralNetwork
com.jcortex.feedForward.PerceptronNeuralNetwork

public class PerceptronNeuralNetwork


extends FeedForwardNeuralNetwork
A Perceptron Neural Network is a specific kind of Feed-Forward Neural Network
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1b

Fields inherited from class com.jcortex.NeuralNetwork


inputTranslator, neurons, outputTranslator, sensors, teacher

Constructor Summary

Page

PerceptronNeuralNetwork(int inputNum, InputTranslator inputTranslator,


OutputTranslator outputTranslator)

326

Constructor for brand-new Perceptron Neural Networks.


PerceptronNeuralNetwork(org.w3c.dom.Node nnRoot)

Creates a
representation.

PerceptronNeuralNetwork

instance

from

its

XML

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

327

325

Class PerceptronNeuralNetwork
Method Summary
void

nn2xml(org.w3c.dom.Element
document)

Page
nnRoot,

org.w3c.dom.Document

There is no aditional specific information this neural network


must put into its XML representation, as it is a pure Feed-Forward
implementation.
protected
void

specificNeuralNetwork2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

nnRoot,

There is no specific information to be added to the XML


configuration as this model is completely based on the Feed-Forward
network.
String

327

toHTMLString()

Produces a String representation of this neural network enhanced


with HTML tags to include styled text.
String

327

328

toString()

Produces a String representation of this neural network.

Methods
inherited
from
com.jcortex.feedForward.FeedForwardNeuralNetwork

328

class

pureThink

Methods inherited from class com.jcortex.NeuralNetwork


addEndNeuron, addFirstNeuron, addNeuron, addNeurons, createNeuralNetwork,
export2XMLDocument, getAttributeCount, getConnectedNeurons, getEndNeurons,
getInputTranslator,
getNeuron,
getNeuronCount,
getNeurons,
getOutputTranslator, getSensor, getSensorCount, getSensors, getTeacher,
neuralNetwork2xml,
pureThink,
setEndNeurons,
setFirtsNeurons,
setInputTranslator, setOutputTranslator, setTeacher, think, toHTMLString,
toString

Constructor Detail
PerceptronNeuralNetwork
public PerceptronNeuralNetwork(int inputNum,
InputTranslator inputTranslator,
OutputTranslator outputTranslator)

Constructor for brand-new Perceptron Neural Networks. Initializes the


network's parameters and creates a Feed-Forward Neuron properly-configured
to be a Perceptron neuron.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

326

Class PerceptronNeuralNetwork

PerceptronNeuralNetwork
public PerceptronNeuralNetwork(org.w3c.dom.Node nnRoot)
throws ReadingException

Creates a PerceptronNeuralNetwork instance from its XML representation.


The whole process is based on the appropriate Feed-Forward Neural Network
constructor as this neuron does not add any specific information.
Throws:
ReadingException

Method Detail
nn2xml
public void nn2xml(org.w3c.dom.Element nnRoot,
org.w3c.dom.Document document)

There is no aditional specific information this neural network must put into its
XML representation, as it is a pure Feed-Forward implementation.
Parameters:
nnRoot

- This neuron's XML

specificNeuralNetwork2xml
protected void specificNeuralNetwork2xml(org.w3c.dom.Element nnRoot,
org.w3c.dom.Document document)

There is no specific information to be added to the XML configuration as this


model is completely based on the Feed-Forward network.
Overrides:
specificNeuralNetwork2xml

in class NeuralNetwork

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

327

Class PerceptronNeuralNetwork
Parameters:
nnRoot

- The networl's node on to which the specific model's info must

be put.
- The original XML document used for the creation of nodes
and other elements needed for representing this networks
configuration.
document

toString
public String toString()

Produces a String representation of this neural network.


Overrides:
toString

in class NeuralNetwork

Returns:
A String representation of this neural network.

toHTMLString
public String toHTMLString()

Produces a String representation of this neural network enhanced with HTML


tags to include styled text.
Overrides:
toHTMLString

in class NeuralNetwork

Returns:
A String representation of this neural network.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

328

Class ToDoList

Class ToDoList
com.jcortex.feedForward
java.lang.Object
com.jcortex.feedForward.ToDoList

All Implemented Interfaces:

Iterator

public class ToDoList


extends Object
implements Iterator
A ToDoList instance puts some order into the stymulus propagation through a FeedForward Neural Network.
This list itself is thought to work as a non-fail-fast Iterator (GoF), as new elements
will be added to the structure each time a neuron is retrieved until the last layer (if
there is no recursive connection to previous layers).
The add() and next() methods are synchronized with looks to its use in multi-thread
environments. Although the current version has not been tested to be completely
thread-safe.
Author:
Miguel Lara Encabo
Version:
0.1

Constructor Summary

Page

ToDoList(int neuronHighestId)

Constructor for instances of class ToDoList.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

330

329

Class ToDoList
Method Summary
synchronized
void

Page

add(Collection neurons, int weight)

Adds a collection of neurons to the list.


boolean

hasNext()

Finds out if there are more elements still left in the list.
synchronized
Object

331

next()

Obtains the next element in the list.


void

330

331

remove()

Empty implementation as no objects should be removed from


the list like this.

331

Constructor Detail
ToDoList
public ToDoList(int neuronHighestId)

Constructor for instances of class ToDoList.


The data structures are created, and the presence array is all initialized to false
as there are no neurons in the list to start with.

Method Detail
add
public synchronized void add(Collection neurons,
int weight)

Adds a collection of neurons to the list. Only the neurons that are not already
in the list will be added.
Parameters:
neurons

- The neuron collection to be added into the list.

- The neuron's weight given by the number of steps given


before it was reached.
weight

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

330

Class ToDoList
hasNext
public boolean hasNext()

Finds out if there are more elements still left in the list.
Specified by:
hasNext

in interface Iterator

Returns:
A boolean value: true if there are still more elements left.

next
public synchronized Object next()

Obtains the next element in the list. It works like a kind of pop from the
ToDoList

Specified by:
next

in interface Iterator

Returns:
The next neuron to be processed; null if there are none left.

remove
public void remove()

Empty implementation as no objects should be removed from the list like this.
Specified by:
remove

in interface Iterator

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

331

Package com.jcortex.hopfield

Package com.jcortex.hopfield
Class Summary

Page

DefaultHopfieldTeacher

Default Teacher implementation for the Hopfield


neural network model.

332

HopfieldNeuralNetwork

The Hopfield Neural Network Model default


implementation.

337

Class DefaultHopfieldTeacher
com.jcortex.hopfield
java.lang.Object
com.jcortex.Teacher
com.jcortex.hopfield.DefaultHopfieldTeacher

public class DefaultHopfieldTeacher


extends Teacher
Default Teacher implementation for the Hopfield neural network model.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.Teacher


VALIDATION_JUMP

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

332

Class DefaultHopfieldTeacher
Constructor Summary

Page

DefaultHopfieldTeacher()
333

The default creator for a brand new teacher.


DefaultHopfieldTeacher(org.w3c.dom.Node teacherNode)

Creates a DefaultMultilayerPerceptronTeacher instance from an XML


node with its configuration.

334

Method Summary

Page

Statistics

createStatsSchema()

Creates an empty stats shema as there is no progress to


follow.
Statistics

educateNetwork(NeuralNetwork nn, Object[] exampleIObjects,


Object[] exampleDObjects)

Educates a Hopfield network using a numerical matrix


approach.
ProgressAnalyzer

334

getAnalyzer()

As there are no statistics to follow, this teacher does not


have a traning analyzer.
protected void

335

specificTeacher2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

336

teacherRoot,
335

This teacher has no arguments that need to be stored.


void

stopTraining()

This teacher does not perform the training using iterations,


so there is no point on having to stop.
String

335

toHTMLString()

Produces a String representation of this teacher's


parameters and settings, including HTML tags to enhance it with
styled text.

336

Methods inherited from class com.jcortex.Teacher


createStatsSchema, educateNetwork, getAnalyzer, getStats,
teacher2xml, toHTMLString, translateAndClassifyExamples

stopTraining,

Constructor Detail
DefaultHopfieldTeacher
public DefaultHopfieldTeacher()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

333

Class DefaultHopfieldTeacher
The default creator for a brand new teacher.
The Hopfield teacher has no training parameters.

DefaultHopfieldTeacher
public DefaultHopfieldTeacher(org.w3c.dom.Node teacherNode)

Creates a DefaultMultilayerPerceptronTeacher instance from an XML node


with its configuration.

Method Detail
educateNetwork
public Statistics educateNetwork(NeuralNetwork nn,
Object[] exampleIObjects,
Object[] exampleDObjects)
throws IllegalArgumentException

Educates a Hopfield network using a numerical matrix approach.


Overrides:
educateNetwork

in class Teacher

Parameters:
nn

- The neural network to be trained.

exampleIObjects

- The example input objects.

exampleDObjects

- The example output objects.

Returns:
The statistics for this training.
Throws:
- Exception thrown when an error occured
due to problems with the training's parameters.
IllegalArgumentException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

334

Class DefaultHopfieldTeacher
createStatsSchema
public Statistics createStatsSchema()

Creates an empty stats shema as there is no progress to follow.


Overrides:
createStatsSchema

in class Teacher

Returns:
An empty Statistics instance.

specificTeacher2xml
protected void specificTeacher2xml(org.w3c.dom.Element teacherRoot,
org.w3c.dom.Document document)

This teacher has no arguments that need to be stored.


Overrides:
specificTeacher2xml

in class Teacher

Parameters:
- The XML node in which this teacher's configuration
must be dumped.
teacherRoot

- The Document instance that will be the ultimate root for


this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

stopTraining
public void stopTraining()

This teacher does not perform the training using iterations, so there is no point
on having to stop. This training is close to immediate!

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

335

Class DefaultHopfieldTeacher
Overrides:
stopTraining

in class Teacher

toHTMLString
public String toHTMLString()

Produces a String representation of this teacher's parameters and settings,


including HTML tags to enhance it with styled text.
Overrides:
toHTMLString

in class Teacher

Returns:
This teacher's String representation.

getAnalyzer
public ProgressAnalyzer getAnalyzer()

As there are no statistics to follow, this teacher does not have a traning
analyzer.
Overrides:
getAnalyzer

in class Teacher

Returns:
null

as there is no progress analyzer.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

336

Class HopfieldNeuralNetwork

Class HopfieldNeuralNetwork
com.jcortex.hopfield
java.lang.Object
com.jcortex.NeuralNetwork
com.jcortex.hopfield.HopfieldNeuralNetwork

public class HopfieldNeuralNetwork


extends NeuralNetwork
The Hopfield Neural Network Model default implementation.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.NeuralNetwork


inputTranslator, neurons, outputTranslator, sensors, teacher

Constructor Summary
HopfieldNeuralNetwork(int inputsNum,
OutputTranslator outputTranslator)

Page
InputTranslator

inputTranslator,
339

Creates brand-new instance of HopfieldNeuralNetwork.


HopfieldNeuralNetwork(org.w3c.dom.Node nnRoot)

Creates a
configuration.

HopfieldNeuralNetwork

instance

from

XML

sotored

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

339

337

Class HopfieldNeuralNetwork
Method Summary
int

Page

getAttributeCount()

Obtains the number of input values (or attribues) this neural


network can deal with.
float[]

getBias()
340

Obtains this network's bias vector.


float[][]

getWeights()

Obtains the weights matrix used by this neural network to store


its information.
static
float

339

hopfieldEnergy(float[]
bias)

pattern,

float[][]

weights,

340

float[]
343

Static method for calculating Hopfield's Energy for a pattern.


static
float[]

hopfieldSignFunction(float[]
functionsInput)

iterationsInput,

float[]
342

Static method for calculating Hopfield's Sign Function.


float[]

pureThink(float[] inputData)
341

Makes the real numerical thinking.


void

setBias(float[] bias)
340

Sets this network's bias vector.


void

setWeights(float[][] weights)
340

Sets this network's weight's matrix.


protected
void

specificNeuralNetwork2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

nnRoot,

Puts into this neural network's XML configuration node the


aditional information it has as being a HopfieldNeuralNetwork instance.
String

toHTMLString()

Produces a String representation of this neural network enhanced


with HTML tags to include styled text.
String

341

342

toString()

Produces a String representation of this neural network.

342

Methods inherited from class com.jcortex.NeuralNetwork


addEndNeuron, addFirstNeuron, addNeuron, addNeurons, createNeuralNetwork,
export2XMLDocument, getAttributeCount, getConnectedNeurons, getEndNeurons,
getInputTranslator,
getNeuron,
getNeuronCount,
getNeurons,
getOutputTranslator, getSensor, getSensorCount, getSensors, getTeacher,
neuralNetwork2xml,
pureThink,
setEndNeurons,
setFirtsNeurons,
setInputTranslator, setOutputTranslator, setTeacher, think, toHTMLString,
toString

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

338

Class HopfieldNeuralNetwork

Constructor Detail
HopfieldNeuralNetwork
public HopfieldNeuralNetwork(int inputsNum,
InputTranslator inputTranslator,
OutputTranslator outputTranslator)

Creates brand-new instance of HopfieldNeuralNetwork.

HopfieldNeuralNetwork
public HopfieldNeuralNetwork(org.w3c.dom.Node nnRoot)
throws ReadingException

Creates a HopfieldNeuralNetwork instance from XML sotored configuration.


This method's main task is loading the square numerical matrix with this
neural network's weights, and the bias vector.
Throws:
ReadingException

Method Detail
getAttributeCount
public int getAttributeCount()

Obtains the number of input values (or attribues) this neural network can deal
with.
Overrides:
getAttributeCount

in class NeuralNetwork

Returns:
The number of input values.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

339

Class HopfieldNeuralNetwork
getBias
public float[] getBias()

Obtains this network's bias vector.


Returns:
The bias vector.

setBias
public void setBias(float[] bias)

Sets this network's bias vector.


Parameters:
bias

- The new bias vector.

getWeights
public float[][] getWeights()

Obtains the weights matrix used by this neural network to store its
information.
Returns:
The weights matrix.

setWeights
public void setWeights(float[][] weights)

Sets this network's weight's matrix.


Parameters:
weights

- The new weights matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

340

Class HopfieldNeuralNetwork

pureThink
public float[] pureThink(float[] inputData)
throws IllegalArgumentException

Makes the real numerical thinking.


This is a matrix-based method, so its propagation strategy is completely
different to other neural networks.
Overrides:
pureThink

in class NeuralNetwork

Parameters:
inputData

- The numerical input data.

Returns:
The numerical result of passing the input through the network.
Throws:
IllegalArgumentException

specificNeuralNetwork2xml
protected void specificNeuralNetwork2xml(org.w3c.dom.Element nnRoot,
org.w3c.dom.Document document)

Puts into this neural network's XML configuration node the aditional
information it has as being a HopfieldNeuralNetwork instance. The most
relevant information stored at this level is matrix with this neural network's
weights.
Overrides:
specificNeuralNetwork2xml

in class NeuralNetwork

Parameters:
nnRoot

- This neural network's XML configuration node.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

341

Class HopfieldNeuralNetwork
document

- The XML Document needed to create new elements.

toString
public String toString()

Produces a String representation of this neural network.


Overrides:
toString

in class NeuralNetwork

Returns:
A String representation of this neural network.

toHTMLString
public String toHTMLString()

Produces a String representation of this neural network enhanced with HTML


tags to include styled text.
Overrides:
toHTMLString

in class NeuralNetwork

Returns:
A String representation of this neural network.

hopfieldSignFunction
public static float[] hopfieldSignFunction(float[] iterationsInput,
float[] functionsInput)

Static method for calculating Hopfield's Sign Function.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

342

Class HopfieldNeuralNetwork
Parameters:
- The previous value vector is needed because if
functionsInput[i]==0 the input value, stored as iterationsInput[i] is
the result for index i.
iterationsInput

functionsInput

- The input with which the function calculates.

Returns:
A vector with the resulting binary values.

hopfieldEnergy
public static float hopfieldEnergy(float[] pattern,
float[][] weights,
float[] bias)

Static method for calculating Hopfield's Energy for a pattern.


Parameters:
pattern

- The pattern.

weights

- The weights matrix.

bias

- The bias vector.

Returns:
The Hopfield's Energy calculated for this pattern.

Package com.jcortex.kohonen
Class Summary

Page

CylinderHexKMap

Models a cylinder-organized Kohonen Map with


hexagonal-shaped neurons.

344

CylinderSquareKMap

Models a cylinder-organized Kohonen Map with


square-shaped neurons.

347

CylinderStarKMap

Models a cylinder-organized Kohonen Map with


star-shaped neurons.

350

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

343

Package com.jcortex.kohonen

Default2DKMap

Intermediate implementation of the KohonenMap


abstract class, that covers the functionality common
to all maps organized in a 2D enviroment (this is,
that can be stored in a 2D matrix).

353

DefaultKohonenTeacher

Default Teacher implementation for the Kohonen


neural networkn model.

358

KohonenMap

Abstract class obliged to all Kohonen Maps used


within the JCortex framework.

368

KohonenNeuralNetwork

The Kohonen Neural Network Model default


implementation.

376

KohonenNeuron

Class that models the functionalities of a Kohonen


neuron.

384

SheetHexKMap

Models a sheet-organized Kohonen Map with


hexagonal-shaped neurons.

395

SheetSquareKMap

Models a sheet-organized Kohonen Map with


square-shaped neurons.

398

SheetStarKMap

Models a sheet-organized Kohonen Map with starshaped neurons.

401

ToroidHexKMap

Models a toroid-organized Kohonen Map with


hexagonal-shaped neurons.

404

ToroidSquareKMap

Models a toroid-organized Kohonen Map with


square-shaped neurons.

407

ToroidStarKMap

Models a toroid-organized Kohonen Map with starshaped neurons.

410

Class CylinderHexKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.CylinderHexKMap

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

344

Class CylinderHexKMap

public class CylinderHexKMap


extends Default2DKMap
Models a cylinder-organized Kohonen Map with hexagonal-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Constructor Summary
CylinderHexKMap(int entriesCount, int rows, int cols, DistanceFunction
dFunction)

Page

346

The basic constructor for this kind of Kohonen Map.


CylinderHexKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a CylinderHexKMap from its configuration stored in an XML node.

Method Summary
boolean[][]

346

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a cylinder-organized map


with hexagonal-shaped neurons.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

346

345

Class CylinderHexKMap
Methods inherited from class com.jcortex.kohonen.Default2DKMap
getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
CylinderHexKMap
public CylinderHexKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

CylinderHexKMap
public CylinderHexKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a CylinderHexKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

346

Class CylinderHexKMap
Creates the Connection-Matrix for a cylinder-organized map with hexagonalshaped neurons.
A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Class CylinderSquareKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.CylinderSquareKMap

public class CylinderSquareKMap


extends Default2DKMap
Models a cylinder-organized Kohonen Map with square-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

347

Class CylinderSquareKMap
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Constructor Summary

Page

CylinderSquareKMap(int
entriesCount,
DistanceFunction dFunction)

int

rows,

int

cols,
349

The basic constructor for this kind of Kohonen Map.


CylinderSquareKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a

CylinderSquareKMap

from its configuration stored in an XML

349

node.

Method Summary
boolean[][]

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a cylinder-organized map


with square-shaped neurons.

349

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

348

Class CylinderSquareKMap

Constructor Detail
CylinderSquareKMap
public CylinderSquareKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

CylinderSquareKMap
public CylinderSquareKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a CylinderSquareKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a cylinder-organized map with squareshaped neurons.


A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

349

Class CylinderSquareKMap
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Class CylinderStarKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.CylinderStarKMap

public class CylinderStarKMap


extends Default2DKMap
Models a cylinder-organized Kohonen Map with star-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

350

Class CylinderStarKMap
Fields inherited from class com.jcortex.kohonen.Default2DKMap
cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Constructor Summary

Page

CylinderStarKMap(int entriesCount, int rows, int cols, DistanceFunction


dFunction)

351

The basic constructor for this kind of Kohonen Map.


CylinderStarKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a

CylinderStarKMap

from its configuration stored in an XML

352

node.

Method Summary
boolean[][]

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a cylinder-organized map


with star-shaped neurons.

352

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
CylinderStarKMap
public CylinderStarKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

351

Class CylinderStarKMap
The basic constructor for this kind of Kohonen Map.
This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

CylinderStarKMap
public CylinderStarKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a CylinderStarKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a cylinder-organized map with star-shaped


neurons.
A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

352

Class CylinderStarKMap

Class Default2DKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap

Direct Known Subclasses:

CylinderHexKMap,
CylinderSquareKMap,
CylinderStarKMap,
SheetHexKMap, SheetSquareKMap, SheetStarKMap, ToroidHexKMap,
ToroidSquareKMap, ToroidStarKMap

abstract public class Default2DKMap


extends KohonenMap
Intermediate implementation of the KohonenMap abstract class, that covers the
functionality common to all maps organized in a 2D enviroment (this is, that can be
stored in a 2D matrix).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Field Summary
protected
int

cols

This map's column size Its visibility is protected to allow a


quicker use from its subclasses.
protected
List

Page

355

neurons

The list of neurons in this map.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

355

353

Class Default2DKMap
protected
int

rows
355

This map's row size.

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Constructor Summary
Default2DKMap(int entriesCount, int
dFunction)

Page
rows,

int cols, DistanceFunction


355

The basic constructor for a brand-new 2D Kohonen Map.


Default2DKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a Default2DKMap from its configuration stored in an XML node.

Method Summary
int

Page

getColumnCount()

Gets the number of columns in this map.


int[]

357

iterator()

Obtains an Iterator instance that guides through the


neurons in the map.
org.w3c.dom.Node

356

getRowCount()

Gets the number of rows in this map.


Iterator

356

getNeurons()

Gets the list of neurons from this map.


int

357

getNeuron(int neuronId)

Gets a neuron given its id number.


List

357

getDimensions()

Obtains this map's dimension in the shape of a int[] array.


KohonenNeuron

356

357

map2xml(org.w3c.dom.Document document)

Obtains this Kohonen Map's XML representation.

358

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

354

Class Default2DKMap

Field Detail
neurons
protected List neurons

The list of neurons in this map. Its visibility is protected to allow a quicker use
from its subclasses.

rows
protected int rows

This map's row size. Its visibility is protected to allow a quicker use from its
subclasses.

cols
protected int cols

This map's column size Its visibility is protected to allow a quicker use from
its subclasses.

Constructor Detail
Default2DKMap
public Default2DKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for a brand-new 2D Kohonen Map.


This constructor initializes this class' attributes and creates all the neurons the
map will hold. These neurons are stored inside its internal list.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

355

Class Default2DKMap
Default2DKMap
public Default2DKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a Default2DKMap from its configuration stored in an XML node.


This constructor gets from the XML node its attributes and its list of neurons
from the Kohonen Neural Network.

Method Detail
getNeuron
public KohonenNeuron getNeuron(int neuronId)

Gets a neuron given its id number.


Overrides:
getNeuron

in class KohonenMap

Parameters:
neuronId

- The identification number of the requested neuron.

Returns:
The requested neuron.

getNeurons
public List getNeurons()

Gets the list of neurons from this map.


Overrides:
getNeurons

in class KohonenMap

Returns:
The list of neurons held by this map.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

356

Class Default2DKMap

getColumnCount
public int getColumnCount()

Gets the number of columns in this map.


Returns:
The number of columns.

getRowCount
public int getRowCount()

Gets the number of rows in this map.


Returns:
The number of rows.

getDimensions
public int[] getDimensions()

Obtains this map's dimension in the shape of a int[] array. Schema: {rows,
columns}.
Overrides:
getDimensions

in class KohonenMap

Returns:
This map's dimension.

iterator
public Iterator iterator()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

357

Class Default2DKMap
Obtains an Iterator instance that guides through the neurons in the map.
Overrides:
iterator

in class KohonenMap

Returns:
The Iterator instance.

map2xml
public org.w3c.dom.Node map2xml(org.w3c.dom.Document document)

Obtains this Kohonen Map's XML representation. Creates the XML node and
stores this map's configuration. The specific KohonenMap subclass is stored as
an attribute in the node.
Overrides:
map2xml

in class KohonenMap

Parameters:
- The Document instance that will be the ultimate root for
this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

Returns:
An XML node with this map's configuration.

Class DefaultKohonenTeacher
com.jcortex.kohonen
java.lang.Object
com.jcortex.Teacher
com.jcortex.kohonen.DefaultKohonenTeacher

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

358

Class DefaultKohonenTeacher

public class DefaultKohonenTeacher


extends Teacher
Default Teacher implementation for the Kohonen neural networkn model.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Field Summary
boolean
static
String

Page

continueTraining

361

MISPLACED_EXAMPLES

Textual identifier for the Misplaced Examples statistic


dimension.

Measure 361

Fields inherited from class com.jcortex.Teacher


VALIDATION_JUMP

Constructor Summary

Page

DefaultKohonenTeacher()

The default creator for a brand new teacher.

361

DefaultKohonenTeacher(org.w3c.dom.Node teacherNode)

Creates a
configuration.

DefaultKohonenTeacher

instance from an XML node with its

Method Summary
Statistics

361

Page

createStatsSchema()

Creates the Statistics instance with the specific progress


measures needed by thos particular Teacher.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

366

359

Class DefaultKohonenTeacher
Statistics

educateNetwork(NeuralNetwork nn, Object[] exampleIObjects,


Object[] exampleDObjects)

Educates a Kohonen Neural Network using the given


example set.
int

getAnalysisWindow()
365

Obtains the Analysis Window training parameter.


ProgressAnalyzer

getAnalyzer()
366

Obtains this teacher's associated training analyzer.


float

getConstantVariation()
364

Obtains the Constant Variation training parameter.


float

getLearningRate()
362

Obtains the Learning Rate training parameter.


long

getMaxIterations()

Obtains
parameter.
float

int

the

Maximum

Iteration

Number

training

363

Obtains the Maximum Average Distance Accepted training


parameter.

364

getMaxMisplacedPercent()

getNeighbourhoodRadius()

Obtains the Neigbourhood Radius training parameter.


void

365

setConstantVariation(float constantVariation)
365

Sets the Constant Variation training parameter.


void

setLearningRate(float learningRate)
363

Sets the Learning Rate training parameter.


void

setMaxIterations(long maxIterations)

Sets the Maximum Iteration Number training parameter.


void

364

setNeighbourhoodRadius(int neighbourhoodRadius)
363

Sets the Neigbourhood Radius training parameter.


void

364

setMaxMisplacedPercent(float maxAverageDistanceAccepted)

Sets the Maximum Average Distance Accepted training


parameter.
void

363

setAnalysisWindow(int constantWindow)

Obtains the Analysis Window training parameter.


void

362

specificTeacher2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

teacherRoot,

Dumps into the teacher's XML node this specific


instance's configuration.

Teacher

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

366

360

Class DefaultKohonenTeacher
void

stopTraining()

Stops the training's progress by interrupting its next


iteration.
String

367

toHTMLString()

Produces a String representation of this teacher's


parameters and settings, including HTML tags to enhance it with
styled text.

367

Methods inherited from class com.jcortex.Teacher


createStatsSchema, educateNetwork, getAnalyzer, getStats,
teacher2xml, toHTMLString, translateAndClassifyExamples

stopTraining,

Field Detail
MISPLACED_EXAMPLES
public static String MISPLACED_EXAMPLES

Textual identifier for the Misplaced Examples statistic Measure dimension.

continueTraining
public boolean continueTraining

Constructor Detail
DefaultKohonenTeacher
public DefaultKohonenTeacher()

The default creator for a brand new teacher.


All learning parameters are initialized with their default values.

DefaultKohonenTeacher
public DefaultKohonenTeacher(org.w3c.dom.Node teacherNode)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

361

Class DefaultKohonenTeacher
Creates a DefaultKohonenTeacher instance from an XML node with its
configuration.

Method Detail
educateNetwork
public Statistics educateNetwork(NeuralNetwork nn,
Object[] exampleIObjects,
Object[] exampleDObjects)
throws IllegalArgumentException

Educates a Kohonen Neural Network using the given example set.


Overrides:
educateNetwork

in class Teacher

Parameters:
nn

- The neural network to be trained.

exampleIObjects

- The example input objects.

exampleDObjects

- The example output objects.

Returns:
The statistics for this training.
Throws:
- Exception thrown when an error occured
due to problems with the training's parameters.
IllegalArgumentException

getLearningRate
public float getLearningRate()

Obtains the Learning Rate training parameter.


Returns:
The requested parameter's value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

362

Class DefaultKohonenTeacher

setLearningRate
public void setLearningRate(float learningRate)

Sets the Learning Rate training parameter.


Parameters:
learningRate

- The new value.

getNeighbourhoodRadius
public int getNeighbourhoodRadius()

Obtains the Neigbourhood Radius training parameter.


Returns:
The requested parameter's value.

setNeighbourhoodRadius
public void setNeighbourhoodRadius(int neighbourhoodRadius)

Sets the Neigbourhood Radius training parameter.


Parameters:
neighbourhoodRadius

- The new value.

getMaxIterations
public long getMaxIterations()

Obtains the Maximum Iteration Number training parameter.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

363

Class DefaultKohonenTeacher
Returns:
The requested parameter's value.

setMaxIterations
public void setMaxIterations(long maxIterations)

Sets the Maximum Iteration Number training parameter.


Parameters:
maxIterations

- The new value.

getMaxMisplacedPercent
public float getMaxMisplacedPercent()

Obtains the Maximum Average Distance Accepted training parameter.


Returns:
The requested parameter's value.

setMaxMisplacedPercent
public void setMaxMisplacedPercent(float maxAverageDistanceAccepted)

Sets the Maximum Average Distance Accepted training parameter.


Parameters:
maxAverageDistanceAccepted

- The new value.

getConstantVariation
public float getConstantVariation()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

364

Class DefaultKohonenTeacher
Obtains the Constant Variation training parameter.
Returns:
The requested parameter's value.

setConstantVariation
public void setConstantVariation(float constantVariation)

Sets the Constant Variation training parameter.


Parameters:
constantVariation

- The new value.

getAnalysisWindow
public int getAnalysisWindow()

Obtains the Analysis Window training parameter.


Returns:
The requested parameter's value.

setAnalysisWindow
public void setAnalysisWindow(int constantWindow)

Obtains the Analysis Window training parameter.


Parameters:
constantWindow

- The new value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

365

Class DefaultKohonenTeacher
getAnalyzer
public ProgressAnalyzer getAnalyzer()

Obtains this teacher's associated training analyzer.


Overrides:
getAnalyzer

in class Teacher

Returns:
The training statistics analyzer

createStatsSchema
public Statistics createStatsSchema()

Creates the Statistics instance with the specific progress measures needed by
thos particular Teacher. This method works as a a Template Method (GoF) for
the getStats() method implemented in the Teacher abstract class. The
measures used in the training will be: MISPLACED_EXAMPLES, WEIGHT_VARIATION,
all of them defined as static Strings in this class.
Overrides:
createStatsSchema

in class Teacher

Returns:
The new Statistics instance.

specificTeacher2xml
public void specificTeacher2xml(org.w3c.dom.Element teacherRoot,
org.w3c.dom.Document document)

Dumps into the teacher's XML node this specific Teacher instance's
configuration. This is a Template Method (GoF) for the Teacher abstract class.
This teacher's training parameters are stored as attributes in the XML
configuration node.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

366

Class DefaultKohonenTeacher
Overrides:
specificTeacher2xml

in class Teacher

Parameters:
- The XML node in which this teacher's configuration
must be dumped.
teacherRoot

- The Document instance that will be the ultimate root for


this XML structure. It is used in these methods to create the XML
Elements and Nodes with its Factory Methods.
document

stopTraining
public void stopTraining()

Stops the training's progress by interrupting its next iteration.


For this, it uses a boolan flag - this class' attribute continueTraining and turns
it false so the next time the iteration reaches the condition state, it will surely
jump out of the training loop.
Overrides:
stopTraining

in class Teacher

toHTMLString
public String toHTMLString()

Produces a String representation of this teacher's parameters and settings,


including HTML tags to enhance it with styled text.
Overrides:
toHTMLString

in class Teacher

Returns:
This teacher's String representation.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

367

Class DefaultKohonenTeacher

Class KohonenMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap

Direct Known Subclasses:

Default2DKMap

abstract public class KohonenMap


extends Object
Abstract class obliged to all Kohonen Maps used within the JCortex framework.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Field Summary
protected
KohonenNeuron

Page

bestNeuron

The best neuron found out during the last propagation


process.
protected
List

neighbourhoods

The list of neighbourhoods.


protected int

370

neuronCount

The number of neurons held by this map.


protected
Sensor[]

370

370

sensors

The array of sensors used by this map.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

370

368

Class KohonenMap
Constructor Summary
public

KohonenMap(int entriesCount, int neuronCount)

Creates a brand Kohonen Map.


protected

Page
371

KohonenMap(org.w3c.dom.Node mapRoot, KohonenNeuralNetwork knn)

Constructor for creating a Kohonen Map from its XML node


representation.

Method Summary
abstract
boolean[][]

Page

createConnectionMatrix(int neuronCount)

Creates the specific Connection Matrix.


KohonenNeuron

373

getDimensions()

Obtains this map's dimensions.


Collection

372

getBestNeuron()

Obtains the best neuron for the last propagation.


abstract int[]

371

375

getNeighbours(KohonenNeuron neuron)

Obtains the list of neurons in neighbourhood of a given

373

one.
Collection

getNeighbours(int neuronId)

Obtains the list of neurons in neighbourhood of a given

373

one.
abstract
KohonenNeuron

getNeuron(int neuronId)

Gets a neuron from the map given given its id.


int

getNeuronCount()

Obtains the number of neurons in the Map.


abstract List

374

integrateWithNeuralNetwork(KohonenNeuralNetwork knn)

Integrates this map with its Kohonen neural network.


abstract
Iterator

374

getNeurons()

Obtains the Vector of Neurons organized by their id.


void

374

371

iterator()

Gets the Iterator that can explore all the neurons in this

375

map.
abstract
org.w3c.dom.Node

map2xml(org.w3c.dom.Document document)

Obtains the XML representation of this Kohonen map.


void

375

prepareNeighbourhoods(int neighbourhoodRadius)

Default neighbourhood preparation, uses a matrixcalculation approach for the creation of neighbourhoods.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

371

369

Class KohonenMap
void

setBestNeuron(KohonenNeuron kNeuron)

Sets the best neuron for the last propagation.

373

Field Detail
neuronCount
protected int neuronCount

The number of neurons held by this map.

neighbourhoods
protected List neighbourhoods

The list of neighbourhoods. Each neighbourhood will be represented by a


collection of neurons. This list's ix indexed entry must match the
neighbourhood of the neuron whose id number is exactly ix.

bestNeuron
protected KohonenNeuron bestNeuron

The best neuron found out during the last propagation process.

sensors
protected Sensor[] sensors

The array of sensors used by this map.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

370

Class KohonenMap

Constructor Detail
KohonenMap
public KohonenMap(int entriesCount,
int neuronCount)

Creates a brand Kohonen Map.


From this abstraction level, the Kohonen map must create the sensors array
and the neighbourhood structure, creating the collection for each
neighbourhood.

KohonenMap
protected KohonenMap(org.w3c.dom.Node mapRoot,
KohonenNeuralNetwork knn)

Constructor for creating a Kohonen Map from its XML node representation.

Method Detail
integrateWithNeuralNetwork
public void integrateWithNeuralNetwork(KohonenNeuralNetwork knn)

Integrates this map with its Kohonen neural network.


This process includes adding all this map's neurons to the neural network's
repository and copying the network's sensors into the
Parameters:
knn

- The Kohonen neural network that holds this map.

prepareNeighbourhoods
public void prepareNeighbourhoods(int neighbourhoodRadius)
throws IllegalArgumentException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

371

Class KohonenMap
Default neighbourhood preparation, uses a matrix-calculation approach for the
creation of neighbourhoods.
It needs each specific kind of Map to produce its own Connection-Matrix. This
matrix is calculated by this specific map using the Template Method (GoF)
createConnectionMatrix().
A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
The initial matrix produced with the Template Method is the one that would
meet the requirements of a 1 neighbourhood radius, showing only the direct
connections of each neuron. Making recursive operations with this matrix, the
neighbourhood for any radius value can be obtained. The [i][j] neurons will be
in each other's neighbourhood.
The matrix representation obtained is afterwords translated into each neuron's
neighbourhood list.
Parameters:
neighbourhoodRadius

- The neighbourhood's radius.

Throws:
- Exception thrown when an error occured
due to problems with the network's parameters.
IllegalArgumentException

createConnectionMatrix
public abstract boolean[][] createConnectionMatrix(int neuronCount)

Creates the specific Connection Matrix. This is a boolean matrix that


indicates the radius = 1 connection between Neighbourhoods. This is part of
the implementation of the Template Method Design Pattern.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

372

Class KohonenMap
getBestNeuron
public KohonenNeuron getBestNeuron()

Obtains the best neuron for the last propagation.


Returns:
The neuron with the lowest distance to the latest input

setBestNeuron
public void setBestNeuron(KohonenNeuron kNeuron)

Sets the best neuron for the last propagation.


Parameters:
kNeuron

- The best neuron.

getNeighbours
public Collection getNeighbours(KohonenNeuron neuron)

Obtains the list of neurons in neighbourhood of a given one.


Parameters:
neuron

- The neuron to be taken as the center of the neighbourhood.

Returns:
The list of kohonen neurons in the neighbourhood.

getNeighbours
public Collection getNeighbours(int neuronId)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

373

Class KohonenMap
Obtains the list of neurons in neighbourhood of a given one. This method
bases its functionality on getNeuron(int) and getNeighbours(KohonenNeuron,
int, short) methods.
Parameters:
- The id of the neuron to be taken as the center of the
neighbourhood.
neuronId

Returns:
The list of kohonen neurons in the neighbourhood.

getNeuron
public abstract KohonenNeuron getNeuron(int neuronId)

Gets a neuron from the map given given its id.


Parameters:
neuronId

- The id of the neuron to be returned.

Returns:
The neuron with that id. null if no neuron has that id.

getNeurons
public abstract List getNeurons()

Obtains the Vector of Neurons organized by their id.


Returns:
The neurons from the Map.

getNeuronCount
public int getNeuronCount()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

374

Class KohonenMap
Obtains the number of neurons in the Map.
Returns:
The number od neurons in the Map.

iterator
public abstract Iterator iterator()

Gets the Iterator that can explore all the neurons in this map.
Returns:
The Iterator instance for this map.

getDimensions
public abstract int[] getDimensions()

Obtains this map's dimensions. This means the number of neurons for each
dimension.
Returns:
A int array with the number of neurons in the index+1 dimension. (In
the array[0] the first dimension will be stored...).

map2xml
public abstract org.w3c.dom.Node map2xml(org.w3c.dom.Document document)

Obtains the XML representation of this Kohonen map. It generates a XML


node with this map's configuration.
Parameters:
document

- The XML document required for the creating new elements.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

375

Class KohonenMap
Returns:
The XML neuron with this Kohonen map's configuration.

Class KohonenNeuralNetwork
com.jcortex.kohonen
java.lang.Object
com.jcortex.NeuralNetwork
com.jcortex.kohonen.KohonenNeuralNetwork

public class KohonenNeuralNetwork


extends NeuralNetwork
The Kohonen Neural Network Model default implementation.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Field Summary
static
final
short

HEX_NEIGHBOURHOOD

static
final
short

LATTICE_1D

static
final
short

LATTICE_2D

static
final
short

LATTICE_CYLINDER

Page
378

Hexagonal hexagonal grid neighbourhood.

379

One dimensional lattice.

379

Two dimensional lattice.


Two dimensional lattice (as in
(vertical only) wrapping.

LATTICE_2D)

with a cylindrical

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

379

376

Class KohonenNeuralNetwork
static
final
short

LATTICE_TOROID

static
final
short

SQUARE_NEIGHBOURHOOD

static
final
short

STAR_NEIGHBOURHOOD

Two dimensional lattice (as in


horizontal & vertical only) wrapping.

LATTICE_2D)

with a toroid (both

379

378

Square grid neighbourhood.

379

Square grid neighbourhood.

Fields inherited from class com.jcortex.NeuralNetwork


inputTranslator, neurons, outputTranslator, sensors, teacher

Constructor Summary

Page

KohonenNeuralNetwork(int
neuronNum,
int
inputsNum, InputTranslator
inputTranslator, OutputTranslator outputTranslator, KohonenMap map,
short neighbourhoodShape)
380

Creates brand-new instance of KohonenNeuralNetwork.


KohonenNeuralNetwork(org.w3c.dom.Node nnRoot)

Creates a
configuration.

KohonenNeuralNetwork

instance

from

XML

sotored

Method Summary
Collection

382

getNeighbourhoodShape()

Obtains this neural netwrok's neighbourhood shape - or


neuron shape.
void

382

getMap()

Obtains the KohonenMap instance that holds this Kohonen


neural network's structure.
short

381

getBestNeuron()

Obtains the neuron that obtained the best result in the last
propagation.
KohonenMap

Page

getBestNeighbourhood()

Obtains the best neuron's neighbourhood.


KohonenNeuron

380

382

prepareNeighbourhoods(int neighbourhoodRadius)

Prepares the neighbourhoods for this neural network's


training, calculating the list of neurons present in each
neighbourhood.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

383

377

Class KohonenNeuralNetwork
float[]

pureThink(float[] input)

Makes the specific numerical thinking for the Kohonen


Neural Network.
protected
void

specificNeuralNetwork2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

nnRoot,

Puts into this neural network's XML configuration node the


aditional information it has as being a KohonenNeuralNetwork
instance.
Object

380

toHTMLString()

Produces a String representation of this neural network


enhanced with HTML tags to include styled text.
String

383

think(Object inputData)

Calculates the result obtained from the input data.


String

381

384

toString()

Produces a String representation of this neural network.

384

Methods inherited from class com.jcortex.NeuralNetwork


addEndNeuron, addFirstNeuron, addNeuron, addNeurons, createNeuralNetwork,
export2XMLDocument, getAttributeCount, getConnectedNeurons, getEndNeurons,
getInputTranslator,
getNeuron,
getNeuronCount,
getNeurons,
getOutputTranslator, getSensor, getSensorCount, getSensors, getTeacher,
neuralNetwork2xml,
pureThink,
setEndNeurons,
setFirtsNeurons,
setInputTranslator, setOutputTranslator, setTeacher, think, toHTMLString,
toString

Field Detail
HEX_NEIGHBOURHOOD
public static final short HEX_NEIGHBOURHOOD

Hexagonal hexagonal grid neighbourhood.

SQUARE_NEIGHBOURHOOD
public static final short SQUARE_NEIGHBOURHOOD

Square grid neighbourhood.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

378

Class KohonenNeuralNetwork
STAR_NEIGHBOURHOOD
public static final short STAR_NEIGHBOURHOOD

Square grid neighbourhood.

LATTICE_1D
public static final short LATTICE_1D

One dimensional lattice. The neurons can be stored in a single dimension


array.

LATTICE_2D
public static final short LATTICE_2D

Two dimensional lattice. The neurons can be stored in a two dimension array.

LATTICE_CYLINDER
public static final short LATTICE_CYLINDER

Two dimensional lattice (as in


wrapping.

LATTICE_2D)

with a cylindrical (vertical only)

LATTICE_TOROID
public static final short LATTICE_TOROID

Two dimensional lattice (as in


vertical only) wrapping.

LATTICE_2D)

with a toroid (both horizontal &

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

379

Class KohonenNeuralNetwork

Constructor Detail
KohonenNeuralNetwork
public KohonenNeuralNetwork(int neuronNum,
int inputsNum,
InputTranslator inputTranslator,
OutputTranslator outputTranslator,
KohonenMap map,
short neighbourhoodShape)

Creates brand-new instance of KohonenNeuralNetwork.

KohonenNeuralNetwork
public KohonenNeuralNetwork(org.w3c.dom.Node nnRoot)
throws ReadingException

Creates a KohonenNeuralNetwork instance from XML sotored configuration.


This method's main task is invoking the creation of the
that organizes the neurons of this network.

KohonenMap

instance

Throws:
ReadingException

Method Detail
think
public Object think(Object inputData)
throws IllegalArgumentException

Calculates the result obtained from the input data.


This method overrides the think() method defined in the abstract class
NeuralNetwork as this network's output is not obtained through its ending
neuron's values, but by the Dominant Class of the best neuron.
Overrides:
think

in class NeuralNetwork

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

380

Class KohonenNeuralNetwork
Parameters:
inputData

- The object that serves as input data for the neural network.

Returns:
An object containing the answer given by the neral network.
Throws:
IllegalArgumentException

pureThink
public float[] pureThink(float[] input)
throws IllegalArgumentException

Makes the specific numerical thinking for the Kohonen Neural Network. This
process is based on the pureThink() method implemented in this network's
Kohonen Map instance.
It behaves as the Template Method (GoF) for the think() method.
Overrides:
pureThink

in class NeuralNetwork

Parameters:
input

- The numerical input data.

Returns:
The numerical result of passing the input through the network.
Throws:
IllegalArgumentException

getBestNeighbourhood
public Collection getBestNeighbourhood()

Obtains the best neuron's neighbourhood.


Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

381

Class KohonenNeuralNetwork
Returns:
A collection with the neurons from the best neuron's neighbourhood.

getBestNeuron
public KohonenNeuron getBestNeuron()

Obtains the neuron that obtained the best result in the last propagation.
Returns:
The best neuron from the last propagation.

getMap
public KohonenMap getMap()

Obtains the
structure.

KohonenMap

instance that holds this Kohonen neural network's

Returns:
This network's associated KohonenMap instance.

getNeighbourhoodShape
public short getNeighbourhoodShape()

Obtains this neural netwrok's neighbourhood shape - or neuron shape.


Returns:
This neural networ's neighbourhood shape - or neuron shape

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

382

Class KohonenNeuralNetwork
prepareNeighbourhoods
public void prepareNeighbourhoods(int neighbourhoodRadius)
throws IllegalArgumentException

Prepares the neighbourhoods for this neural network's training, calculating the
list of neurons present in each neighbourhood.
This method is based on the prepareNeighbourhoods() method from this
network's associated KohonenMap instance.
Parameters:
neighbourhoodRadius

- The neighbourhood radius that will be used in

the training.
Throws:
- Exception thrown if any problem is found
with the value of the network's or training parameters.
IllegalArgumentException

specificNeuralNetwork2xml
protected void specificNeuralNetwork2xml(org.w3c.dom.Element nnRoot,
org.w3c.dom.Document document)

Puts into this neural network's XML configuration node the aditional
information it has as being a KohonenNeuralNetwork instance. The most
relevant information stored at this level is the Kohonen Map that holds this
network's structure.
Overrides:
specificNeuralNetwork2xml

in class NeuralNetwork

Parameters:
nnRoot

- This neural network's XML configuration node.

document

- The XML Document needed to create new elements.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

383

Class KohonenNeuralNetwork
toString
public String toString()

Produces a String representation of this neural network.


Overrides:
toString

in class NeuralNetwork

Returns:
A String representation of this neural network.

toHTMLString
public String toHTMLString()

Produces a String representation of this neural network enhanced with HTML


tags to include styled text.
Overrides:
toHTMLString

in class NeuralNetwork

Returns:
A String representation of this neural network.

Class KohonenNeuron
com.jcortex.kohonen
java.lang.Object
com.jcortex.Neuron
com.jcortex.kohonen.KohonenNeuron

All Implemented Interfaces:

AxonReceiver, AxonSource

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

384

Class KohonenNeuron

public class KohonenNeuron


extends Neuron
Class that models the functionalities of a Kohonen neuron.
A Kohonen neuron network can be associated to various Distance Functions. It
stores has references to its entries, this neural network's sensors, and keeps record of
the classes of the examples used for its training.
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.Neuron


RANDOM_CLOSE_TO_ZERO_VALUE, RANDOM_INITIAL_VALUE, ZERO_INITIAL_VALUE

Constructor Summary

Page

KohonenNeuron(int
id,
int
entriesCount,
distanceFunction, AxonSource[] sensors)

DistanceFunction
387

Creates a brand-new KohonenNeuron instance.


KohonenNeuron(org.w3c.dom.Node neuronNode, NeuralNetwork nn)

Creates a
configuration.

KohonenNeuron

instance from an XML node with its

Method Summary
void

390

addEntry(AxonSource entry)

This should not be used.


void

Page

addConnectedNeuron(AxonReceiver child, boolean back_connection)

Ignored for Kohonen neurons as these can not have childs.


void

387

391

addEntry(AxonSource entry, float weight)

This should not be used.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

391

385

Class KohonenNeuron
void

clearExamplesInClasses()

Cleans the dominant class and the classes map.


float

getAxonValue()

Obtains the last Axon Value produced by the method


produceAxonValue().
int

394

setEntryWeight(AxonSource parent, float value)

Sets the weight for the requested entry.


void

388

registerLastExampleClass(Object lastExampleClass)

Records the last example's class.


void

392

produceAxonValue()

Produces this neuron's Axon Value that is none other than the
distance between the input values and the ones stored as its weights.
void

392

getWeigths()

Obtains this neuron's weight's array.


float

388

getWeight(int ix)

Obtains the value from this neuron's weight vector, referenced


by the given index.
float[]

388

getEntryWeight(AxonSource parent)

Obtains the weight associate to a given entry.


float

391

getEntries()

Obtains the entries for this neuron which are none others but the
neural network's sensors.
float

389

getDominantClass()

Obtains this neuron's dominant class: the one that has obtained
most of the examples.
Collection

392

getConnectedNeurons()

No neurons can be connected to a Kohonen neuron.


Object

392

getClusterSuccesses()

Obtains the number of clustering successes.This is the number


of classes registered from the examples that have fallen into this
neuron that match the dominant class.
Collection

389

getClusterErrors()

Obtains the number of clustering errors.This is the number of


classes registered from the examples that have fallen into this neuron
that do not match the dominant class.
int

394

393

setEntryWeight(int ix, float value)

Sets the weight for the entry on the position ix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

393

386

Class KohonenNeuron
protected
void

specificNeuron2xml(org.w3c.dom.Element
org.w3c.dom.Document document)

neuronRoot,

Adds the specific information known to the Kohonen Neuron at


this level.
String

390

toString()

Obtains a String representation of this neuron.

394

Methods inherited from class com.jcortex.Neuron


equals, getConnectedNeurons, getId, neuron2xml, toString

Methods inherited from interface com.jcortex.AxonSource


addConnectedNeuron, getAxonValue, getId, produceAxonValue

Methods inherited from interface com.jcortex.AxonReceiver


addEntry, addEntry, getEntries, getEntryWeight, getId, setEntryWeight

Constructor Detail
KohonenNeuron
public KohonenNeuron(int id,
int entriesCount,
DistanceFunction distanceFunction,
AxonSource[] sensors)

Creates a brand-new KohonenNeuron instance.

KohonenNeuron
public KohonenNeuron(org.w3c.dom.Node neuronNode,
NeuralNetwork nn)
throws ReadingException

Creates a KohonenNeuron instance from an XML node with its configuration.


Throws:
ReadingException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

387

Class KohonenNeuron

Method Detail
getEntries
public Collection getEntries()

Obtains the entries for this neuron which are none others but the neural
network's sensors.
Specified by:
getEntries

in interface AxonReceiver

Returns:
A collection with this neuron's entries: the sensors.

getEntryWeight
public float getEntryWeight(AxonSource parent)

Obtains the weight associate to a given entry.


Specified by:
getEntryWeight

in interface AxonReceiver

Parameters:
parent

- The entry whose weight is requested.

Returns:
The weight requested.

produceAxonValue
public float produceAxonValue()
throws IllegalArgumentException

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

388

Class KohonenNeuron
Produces this neuron's Axon Value that is none other than the distance
between the input values and the ones stored as its weights. The Axon Value is
both returned and stored as a
Specified by:
produceAxonValue

in interface AxonSource

Returns:
The Axon Value calculated.
Throws:
IllegalArgumentException

- This exception can be thrown by the

distance function.

getAxonValue
public float getAxonValue()

Obtains the last Axon Value produced by the method produceAxonValue().


Specified by:
getAxonValue

in interface AxonSource

Returns:
The last Axon Value produced.

getConnectedNeurons
public Collection getConnectedNeurons()

No neurons can be connected to a Kohonen neuron.


Overrides:
getConnectedNeurons

in class Neuron

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

389

Class KohonenNeuron
Returns:
null

as no neurons can be connected.

specificNeuron2xml
protected void specificNeuron2xml(org.w3c.dom.Element neuronRoot,
org.w3c.dom.Document document)

Adds the specific information known to the Kohonen Neuron at this level.
This method puts the intance attributes known at this level as attributes of the
XML node. Puts as well the entries-weights structure and the examples'
classes records.
Overrides:
specificNeuron2xml

in class Neuron

Parameters:
neuronRoot
document

- The neuron's XML configuration node.

- The XML Document used to create new elements.

addConnectedNeuron
public void addConnectedNeuron(AxonReceiver child,
boolean back_connection)

Ignored for Kohonen neurons as these can not have childs.


Specified by:
addConnectedNeuron

in interface AxonSource

Parameters:
child

- The child element connected to this AxonSource instance.

back_connection

- Indicates if this neuron has to create the entry in its

child.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

390

Class KohonenNeuron

addEntry
public void addEntry(AxonSource entry)

This should not be used. Better create a new network.


Specified by:
addEntry

in interface AxonReceiver

Parameters:
entry

- The new axon data source on to which stablish a connection.

addEntry
public void addEntry(AxonSource entry,
float weight)

This should not be used. Better create a new network.


Specified by:
addEntry

in interface AxonReceiver

Parameters:
entry

- The new AxonSource element to be connected as its father.

weight

- The entry's weight

getDominantClass
public Object getDominantClass()

Obtains this neuron's dominant class: the one that has obtained most of the
examples.
Returns:
The dominant class.
Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

391

Class KohonenNeuron

getClusterSuccesses
public int getClusterSuccesses()

Obtains the number of clustering successes.This is the number of classes


registered from the examples that have fallen into this neuron that match the
dominant class.
Returns:
The number of cluster successes.

getClusterErrors
public int getClusterErrors()

Obtains the number of clustering errors.This is the number of classes


registered from the examples that have fallen into this neuron that do not
match the dominant class.
Returns:
The number of cluster errors.

getWeigths
public float[] getWeigths()

Obtains this neuron's weight's array.


Returns:
The weights array.

getWeight
public float getWeight(int ix)

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

392

Class KohonenNeuron
Obtains the value from this neuron's weight vector, referenced by the given
index.
Parameters:
ix

- The weight's index.

Returns:
The weight value requested

setEntryWeight
public void setEntryWeight(int ix,
float value)

Sets the weight for the entry on the position ix.


Parameters:
ix

- The position of the weight to set.

value

- The new value.

setEntryWeight
public void setEntryWeight(AxonSource parent,
float value)

Sets the weight for the requested entry.


Specified by:
setEntryWeight

in interface AxonReceiver

Parameters:
parent
value

- The Sensor instance that is an entry for this neuron.

- The new value.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

393

Class KohonenNeuron
registerLastExampleClass
public void registerLastExampleClass(Object lastExampleClass)

Records the last example's class. The "class" is not a Java "class", but a float
number.
This method looks if this class has already been recorded in this neuron, an
accumulates this hit. If it has never been seen, it creates a new entry in the map
for it.
Parameters:
lastExampleClass

- The last example's class.

clearExamplesInClasses
public void clearExamplesInClasses()

Cleans the dominant class and the classes map. Pretty much like a reset.

toString
public String toString()

Obtains a String representation of this neuron.


Overrides:
toString

in class Neuron

Returns:
This neuron's string representation.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

394

Class SheetHexKMap

Class SheetHexKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.SheetHexKMap

public class SheetHexKMap


extends Default2DKMap
Models a sheet-organized Kohonen Map with hexagonal-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

395

Class SheetHexKMap
Constructor Summary
SheetHexKMap(int
dFunction)

entriesCount,

Page
int

rows,

int

cols,

DistanceFunction
396

The basic constructor for this kind of Kohonen Map.


SheetHexKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a SheetHexKMap from its configuration stored in an XML node.

Method Summary
boolean[][]

397

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a sheet-organized map with


hexagonal-shaped neurons.

397

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
SheetHexKMap
public SheetHexKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

396

Class SheetHexKMap
SheetHexKMap
public SheetHexKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a SheetHexKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a sheet-organized map with hexagonalshaped neurons.


A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

397

Class SheetSquareKMap

Class SheetSquareKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.SheetSquareKMap

public class SheetSquareKMap


extends Default2DKMap
Models a sheet-organized Kohonen Map with square-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

398

Class SheetSquareKMap
Constructor Summary
SheetSquareKMap(int entriesCount, int rows, int cols, DistanceFunction
dFunction)

Page

399

The basic constructor for this kind of Kohonen Map.


SheetSquareKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a SheetSquareKMap from its configuration stored in an XML node.

Method Summary
boolean[][]

400

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a sheet-organized map with


square-shaped neurons.

400

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
SheetSquareKMap
public SheetSquareKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

399

Class SheetSquareKMap
SheetSquareKMap
public SheetSquareKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a SheetSquareKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a sheet-organized map with square-shaped


neurons.
A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

400

Class SheetStarKMap

Class SheetStarKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.SheetStarKMap

public class SheetStarKMap


extends Default2DKMap
Models a sheet-organized Kohonen Map with star-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

401

Class SheetStarKMap
Constructor Summary
SheetStarKMap(int entriesCount, int
dFunction)

Page
rows,

int cols, DistanceFunction


402

The basic constructor for this kind of Kohonen Map.


SheetStarKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a SheetStarKMap from its configuration stored in an XML node.

Method Summary
boolean[][]

403

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a sheet-organized map with


star-shaped neurons.

403

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
SheetStarKMap
public SheetStarKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

402

Class SheetStarKMap
SheetStarKMap
public SheetStarKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a SheetStarKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a sheet-organized map with star-shaped


neurons.
A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

403

Class ToroidHexKMap

Class ToroidHexKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.ToroidHexKMap

public class ToroidHexKMap


extends Default2DKMap
Models a toroid-organized Kohonen Map with hexagonal-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

404

Class ToroidHexKMap
Constructor Summary
ToroidHexKMap(int entriesCount, int
dFunction)

Page
rows,

int cols, DistanceFunction


405

The basic constructor for this kind of Kohonen Map.


ToroidHexKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a ToroidHexKMap from its configuration stored in an XML node.

Method Summary
boolean[][]

406

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a toroid-organized map


with hexagonal-shaped neurons.

406

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
ToroidHexKMap
public ToroidHexKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)
throws IllegalArgumentException

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.
The number of columns must be even so both sides of hexagonal neurons
can fit for the wrapping.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

405

Class ToroidHexKMap
Throws:
IllegalArgumentException

ToroidHexKMap
public ToroidHexKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)
throws IllegalArgumentException

Creates a ToroidHexKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.
Throws:
IllegalArgumentException

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a toroid-organized map with hexagonalshaped neurons.


A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

406

Class ToroidHexKMap
Returns:
The Connection-Matrix.

Class ToroidSquareKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.ToroidSquareKMap

public class ToroidSquareKMap


extends Default2DKMap
Models a toroid-organized Kohonen Map with square-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

407

Class ToroidSquareKMap
Constructor Summary

Page

ToroidSquareKMap(int entriesCount, int rows, int cols, DistanceFunction


dFunction)

408

The basic constructor for this kind of Kohonen Map.


ToroidSquareKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a

ToroidSquareKMap

from its configuration stored in an XML

409

node.

Method Summary
boolean[][]

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a toroid-organized map


with square-shaped neurons.

409

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
ToroidSquareKMap
public ToroidSquareKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

408

Class ToroidSquareKMap
ToroidSquareKMap
public ToroidSquareKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a ToroidSquareKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a toroid-organized map with squareshaped neurons.


A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

409

Class ToroidStarKMap

Class ToroidStarKMap
com.jcortex.kohonen
java.lang.Object
com.jcortex.kohonen.KohonenMap
com.jcortex.kohonen.Default2DKMap
com.jcortex.kohonen.ToroidStarKMap

public class ToroidStarKMap


extends Default2DKMap
Models a toroid-organized Kohonen Map with star-shaped neurons.
This map is an extension of Default2DKMap. A cylinder map is a plain 2D map that has
been wrapped vertically (to allow more versatility in the shape of neurons).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Fields inherited from class com.jcortex.kohonen.Default2DKMap


cols, neurons, rows

Fields inherited from class com.jcortex.kohonen.KohonenMap


bestNeuron, neighbourhoods, neuronCount, sensors

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

410

Class ToroidStarKMap
Constructor Summary
ToroidStarKMap(int entriesCount, int rows, int cols, DistanceFunction
dFunction)

Page

411

The basic constructor for this kind of Kohonen Map.


ToroidStarKMap(org.w3c.dom.Node mapNode, KohonenNeuralNetwork knn)

Creates a ToroidStarKMap from its configuration stored in an XML node.

Method Summary
boolean[][]

412

Page

createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a toroid-organized map


with star-shaped neurons.

412

Methods inherited from class com.jcortex.kohonen.Default2DKMap


getColumnCount, getDimensions, getNeuron, getNeurons, getRowCount, iterator,
map2xml

Methods inherited from class com.jcortex.kohonen.KohonenMap


createConnectionMatrix,
getBestNeuron,
getDimensions,
getNeighbours,
getNeighbours,
getNeuron,
getNeuronCount,
getNeurons,
integrateWithNeuralNetwork,
iterator,
map2xml,
prepareNeighbourhoods,
setBestNeuron

Constructor Detail
ToroidStarKMap
public ToroidStarKMap(int entriesCount,
int rows,
int cols,
DistanceFunction dFunction)

The basic constructor for this kind of Kohonen Map.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

411

Class ToroidStarKMap
ToroidStarKMap
public ToroidStarKMap(org.w3c.dom.Node mapNode,
KohonenNeuralNetwork knn)

Creates a ToroidStarKMap from its configuration stored in an XML node.


This class is completely based on the Default2DKMap so this constructor does
nothing else than invoking its super-constructor.

Method Detail
createConnectionMatrix
public boolean[][] createConnectionMatrix(int neuronCount)

Creates the Connection-Matrix for a toroid-organized map with star-shaped


neurons.
A Connection-Matrix is a boolean[][] array that has a line and row for each
neuron in the map. The value of position [i][j] will be true when the neuron
with id number i and the neuron with id number j are direct neighbours (with
no other neurons between them). The value of position [i][j] will be false
otherwise.
Overrides:
createConnectionMatrix

in class KohonenMap

Parameters:
neuronCount

- The number of neurons that

Returns:
The Connection-Matrix.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

412

Package com.jcortex.networkFunctions

Package com.jcortex.networkFunctions
Class Summary

Page

LinearBasisFunction

The NetworkFunction implementation of the Linear


Basis Function.

413

RadialBasisFunction

The NetworkFunction implementation of the Linear


Basis Function.

415

Class LinearBasisFunction
com.jcortex.networkFunctions
java.lang.Object
com.jcortex.networkFunctions.LinearBasisFunction

All Implemented Interfaces:

NetworkFunction

public class LinearBasisFunction


extends Object
implements NetworkFunction
The NetworkFunction implementation of the Linear Basis Function. As this class
does not store any specific attributes or parameters it has been buit to work
complaying with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

413

Class LinearBasisFunction
Method Summary
static
LinearBasisFunction

Page

getInstance()

Obtains the Singleton (GoF) instance for this class.


float

414

getSolution(Collection axonSourceEntries)

Implementation of the Linear Basis Function.

414

Methods inherited from interface com.jcortex.NetworkFunction


getSolution

Method Detail
getInstance
public static LinearBasisFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getSolution
public float getSolution(Collection axonSourceEntries)

Implementation of the Linear Basis Function.


Specified by:
getSolution

in interface NetworkFunction

Parameters:
- The collection of AxonSourceEntry instances from
which float values will be obtained to use in the function.
axonSourceEntries

Returns:
The composed value of all the entries' values.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

414

Class RadialBasisFunction

Class RadialBasisFunction
com.jcortex.networkFunctions
java.lang.Object
com.jcortex.networkFunctions.RadialBasisFunction

All Implemented Interfaces:

NetworkFunction

public class RadialBasisFunction


extends Object
implements NetworkFunction
The NetworkFunction implementation of the Linear Basis Function. As this class
does not store any specific attributes or parameters it has been buit to work
complaying with the Singleton pattern (GoF).
Author:
Miguel Lara Encabo - miguel@mac.com
Version:
0.1

Method Summary
static
RadialBasisFunction

Page

getInstance()

Obtains the Singleton (GoF) instance for this class.


float

416

getSolution(Collection axonSourceEntries)

Implementation of the Radial Basis Function.

416

Methods inherited from interface com.jcortex.NetworkFunction


getSolution

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

415

Class RadialBasisFunction

Method Detail
getInstance
public static RadialBasisFunction getInstance()

Obtains the Singleton (GoF) instance for this class.


Returns:
This class' Singleton (GoF) instance.

getSolution
public float getSolution(Collection axonSourceEntries)

Implementation of the Radial Basis Function.


Specified by:
getSolution

in interface NetworkFunction

Parameters:
- The collection of AxonSourceEntry instances from
which float values will be obtained to use in the function.
axonSourceEntries

Returns:
The composed value of all the entries' values.

Package com.jcortex.translators
Class Summary

Page

SingleBooleanOutputTranslator

417

TransparentInputTranslator

419

TransparentOutputTranslator

421

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

416

Class SingleBooleanOutputTranslator

Class SingleBooleanOutputTranslator
com.jcortex.translators
java.lang.Object
com.jcortex.translators.SingleBooleanOutputTranslator

All Implemented Interfaces:

OutputTranslator

public class SingleBooleanOutputTranslator


extends Object
implements OutputTranslator

Constructor Summary

Page

SingleBooleanOutputTranslator()

417

Method Summary

Page

float[]

getOutputBackTranslation(Object desired_output)

Translates a desired result into the numerical value it should have


produced.
Object

418

getOutputTranslation(float[] input_value)

Translates the numerical value given out by neurons as an object


that can be taken as the qualitative result given by the network.

418

Methods inherited from interface com.jcortex.OutputTranslator


getOutputBackTranslation, getOutputTranslation

Constructor Detail
SingleBooleanOutputTranslator
public SingleBooleanOutputTranslator()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

417

Class SingleBooleanOutputTranslator

Method Detail
getOutputTranslation
public Object getOutputTranslation(float[] input_value)

Description copied from interface: OutputTranslator


Translates the numerical value given out by neurons as an object that can be
taken as the qualitative result given by the network.
Specified by:
getOutputTranslation

in interface OutputTranslator

Parameters:
input_value

- The float array that is the result of the neural network's

process.
Returns:
The Object returned as a qualitative response from the neural network.

getOutputBackTranslation
public float[] getOutputBackTranslation(Object desired_output)

Description copied from interface: OutputTranslator


Translates a desired result into the numerical value it should have produced.
Specified by:
getOutputBackTranslation

in interface OutputTranslator

Parameters:
desired_output

- The object that is the desired output for an example.

Returns:
The Object returned as a qualitative response from the neural network.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

418

Class TransparentInputTranslator

Class TransparentInputTranslator
com.jcortex.translators
java.lang.Object
com.jcortex.translators.TransparentInputTranslator

All Implemented Interfaces:

InputTranslator

public class TransparentInputTranslator


extends Object
implements InputTranslator

Constructor Summary

Page

TransparentInputTranslator()

419

Method Summary

Page

float[]

getInputTranslation(Object input_value)

Translates the input value given as an object into the numerical


values that can be fed onto the neurons.

420

Methods inherited from interface com.jcortex.InputTranslator


getInputTranslation

Constructor Detail
TransparentInputTranslator
public TransparentInputTranslator()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

419

Class TransparentInputTranslator

Method Detail
getInputTranslation
public float[] getInputTranslation(Object input_value)

Description copied from interface: InputTranslator


Translates the input value given as an object into the numerical values that can
be fed onto the neurons.
Specified by:
getInputTranslation

in interface InputTranslator

Parameters:
input_value

- The qualitative Object used in each particular problem.

Returns:
The float array that contains the input for each Neuron.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

420

Class TransparentInputTranslator

Class TransparentOutputTranslator
com.jcortex.translators
java.lang.Object
com.jcortex.translators.TransparentOutputTranslator

All Implemented Interfaces:

OutputTranslator

public class TransparentOutputTranslator


extends Object
implements OutputTranslator

Constructor Summary

Page

TransparentOutputTranslator()

421

Method Summary

Page

float[]

getOutputBackTranslation(Object desired_output)

Translates a desired result into the numerical value it should have


produced.
Object

422

getOutputTranslation(float[] input_value)

Translates the numerical value given out by neurons as an object


that can be taken as the qualitative result given by the network.

422

Methods inherited from interface com.jcortex.OutputTranslator


getOutputBackTranslation, getOutputTranslation

Constructor Detail
TransparentOutputTranslator
public TransparentOutputTranslator()

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

421

Class TransparentInputTranslator

Method Detail
getOutputTranslation
public Object getOutputTranslation(float[] input_value)

Description copied from interface: OutputTranslator


Translates the numerical value given out by neurons as an object that can be
taken as the qualitative result given by the network.
Specified by:
getOutputTranslation

in interface OutputTranslator

Parameters:
input_value

- The float array that is the result of the neural network's

process.
Returns:
The Object returned as a qualitative response from the neural network.

getOutputBackTranslation
public float[] getOutputBackTranslation(Object desired_output)

Description copied from interface: OutputTranslator


Translates a desired result into the numerical value it should have produced.
Specified by:
getOutputBackTranslation

in interface OutputTranslator

Parameters:
desired_output

- The object that is the desired output for an example.

Returns:
The Object returned as a qualitative response from the neural network.

Framework para Redes Neuronales en Java Miguel Lara Encabo 06/2006

422

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Anexo B: Ejemplos de uso

Modelo de Redes de Hopfield


Configuracin de la Red y del Maestro:
La Red de Hopfield
es el modelo ms
simple de configurar.
Se indica que los
ejemplos del
conjunto de
entrenamiento tienen
24 atributos.
Causas de parada del entrenamiento:
El entrenamiento de una red de Hopfield no se detiene dependiendo de su evolucin,
sino que finaliza cuando se ha completado el clculo de la matriz de pesos.
Resultados de los estadsticos:
No se proporcionan resultados estadsticos, al no haber iteraciones.
Archivo de ejemplos:
aNumbers.txt (ver)
Nodo de configuracin XML generado:
<neuralNetwork attributeCount="24" class="com.jcortex.hopfield.HopfieldNeuralNetwork"
inputTranslator="com.jcortex.translators.TransparentInputTranslator" neuronCount="0"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
sensorCount="0">
<weights>
<weight col="0" row="0" value="0.0"/>
<weight col="1" row="0" value="-0.083333336"/>
<weight col="2" row="0" value="-0.25"/>
<weight col="3" row="0" value="0.41666666"/>
<weight col="4" row="0" value="-0.16666667"/>
<weight col="5" row="0" value="0.083333336"/>
<weight col="6" row="0" value="0.083333336"/>
<weight col="7" row="0" value="-0.083333336"/>
<weight col="8" row="0" value="0.0"/>
<weight col="9" row="0" value="0.16666667"/>
<weight col="10" row="0" value="-0.083333336"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

423

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="11" row="0" value="0.083333336"/>


col="12" row="0" value="-0.083333336"/>
col="13" row="0" value="0.083333336"/>
col="14" row="0" value="-0.083333336"/>
col="15" row="0" value="-0.083333336"/>
col="16" row="0" value="0.0"/>
col="17" row="0" value="0.16666667"/>
col="18" row="0" value="0.083333336"/>
col="19" row="0" value="-0.083333336"/>
col="20" row="0" value="0.16666667"/>
col="21" row="0" value="-0.16666667"/>
col="22" row="0" value="-0.25"/>
col="23" row="0" value="0.083333336"/>
col="0" row="1" value="-0.083333336"/>
col="1" row="1" value="0.0"/>
col="2" row="1" value="0.25"/>
col="3" row="1" value="-0.083333336"/>
col="4" row="1" value="0.33333334"/>
col="5" row="1" value="-0.41666666"/>
col="6" row="1" value="-0.41666666"/>
col="7" row="1" value="0.25"/>
col="8" row="1" value="0.0"/>
col="9" row="1" value="0.0"/>
col="10" row="1" value="-0.083333336"/>
col="11" row="1" value="0.083333336"/>
col="12" row="1" value="-0.083333336"/>
col="13" row="1" value="-0.25"/>
col="14" row="1" value="-0.083333336"/>
col="15" row="1" value="0.083333336"/>
col="16" row="1" value="0.16666667"/>
col="17" row="1" value="-0.16666667"/>
col="18" row="1" value="-0.25"/>
col="19" row="1" value="0.25"/>
col="20" row="1" value="-0.16666667"/>
col="21" row="1" value="0.16666667"/>
col="22" row="1" value="0.25"/>
col="23" row="1" value="-0.25"/>
col="0" row="2" value="-0.25"/>
col="1" row="2" value="0.25"/>
col="2" row="2" value="0.0"/>
col="3" row="2" value="-0.25"/>
col="4" row="2" value="0.16666667"/>
col="5" row="2" value="-0.25"/>
col="6" row="2" value="-0.25"/>
col="7" row="2" value="0.083333336"/>
col="8" row="2" value="0.0"/>
col="9" row="2" value="-0.16666667"/>
col="10" row="2" value="0.083333336"/>
col="11" row="2" value="-0.083333336"/>
col="12" row="2" value="-0.083333336"/>
col="13" row="2" value="-0.25"/>
col="14" row="2" value="0.083333336"/>
col="15" row="2" value="0.083333336"/>
col="16" row="2" value="0.0"/>
col="17" row="2" value="-0.33333334"/>
col="18" row="2" value="-0.083333336"/>
col="19" row="2" value="0.083333336"/>
col="20" row="2" value="-0.33333334"/>
col="21" row="2" value="0.16666667"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

424

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="22" row="2" value="0.41666666"/>


col="23" row="2" value="-0.25"/>
col="0" row="3" value="0.41666666"/>
col="1" row="3" value="-0.083333336"/>
col="2" row="3" value="-0.25"/>
col="3" row="3" value="0.0"/>
col="4" row="3" value="-0.16666667"/>
col="5" row="3" value="0.083333336"/>
col="6" row="3" value="0.083333336"/>
col="7" row="3" value="-0.083333336"/>
col="8" row="3" value="0.0"/>
col="9" row="3" value="0.16666667"/>
col="10" row="3" value="-0.083333336"/>
col="11" row="3" value="0.083333336"/>
col="12" row="3" value="-0.083333336"/>
col="13" row="3" value="0.083333336"/>
col="14" row="3" value="-0.083333336"/>
col="15" row="3" value="-0.083333336"/>
col="16" row="3" value="0.0"/>
col="17" row="3" value="0.16666667"/>
col="18" row="3" value="0.083333336"/>
col="19" row="3" value="-0.083333336"/>
col="20" row="3" value="0.16666667"/>
col="21" row="3" value="-0.16666667"/>
col="22" row="3" value="-0.25"/>
col="23" row="3" value="0.083333336"/>
col="0" row="4" value="-0.16666667"/>
col="1" row="4" value="0.33333334"/>
col="2" row="4" value="0.16666667"/>
col="3" row="4" value="-0.16666667"/>
col="4" row="4" value="0.0"/>
col="5" row="4" value="-0.33333334"/>
col="6" row="4" value="-0.33333334"/>
col="7" row="4" value="0.16666667"/>
col="8" row="4" value="0.083333336"/>
col="9" row="4" value="0.083333336"/>
col="10" row="4" value="0.0"/>
col="11" row="4" value="0.0"/>
col="12" row="4" value="0.0"/>
col="13" row="4" value="-0.16666667"/>
col="14" row="4" value="-0.16666667"/>
col="15" row="4" value="0.16666667"/>
col="16" row="4" value="0.25"/>
col="17" row="4" value="-0.083333336"/>
col="18" row="4" value="-0.33333334"/>
col="19" row="4" value="0.33333334"/>
col="20" row="4" value="-0.083333336"/>
col="21" row="4" value="0.25"/>
col="22" row="4" value="0.16666667"/>
col="23" row="4" value="-0.16666667"/>
col="0" row="5" value="0.083333336"/>
col="1" row="5" value="-0.41666666"/>
col="2" row="5" value="-0.25"/>
col="3" row="5" value="0.083333336"/>
col="4" row="5" value="-0.33333334"/>
col="5" row="5" value="0.0"/>
col="6" row="5" value="0.41666666"/>
col="7" row="5" value="-0.25"/>
col="8" row="5" value="0.0"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

425

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="9" row="5" value="0.0"/>


col="10" row="5" value="0.083333336"/>
col="11" row="5" value="-0.083333336"/>
col="12" row="5" value="0.083333336"/>
col="13" row="5" value="0.25"/>
col="14" row="5" value="0.083333336"/>
col="15" row="5" value="-0.083333336"/>
col="16" row="5" value="-0.16666667"/>
col="17" row="5" value="0.16666667"/>
col="18" row="5" value="0.25"/>
col="19" row="5" value="-0.25"/>
col="20" row="5" value="0.16666667"/>
col="21" row="5" value="-0.16666667"/>
col="22" row="5" value="-0.25"/>
col="23" row="5" value="0.25"/>
col="0" row="6" value="0.083333336"/>
col="1" row="6" value="-0.41666666"/>
col="2" row="6" value="-0.25"/>
col="3" row="6" value="0.083333336"/>
col="4" row="6" value="-0.33333334"/>
col="5" row="6" value="0.41666666"/>
col="6" row="6" value="0.0"/>
col="7" row="6" value="-0.25"/>
col="8" row="6" value="0.0"/>
col="9" row="6" value="0.0"/>
col="10" row="6" value="0.083333336"/>
col="11" row="6" value="-0.083333336"/>
col="12" row="6" value="0.083333336"/>
col="13" row="6" value="0.25"/>
col="14" row="6" value="0.083333336"/>
col="15" row="6" value="-0.083333336"/>
col="16" row="6" value="-0.16666667"/>
col="17" row="6" value="0.16666667"/>
col="18" row="6" value="0.25"/>
col="19" row="6" value="-0.25"/>
col="20" row="6" value="0.16666667"/>
col="21" row="6" value="-0.16666667"/>
col="22" row="6" value="-0.25"/>
col="23" row="6" value="0.25"/>
col="0" row="7" value="-0.083333336"/>
col="1" row="7" value="0.25"/>
col="2" row="7" value="0.083333336"/>
col="3" row="7" value="-0.083333336"/>
col="4" row="7" value="0.16666667"/>
col="5" row="7" value="-0.25"/>
col="6" row="7" value="-0.25"/>
col="7" row="7" value="0.0"/>
col="8" row="7" value="-0.16666667"/>
col="9" row="7" value="-0.16666667"/>
col="10" row="7" value="-0.25"/>
col="11" row="7" value="0.25"/>
col="12" row="7" value="-0.083333336"/>
col="13" row="7" value="-0.083333336"/>
col="14" row="7" value="0.083333336"/>
col="15" row="7" value="-0.083333336"/>
col="16" row="7" value="0.0"/>
col="17" row="7" value="0.0"/>
col="18" row="7" value="-0.083333336"/>
col="19" row="7" value="0.083333336"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

426

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="20" row="7" value="0.0"/>


col="21" row="7" value="0.0"/>
col="22" row="7" value="0.083333336"/>
col="23" row="7" value="-0.083333336"/>
col="0" row="8" value="0.0"/>
col="1" row="8" value="0.0"/>
col="2" row="8" value="0.0"/>
col="3" row="8" value="0.0"/>
col="4" row="8" value="0.083333336"/>
col="5" row="8" value="0.0"/>
col="6" row="8" value="0.0"/>
col="7" row="8" value="-0.16666667"/>
col="8" row="8" value="0.0"/>
col="9" row="8" value="0.083333336"/>
col="10" row="8" value="0.0"/>
col="11" row="8" value="0.0"/>
col="12" row="8" value="0.16666667"/>
col="13" row="8" value="0.16666667"/>
col="14" row="8" value="-0.16666667"/>
col="15" row="8" value="0.33333334"/>
col="16" row="8" value="0.083333336"/>
col="17" row="8" value="-0.083333336"/>
col="18" row="8" value="-0.16666667"/>
col="19" row="8" value="0.16666667"/>
col="20" row="8" value="-0.083333336"/>
col="21" row="8" value="-0.083333336"/>
col="22" row="8" value="0.0"/>
col="23" row="8" value="-0.16666667"/>
col="0" row="9" value="0.16666667"/>
col="1" row="9" value="0.0"/>
col="2" row="9" value="-0.16666667"/>
col="3" row="9" value="0.16666667"/>
col="4" row="9" value="0.083333336"/>
col="5" row="9" value="0.0"/>
col="6" row="9" value="0.0"/>
col="7" row="9" value="-0.16666667"/>
col="8" row="9" value="0.083333336"/>
col="9" row="9" value="0.0"/>
col="10" row="9" value="0.16666667"/>
col="11" row="9" value="-0.16666667"/>
col="12" row="9" value="0.16666667"/>
col="13" row="9" value="0.0"/>
col="14" row="9" value="-0.33333334"/>
col="15" row="9" value="0.16666667"/>
col="16" row="9" value="0.25"/>
col="17" row="9" value="0.083333336"/>
col="18" row="9" value="-0.16666667"/>
col="19" row="9" value="0.16666667"/>
col="20" row="9" value="0.083333336"/>
col="21" row="9" value="0.083333336"/>
col="22" row="9" value="-0.16666667"/>
col="23" row="9" value="0.0"/>
col="0" row="10" value="-0.083333336"/>
col="1" row="10" value="-0.083333336"/>
col="2" row="10" value="0.083333336"/>
col="3" row="10" value="-0.083333336"/>
col="4" row="10" value="0.0"/>
col="5" row="10" value="0.083333336"/>
col="6" row="10" value="0.083333336"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

427

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="7" row="10" value="-0.25"/>


col="8" row="10" value="0.0"/>
col="9" row="10" value="0.16666667"/>
col="10" row="10" value="0.0"/>
col="11" row="10" value="-0.41666666"/>
col="12" row="10" value="0.083333336"/>
col="13" row="10" value="-0.083333336"/>
col="14" row="10" value="-0.083333336"/>
col="15" row="10" value="0.083333336"/>
col="16" row="10" value="0.16666667"/>
col="17" row="10" value="-0.16666667"/>
col="18" row="10" value="0.083333336"/>
col="19" row="10" value="0.083333336"/>
col="20" row="10" value="-0.16666667"/>
col="21" row="10" value="0.16666667"/>
col="22" row="10" value="0.083333336"/>
col="23" row="10" value="-0.083333336"/>
col="0" row="11" value="0.083333336"/>
col="1" row="11" value="0.083333336"/>
col="2" row="11" value="-0.083333336"/>
col="3" row="11" value="0.083333336"/>
col="4" row="11" value="0.0"/>
col="5" row="11" value="-0.083333336"/>
col="6" row="11" value="-0.083333336"/>
col="7" row="11" value="0.25"/>
col="8" row="11" value="0.0"/>
col="9" row="11" value="-0.16666667"/>
col="10" row="11" value="-0.41666666"/>
col="11" row="11" value="0.0"/>
col="12" row="11" value="-0.083333336"/>
col="13" row="11" value="0.083333336"/>
col="14" row="11" value="0.083333336"/>
col="15" row="11" value="-0.083333336"/>
col="16" row="11" value="-0.16666667"/>
col="17" row="11" value="0.16666667"/>
col="18" row="11" value="-0.083333336"/>
col="19" row="11" value="-0.083333336"/>
col="20" row="11" value="0.16666667"/>
col="21" row="11" value="-0.16666667"/>
col="22" row="11" value="-0.083333336"/>
col="23" row="11" value="0.083333336"/>
col="0" row="12" value="-0.083333336"/>
col="1" row="12" value="-0.083333336"/>
col="2" row="12" value="-0.083333336"/>
col="3" row="12" value="-0.083333336"/>
col="4" row="12" value="0.0"/>
col="5" row="12" value="0.083333336"/>
col="6" row="12" value="0.083333336"/>
col="7" row="12" value="-0.083333336"/>
col="8" row="12" value="0.16666667"/>
col="9" row="12" value="0.16666667"/>
col="10" row="12" value="0.083333336"/>
col="11" row="12" value="-0.083333336"/>
col="12" row="12" value="0.0"/>
col="13" row="12" value="0.083333336"/>
col="14" row="12" value="-0.25"/>
col="15" row="12" value="0.25"/>
col="16" row="12" value="0.16666667"/>
col="17" row="12" value="0.0"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

428

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="18" row="12" value="-0.083333336"/>


col="19" row="12" value="0.083333336"/>
col="20" row="12" value="0.0"/>
col="21" row="12" value="0.0"/>
col="22" row="12" value="-0.083333336"/>
col="23" row="12" value="-0.083333336"/>
col="0" row="13" value="0.083333336"/>
col="1" row="13" value="-0.25"/>
col="2" row="13" value="-0.25"/>
col="3" row="13" value="0.083333336"/>
col="4" row="13" value="-0.16666667"/>
col="5" row="13" value="0.25"/>
col="6" row="13" value="0.25"/>
col="7" row="13" value="-0.083333336"/>
col="8" row="13" value="0.16666667"/>
col="9" row="13" value="0.0"/>
col="10" row="13" value="-0.083333336"/>
col="11" row="13" value="0.083333336"/>
col="12" row="13" value="0.083333336"/>
col="13" row="13" value="0.0"/>
col="14" row="13" value="0.083333336"/>
col="15" row="13" value="0.083333336"/>
col="16" row="13" value="-0.16666667"/>
col="17" row="13" value="0.16666667"/>
col="18" row="13" value="0.083333336"/>
col="19" row="13" value="-0.083333336"/>
col="20" row="13" value="0.16666667"/>
col="21" row="13" value="-0.33333334"/>
col="22" row="13" value="-0.25"/>
col="23" row="13" value="0.083333336"/>
col="0" row="14" value="-0.083333336"/>
col="1" row="14" value="-0.083333336"/>
col="2" row="14" value="0.083333336"/>
col="3" row="14" value="-0.083333336"/>
col="4" row="14" value="-0.16666667"/>
col="5" row="14" value="0.083333336"/>
col="6" row="14" value="0.083333336"/>
col="7" row="14" value="0.083333336"/>
col="8" row="14" value="-0.16666667"/>
col="9" row="14" value="-0.33333334"/>
col="10" row="14" value="-0.083333336"/>
col="11" row="14" value="0.083333336"/>
col="12" row="14" value="-0.25"/>
col="13" row="14" value="0.083333336"/>
col="14" row="14" value="0.0"/>
col="15" row="14" value="-0.25"/>
col="16" row="14" value="-0.33333334"/>
col="17" row="14" value="0.0"/>
col="18" row="14" value="0.25"/>
col="19" row="14" value="-0.25"/>
col="20" row="14" value="0.0"/>
col="21" row="14" value="-0.16666667"/>
col="22" row="14" value="0.083333336"/>
col="23" row="14" value="0.083333336"/>
col="0" row="15" value="-0.083333336"/>
col="1" row="15" value="0.083333336"/>
col="2" row="15" value="0.083333336"/>
col="3" row="15" value="-0.083333336"/>
col="4" row="15" value="0.16666667"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

429

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="5" row="15" value="-0.083333336"/>


col="6" row="15" value="-0.083333336"/>
col="7" row="15" value="-0.083333336"/>
col="8" row="15" value="0.33333334"/>
col="9" row="15" value="0.16666667"/>
col="10" row="15" value="0.083333336"/>
col="11" row="15" value="-0.083333336"/>
col="12" row="15" value="0.25"/>
col="13" row="15" value="0.083333336"/>
col="14" row="15" value="-0.25"/>
col="15" row="15" value="0.0"/>
col="16" row="15" value="0.16666667"/>
col="17" row="15" value="-0.16666667"/>
col="18" row="15" value="-0.25"/>
col="19" row="15" value="0.25"/>
col="20" row="15" value="-0.16666667"/>
col="21" row="15" value="0.0"/>
col="22" row="15" value="0.083333336"/>
col="23" row="15" value="-0.25"/>
col="0" row="16" value="0.0"/>
col="1" row="16" value="0.16666667"/>
col="2" row="16" value="0.0"/>
col="3" row="16" value="0.0"/>
col="4" row="16" value="0.25"/>
col="5" row="16" value="-0.16666667"/>
col="6" row="16" value="-0.16666667"/>
col="7" row="16" value="0.0"/>
col="8" row="16" value="0.083333336"/>
col="9" row="16" value="0.25"/>
col="10" row="16" value="0.16666667"/>
col="11" row="16" value="-0.16666667"/>
col="12" row="16" value="0.16666667"/>
col="13" row="16" value="-0.16666667"/>
col="14" row="16" value="-0.33333334"/>
col="15" row="16" value="0.16666667"/>
col="16" row="16" value="0.0"/>
col="17" row="16" value="-0.083333336"/>
col="18" row="16" value="-0.16666667"/>
col="19" row="16" value="0.33333334"/>
col="20" row="16" value="-0.083333336"/>
col="21" row="16" value="0.25"/>
col="22" row="16" value="0.0"/>
col="23" row="16" value="-0.16666667"/>
col="0" row="17" value="0.16666667"/>
col="1" row="17" value="-0.16666667"/>
col="2" row="17" value="-0.33333334"/>
col="3" row="17" value="0.16666667"/>
col="4" row="17" value="-0.083333336"/>
col="5" row="17" value="0.16666667"/>
col="6" row="17" value="0.16666667"/>
col="7" row="17" value="0.0"/>
col="8" row="17" value="-0.083333336"/>
col="9" row="17" value="0.083333336"/>
col="10" row="17" value="-0.16666667"/>
col="11" row="17" value="0.16666667"/>
col="12" row="17" value="0.0"/>
col="13" row="17" value="0.16666667"/>
col="14" row="17" value="0.0"/>
col="15" row="17" value="-0.16666667"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

430

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="16" row="17" value="-0.083333336"/>


col="17" row="17" value="0.0"/>
col="18" row="17" value="0.0"/>
col="19" row="17" value="-0.16666667"/>
col="20" row="17" value="0.41666666"/>
col="21" row="17" value="-0.083333336"/>
col="22" row="17" value="-0.33333334"/>
col="23" row="17" value="0.33333334"/>
col="0" row="18" value="0.083333336"/>
col="1" row="18" value="-0.25"/>
col="2" row="18" value="-0.083333336"/>
col="3" row="18" value="0.083333336"/>
col="4" row="18" value="-0.33333334"/>
col="5" row="18" value="0.25"/>
col="6" row="18" value="0.25"/>
col="7" row="18" value="-0.083333336"/>
col="8" row="18" value="-0.16666667"/>
col="9" row="18" value="-0.16666667"/>
col="10" row="18" value="0.083333336"/>
col="11" row="18" value="-0.083333336"/>
col="12" row="18" value="-0.083333336"/>
col="13" row="18" value="0.083333336"/>
col="14" row="18" value="0.25"/>
col="15" row="18" value="-0.25"/>
col="16" row="18" value="-0.16666667"/>
col="17" row="18" value="0.0"/>
col="18" row="18" value="0.0"/>
col="19" row="18" value="-0.25"/>
col="20" row="18" value="0.0"/>
col="21" row="18" value="-0.16666667"/>
col="22" row="18" value="-0.083333336"/>
col="23" row="18" value="0.083333336"/>
col="0" row="19" value="-0.083333336"/>
col="1" row="19" value="0.25"/>
col="2" row="19" value="0.083333336"/>
col="3" row="19" value="-0.083333336"/>
col="4" row="19" value="0.33333334"/>
col="5" row="19" value="-0.25"/>
col="6" row="19" value="-0.25"/>
col="7" row="19" value="0.083333336"/>
col="8" row="19" value="0.16666667"/>
col="9" row="19" value="0.16666667"/>
col="10" row="19" value="0.083333336"/>
col="11" row="19" value="-0.083333336"/>
col="12" row="19" value="0.083333336"/>
col="13" row="19" value="-0.083333336"/>
col="14" row="19" value="-0.25"/>
col="15" row="19" value="0.25"/>
col="16" row="19" value="0.33333334"/>
col="17" row="19" value="-0.16666667"/>
col="18" row="19" value="-0.25"/>
col="19" row="19" value="0.0"/>
col="20" row="19" value="-0.16666667"/>
col="21" row="19" value="0.16666667"/>
col="22" row="19" value="0.083333336"/>
col="23" row="19" value="-0.25"/>
col="0" row="20" value="0.16666667"/>
col="1" row="20" value="-0.16666667"/>
col="2" row="20" value="-0.33333334"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

431

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight
<weight

col="3" row="20" value="0.16666667"/>


col="4" row="20" value="-0.083333336"/>
col="5" row="20" value="0.16666667"/>
col="6" row="20" value="0.16666667"/>
col="7" row="20" value="0.0"/>
col="8" row="20" value="-0.083333336"/>
col="9" row="20" value="0.083333336"/>
col="10" row="20" value="-0.16666667"/>
col="11" row="20" value="0.16666667"/>
col="12" row="20" value="0.0"/>
col="13" row="20" value="0.16666667"/>
col="14" row="20" value="0.0"/>
col="15" row="20" value="-0.16666667"/>
col="16" row="20" value="-0.083333336"/>
col="17" row="20" value="0.41666666"/>
col="18" row="20" value="0.0"/>
col="19" row="20" value="-0.16666667"/>
col="20" row="20" value="0.0"/>
col="21" row="20" value="-0.083333336"/>
col="22" row="20" value="-0.33333334"/>
col="23" row="20" value="0.33333334"/>
col="0" row="21" value="-0.16666667"/>
col="1" row="21" value="0.16666667"/>
col="2" row="21" value="0.16666667"/>
col="3" row="21" value="-0.16666667"/>
col="4" row="21" value="0.25"/>
col="5" row="21" value="-0.16666667"/>
col="6" row="21" value="-0.16666667"/>
col="7" row="21" value="0.0"/>
col="8" row="21" value="-0.083333336"/>
col="9" row="21" value="0.083333336"/>
col="10" row="21" value="0.16666667"/>
col="11" row="21" value="-0.16666667"/>
col="12" row="21" value="0.0"/>
col="13" row="21" value="-0.33333334"/>
col="14" row="21" value="-0.16666667"/>
col="15" row="21" value="0.0"/>
col="16" row="21" value="0.25"/>
col="17" row="21" value="-0.083333336"/>
col="18" row="21" value="-0.16666667"/>
col="19" row="21" value="0.16666667"/>
col="20" row="21" value="-0.083333336"/>
col="21" row="21" value="0.0"/>
col="22" row="21" value="0.16666667"/>
col="23" row="21" value="0.0"/>
col="0" row="22" value="-0.25"/>
col="1" row="22" value="0.25"/>
col="2" row="22" value="0.41666666"/>
col="3" row="22" value="-0.25"/>
col="4" row="22" value="0.16666667"/>
col="5" row="22" value="-0.25"/>
col="6" row="22" value="-0.25"/>
col="7" row="22" value="0.083333336"/>
col="8" row="22" value="0.0"/>
col="9" row="22" value="-0.16666667"/>
col="10" row="22" value="0.083333336"/>
col="11" row="22" value="-0.083333336"/>
col="12" row="22" value="-0.083333336"/>
col="13" row="22" value="-0.25"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

432

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<weight col="14" row="22" value="0.083333336"/>
<weight col="15" row="22" value="0.083333336"/>
<weight col="16" row="22" value="0.0"/>
<weight col="17" row="22" value="-0.33333334"/>
<weight col="18" row="22" value="-0.083333336"/>
<weight col="19" row="22" value="0.083333336"/>
<weight col="20" row="22" value="-0.33333334"/>
<weight col="21" row="22" value="0.16666667"/>
<weight col="22" row="22" value="0.0"/>
<weight col="23" row="22" value="-0.25"/>
<weight col="0" row="23" value="0.083333336"/>
<weight col="1" row="23" value="-0.25"/>
<weight col="2" row="23" value="-0.25"/>
<weight col="3" row="23" value="0.083333336"/>
<weight col="4" row="23" value="-0.16666667"/>
<weight col="5" row="23" value="0.25"/>
<weight col="6" row="23" value="0.25"/>
<weight col="7" row="23" value="-0.083333336"/>
<weight col="8" row="23" value="-0.16666667"/>
<weight col="9" row="23" value="0.0"/>
<weight col="10" row="23" value="-0.083333336"/>
<weight col="11" row="23" value="0.083333336"/>
<weight col="12" row="23" value="-0.083333336"/>
<weight col="13" row="23" value="0.083333336"/>
<weight col="14" row="23" value="0.083333336"/>
<weight col="15" row="23" value="-0.25"/>
<weight col="16" row="23" value="-0.16666667"/>
<weight col="17" row="23" value="0.33333334"/>
<weight col="18" row="23" value="0.083333336"/>
<weight col="19" row="23" value="-0.25"/>
<weight col="20" row="23" value="0.33333334"/>
<weight col="21" row="23" value="0.0"/>
<weight col="22" row="23" value="-0.25"/>
<weight col="23" row="23" value="0.0"/>
</weights>
<biasVector>
<bias ix="0" value="0.0"/>
<bias ix="1" value="0.0"/>
<bias ix="2" value="0.0"/>
<bias ix="3" value="0.0"/>
<bias ix="4" value="0.0"/>
<bias ix="5" value="0.0"/>
<bias ix="6" value="0.0"/>
<bias ix="7" value="0.0"/>
<bias ix="8" value="0.0"/>
<bias ix="9" value="0.0"/>
<bias ix="10" value="0.0"/>
<bias ix="11" value="0.0"/>
<bias ix="12" value="0.0"/>
<bias ix="13" value="0.0"/>
<bias ix="14" value="0.0"/>
<bias ix="15" value="0.0"/>
<bias ix="16" value="0.0"/>
<bias ix="17" value="0.0"/>
<bias ix="18" value="0.0"/>
<bias ix="19" value="0.0"/>
<bias ix="20" value="0.0"/>
<bias ix="21" value="0.0"/>
<bias ix="22" value="0.0"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

433

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<bias ix="23" value="0.0"/>
</biasVector>
<teacher class="com.jcortex.hopfield.DefaultHopfieldTeacher"/>
</neuralNetwork>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

434

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Modelo de Mapas de Kohonen


Configuracin de la Red y del Maestro:
Mapa de Kohonen,
con neuronas
hexagonales y
recogidas en un
plano. De 6 x 8
neuronas. La
funcin utilizada
para medir la
distancia entre los
ejemplos es la
Distancia Eucldea.
Esquema de la red entrenada:

Causas de parada del entrenamiento:


Razones de parada de los analizadores aglutinados:
{
....Detenido porque Ejemplos mal agrupados no decreca suficientemente bien.
a[o] = 0.23584905; a[m] = 0.18867925; a[n] = 0.24528302
....Variacin de Pesos (Media Abs.) no ha encontrado razones hasta ahora para detener
el entrenamiento.
}

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

435

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Resultados de los estadsticos:

Se puede apreciar como el conjunto de datos no logra ser analizado de forma


satisfactoria mediante un Mapa de Kohonen. Se aprecia en la grfica de ejemplos mal
agrupados como alrededor del 23% de los ejemplos del conjunto no logran ser
correctamente agrupados en una neurona pura, con otros ejemplos de su misma clase.
Este hecho se debe, en parte, a que cada ejemplo cuenta con un gran nmero de
atributos, de los cuales no se ha podido llegar a descartar ninguno por lo dispersa que
se encontraba la significancia. Adems parece que la seleccin de la clase no es
connatural a la diferencia entre los valores: la distancia natural tomada entre los
Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

436

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


elementos.
Un mayor nmero de neuronas se ha descartado ya que se producira gran cantidad de
clusters sin elementos.
Archivo de ejemplos:
aPromoters.txt (ver)
Nodo de configuracin XML generado:
<neuralNetwork class="com.jcortex.kohonen.KohonenNeuralNetwork"
inputTranslator="com.jcortex.translators.TransparentInputTranslator"
neighbourhoodShape="1" neuronCount="48"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
sensorCount="57">
<kmap class="com.jcortex.kohonen.SheetHexKMap" columns="8" rows="6"/>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="0"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.49221614"/> <entry entry="-2"
weight="0.42555952"/> <entry entry="-3" weight="0.5604756"/> <entry entry="4" weight="0.42844892"/> <entry entry="-5" weight="0.646903"/> <entry
entry="-6" weight="0.37402648"/> <entry entry="-7" weight="0.30356243"/>
<entry entry="-8" weight="0.83151835"/> <entry entry="-9"
weight="0.38037467"/> <entry entry="-10" weight="0.36698085"/> <entry
entry="-11" weight="0.20062664"/> <entry entry="-12" weight="0.65873593"/>
<entry entry="-13" weight="0.57604414"/> <entry entry="-14"
weight="0.56447977"/> <entry entry="-15" weight="0.41138303"/> <entry
entry="-16" weight="0.47764182"/> <entry entry="-17" weight="0.57738936"/>
<entry entry="-18" weight="0.4037699"/> <entry entry="-19"
weight="0.5801815"/> <entry entry="-20" weight="0.18617734"/> <entry entry="21" weight="0.12312682"/> <entry entry="-22" weight="0.1790131"/> <entry
entry="-23" weight="0.256644"/> <entry entry="-24" weight="0.70168644"/>
<entry entry="-25" weight="0.6187581"/> <entry entry="-26"
weight="0.58854914"/> <entry entry="-27" weight="0.6541532"/> <entry entry="28" weight="0.35783687"/> <entry entry="-29" weight="0.9738312"/> <entry
entry="-30" weight="0.630539"/> <entry entry="-31" weight="0.49092004"/>
<entry entry="-32" weight="0.093761064"/> <entry entry="-33"
weight="0.6926569"/> <entry entry="-34" weight="0.71236134"/> <entry entry="35" weight="0.5313366"/> <entry entry="-36" weight="0.6958836"/> <entry
entry="-37" weight="0.87861866"/> <entry entry="-38" weight="0.8226808"/>
<entry entry="-39" weight="0.71353203"/> <entry entry="-40"
weight="0.7764238"/> <entry entry="-41" weight="0.84159046"/> <entry entry="42" weight="0.75658697"/> <entry entry="-43" weight="0.6502058"/> <entry
entry="-44" weight="0.29240748"/> <entry entry="-45" weight="0.800418"/>
<entry entry="-46" weight="0.540604"/> <entry entry="-47"
weight="0.29367352"/> <entry entry="-48" weight="0.296251"/> <entry entry="49" weight="0.30206388"/> <entry entry="-50" weight="0.5566186"/> <entry
entry="-51" weight="0.5103126"/> <entry entry="-52" weight="0.14604226"/>
<entry entry="-53" weight="0.53064483"/> <entry entry="-54"
weight="0.7987473"/> <entry entry="-55" weight="0.021274399"/> <entry
entry="-56" weight="0.3763117"/> <entry entry="-57" weight="0.47270948"/>
</entries>
<examplesInClasses>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

437

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<examplesClassCount class="1.0" count="3"/> <examplesClassCount class="0.0"
count="4"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="1"
neuronClass="null">
<entries>
<entry entry="-1" weight="0.35465908"/> <entry entry="-2"
weight="0.45872912"/> <entry entry="-3" weight="0.4789079"/> <entry entry="4" weight="0.37331223"/> <entry entry="-5" weight="0.7180119"/> <entry
entry="-6" weight="0.43618664"/> <entry entry="-7" weight="0.32211617"/>
<entry entry="-8" weight="0.7534155"/> <entry entry="-9"
weight="0.47369656"/> <entry entry="-10" weight="0.44270146"/> <entry
entry="-11" weight="0.198977"/> <entry entry="-12" weight="0.6529839"/>
<entry entry="-13" weight="0.67099005"/> <entry entry="-14"
weight="0.59094185"/> <entry entry="-15" weight="0.34194726"/> <entry
entry="-16" weight="0.5239393"/> <entry entry="-17" weight="0.6689506"/>
<entry entry="-18" weight="0.45672053"/> <entry entry="-19"
weight="0.44730908"/> <entry entry="-20" weight="0.18386665"/> <entry
entry="-21" weight="0.22167242"/> <entry entry="-22" weight="0.14615107"/>
<entry entry="-23" weight="0.30389583"/> <entry entry="-24"
weight="0.72787124"/> <entry entry="-25" weight="0.6487001"/> <entry entry="26" weight="0.5696288"/> <entry entry="-27" weight="0.68683285"/> <entry
entry="-28" weight="0.28516817"/> <entry entry="-29" weight="0.8954435"/>
<entry entry="-30" weight="0.5624428"/> <entry entry="-31"
weight="0.45689937"/> <entry entry="-32" weight="0.15768439"/> <entry
entry="-33" weight="0.7361756"/> <entry entry="-34" weight="0.65673715"/>
<entry entry="-35" weight="0.5345044"/> <entry entry="-36"
weight="0.60786706"/> <entry entry="-37" weight="0.9054916"/> <entry entry="38" weight="0.7365634"/> <entry entry="-39" weight="0.6486838"/> <entry
entry="-40" weight="0.87646"/> <entry entry="-41" weight="0.7322775"/> <entry
entry="-42" weight="0.63953745"/> <entry entry="-43" weight="0.74549985"/>
<entry entry="-44" weight="0.31188217"/> <entry entry="-45"
weight="0.72438186"/> <entry entry="-46" weight="0.5623425"/> <entry entry="47" weight="0.23093364"/> <entry entry="-48" weight="0.22405972"/> <entry
entry="-49" weight="0.34166786"/> <entry entry="-50" weight="0.67516565"/>
<entry entry="-51" weight="0.556191"/> <entry entry="-52"
weight="0.19625047"/> <entry entry="-53" weight="0.44313887"/> <entry
entry="-54" weight="0.7845372"/> <entry entry="-55" weight="0.04043218"/>
<entry entry="-56" weight="0.31414008"/> <entry entry="-57"
weight="0.35504606"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="2"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.39951828"/> <entry entry="-2"
weight="0.45626068"/> <entry entry="-3" weight="0.47267503"/> <entry entry="4" weight="0.36665905"/> <entry entry="-5" weight="0.6811618"/> <entry
entry="-6" weight="0.49153075"/> <entry entry="-7" weight="0.36066425"/>
<entry entry="-8" weight="0.7478222"/> <entry entry="-9" weight="0.4696888"/>
<entry entry="-10" weight="0.4706001"/> <entry entry="-11"
weight="0.2142697"/> <entry entry="-12" weight="0.6332015"/> <entry entry="13" weight="0.7382133"/> <entry entry="-14" weight="0.54939884"/> <entry
entry="-15" weight="0.332459"/> <entry entry="-16" weight="0.5469177"/>
<entry entry="-17" weight="0.7030398"/> <entry entry="-18"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

438

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.44244906"/> <entry entry="-19" weight="0.4293024"/> <entry entry="20" weight="0.15679953"/> <entry entry="-21" weight="0.27165252"/> <entry
entry="-22" weight="0.18024749"/> <entry entry="-23" weight="0.3234964"/>
<entry entry="-24" weight="0.7131204"/> <entry entry="-25"
weight="0.6704207"/> <entry entry="-26" weight="0.5284261"/> <entry entry="27" weight="0.68445647"/> <entry entry="-28" weight="0.25568488"/> <entry
entry="-29" weight="0.8744471"/> <entry entry="-30" weight="0.5905634"/>
<entry entry="-31" weight="0.42207992"/> <entry entry="-32"
weight="0.115661435"/> <entry entry="-33" weight="0.7926881"/> <entry
entry="-34" weight="0.6071801"/> <entry entry="-35" weight="0.48130053"/>
<entry entry="-36" weight="0.6302914"/> <entry entry="-37"
weight="0.874953"/> <entry entry="-38" weight="0.7165415"/> <entry entry="39" weight="0.6992448"/> <entry entry="-40" weight="0.9368913"/> <entry
entry="-41" weight="0.7493421"/> <entry entry="-42" weight="0.6644"/> <entry
entry="-43" weight="0.811373"/> <entry entry="-44" weight="0.30019608"/>
<entry entry="-45" weight="0.80231875"/> <entry entry="-46"
weight="0.52497554"/> <entry entry="-47" weight="0.18966426"/> <entry
entry="-48" weight="0.23669672"/> <entry entry="-49" weight="0.4080788"/>
<entry entry="-50" weight="0.70361197"/> <entry entry="-51"
weight="0.58877623"/> <entry entry="-52" weight="0.1782003"/> <entry entry="53" weight="0.5133717"/> <entry entry="-54" weight="0.8263915"/> <entry
entry="-55" weight="0.06980166"/> <entry entry="-56" weight="0.30643508"/>
<entry entry="-57" weight="0.39334062"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="3"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.31982797"/> <entry entry="-2"
weight="0.1455884"/> <entry entry="-3" weight="0.5547928"/> <entry entry="-4"
weight="0.2005755"/> <entry entry="-5" weight="0.52805436"/> <entry entry="6" weight="0.5175274"/> <entry entry="-7" weight="0.30419517"/> <entry
entry="-8" weight="0.55049926"/> <entry entry="-9" weight="0.57384205"/>
<entry entry="-10" weight="0.7184476"/> <entry entry="-11"
weight="0.3646818"/> <entry entry="-12" weight="0.41691163"/> <entry entry="13" weight="0.64328474"/> <entry entry="-14" weight="0.54678196"/> <entry
entry="-15" weight="0.36197942"/> <entry entry="-16" weight="0.68159413"/>
<entry entry="-17" weight="0.48394963"/> <entry entry="-18"
weight="0.54044783"/> <entry entry="-19" weight="0.1050296"/> <entry entry="20" weight="0.35427013"/> <entry entry="-21" weight="0.3845269"/> <entry
entry="-22" weight="0.28060004"/> <entry entry="-23" weight="0.28099665"/>
<entry entry="-24" weight="0.71931595"/> <entry entry="-25"
weight="0.64965796"/> <entry entry="-26" weight="0.55019313"/> <entry
entry="-27" weight="0.48257187"/> <entry entry="-28" weight="0.27877343"/>
<entry entry="-29" weight="0.79459286"/> <entry entry="-30"
weight="0.2895898"/> <entry entry="-31" weight="0.31969368"/> <entry entry="32" weight="0.2652351"/> <entry entry="-33" weight="0.76404494"/> <entry
entry="-34" weight="0.65840316"/> <entry entry="-35" weight="0.41055852"/>
<entry entry="-36" weight="0.62033427"/> <entry entry="-37"
weight="0.86557937"/> <entry entry="-38" weight="0.5619223"/> <entry entry="39" weight="0.41614917"/> <entry entry="-40" weight="0.77181554"/> <entry
entry="-41" weight="0.5491008"/> <entry entry="-42" weight="0.4143539"/>
<entry entry="-43" weight="0.75053716"/> <entry entry="-44"
weight="0.2883105"/> <entry entry="-45" weight="0.525621"/> <entry entry="-

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

439

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


46" weight="0.5100949"/> <entry entry="-47" weight="0.40827358"/> <entry
entry="-48" weight="0.40905145"/> <entry entry="-49" weight="0.5403618"/>
<entry entry="-50" weight="0.70895654"/> <entry entry="-51"
weight="0.45602313"/> <entry entry="-52" weight="0.37377882"/> <entry
entry="-53" weight="0.2847839"/> <entry entry="-54" weight="0.8514939"/>
<entry entry="-55" weight="0.07789549"/> <entry entry="-56"
weight="0.49509108"/> <entry entry="-57" weight="0.35409176"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="4"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.47857177"/> <entry entry="-2"
weight="0.1324099"/> <entry entry="-3" weight="0.693247"/> <entry entry="-4"
weight="0.48441485"/> <entry entry="-5" weight="0.25301957"/> <entry entry="6" weight="0.49631277"/> <entry entry="-7" weight="0.4548292"/> <entry
entry="-8" weight="0.42352638"/> <entry entry="-9" weight="0.2994064"/>
<entry entry="-10" weight="0.29651666"/> <entry entry="-11"
weight="0.38458186"/> <entry entry="-12" weight="0.70486313"/> <entry
entry="-13" weight="0.38948232"/> <entry entry="-14" weight="0.70050305"/>
<entry entry="-15" weight="0.6424996"/> <entry entry="-16"
weight="0.42240393"/> <entry entry="-17" weight="0.33290714"/> <entry
entry="-18" weight="0.26374725"/> <entry entry="-19" weight="0.49456283"/>
<entry entry="-20" weight="0.33435246"/> <entry entry="-21"
weight="0.38158536"/> <entry entry="-22" weight="0.5458811"/> <entry entry="23" weight="0.17974861"/> <entry entry="-24" weight="0.47287747"/> <entry
entry="-25" weight="0.3686818"/> <entry entry="-26" weight="0.5712999"/>
<entry entry="-27" weight="0.45038664"/> <entry entry="-28"
weight="0.6914266"/> <entry entry="-29" weight="0.7837686"/> <entry entry="30" weight="0.6821626"/> <entry entry="-31" weight="0.6131736"/> <entry
entry="-32" weight="0.25411022"/> <entry entry="-33" weight="0.4971209"/>
<entry entry="-34" weight="0.79530764"/> <entry entry="-35"
weight="0.429061"/> <entry entry="-36" weight="0.58835006"/> <entry entry="37" weight="0.74052596"/> <entry entry="-38" weight="0.44913143"/> <entry
entry="-39" weight="0.6861573"/> <entry entry="-40" weight="0.36820036"/>
<entry entry="-41" weight="0.5567043"/> <entry entry="-42"
weight="0.560668"/> <entry entry="-43" weight="0.37069115"/> <entry entry="44" weight="0.43041736"/> <entry entry="-45" weight="0.661705"/> <entry
entry="-46" weight="0.76276785"/> <entry entry="-47" weight="0.6868418"/>
<entry entry="-48" weight="0.4173379"/> <entry entry="-49"
weight="0.17301789"/> <entry entry="-50" weight="0.44644266"/> <entry
entry="-51" weight="0.47257137"/> <entry entry="-52" weight="0.24198036"/>
<entry entry="-53" weight="0.5437949"/> <entry entry="-54"
weight="0.8516322"/> <entry entry="-55" weight="0.09668637"/> <entry entry="56" weight="0.7728646"/> <entry entry="-57" weight="0.50004625"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="5"
neuronClass="0.0">
<entries>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

440

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entry entry="-1" weight="0.5352625"/> <entry entry="-2"
weight="0.31110328"/> <entry entry="-3" weight="0.7394371"/> <entry entry="4" weight="0.51975846"/> <entry entry="-5" weight="0.36864203"/> <entry
entry="-6" weight="0.30601662"/> <entry entry="-7" weight="0.2762812"/>
<entry entry="-8" weight="0.44860804"/> <entry entry="-9"
weight="0.34535462"/> <entry entry="-10" weight="0.24894463"/> <entry
entry="-11" weight="0.38972506"/> <entry entry="-12" weight="0.63902265"/>
<entry entry="-13" weight="0.26085728"/> <entry entry="-14"
weight="0.6487766"/> <entry entry="-15" weight="0.7447883"/> <entry entry="16" weight="0.43070015"/> <entry entry="-17" weight="0.18817489"/> <entry
entry="-18" weight="0.31242275"/> <entry entry="-19" weight="0.596017"/>
<entry entry="-20" weight="0.5081291"/> <entry entry="-21"
weight="0.234093"/> <entry entry="-22" weight="0.52966857"/> <entry entry="23" weight="0.2859169"/> <entry entry="-24" weight="0.38394648"/> <entry
entry="-25" weight="0.27154502"/> <entry entry="-26" weight="0.8012119"/>
<entry entry="-27" weight="0.2943329"/> <entry entry="-28"
weight="0.72936493"/> <entry entry="-29" weight="0.6979279"/> <entry entry="30" weight="0.7419088"/> <entry entry="-31" weight="0.61652845"/> <entry
entry="-32" weight="0.46838608"/> <entry entry="-33" weight="0.24337071"/>
<entry entry="-34" weight="0.82044464"/> <entry entry="-35"
weight="0.5796553"/> <entry entry="-36" weight="0.71357226"/> <entry entry="37" weight="0.83310366"/> <entry entry="-38" weight="0.5125545"/> <entry
entry="-39" weight="0.51485777"/> <entry entry="-40" weight="0.12168399"/>
<entry entry="-41" weight="0.7037415"/> <entry entry="-42"
weight="0.6213326"/> <entry entry="-43" weight="0.11669605"/> <entry entry="44" weight="0.4780789"/> <entry entry="-45" weight="0.6758096"/> <entry
entry="-46" weight="0.7383983"/> <entry entry="-47" weight="0.87860477"/>
<entry entry="-48" weight="0.4606642"/> <entry entry="-49"
weight="0.2317192"/> <entry entry="-50" weight="0.3508876"/> <entry entry="51" weight="0.3492964"/> <entry entry="-52" weight="0.48519427"/> <entry
entry="-53" weight="0.5530391"/> <entry entry="-54" weight="0.69291055"/>
<entry entry="-55" weight="0.19439563"/> <entry entry="-56"
weight="0.8202158"/> <entry entry="-57" weight="0.5223155"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="6"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.3730325"/> <entry entry="-2"
weight="0.45000178"/> <entry entry="-3" weight="0.4837341"/> <entry entry="4" weight="0.37699425"/> <entry entry="-5" weight="0.72189486"/> <entry
entry="-6" weight="0.4327911"/> <entry entry="-7" weight="0.3313594"/> <entry
entry="-8" weight="0.7740556"/> <entry entry="-9" weight="0.45294777"/>
<entry entry="-10" weight="0.44473386"/> <entry entry="-11"
weight="0.19159336"/> <entry entry="-12" weight="0.6630855"/> <entry entry="13" weight="0.6683285"/> <entry entry="-14" weight="0.61947495"/> <entry
entry="-15" weight="0.3487469"/> <entry entry="-16" weight="0.50736564"/>
<entry entry="-17" weight="0.64639175"/> <entry entry="-18"
weight="0.4534204"/> <entry entry="-19" weight="0.45016584"/> <entry entry="20" weight="0.18582162"/> <entry entry="-21" weight="0.2180871"/> <entry
entry="-22" weight="0.13574447"/> <entry entry="-23" weight="0.3194044"/>
<entry entry="-24" weight="0.7415368"/> <entry entry="-25"
weight="0.6597027"/> <entry entry="-26" weight="0.55547315"/> <entry entry="27" weight="0.6958301"/> <entry entry="-28" weight="0.28925902"/> <entry
entry="-29" weight="0.8895189"/> <entry entry="-30" weight="0.5418955"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

441

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entry entry="-31" weight="0.4619118"/> <entry entry="-32"
weight="0.14856559"/> <entry entry="-33" weight="0.7353481"/> <entry entry="34" weight="0.66844845"/> <entry entry="-35" weight="0.5367346"/> <entry
entry="-36" weight="0.5918486"/> <entry entry="-37" weight="0.8931445"/>
<entry entry="-38" weight="0.74005544"/> <entry entry="-39"
weight="0.660032"/> <entry entry="-40" weight="0.8772229"/> <entry entry="41" weight="0.75198865"/> <entry entry="-42" weight="0.6417098"/> <entry
entry="-43" weight="0.75158507"/> <entry entry="-44" weight="0.3025652"/>
<entry entry="-45" weight="0.72219396"/> <entry entry="-46"
weight="0.5454778"/> <entry entry="-47" weight="0.24441306"/> <entry entry="48" weight="0.2174714"/> <entry entry="-49" weight="0.34096122"/> <entry
entry="-50" weight="0.66303355"/> <entry entry="-51" weight="0.57192"/>
<entry entry="-52" weight="0.18432593"/> <entry entry="-53"
weight="0.42845815"/> <entry entry="-54" weight="0.7797404"/> <entry entry="55" weight="0.031199513"/> <entry entry="-56" weight="0.31531996"/> <entry
entry="-57" weight="0.37525418"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="7"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.65045345"/> <entry entry="-2"
weight="0.27044204"/> <entry entry="-3" weight="0.28687435"/> <entry entry="4" weight="0.35217994"/> <entry entry="-5" weight="0.4135851"/> <entry
entry="-6" weight="0.70238686"/> <entry entry="-7" weight="0.614542"/> <entry
entry="-8" weight="0.46586916"/> <entry entry="-9" weight="0.2719544"/>
<entry entry="-10" weight="0.68685865"/> <entry entry="-11"
weight="0.12618443"/> <entry entry="-12" weight="0.38096023"/> <entry
entry="-13" weight="0.4408111"/> <entry entry="-14" weight="0.74658155"/>
<entry entry="-15" weight="0.20724155"/> <entry entry="-16"
weight="0.31759012"/> <entry entry="-17" weight="0.6727879"/> <entry entry="18" weight="0.5247361"/> <entry entry="-19" weight="0.25795817"/> <entry
entry="-20" weight="0.36578363"/> <entry entry="-21" weight="0.42448613"/>
<entry entry="-22" weight="0.23257619"/> <entry entry="-23"
weight="0.599388"/> <entry entry="-24" weight="0.56854916"/> <entry entry="25" weight="0.81203425"/> <entry entry="-26" weight="0.3039204"/> <entry
entry="-27" weight="0.42221314"/> <entry entry="-28" weight="0.5567306"/>
<entry entry="-29" weight="0.77919966"/> <entry entry="-30"
weight="0.6053847"/> <entry entry="-31" weight="0.38481086"/> <entry entry="32" weight="0.070147194"/> <entry entry="-33" weight="0.6086406"/> <entry
entry="-34" weight="0.77233595"/> <entry entry="-35" weight="0.4255682"/>
<entry entry="-36" weight="0.3739069"/> <entry entry="-37"
weight="0.91370064"/> <entry entry="-38" weight="0.8243662"/> <entry entry="39" weight="0.42566913"/> <entry entry="-40" weight="0.83131784"/> <entry
entry="-41" weight="0.59197557"/> <entry entry="-42" weight="0.53231496"/>
<entry entry="-43" weight="0.48070806"/> <entry entry="-44"
weight="0.17645651"/> <entry entry="-45" weight="0.8798241"/> <entry entry="46" weight="0.4390755"/> <entry entry="-47" weight="0.123005144"/> <entry
entry="-48" weight="0.13414617"/> <entry entry="-49" weight="0.6379539"/>
<entry entry="-50" weight="0.5474654"/> <entry entry="-51"
weight="0.3578719"/> <entry entry="-52" weight="0.096595176"/> <entry
entry="-53" weight="0.5593533"/> <entry entry="-54" weight="0.4990533"/>
<entry entry="-55" weight="0.03167846"/> <entry entry="-56"
weight="0.32392734"/> <entry entry="-57" weight="0.6474187"/>
</entries>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

442

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<examplesInClasses>
<examplesClassCount class="1.0" count="2"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="8"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.6711149"/> <entry entry="-2"
weight="0.13217193"/> <entry entry="-3" weight="0.30311817"/> <entry entry="4" weight="0.3333754"/> <entry entry="-5" weight="0.23788919"/> <entry
entry="-6" weight="0.7543818"/> <entry entry="-7" weight="0.63576895"/>
<entry entry="-8" weight="0.30693978"/> <entry entry="-9"
weight="0.32485148"/> <entry entry="-10" weight="0.9243849"/> <entry entry="11" weight="0.30618286"/> <entry entry="-12" weight="0.27855894"/> <entry
entry="-13" weight="0.38526273"/> <entry entry="-14" weight="0.7589376"/>
<entry entry="-15" weight="0.30710626"/> <entry entry="-16"
weight="0.4409641"/> <entry entry="-17" weight="0.6170359"/> <entry entry="18" weight="0.6503862"/> <entry entry="-19" weight="0.11858011"/> <entry
entry="-20" weight="0.39484543"/> <entry entry="-21" weight="0.5845042"/>
<entry entry="-22" weight="0.38193423"/> <entry entry="-23"
weight="0.690436"/> <entry entry="-24" weight="0.6323353"/> <entry entry="25" weight="0.7843242"/> <entry entry="-26" weight="0.27339703"/> <entry
entry="-27" weight="0.2032395"/> <entry entry="-28" weight="0.6310811"/>
<entry entry="-29" weight="0.7283938"/> <entry entry="-30"
weight="0.42748463"/> <entry entry="-31" weight="0.3195737"/> <entry entry="32" weight="0.16022937"/> <entry entry="-33" weight="0.6866232"/> <entry
entry="-34" weight="0.75932795"/> <entry entry="-35" weight="0.4382176"/>
<entry entry="-36" weight="0.45154515"/> <entry entry="-37"
weight="0.92685395"/> <entry entry="-38" weight="0.82641697"/> <entry
entry="-39" weight="0.30500257"/> <entry entry="-40" weight="0.72955614"/>
<entry entry="-41" weight="0.53204095"/> <entry entry="-42"
weight="0.40421957"/> <entry entry="-43" weight="0.41884917"/> <entry
entry="-44" weight="0.09270316"/> <entry entry="-45" weight="0.84957105"/>
<entry entry="-46" weight="0.38365522"/> <entry entry="-47"
weight="0.29609126"/> <entry entry="-48" weight="0.36190665"/> <entry
entry="-49" weight="0.7407195"/> <entry entry="-50" weight="0.46289125"/>
<entry entry="-51" weight="0.37220383"/> <entry entry="-52"
weight="0.18120539"/> <entry entry="-53" weight="0.53118026"/> <entry
entry="-54" weight="0.48194352"/> <entry entry="-55" weight="0.18904115"/>
<entry entry="-56" weight="0.4916676"/> <entry entry="-57"
weight="0.77231544"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="9"
neuronClass="null">
<entries>
<entry entry="-1" weight="0.7476748"/> <entry entry="-2"
weight="0.08694561"/> <entry entry="-3" weight="0.39226612"/> <entry entry="4" weight="0.35732165"/> <entry entry="-5" weight="0.21395877"/> <entry
entry="-6" weight="0.665963"/> <entry entry="-7" weight="0.57241184"/> <entry
entry="-8" weight="0.3678345"/> <entry entry="-9" weight="0.25413722"/>
<entry entry="-10" weight="0.7945488"/> <entry entry="-11" weight="0.26474"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

443

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entry entry="-12" weight="0.2758323"/> <entry entry="-13"
weight="0.2727085"/> <entry entry="-14" weight="0.75738215"/> <entry entry="15" weight="0.36115098"/> <entry entry="-16" weight="0.40663382"/> <entry
entry="-17" weight="0.5012547"/> <entry entry="-18" weight="0.56292355"/>
<entry entry="-19" weight="0.22525533"/> <entry entry="-20"
weight="0.43468705"/> <entry entry="-21" weight="0.4345541"/> <entry entry="22" weight="0.37396774"/> <entry entry="-23" weight="0.6007023"/> <entry
entry="-24" weight="0.5794548"/> <entry entry="-25" weight="0.76759934"/>
<entry entry="-26" weight="0.34626696"/> <entry entry="-27"
weight="0.19613935"/> <entry entry="-28" weight="0.6948836"/> <entry entry="29" weight="0.7842662"/> <entry entry="-30" weight="0.49515182"/> <entry
entry="-31" weight="0.35965112"/> <entry entry="-32" weight="0.11093835"/>
<entry entry="-33" weight="0.5806552"/> <entry entry="-34"
weight="0.84399444"/> <entry entry="-35" weight="0.40945184"/> <entry
entry="-36" weight="0.5091549"/> <entry entry="-37" weight="0.9211757"/>
<entry entry="-38" weight="0.86094147"/> <entry entry="-39"
weight="0.3397054"/> <entry entry="-40" weight="0.6115648"/> <entry entry="41" weight="0.60425425"/> <entry entry="-42" weight="0.4973562"/> <entry
entry="-43" weight="0.32040992"/> <entry entry="-44" weight="0.11020539"/>
<entry entry="-45" weight="0.84522057"/> <entry entry="-46"
weight="0.38927975"/> <entry entry="-47" weight="0.37298876"/> <entry
entry="-48" weight="0.37529272"/> <entry entry="-49" weight="0.6733208"/>
<entry entry="-50" weight="0.38337147"/> <entry entry="-51"
weight="0.28949946"/> <entry entry="-52" weight="0.15879497"/> <entry
entry="-53" weight="0.5750031"/> <entry entry="-54" weight="0.5087272"/>
<entry entry="-55" weight="0.10956643"/> <entry entry="-56"
weight="0.5230465"/> <entry entry="-57" weight="0.8130924"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="10"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.6740594"/> <entry entry="-2"
weight="0.33413345"/> <entry entry="-3" weight="0.64834"/> <entry entry="-4"
weight="0.5832648"/> <entry entry="-5" weight="0.19975841"/> <entry entry="6" weight="0.46694452"/> <entry entry="-7" weight="0.43366092"/> <entry
entry="-8" weight="0.40657198"/> <entry entry="-9" weight="0.36270273"/>
<entry entry="-10" weight="0.47393367"/> <entry entry="-11"
weight="0.5183089"/> <entry entry="-12" weight="0.67099553"/> <entry entry="13" weight="0.26572526"/> <entry entry="-14" weight="0.67864686"/> <entry
entry="-15" weight="0.9333759"/> <entry entry="-16" weight="0.41794798"/>
<entry entry="-17" weight="0.38872972"/> <entry entry="-18"
weight="0.38909706"/> <entry entry="-19" weight="0.66779006"/> <entry
entry="-20" weight="0.39638028"/> <entry entry="-21" weight="0.3770911"/>
<entry entry="-22" weight="0.57597995"/> <entry entry="-23"
weight="0.43612617"/> <entry entry="-24" weight="0.5312053"/> <entry entry="25" weight="0.40341836"/> <entry entry="-26" weight="0.67113435"/> <entry
entry="-27" weight="0.17602906"/> <entry entry="-28" weight="0.9179091"/>
<entry entry="-29" weight="0.78087974"/> <entry entry="-30"
weight="0.64348525"/> <entry entry="-31" weight="0.54114836"/> <entry
entry="-32" weight="0.40268844"/> <entry entry="-33" weight="0.53660953"/>
<entry entry="-34" weight="0.84231377"/> <entry entry="-35"
weight="0.6007485"/> <entry entry="-36" weight="0.7918919"/> <entry entry="37" weight="0.7822946"/> <entry entry="-38" weight="0.56887376"/> <entry
entry="-39" weight="0.7257467"/> <entry entry="-40" weight="0.30158746"/>
<entry entry="-41" weight="0.78902555"/> <entry entry="-42"
weight="0.57648194"/> <entry entry="-43" weight="0.17291743"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

444

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-44" weight="0.26169783"/> <entry entry="-45" weight="0.89602727"/>
<entry entry="-46" weight="0.5729004"/> <entry entry="-47"
weight="0.9092334"/> <entry entry="-48" weight="0.69845"/> <entry entry="-49"
weight="0.145417"/> <entry entry="-50" weight="0.26171288"/> <entry entry="51" weight="0.5364832"/> <entry entry="-52" weight="0.21995302"/> <entry
entry="-53" weight="0.7351616"/> <entry entry="-54" weight="0.6034008"/>
<entry entry="-55" weight="0.40093482"/> <entry entry="-56"
weight="0.9158098"/> <entry entry="-57" weight="0.7533376"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="11"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.74924624"/> <entry entry="-2"
weight="0.24855395"/> <entry entry="-3" weight="0.71437794"/> <entry entry="4" weight="0.44009966"/> <entry entry="-5" weight="0.25319147"/> <entry
entry="-6" weight="0.3118436"/> <entry entry="-7" weight="0.40269005"/>
<entry entry="-8" weight="0.6011416"/> <entry entry="-9"
weight="0.36686146"/> <entry entry="-10" weight="0.34617004"/> <entry
entry="-11" weight="0.41823596"/> <entry entry="-12" weight="0.591143"/>
<entry entry="-13" weight="0.30724508"/> <entry entry="-14"
weight="0.56254417"/> <entry entry="-15" weight="0.8546159"/> <entry entry="16" weight="0.29093018"/> <entry entry="-17" weight="0.20195657"/> <entry
entry="-18" weight="0.2754004"/> <entry entry="-19" weight="0.6188535"/>
<entry entry="-20" weight="0.5689237"/> <entry entry="-21"
weight="0.21009426"/> <entry entry="-22" weight="0.41164476"/> <entry
entry="-23" weight="0.35204282"/> <entry entry="-24" weight="0.4330601"/>
<entry entry="-25" weight="0.36288387"/> <entry entry="-26"
weight="0.8128796"/> <entry entry="-27" weight="0.22021556"/> <entry entry="28" weight="0.8801797"/> <entry entry="-29" weight="0.87043333"/> <entry
entry="-30" weight="0.6582846"/> <entry entry="-31" weight="0.55078685"/>
<entry entry="-32" weight="0.3788155"/> <entry entry="-33"
weight="0.37657967"/> <entry entry="-34" weight="0.91393787"/> <entry
entry="-35" weight="0.54940325"/> <entry entry="-36" weight="0.5823771"/>
<entry entry="-37" weight="0.7184359"/> <entry entry="-38"
weight="0.50512934"/> <entry entry="-39" weight="0.70920366"/> <entry
entry="-40" weight="0.30152538"/> <entry entry="-41" weight="0.85229164"/>
<entry entry="-42" weight="0.56056935"/> <entry entry="-43"
weight="0.28698438"/> <entry entry="-44" weight="0.34246024"/> <entry
entry="-45" weight="0.82025313"/> <entry entry="-46" weight="0.50913393"/>
<entry entry="-47" weight="0.83070487"/> <entry entry="-48"
weight="0.651222"/> <entry entry="-49" weight="0.25638908"/> <entry entry="50" weight="0.4005928"/> <entry entry="-51" weight="0.38203007"/> <entry
entry="-52" weight="0.25170362"/> <entry entry="-53" weight="0.60336876"/>
<entry entry="-54" weight="0.5550172"/> <entry entry="-55"
weight="0.2445909"/> <entry entry="-56" weight="0.8542425"/> <entry entry="57" weight="0.6350972"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="12"
neuronClass="0.0">

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

445

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entries>
<entry entry="-1" weight="0.5915879"/> <entry entry="-2"
weight="0.48731646"/> <entry entry="-3" weight="0.55646706"/> <entry entry="4" weight="0.40673047"/> <entry entry="-5" weight="0.68459094"/> <entry
entry="-6" weight="0.36252457"/> <entry entry="-7" weight="0.27360612"/>
<entry entry="-8" weight="0.87504584"/> <entry entry="-9"
weight="0.4520819"/> <entry entry="-10" weight="0.4062805"/> <entry entry="11" weight="0.20052007"/> <entry entry="-12" weight="0.6074952"/> <entry
entry="-13" weight="0.53885484"/> <entry entry="-14" weight="0.51992446"/>
<entry entry="-15" weight="0.4970743"/> <entry entry="-16"
weight="0.45360544"/> <entry entry="-17" weight="0.5459"/> <entry entry="-18"
weight="0.38589752"/> <entry entry="-19" weight="0.6213362"/> <entry entry="20" weight="0.27916926"/> <entry entry="-21" weight="0.060963456"/> <entry
entry="-22" weight="0.10896244"/> <entry entry="-23" weight="0.32699788"/>
<entry entry="-24" weight="0.6716241"/> <entry entry="-25"
weight="0.64815205"/> <entry entry="-26" weight="0.6629099"/> <entry entry="27" weight="0.57874554"/> <entry entry="-28" weight="0.42051372"/> <entry
entry="-29" weight="0.9585512"/> <entry entry="-30" weight="0.62314475"/>
<entry entry="-31" weight="0.42891693"/> <entry entry="-32"
weight="0.15671559"/> <entry entry="-33" weight="0.63794196"/> <entry
entry="-34" weight="0.75570375"/> <entry entry="-35" weight="0.54741424"/>
<entry entry="-36" weight="0.71495646"/> <entry entry="-37"
weight="0.8871094"/> <entry entry="-38" weight="0.7789102"/> <entry entry="39" weight="0.7113825"/> <entry entry="-40" weight="0.7718964"/> <entry
entry="-41" weight="0.9398449"/> <entry entry="-42" weight="0.76864475"/>
<entry entry="-43" weight="0.604589"/> <entry entry="-44"
weight="0.24322847"/> <entry entry="-45" weight="0.8587304"/> <entry entry="46" weight="0.4581921"/> <entry entry="-47" weight="0.37508062"/> <entry
entry="-48" weight="0.3530795"/> <entry entry="-49" weight="0.32257974"/>
<entry entry="-50" weight="0.55443776"/> <entry entry="-51"
weight="0.48917922"/> <entry entry="-52" weight="0.13857025"/> <entry
entry="-53" weight="0.57867664"/> <entry entry="-54" weight="0.7271591"/>
<entry entry="-55" weight="0.08389531"/> <entry entry="-56"
weight="0.40878257"/> <entry entry="-57" weight="0.52047825"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="4"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="13"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.6270153"/> <entry entry="-2"
weight="0.26507032"/> <entry entry="-3" weight="0.2931093"/> <entry entry="4" weight="0.36461502"/> <entry entry="-5" weight="0.43498105"/> <entry
entry="-6" weight="0.66168314"/> <entry entry="-7" weight="0.5980439"/>
<entry entry="-8" weight="0.46915862"/> <entry entry="-9"
weight="0.2821927"/> <entry entry="-10" weight="0.6661231"/> <entry entry="11" weight="0.11460001"/> <entry entry="-12" weight="0.40073246"/> <entry
entry="-13" weight="0.39605245"/> <entry entry="-14" weight="0.76377976"/>
<entry entry="-15" weight="0.20480503"/> <entry entry="-16"
weight="0.31012827"/> <entry entry="-17" weight="0.65399927"/> <entry
entry="-18" weight="0.5309178"/> <entry entry="-19" weight="0.27617496"/>
<entry entry="-20" weight="0.3750461"/> <entry entry="-21"
weight="0.39033228"/> <entry entry="-22" weight="0.20761037"/> <entry
entry="-23" weight="0.58931506"/> <entry entry="-24" weight="0.58061117"/>
<entry entry="-25" weight="0.79267573"/> <entry entry="-26"
weight="0.33012408"/> <entry entry="-27" weight="0.4120209"/> <entry entry="-

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

446

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


28" weight="0.5767143"/> <entry entry="-29" weight="0.80095136"/> <entry
entry="-30" weight="0.5902237"/> <entry entry="-31" weight="0.4132612"/>
<entry entry="-32" weight="0.090849355"/> <entry entry="-33"
weight="0.5694683"/> <entry entry="-34" weight="0.8031853"/> <entry entry="35" weight="0.4470556"/> <entry entry="-36" weight="0.35288107"/> <entry
entry="-37" weight="0.9392649"/> <entry entry="-38" weight="0.84563124"/>
<entry entry="-39" weight="0.3942761"/> <entry entry="-40"
weight="0.7928095"/> <entry entry="-41" weight="0.57485723"/> <entry entry="42" weight="0.5182501"/> <entry entry="-43" weight="0.4460796"/> <entry
entry="-44" weight="0.18021925"/> <entry entry="-45" weight="0.83654934"/>
<entry entry="-46" weight="0.46728644"/> <entry entry="-47"
weight="0.14572081"/> <entry entry="-48" weight="0.13145754"/> <entry
entry="-49" weight="0.60746634"/> <entry entry="-50" weight="0.52660596"/>
<entry entry="-51" weight="0.34281462"/> <entry entry="-52"
weight="0.10704801"/> <entry entry="-53" weight="0.5216965"/> <entry entry="54" weight="0.47415197"/> <entry entry="-55" weight="0.026426835"/> <entry
entry="-56" weight="0.31998903"/> <entry entry="-57" weight="0.6292875"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="14"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.65117264"/> <entry entry="-2"
weight="0.1739111"/> <entry entry="-3" weight="0.26756114"/> <entry entry="4" weight="0.34317106"/> <entry entry="-5" weight="0.26214805"/> <entry
entry="-6" weight="0.7715422"/> <entry entry="-7" weight="0.60673934"/>
<entry entry="-8" weight="0.3767063"/> <entry entry="-9"
weight="0.29738566"/> <entry entry="-10" weight="0.95514977"/> <entry
entry="-11" weight="0.33054566"/> <entry entry="-12" weight="0.2547214"/>
<entry entry="-13" weight="0.3139644"/> <entry entry="-14"
weight="0.79982597"/> <entry entry="-15" weight="0.33035588"/> <entry
entry="-16" weight="0.4496824"/> <entry entry="-17" weight="0.5602297"/>
<entry entry="-18" weight="0.67100316"/> <entry entry="-19"
weight="0.19591595"/> <entry entry="-20" weight="0.373969"/> <entry entry="21" weight="0.59592575"/> <entry entry="-22" weight="0.39301372"/> <entry
entry="-23" weight="0.66624343"/> <entry entry="-24" weight="0.64926547"/>
<entry entry="-25" weight="0.75119764"/> <entry entry="-26"
weight="0.32457113"/> <entry entry="-27" weight="0.22007848"/> <entry
entry="-28" weight="0.65295583"/> <entry entry="-29" weight="0.6746766"/>
<entry entry="-30" weight="0.39943597"/> <entry entry="-31"
weight="0.36918488"/> <entry entry="-32" weight="0.13438658"/> <entry
entry="-33" weight="0.6472377"/> <entry entry="-34" weight="0.7811284"/>
<entry entry="-35" weight="0.4655084"/> <entry entry="-36"
weight="0.50981796"/> <entry entry="-37" weight="0.9185603"/> <entry entry="38" weight="0.8642246"/> <entry entry="-39" weight="0.31333488"/> <entry
entry="-40" weight="0.75006175"/> <entry entry="-41" weight="0.5142043"/>
<entry entry="-42" weight="0.4047152"/> <entry entry="-43"
weight="0.34666944"/> <entry entry="-44" weight="0.0584912"/> <entry entry="45" weight="0.87648875"/> <entry entry="-46" weight="0.31431344"/> <entry
entry="-47" weight="0.3593282"/> <entry entry="-48" weight="0.38604432"/>
<entry entry="-49" weight="0.7228821"/> <entry entry="-50"
weight="0.47663543"/> <entry entry="-51" weight="0.37063026"/> <entry
entry="-52" weight="0.21249613"/> <entry entry="-53" weight="0.49055177"/>
<entry entry="-54" weight="0.49497473"/> <entry entry="-55"
weight="0.22170414"/> <entry entry="-56" weight="0.49680415"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

447

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-57" weight="0.74673307"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="3"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="15"
neuronClass="null">
<entries>
<entry entry="-1" weight="0.6321354"/> <entry entry="-2"
weight="0.18796097"/> <entry entry="-3" weight="0.25961918"/> <entry entry="4" weight="0.3541326"/> <entry entry="-5" weight="0.25253385"/> <entry
entry="-6" weight="0.7658506"/> <entry entry="-7" weight="0.60347056"/>
<entry entry="-8" weight="0.35214207"/> <entry entry="-9"
weight="0.30096054"/> <entry entry="-10" weight="0.9409632"/> <entry entry="11" weight="0.34944636"/> <entry entry="-12" weight="0.25908476"/> <entry
entry="-13" weight="0.31188118"/> <entry entry="-14" weight="0.7993383"/>
<entry entry="-15" weight="0.32678223"/> <entry entry="-16"
weight="0.46761817"/> <entry entry="-17" weight="0.5754912"/> <entry entry="18" weight="0.6645785"/> <entry entry="-19" weight="0.2080196"/> <entry
entry="-20" weight="0.37772337"/> <entry entry="-21" weight="0.60130894"/>
<entry entry="-22" weight="0.4129067"/> <entry entry="-23"
weight="0.6632006"/> <entry entry="-24" weight="0.63677615"/> <entry entry="25" weight="0.7438775"/> <entry entry="-26" weight="0.34854484"/> <entry
entry="-27" weight="0.20495656"/> <entry entry="-28" weight="0.6653706"/>
<entry entry="-29" weight="0.66318524"/> <entry entry="-30"
weight="0.4052921"/> <entry entry="-31" weight="0.3838808"/> <entry entry="32" weight="0.13077304"/> <entry entry="-33" weight="0.63411367"/> <entry
entry="-34" weight="0.78032786"/> <entry entry="-35" weight="0.45755973"/>
<entry entry="-36" weight="0.5168342"/> <entry entry="-37"
weight="0.9320531"/> <entry entry="-38" weight="0.8789207"/> <entry entry="39" weight="0.30639184"/> <entry entry="-40" weight="0.7388955"/> <entry
entry="-41" weight="0.5030858"/> <entry entry="-42" weight="0.40862742"/>
<entry entry="-43" weight="0.34183523"/> <entry entry="-44"
weight="0.06327829"/> <entry entry="-45" weight="0.87211573"/> <entry
entry="-46" weight="0.3122721"/> <entry entry="-47" weight="0.3662952"/>
<entry entry="-48" weight="0.40530482"/> <entry entry="-49"
weight="0.72129136"/> <entry entry="-50" weight="0.48041898"/> <entry
entry="-51" weight="0.36641473"/> <entry entry="-52" weight="0.2376835"/>
<entry entry="-53" weight="0.49272364"/> <entry entry="-54"
weight="0.4882468"/> <entry entry="-55" weight="0.24117684"/> <entry entry="56" weight="0.48783758"/> <entry entry="-57" weight="0.73991686"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="16"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.7895915"/> <entry entry="-2"
weight="0.21779402"/> <entry entry="-3" weight="0.35888863"/> <entry entry="4" weight="0.48142526"/> <entry entry="-5" weight="0.1158136"/> <entry
entry="-6" weight="0.71479255"/> <entry entry="-7" weight="0.66490626"/>
<entry entry="-8" weight="0.28303838"/> <entry entry="-9"
weight="0.20128351"/> <entry entry="-10" weight="0.7142018"/> <entry entry="11" weight="0.3350197"/> <entry entry="-12" weight="0.38958496"/> <entry
entry="-13" weight="0.137167"/> <entry entry="-14" weight="0.81856763"/>
<entry entry="-15" weight="0.5535859"/> <entry entry="-16"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

448

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.2538088"/> <entry entry="-17" weight="0.48667568"/> <entry entry="18" weight="0.5058593"/> <entry entry="-19" weight="0.44130242"/> <entry
entry="-20" weight="0.4705842"/> <entry entry="-21" weight="0.52139515"/>
<entry entry="-22" weight="0.49586934"/> <entry entry="-23"
weight="0.63519835"/> <entry entry="-24" weight="0.45645988"/> <entry
entry="-25" weight="0.61733764"/> <entry entry="-26" weight="0.40898445"/>
<entry entry="-27" weight="0.13356915"/> <entry entry="-28"
weight="0.953416"/> <entry entry="-29" weight="0.71362954"/> <entry entry="30" weight="0.63649553"/> <entry entry="-31" weight="0.4795492"/> <entry
entry="-32" weight="0.20467418"/> <entry entry="-33" weight="0.45194793"/>
<entry entry="-34" weight="0.9078784"/> <entry entry="-35"
weight="0.49463102"/> <entry entry="-36" weight="0.50234795"/> <entry
entry="-37" weight="0.85875916"/> <entry entry="-38" weight="0.75958973"/>
<entry entry="-39" weight="0.4510037"/> <entry entry="-40"
weight="0.47921908"/> <entry entry="-41" weight="0.5856287"/> <entry entry="42" weight="0.48025677"/> <entry entry="-43" weight="0.08689697"/> <entry
entry="-44" weight="0.12766409"/> <entry entry="-45" weight="0.96213734"/>
<entry entry="-46" weight="0.43660605"/> <entry entry="-47"
weight="0.557979"/> <entry entry="-48" weight="0.44010407"/> <entry entry="49" weight="0.47725517"/> <entry entry="-50" weight="0.31189463"/> <entry
entry="-51" weight="0.32697636"/> <entry entry="-52" weight="0.13437709"/>
<entry entry="-53" weight="0.68849987"/> <entry entry="-54"
weight="0.38695806"/> <entry entry="-55" weight="0.2590415"/> <entry entry="56" weight="0.68208176"/> <entry entry="-57" weight="0.83484745"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="3"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="17"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.70685625"/> <entry entry="-2"
weight="0.32563818"/> <entry entry="-3" weight="0.6480838"/> <entry entry="4" weight="0.5923317"/> <entry entry="-5" weight="0.17180696"/> <entry
entry="-6" weight="0.42399096"/> <entry entry="-7" weight="0.4614563"/>
<entry entry="-8" weight="0.4521889"/> <entry entry="-9"
weight="0.32414946"/> <entry entry="-10" weight="0.4729375"/> <entry entry="11" weight="0.527681"/> <entry entry="-12" weight="0.7050661"/> <entry
entry="-13" weight="0.25747964"/> <entry entry="-14" weight="0.69811714"/>
<entry entry="-15" weight="0.9222995"/> <entry entry="-16"
weight="0.37635568"/> <entry entry="-17" weight="0.35084188"/> <entry
entry="-18" weight="0.3882195"/> <entry entry="-19" weight="0.7011436"/>
<entry entry="-20" weight="0.39745405"/> <entry entry="-21"
weight="0.38037154"/> <entry entry="-22" weight="0.5793441"/> <entry entry="23" weight="0.4357812"/> <entry entry="-24" weight="0.5458028"/> <entry
entry="-25" weight="0.36591125"/> <entry entry="-26" weight="0.6664717"/>
<entry entry="-27" weight="0.17553121"/> <entry entry="-28"
weight="0.9381658"/> <entry entry="-29" weight="0.8141633"/> <entry entry="30" weight="0.62041926"/> <entry entry="-31" weight="0.59011114"/> <entry
entry="-32" weight="0.37576842"/> <entry entry="-33" weight="0.50873077"/>
<entry entry="-34" weight="0.86040443"/> <entry entry="-35"
weight="0.62894243"/> <entry entry="-36" weight="0.7355695"/> <entry entry="37" weight="0.75992304"/> <entry entry="-38" weight="0.64420676"/> <entry
entry="-39" weight="0.72355694"/> <entry entry="-40" weight="0.2661214"/>
<entry entry="-41" weight="0.8108183"/> <entry entry="-42"
weight="0.5892099"/> <entry entry="-43" weight="0.1726237"/> <entry entry="44" weight="0.24807651"/> <entry entry="-45" weight="0.89388883"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

449

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-46" weight="0.55536485"/> <entry entry="-47" weight="0.9092447"/>
<entry entry="-48" weight="0.7460817"/> <entry entry="-49"
weight="0.14214116"/> <entry entry="-50" weight="0.23120944"/> <entry
entry="-51" weight="0.54401135"/> <entry entry="-52" weight="0.22401933"/>
<entry entry="-53" weight="0.6772083"/> <entry entry="-54"
weight="0.5538057"/> <entry entry="-55" weight="0.4107085"/> <entry entry="56" weight="0.9176152"/> <entry entry="-57" weight="0.7862929"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="18"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.81545955"/> <entry entry="-2"
weight="0.14641272"/> <entry entry="-3" weight="0.45612007"/> <entry entry="4" weight="0.35555184"/> <entry entry="-5" weight="0.4200892"/> <entry
entry="-6" weight="0.56002814"/> <entry entry="-7" weight="0.60374486"/>
<entry entry="-8" weight="0.524994"/> <entry entry="-9" weight="0.4306695"/>
<entry entry="-10" weight="0.91655993"/> <entry entry="-11"
weight="0.15775782"/> <entry entry="-12" weight="0.18306981"/> <entry
entry="-13" weight="0.2546466"/> <entry entry="-14" weight="0.76144123"/>
<entry entry="-15" weight="0.26842684"/> <entry entry="-16"
weight="0.343875"/> <entry entry="-17" weight="0.45455438"/> <entry entry="18" weight="0.6289231"/> <entry entry="-19" weight="0.23059632"/> <entry
entry="-20" weight="0.55130947"/> <entry entry="-21" weight="0.4664023"/>
<entry entry="-22" weight="0.2983616"/> <entry entry="-23"
weight="0.7215892"/> <entry entry="-24" weight="0.6644464"/> <entry entry="25" weight="0.7966376"/> <entry entry="-26" weight="0.3034512"/> <entry
entry="-27" weight="0.26523823"/> <entry entry="-28" weight="0.5479013"/>
<entry entry="-29" weight="0.6487944"/> <entry entry="-30"
weight="0.3497134"/> <entry entry="-31" weight="0.38889286"/> <entry entry="32" weight="0.26377943"/> <entry entry="-33" weight="0.56278723"/> <entry
entry="-34" weight="0.8704299"/> <entry entry="-35" weight="0.3764738"/>
<entry entry="-36" weight="0.3054753"/> <entry entry="-37"
weight="0.9464936"/> <entry entry="-38" weight="0.7575083"/> <entry entry="39" weight="0.22439475"/> <entry entry="-40" weight="0.6259353"/> <entry
entry="-41" weight="0.6362978"/> <entry entry="-42" weight="0.4977483"/>
<entry entry="-43" weight="0.45519382"/> <entry entry="-44"
weight="0.19858582"/> <entry entry="-45" weight="0.81662226"/> <entry
entry="-46" weight="0.29815438"/> <entry entry="-47" weight="0.28761086"/>
<entry entry="-48" weight="0.18334031"/> <entry entry="-49"
weight="0.7772087"/> <entry entry="-50" weight="0.41625527"/> <entry entry="51" weight="0.33535215"/> <entry entry="-52" weight="0.22437742"/> <entry
entry="-53" weight="0.3988043"/> <entry entry="-54" weight="0.46920693"/>
<entry entry="-55" weight="0.13686883"/> <entry entry="-56"
weight="0.423251"/> <entry entry="-57" weight="0.65931374"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="19"
neuronClass="1.0">

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

450

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entries>
<entry entry="-1" weight="0.6856811"/> <entry entry="-2"
weight="0.19820605"/> <entry entry="-3" weight="0.44565114"/> <entry entry="4" weight="0.37710518"/> <entry entry="-5" weight="0.17895544"/> <entry
entry="-6" weight="0.5688694"/> <entry entry="-7" weight="0.7790667"/> <entry
entry="-8" weight="0.40937948"/> <entry entry="-9" weight="0.37425518"/>
<entry entry="-10" weight="0.8218027"/> <entry entry="-11"
weight="0.2578573"/> <entry entry="-12" weight="0.37550947"/> <entry entry="13" weight="0.23311423"/> <entry entry="-14" weight="0.88786495"/> <entry
entry="-15" weight="0.21534106"/> <entry entry="-16" weight="0.26359382"/>
<entry entry="-17" weight="0.44310534"/> <entry entry="-18"
weight="0.5953935"/> <entry entry="-19" weight="0.31179637"/> <entry entry="20" weight="0.52154005"/> <entry entry="-21" weight="0.6179602"/> <entry
entry="-22" weight="0.54147106"/> <entry entry="-23" weight="0.6897883"/>
<entry entry="-24" weight="0.70498884"/> <entry entry="-25"
weight="0.87402886"/> <entry entry="-26" weight="0.34543493"/> <entry
entry="-27" weight="0.11759868"/> <entry entry="-28" weight="0.7056126"/>
<entry entry="-29" weight="0.64200103"/> <entry entry="-30"
weight="0.48466182"/> <entry entry="-31" weight="0.4478909"/> <entry entry="32" weight="0.35347044"/> <entry entry="-33" weight="0.69393694"/> <entry
entry="-34" weight="0.88887155"/> <entry entry="-35" weight="0.5437747"/>
<entry entry="-36" weight="0.52148914"/> <entry entry="-37"
weight="0.9690064"/> <entry entry="-38" weight="0.8345505"/> <entry entry="39" weight="0.26770127"/> <entry entry="-40" weight="0.762319"/> <entry
entry="-41" weight="0.56750727"/> <entry entry="-42" weight="0.3301739"/>
<entry entry="-43" weight="0.22894831"/> <entry entry="-44"
weight="0.057890225"/> <entry entry="-45" weight="0.8673049"/> <entry
entry="-46" weight="0.37047774"/> <entry entry="-47" weight="0.21092083"/>
<entry entry="-48" weight="0.3658479"/> <entry entry="-49"
weight="0.76525605"/> <entry entry="-50" weight="0.29891905"/> <entry
entry="-51" weight="0.24267241"/> <entry entry="-52" weight="0.20738754"/>
<entry entry="-53" weight="0.6395329"/> <entry entry="-54"
weight="0.2803785"/> <entry entry="-55" weight="0.39768526"/> <entry entry="56" weight="0.331558"/> <entry entry="-57" weight="0.85326463"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="20"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.64641726"/> <entry entry="-2"
weight="0.20587195"/> <entry entry="-3" weight="0.3995594"/> <entry entry="4" weight="0.34585947"/> <entry entry="-5" weight="0.1717206"/> <entry
entry="-6" weight="0.6193502"/> <entry entry="-7" weight="0.74460137"/>
<entry entry="-8" weight="0.38249114"/> <entry entry="-9"
weight="0.33727658"/> <entry entry="-10" weight="0.8058316"/> <entry entry="11" weight="0.26964527"/> <entry entry="-12" weight="0.37794006"/> <entry
entry="-13" weight="0.24479985"/> <entry entry="-14" weight="0.89809346"/>
<entry entry="-15" weight="0.21853708"/> <entry entry="-16"
weight="0.27668047"/> <entry entry="-17" weight="0.42156002"/> <entry
entry="-18" weight="0.5807172"/> <entry entry="-19" weight="0.29768205"/>
<entry entry="-20" weight="0.51065284"/> <entry entry="-21"
weight="0.6109182"/> <entry entry="-22" weight="0.524349"/> <entry entry="23" weight="0.64788157"/> <entry entry="-24" weight="0.6727401"/> <entry
entry="-25" weight="0.8742862"/> <entry entry="-26" weight="0.36915773"/>
<entry entry="-27" weight="0.120353855"/> <entry entry="-28"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

451

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.7281496"/> <entry entry="-29" weight="0.6369024"/> <entry entry="30" weight="0.4960792"/> <entry entry="-31" weight="0.42931694"/> <entry
entry="-32" weight="0.32622218"/> <entry entry="-33" weight="0.6647226"/>
<entry entry="-34" weight="0.8727139"/> <entry entry="-35"
weight="0.56729335"/> <entry entry="-36" weight="0.5675615"/> <entry entry="37" weight="0.93458784"/> <entry entry="-38" weight="0.8387899"/> <entry
entry="-39" weight="0.27192086"/> <entry entry="-40" weight="0.7928757"/>
<entry entry="-41" weight="0.53565425"/> <entry entry="-42"
weight="0.29313794"/> <entry entry="-43" weight="0.1902219"/> <entry entry="44" weight="0.045516018"/> <entry entry="-45" weight="0.8594844"/> <entry
entry="-46" weight="0.37142223"/> <entry entry="-47" weight="0.24479191"/>
<entry entry="-48" weight="0.3900708"/> <entry entry="-49"
weight="0.7542457"/> <entry entry="-50" weight="0.31867468"/> <entry entry="51" weight="0.22740485"/> <entry entry="-52" weight="0.22859842"/> <entry
entry="-53" weight="0.65264314"/> <entry entry="-54" weight="0.28243977"/>
<entry entry="-55" weight="0.3883467"/> <entry entry="-56"
weight="0.3379589"/> <entry entry="-57" weight="0.8666674"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="21"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.648359"/> <entry entry="-2" weight="0.2928867"/>
<entry entry="-3" weight="0.35242575"/> <entry entry="-4"
weight="0.40930924"/> <entry entry="-5" weight="0.09910603"/> <entry entry="6" weight="0.6487055"/> <entry entry="-7" weight="0.8485182"/> <entry
entry="-8" weight="0.2820611"/> <entry entry="-9" weight="0.34690487"/>
<entry entry="-10" weight="0.79351294"/> <entry entry="-11"
weight="0.3428054"/> <entry entry="-12" weight="0.4690803"/> <entry entry="13" weight="0.23009805"/> <entry entry="-14" weight="0.90832186"/> <entry
entry="-15" weight="0.30901808"/> <entry entry="-16" weight="0.17660326"/>
<entry entry="-17" weight="0.48834282"/> <entry entry="-18"
weight="0.5726885"/> <entry entry="-19" weight="0.3692161"/> <entry entry="20" weight="0.53831404"/> <entry entry="-21" weight="0.7046171"/> <entry
entry="-22" weight="0.59050375"/> <entry entry="-23" weight="0.7227464"/>
<entry entry="-24" weight="0.6145885"/> <entry entry="-25"
weight="0.788109"/> <entry entry="-26" weight="0.39341107"/> <entry entry="27" weight="0.05276105"/> <entry entry="-28" weight="0.878516"/> <entry
entry="-29" weight="0.62342364"/> <entry entry="-30" weight="0.550976"/>
<entry entry="-31" weight="0.48243508"/> <entry entry="-32"
weight="0.41291794"/> <entry entry="-33" weight="0.6318327"/> <entry entry="34" weight="0.89794403"/> <entry entry="-35" weight="0.6342179"/> <entry
entry="-36" weight="0.49565235"/> <entry entry="-37" weight="0.9242828"/>
<entry entry="-38" weight="0.7718485"/> <entry entry="-39"
weight="0.31330383"/> <entry entry="-40" weight="0.7407652"/> <entry entry="41" weight="0.513481"/> <entry entry="-42" weight="0.24454893"/> <entry
entry="-43" weight="0.12068685"/> <entry entry="-44" weight="0.04298827"/>
<entry entry="-45" weight="0.90930873"/> <entry entry="-46"
weight="0.40314704"/> <entry entry="-47" weight="0.31234002"/> <entry
entry="-48" weight="0.45239896"/> <entry entry="-49" weight="0.66024536"/>
<entry entry="-50" weight="0.3104124"/> <entry entry="-51"
weight="0.2729528"/> <entry entry="-52" weight="0.21276952"/> <entry entry="53" weight="0.7054085"/> <entry entry="-54" weight="0.15355077"/> <entry
entry="-55" weight="0.5154307"/> <entry entry="-56" weight="0.428338"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

452

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entry entry="-57" weight="0.86321986"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="22"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.83245665"/> <entry entry="-2"
weight="0.24336478"/> <entry entry="-3" weight="0.33044547"/> <entry entry="4" weight="0.4905573"/> <entry entry="-5" weight="0.09715753"/> <entry
entry="-6" weight="0.73737466"/> <entry entry="-7" weight="0.7107936"/>
<entry entry="-8" weight="0.30460048"/> <entry entry="-9"
weight="0.1878059"/> <entry entry="-10" weight="0.7108799"/> <entry entry="11" weight="0.3662346"/> <entry entry="-12" weight="0.37738755"/> <entry
entry="-13" weight="0.14070934"/> <entry entry="-14" weight="0.8076145"/>
<entry entry="-15" weight="0.5397152"/> <entry entry="-16"
weight="0.23803098"/> <entry entry="-17" weight="0.50922316"/> <entry
entry="-18" weight="0.48166043"/> <entry entry="-19" weight="0.469806"/>
<entry entry="-20" weight="0.46856797"/> <entry entry="-21"
weight="0.52432656"/> <entry entry="-22" weight="0.5093828"/> <entry entry="23" weight="0.65555286"/> <entry entry="-24" weight="0.4658894"/> <entry
entry="-25" weight="0.6271335"/> <entry entry="-26" weight="0.38676476"/>
<entry entry="-27" weight="0.16153508"/> <entry entry="-28"
weight="0.9728554"/> <entry entry="-29" weight="0.7253048"/> <entry entry="30" weight="0.64337784"/> <entry entry="-31" weight="0.50607413"/> <entry
entry="-32" weight="0.18187466"/> <entry entry="-33" weight="0.44280422"/>
<entry entry="-34" weight="0.91866803"/> <entry entry="-35"
weight="0.5049885"/> <entry entry="-36" weight="0.50357413"/> <entry entry="37" weight="0.85237706"/> <entry entry="-38" weight="0.7840935"/> <entry
entry="-39" weight="0.45550665"/> <entry entry="-40" weight="0.47156054"/>
<entry entry="-41" weight="0.61548203"/> <entry entry="-42"
weight="0.50416213"/> <entry entry="-43" weight="0.09986136"/> <entry
entry="-44" weight="0.12517187"/> <entry entry="-45" weight="0.9808408"/>
<entry entry="-46" weight="0.4244056"/> <entry entry="-47"
weight="0.55180585"/> <entry entry="-48" weight="0.48558307"/> <entry
entry="-49" weight="0.5060296"/> <entry entry="-50" weight="0.32181686"/>
<entry entry="-51" weight="0.35382664"/> <entry entry="-52"
weight="0.14310774"/> <entry entry="-53" weight="0.6842123"/> <entry entry="54" weight="0.3851021"/> <entry entry="-55" weight="0.27701318"/> <entry
entry="-56" weight="0.6589355"/> <entry entry="-57" weight="0.84348464"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="23"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.7962454"/> <entry entry="-2" weight="0.3879124"/>
<entry entry="-3" weight="0.57823825"/> <entry entry="-4"
weight="0.5889453"/> <entry entry="-5" weight="0.14323553"/> <entry entry="6" weight="0.51580495"/> <entry entry="-7" weight="0.5532037"/> <entry
entry="-8" weight="0.47189963"/> <entry entry="-9" weight="0.3235078"/>
<entry entry="-10" weight="0.48258367"/> <entry entry="-11"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

453

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.6029472"/> <entry entry="-12" weight="0.6442096"/> <entry entry="13" weight="0.27998212"/> <entry entry="-14" weight="0.6460753"/> <entry
entry="-15" weight="0.9133547"/> <entry entry="-16" weight="0.37536532"/>
<entry entry="-17" weight="0.4475564"/> <entry entry="-18"
weight="0.31911808"/> <entry entry="-19" weight="0.7370639"/> <entry entry="20" weight="0.40363485"/> <entry entry="-21" weight="0.37738726"/> <entry
entry="-22" weight="0.6074079"/> <entry entry="-23" weight="0.4975898"/>
<entry entry="-24" weight="0.5732262"/> <entry entry="-25"
weight="0.43241483"/> <entry entry="-26" weight="0.61375564"/> <entry
entry="-27" weight="0.2442259"/> <entry entry="-28" weight="0.98011005"/>
<entry entry="-29" weight="0.8084537"/> <entry entry="-30"
weight="0.67268574"/> <entry entry="-31" weight="0.62338066"/> <entry
entry="-32" weight="0.3500199"/> <entry entry="-33" weight="0.5100279"/>
<entry entry="-34" weight="0.8789812"/> <entry entry="-35"
weight="0.6222449"/> <entry entry="-36" weight="0.79696614"/> <entry entry="37" weight="0.7635978"/> <entry entry="-38" weight="0.6403474"/> <entry
entry="-39" weight="0.7464708"/> <entry entry="-40" weight="0.26195526"/>
<entry entry="-41" weight="0.85669756"/> <entry entry="-42"
weight="0.6420258"/> <entry entry="-43" weight="0.20149523"/> <entry entry="44" weight="0.23729153"/> <entry entry="-45" weight="0.94999534"/> <entry
entry="-46" weight="0.55792487"/> <entry entry="-47" weight="0.88076425"/>
<entry entry="-48" weight="0.83243436"/> <entry entry="-49"
weight="0.23038547"/> <entry entry="-50" weight="0.2785071"/> <entry entry="51" weight="0.6118857"/> <entry entry="-52" weight="0.23035933"/> <entry
entry="-53" weight="0.7085845"/> <entry entry="-54" weight="0.5915338"/>
<entry entry="-55" weight="0.44515735"/> <entry entry="-56"
weight="0.85722876"/> <entry entry="-57" weight="0.79578066"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="24"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.979723"/> <entry entry="-2" weight="0.37441826"/>
<entry entry="-3" weight="0.7217533"/> <entry entry="-4" weight="0.5287546"/>
<entry entry="-5" weight="0.30484504"/> <entry entry="-6"
weight="0.4541388"/> <entry entry="-7" weight="0.5653154"/> <entry entry="-8"
weight="0.7267707"/> <entry entry="-9" weight="0.5014846"/> <entry entry="10" weight="0.492617"/> <entry entry="-11" weight="0.45872667"/> <entry
entry="-12" weight="0.4932121"/> <entry entry="-13" weight="0.2623518"/>
<entry entry="-14" weight="0.494287"/> <entry entry="-15"
weight="0.8260258"/> <entry entry="-16" weight="0.2562272"/> <entry entry="17" weight="0.3637733"/> <entry entry="-18" weight="0.20081478"/> <entry
entry="-19" weight="0.776883"/> <entry entry="-20" weight="0.6147596"/>
<entry entry="-21" weight="0.26390934"/> <entry entry="-22"
weight="0.4676029"/> <entry entry="-23" weight="0.4522318"/> <entry entry="24" weight="0.54338205"/> <entry entry="-25" weight="0.523893"/> <entry
entry="-26" weight="0.6023549"/> <entry entry="-27" weight="0.35444614"/>
<entry entry="-28" weight="0.8542247"/> <entry entry="-29"
weight="0.75405777"/> <entry entry="-30" weight="0.5987118"/> <entry entry="31" weight="0.59575707"/> <entry entry="-32" weight="0.39453313"/> <entry
entry="-33" weight="0.45958155"/> <entry entry="-34" weight="0.97705704"/>
<entry entry="-35" weight="0.4230451"/> <entry entry="-36"
weight="0.6263315"/> <entry entry="-37" weight="0.7219764"/> <entry entry="38" weight="0.41193682"/> <entry entry="-39" weight="0.7374467"/> <entry
entry="-40" weight="0.36012274"/> <entry entry="-41" weight="0.9334968"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

454

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entry entry="-42" weight="0.75792813"/> <entry entry="-43"
weight="0.36962813"/> <entry entry="-44" weight="0.3391709"/> <entry entry="45" weight="0.9415693"/> <entry entry="-46" weight="0.4302547"/> <entry
entry="-47" weight="0.7526485"/> <entry entry="-48" weight="0.63327414"/>
<entry entry="-49" weight="0.28500742"/> <entry entry="-50"
weight="0.39566928"/> <entry entry="-51" weight="0.5283861"/> <entry entry="52" weight="0.16932563"/> <entry entry="-53" weight="0.6220075"/> <entry
entry="-54" weight="0.643656"/> <entry entry="-55" weight="0.35492992"/>
<entry entry="-56" weight="0.78192204"/> <entry entry="-57"
weight="0.5960896"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="25"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.72801244"/> <entry entry="-2"
weight="0.27747148"/> <entry entry="-3" weight="0.47750345"/> <entry entry="4" weight="0.47556522"/> <entry entry="-5" weight="0.2228829"/> <entry
entry="-6" weight="0.5717865"/> <entry entry="-7" weight="0.8613948"/> <entry
entry="-8" weight="0.48705804"/> <entry entry="-9" weight="0.39570644"/>
<entry entry="-10" weight="0.79445034"/> <entry entry="-11"
weight="0.2429328"/> <entry entry="-12" weight="0.416767"/> <entry entry="13" weight="0.14767703"/> <entry entry="-14" weight="0.9364952"/> <entry
entry="-15" weight="0.18120888"/> <entry entry="-16" weight="0.15232454"/>
<entry entry="-17" weight="0.3907286"/> <entry entry="-18"
weight="0.5195492"/> <entry entry="-19" weight="0.48942125"/> <entry entry="20" weight="0.6024615"/> <entry entry="-21" weight="0.69705987"/> <entry
entry="-22" weight="0.61056"/> <entry entry="-23" weight="0.6819058"/> <entry
entry="-24" weight="0.66382736"/> <entry entry="-25" weight="0.7907727"/>
<entry entry="-26" weight="0.3151461"/> <entry entry="-27"
weight="0.20493935"/> <entry entry="-28" weight="0.74055505"/> <entry
entry="-29" weight="0.48034352"/> <entry entry="-30" weight="0.48228174"/>
<entry entry="-31" weight="0.6155314"/> <entry entry="-32"
weight="0.40908802"/> <entry entry="-33" weight="0.5636561"/> <entry entry="34" weight="0.955076"/> <entry entry="-35" weight="0.47510558"/> <entry
entry="-36" weight="0.38319352"/> <entry entry="-37" weight="0.90706825"/>
<entry entry="-38" weight="0.7322002"/> <entry entry="-39"
weight="0.28435135"/> <entry entry="-40" weight="0.71086156"/> <entry
entry="-41" weight="0.5015967"/> <entry entry="-42" weight="0.37782815"/>
<entry entry="-43" weight="0.17984454"/> <entry entry="-44"
weight="0.14847493"/> <entry entry="-45" weight="0.8946935"/> <entry entry="46" weight="0.36036974"/> <entry entry="-47" weight="0.23623858"/> <entry
entry="-48" weight="0.25577998"/> <entry entry="-49" weight="0.69366837"/>
<entry entry="-50" weight="0.29398102"/> <entry entry="-51"
weight="0.28572726"/> <entry entry="-52" weight="0.25454712"/> <entry
entry="-53" weight="0.54329693"/> <entry entry="-54" weight="0.2775549"/>
<entry entry="-55" weight="0.46731448"/> <entry entry="-56"
weight="0.3231492"/> <entry entry="-57" weight="0.74507385"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="3"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

455

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="26"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.6776711"/> <entry entry="-2" weight="0.3008679"/>
<entry entry="-3" weight="0.42056343"/> <entry entry="-4"
weight="0.51069796"/> <entry entry="-5" weight="0.13376707"/> <entry entry="6" weight="0.6098981"/> <entry entry="-7" weight="0.8690349"/> <entry
entry="-8" weight="0.35596532"/> <entry entry="-9" weight="0.3582592"/>
<entry entry="-10" weight="0.81596965"/> <entry entry="-11"
weight="0.3184706"/> <entry entry="-12" weight="0.4849788"/> <entry entry="13" weight="0.15869617"/> <entry entry="-14" weight="0.9635642"/> <entry
entry="-15" weight="0.25466657"/> <entry entry="-16" weight="0.18853408"/>
<entry entry="-17" weight="0.48869458"/> <entry entry="-18"
weight="0.5900889"/> <entry entry="-19" weight="0.45305124"/> <entry entry="20" weight="0.5303769"/> <entry entry="-21" weight="0.7343004"/> <entry
entry="-22" weight="0.658035"/> <entry entry="-23" weight="0.7340176"/>
<entry entry="-24" weight="0.6832236"/> <entry entry="-25"
weight="0.7854242"/> <entry entry="-26" weight="0.30112725"/> <entry entry="27" weight="0.12976071"/> <entry entry="-28" weight="0.81425995"/> <entry
entry="-29" weight="0.5514507"/> <entry entry="-30" weight="0.5047028"/>
<entry entry="-31" weight="0.57436377"/> <entry entry="-32"
weight="0.43136072"/> <entry entry="-33" weight="0.633669"/> <entry entry="34" weight="0.92287785"/> <entry entry="-35" weight="0.57729954"/> <entry
entry="-36" weight="0.47095844"/> <entry entry="-37" weight="0.9344516"/>
<entry entry="-38" weight="0.80134493"/> <entry entry="-39"
weight="0.29858494"/> <entry entry="-40" weight="0.6859464"/> <entry entry="41" weight="0.5058414"/> <entry entry="-42" weight="0.32410347"/> <entry
entry="-43" weight="0.10162784"/> <entry entry="-44" weight="0.092387676"/>
<entry entry="-45" weight="0.9084744"/> <entry entry="-46"
weight="0.43018407"/> <entry entry="-47" weight="0.28343335"/> <entry
entry="-48" weight="0.3629976"/> <entry entry="-49" weight="0.62816024"/>
<entry entry="-50" weight="0.231691"/> <entry entry="-51"
weight="0.31339186"/> <entry entry="-52" weight="0.2285988"/> <entry entry="53" weight="0.6224544"/> <entry entry="-54" weight="0.21427488"/> <entry
entry="-55" weight="0.52391577"/> <entry entry="-56" weight="0.38696513"/>
<entry entry="-57" weight="0.8396728"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="27"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.57029796"/> <entry entry="-2"
weight="0.32523394"/> <entry entry="-3" weight="0.35915685"/> <entry entry="4" weight="0.44383872"/> <entry entry="-5" weight="0.06065868"/> <entry
entry="-6" weight="0.70103335"/> <entry entry="-7" weight="0.85310334"/>
<entry entry="-8" weight="0.32115644"/> <entry entry="-9"
weight="0.27648115"/> <entry entry="-10" weight="0.71921855"/> <entry
entry="-11" weight="0.2988317"/> <entry entry="-12" weight="0.4637889"/>
<entry entry="-13" weight="0.20789208"/> <entry entry="-14"
weight="0.9849377"/> <entry entry="-15" weight="0.22645311"/> <entry entry="16" weight="0.24221842"/> <entry entry="-17" weight="0.5342216"/> <entry
entry="-18" weight="0.5621196"/> <entry entry="-19" weight="0.42705905"/>
<entry entry="-20" weight="0.5417601"/> <entry entry="-21"
weight="0.6810891"/> <entry entry="-22" weight="0.6528734"/> <entry entry="-

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

456

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


23" weight="0.6600247"/> <entry entry="-24" weight="0.61472714"/> <entry
entry="-25" weight="0.7502464"/> <entry entry="-26" weight="0.29553467"/>
<entry entry="-27" weight="0.17752045"/> <entry entry="-28"
weight="0.8286956"/> <entry entry="-29" weight="0.5532056"/> <entry entry="30" weight="0.5645825"/> <entry entry="-31" weight="0.5660215"/> <entry
entry="-32" weight="0.41034442"/> <entry entry="-33" weight="0.5818306"/>
<entry entry="-34" weight="0.9064228"/> <entry entry="-35"
weight="0.68054897"/> <entry entry="-36" weight="0.5560749"/> <entry entry="37" weight="0.8705281"/> <entry entry="-38" weight="0.87046653"/> <entry
entry="-39" weight="0.32738715"/> <entry entry="-40" weight="0.6578324"/>
<entry entry="-41" weight="0.45273116"/> <entry entry="-42"
weight="0.3071906"/> <entry entry="-43" weight="0.101924755"/> <entry
entry="-44" weight="0.13974911"/> <entry entry="-45" weight="0.8748197"/>
<entry entry="-46" weight="0.4036441"/> <entry entry="-47"
weight="0.31389213"/> <entry entry="-48" weight="0.46808037"/> <entry
entry="-49" weight="0.58914655"/> <entry entry="-50" weight="0.24698251"/>
<entry entry="-51" weight="0.2827888"/> <entry entry="-52"
weight="0.25353652"/> <entry entry="-53" weight="0.6366536"/> <entry entry="54" weight="0.17351109"/> <entry entry="-55" weight="0.49414667"/> <entry
entry="-56" weight="0.33221063"/> <entry entry="-57" weight="0.87135553"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="4"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="28"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.61600804"/> <entry entry="-2"
weight="0.32006374"/> <entry entry="-3" weight="0.3720814"/> <entry entry="4" weight="0.41826105"/> <entry entry="-5" weight="0.059526555"/> <entry
entry="-6" weight="0.6796674"/> <entry entry="-7" weight="0.87415624"/>
<entry entry="-8" weight="0.33226728"/> <entry entry="-9"
weight="0.29274863"/> <entry entry="-10" weight="0.723819"/> <entry entry="11" weight="0.30745757"/> <entry entry="-12" weight="0.45835277"/> <entry
entry="-13" weight="0.24059437"/> <entry entry="-14" weight="0.93363917"/>
<entry entry="-15" weight="0.26617187"/> <entry entry="-16"
weight="0.21921283"/> <entry entry="-17" weight="0.5569169"/> <entry entry="18" weight="0.55857277"/> <entry entry="-19" weight="0.39095145"/> <entry
entry="-20" weight="0.58314604"/> <entry entry="-21" weight="0.6338564"/>
<entry entry="-22" weight="0.61819214"/> <entry entry="-23"
weight="0.7184525"/> <entry entry="-24" weight="0.639066"/> <entry entry="25" weight="0.77694905"/> <entry entry="-26" weight="0.31189248"/> <entry
entry="-27" weight="0.13696519"/> <entry entry="-28" weight="0.8432896"/>
<entry entry="-29" weight="0.5924717"/> <entry entry="-30"
weight="0.5811357"/> <entry entry="-31" weight="0.54381377"/> <entry entry="32" weight="0.4453077"/> <entry entry="-33" weight="0.59506226"/> <entry
entry="-34" weight="0.9304504"/> <entry entry="-35" weight="0.69448864"/>
<entry entry="-36" weight="0.54293346"/> <entry entry="-37"
weight="0.90070343"/> <entry entry="-38" weight="0.838452"/> <entry entry="39" weight="0.33263302"/> <entry entry="-40" weight="0.6470656"/> <entry
entry="-41" weight="0.50354683"/> <entry entry="-42" weight="0.31870675"/>
<entry entry="-43" weight="0.11891217"/> <entry entry="-44"
weight="0.11644391"/> <entry entry="-45" weight="0.875152"/> <entry entry="46" weight="0.40680778"/> <entry entry="-47" weight="0.3039239"/> <entry
entry="-48" weight="0.49809265"/> <entry entry="-49" weight="0.62092716"/>
<entry entry="-50" weight="0.27373055"/> <entry entry="-51"
weight="0.28028303"/> <entry entry="-52" weight="0.21271865"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

457

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-53" weight="0.6512835"/> <entry entry="-54" weight="0.13419807"/>
<entry entry="-55" weight="0.49267554"/> <entry entry="-56"
weight="0.36138716"/> <entry entry="-57" weight="0.87548184"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="29" neuronClass="null">
<entries>
<entry entry="-1" weight="0.3804492"/> <entry entry="-2" weight="0.6698118"/>
<entry entry="-3" weight="0.3666246"/> <entry entry="-4"
weight="0.57466924"/> <entry entry="-5" weight="0.16422111"/> <entry entry="6" weight="0.77593106"/> <entry entry="-7" weight="0.6497349"/> <entry
entry="-8" weight="0.48345783"/> <entry entry="-9" weight="0.372392"/> <entry
entry="-10" weight="0.6806629"/> <entry entry="-11" weight="0.6338525"/>
<entry entry="-12" weight="0.60633016"/> <entry entry="-13"
weight="0.44792518"/> <entry entry="-14" weight="0.8155137"/> <entry entry="15" weight="0.7392467"/> <entry entry="-16" weight="0.6101677"/> <entry
entry="-17" weight="0.81325126"/> <entry entry="-18" weight="0.5970614"/>
<entry entry="-19" weight="0.6469066"/> <entry entry="-20"
weight="0.4468521"/> <entry entry="-21" weight="0.5871618"/> <entry entry="22" weight="0.68374205"/> <entry entry="-23" weight="0.6652399"/> <entry
entry="-24" weight="0.7427405"/> <entry entry="-25" weight="0.3804385"/>
<entry entry="-26" weight="0.42659956"/> <entry entry="-27"
weight="0.3814577"/> <entry entry="-28" weight="0.79196715"/> <entry entry="29" weight="0.47215706"/> <entry entry="-30" weight="0.44135875"/> <entry
entry="-31" weight="0.70542115"/> <entry entry="-32" weight="0.5713888"/>
<entry entry="-33" weight="0.6187372"/> <entry entry="-34"
weight="0.80772924"/> <entry entry="-35" weight="0.8961601"/> <entry entry="36" weight="0.84139943"/> <entry entry="-37" weight="0.7245549"/> <entry
entry="-38" weight="0.77842087"/> <entry entry="-39" weight="0.7044751"/>
<entry entry="-40" weight="0.39666384"/> <entry entry="-41"
weight="0.5924439"/> <entry entry="-42" weight="0.5172558"/> <entry entry="43" weight="0.3294707"/> <entry entry="-44" weight="0.3231422"/> <entry
entry="-45" weight="0.8801754"/> <entry entry="-46" weight="0.32420412"/>
<entry entry="-47" weight="0.8447402"/> <entry entry="-48"
weight="0.94276077"/> <entry entry="-49" weight="0.17405955"/> <entry
entry="-50" weight="0.39305526"/> <entry entry="-51" weight="0.77849865"/>
<entry entry="-52" weight="0.37028605"/> <entry entry="-53"
weight="0.4077565"/> <entry entry="-54" weight="0.37355912"/> <entry entry="55" weight="0.70100343"/> <entry entry="-56" weight="0.6364194"/> <entry
entry="-57" weight="0.6551463"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="30"
neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.5497866"/> <entry entry="-2"
weight="0.51017326"/> <entry entry="-3" weight="0.6652093"/> <entry entry="4" weight="0.65005535"/> <entry entry="-5" weight="0.21378882"/> <entry
entry="-6" weight="0.25197464"/> <entry entry="-7" weight="0.8550203"/>
<entry entry="-8" weight="0.46235755"/> <entry entry="-9"
weight="0.5418829"/> <entry entry="-10" weight="0.6260581"/> <entry entry="11" weight="0.21216783"/> <entry entry="-12" weight="0.866245"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

458

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-13" weight="0.47272307"/> <entry entry="-14" weight="0.47880456"/>
<entry entry="-15" weight="0.413934"/> <entry entry="-16"
weight="0.13779631"/> <entry entry="-17" weight="0.5543422"/> <entry entry="18" weight="0.47477794"/> <entry entry="-19" weight="0.5939042"/> <entry
entry="-20" weight="0.51545113"/> <entry entry="-21" weight="0.7751178"/>
<entry entry="-22" weight="0.7018045"/> <entry entry="-23"
weight="0.33425307"/> <entry entry="-24" weight="0.81474966"/> <entry
entry="-25" weight="0.82718945"/> <entry entry="-26" weight="0.52286965"/>
<entry entry="-27" weight="0.30139667"/> <entry entry="-28"
weight="0.7169807"/> <entry entry="-29" weight="0.6585155"/> <entry entry="30" weight="0.3354477"/> <entry entry="-31" weight="0.5867507"/> <entry
entry="-32" weight="0.7354624"/> <entry entry="-33" weight="0.8053365"/>
<entry entry="-34" weight="0.9752619"/> <entry entry="-35"
weight="0.30260283"/> <entry entry="-36" weight="0.47738037"/> <entry
entry="-37" weight="0.9008166"/> <entry entry="-38" weight="0.5721144"/>
<entry entry="-39" weight="0.5291626"/> <entry entry="-40"
weight="0.40104225"/> <entry entry="-41" weight="0.8232177"/> <entry entry="42" weight="0.6877458"/> <entry entry="-43" weight="0.48131937"/> <entry
entry="-44" weight="0.5838696"/> <entry entry="-45" weight="0.590658"/>
<entry entry="-46" weight="0.2963248"/> <entry entry="-47"
weight="0.32481074"/> <entry entry="-48" weight="0.35837123"/> <entry
entry="-49" weight="0.32149172"/> <entry entry="-50" weight="0.0982018"/>
<entry entry="-51" weight="0.5498457"/> <entry entry="-52"
weight="0.4885724"/> <entry entry="-53" weight="0.43802217"/> <entry entry="54" weight="0.63805336"/> <entry entry="-55" weight="0.86822605"/> <entry
entry="-56" weight="0.33160266"/> <entry entry="-57" weight="0.5502513"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="31" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.61916006"/> <entry entry="-2"
weight="0.3382686"/> <entry entry="-3" weight="0.30272907"/> <entry entry="4" weight="0.49398577"/> <entry entry="-5" weight="0.13574117"/> <entry
entry="-6" weight="0.6005313"/> <entry entry="-7" weight="0.9485615"/> <entry
entry="-8" weight="0.2698043"/> <entry entry="-9" weight="0.35043746"/>
<entry entry="-10" weight="0.71867895"/> <entry entry="-11"
weight="0.1342834"/> <entry entry="-12" weight="0.53149796"/> <entry entry="13" weight="0.256085"/> <entry entry="-14" weight="0.67631274"/> <entry
entry="-15" weight="0.22209705"/> <entry entry="-16" weight="0.057286445"/>
<entry entry="-17" weight="0.6128353"/> <entry entry="-18"
weight="0.5300689"/> <entry entry="-19" weight="0.29432884"/> <entry entry="20" weight="0.55574787"/> <entry entry="-21" weight="0.69976175"/> <entry
entry="-22" weight="0.5761349"/> <entry entry="-23" weight="0.57355124"/>
<entry entry="-24" weight="0.5377871"/> <entry entry="-25"
weight="0.84032065"/> <entry entry="-26" weight="0.3701409"/> <entry entry="27" weight="0.15695369"/> <entry entry="-28" weight="0.88526756"/> <entry
entry="-29" weight="0.6799295"/> <entry entry="-30" weight="0.45692176"/>
<entry entry="-31" weight="0.47660315"/> <entry entry="-32"
weight="0.42061922"/> <entry entry="-33" weight="0.6136538"/> <entry entry="34" weight="0.98536026"/> <entry entry="-35" weight="0.3101017"/> <entry
entry="-36" weight="0.33597046"/> <entry entry="-37" weight="0.87617314"/>
<entry entry="-38" weight="0.7393187"/> <entry entry="-39"
weight="0.33700603"/> <entry entry="-40" weight="0.57448274"/> <entry
entry="-41" weight="0.5712104"/> <entry entry="-42" weight="0.54706377"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

459

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<entry entry="-43" weight="0.25225803"/> <entry entry="-44"
weight="0.38462025"/> <entry entry="-45" weight="0.75007653"/> <entry
entry="-46" weight="0.2845614"/> <entry entry="-47" weight="0.1590155"/>
<entry entry="-48" weight="0.2944684"/> <entry entry="-49"
weight="0.59818184"/> <entry entry="-50" weight="0.2504217"/> <entry entry="51" weight="0.25781924"/> <entry entry="-52" weight="0.32241452"/> <entry
entry="-53" weight="0.58992845"/> <entry entry="-54" weight="0.34086427"/>
<entry entry="-55" weight="0.5543686"/> <entry entry="-56"
weight="0.33498657"/> <entry entry="-57" weight="0.654921"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="32"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.5550679"/> <entry entry="-2"
weight="0.30064535"/> <entry entry="-3" weight="0.350149"/> <entry entry="-4"
weight="0.43676752"/> <entry entry="-5" weight="0.15910059"/> <entry entry="6" weight="0.66071755"/> <entry entry="-7" weight="0.8962509"/> <entry
entry="-8" weight="0.35844487"/> <entry entry="-9" weight="0.36515757"/>
<entry entry="-10" weight="0.6198789"/> <entry entry="-11"
weight="0.25350708"/> <entry entry="-12" weight="0.51485753"/> <entry
entry="-13" weight="0.23081768"/> <entry entry="-14" weight="0.8944181"/>
<entry entry="-15" weight="0.12575881"/> <entry entry="-16"
weight="0.1442217"/> <entry entry="-17" weight="0.5013409"/> <entry entry="18" weight="0.5010468"/> <entry entry="-19" weight="0.27421367"/> <entry
entry="-20" weight="0.59789556"/> <entry entry="-21" weight="0.5710261"/>
<entry entry="-22" weight="0.60818875"/> <entry entry="-23"
weight="0.7473167"/> <entry entry="-24" weight="0.5433496"/> <entry entry="25" weight="0.7539845"/> <entry entry="-26" weight="0.3295044"/> <entry
entry="-27" weight="0.06390699"/> <entry entry="-28" weight="0.8591409"/>
<entry entry="-29" weight="0.6034475"/> <entry entry="-30"
weight="0.49393135"/> <entry entry="-31" weight="0.56335247"/> <entry
entry="-32" weight="0.44436514"/> <entry entry="-33" weight="0.5776615"/>
<entry entry="-34" weight="0.90742457"/> <entry entry="-35"
weight="0.5262253"/> <entry entry="-36" weight="0.47024855"/> <entry entry="37" weight="0.7658118"/> <entry entry="-38" weight="0.7642909"/> <entry
entry="-39" weight="0.342183"/> <entry entry="-40" weight="0.7553618"/>
<entry entry="-41" weight="0.4630877"/> <entry entry="-42"
weight="0.3859327"/> <entry entry="-43" weight="0.09794644"/> <entry entry="44" weight="0.25394022"/> <entry entry="-45" weight="0.7974598"/> <entry
entry="-46" weight="0.39761296"/> <entry entry="-47" weight="0.13129476"/>
<entry entry="-48" weight="0.48710793"/> <entry entry="-49"
weight="0.7052608"/> <entry entry="-50" weight="0.28353885"/> <entry entry="51" weight="0.19314149"/> <entry entry="-52" weight="0.2924592"/> <entry
entry="-53" weight="0.76866794"/> <entry entry="-54" weight="0.08755084"/>
<entry entry="-55" weight="0.5642251"/> <entry entry="-56"
weight="0.3889171"/> <entry entry="-57" weight="0.78411835"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="3"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

460

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


id="33" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.645871"/> <entry entry="-2" weight="0.4213917"/>
<entry entry="-3" weight="0.20176657"/> <entry entry="-4"
weight="0.5478845"/> <entry entry="-5" weight="0.33645758"/> <entry entry="6" weight="0.6472796"/> <entry entry="-7" weight="0.93553036"/> <entry
entry="-8" weight="0.29320508"/> <entry entry="-9" weight="0.21377787"/>
<entry entry="-10" weight="0.5271768"/> <entry entry="-11"
weight="0.23530708"/> <entry entry="-12" weight="0.30717796"/> <entry
entry="-13" weight="0.13980992"/> <entry entry="-14" weight="0.8503622"/>
<entry entry="-15" weight="0.0766845"/> <entry entry="-16"
weight="0.32923064"/> <entry entry="-17" weight="0.6457639"/> <entry entry="18" weight="0.40468735"/> <entry entry="-19" weight="0.15996379"/> <entry
entry="-20" weight="0.539448"/> <entry entry="-21" weight="0.5225402"/>
<entry entry="-22" weight="0.57053035"/> <entry entry="-23"
weight="0.60309577"/> <entry entry="-24" weight="0.4543767"/> <entry entry="25" weight="0.61199933"/> <entry entry="-26" weight="0.36048347"/> <entry
entry="-27" weight="0.04089351"/> <entry entry="-28" weight="0.9208307"/>
<entry entry="-29" weight="0.71252733"/> <entry entry="-30"
weight="0.48727688"/> <entry entry="-31" weight="0.38942575"/> <entry
entry="-32" weight="0.26154464"/> <entry entry="-33" weight="0.6311238"/>
<entry entry="-34" weight="0.7799008"/> <entry entry="-35"
weight="0.618937"/> <entry entry="-36" weight="0.3701908"/> <entry entry="37" weight="0.77309746"/> <entry entry="-38" weight="0.8616898"/> <entry
entry="-39" weight="0.36275935"/> <entry entry="-40" weight="0.718952"/>
<entry entry="-41" weight="0.32335198"/> <entry entry="-42"
weight="0.5195858"/> <entry entry="-43" weight="0.2087346"/> <entry entry="44" weight="0.30901214"/> <entry entry="-45" weight="0.6347734"/> <entry
entry="-46" weight="0.37398726"/> <entry entry="-47" weight="0.24148472"/>
<entry entry="-48" weight="0.54062593"/> <entry entry="-49"
weight="0.82667065"/> <entry entry="-50" weight="0.30944395"/> <entry
entry="-51" weight="0.11312976"/> <entry entry="-52" weight="0.18048033"/>
<entry entry="-53" weight="0.64995146"/> <entry entry="-54"
weight="0.053611893"/> <entry entry="-55" weight="0.57694066"/> <entry
entry="-56" weight="0.5281312"/> <entry entry="-57" weight="0.78929293"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="34" neuronClass="null">
<entries>
<entry entry="-1" weight="0.47271794"/> <entry entry="-2"
weight="0.68912923"/> <entry entry="-3" weight="0.40577853"/> <entry entry="4" weight="0.6615682"/> <entry entry="-5" weight="0.49985456"/> <entry
entry="-6" weight="0.43179467"/> <entry entry="-7" weight="0.82055587"/>
<entry entry="-8" weight="0.45866144"/> <entry entry="-9"
weight="0.25923353"/> <entry entry="-10" weight="0.3143031"/> <entry entry="11" weight="0.43421212"/> <entry entry="-12" weight="0.45489183"/> <entry
entry="-13" weight="0.27188337"/> <entry entry="-14" weight="0.81342155"/>
<entry entry="-15" weight="0.2250878"/> <entry entry="-16"
weight="0.6326172"/> <entry entry="-17" weight="0.6413959"/> <entry entry="18" weight="0.33274737"/> <entry entry="-19" weight="0.32537138"/> <entry
entry="-20" weight="0.4369872"/> <entry entry="-21" weight="0.50882524"/>
<entry entry="-22" weight="0.7040434"/> <entry entry="-23"
weight="0.36637092"/> <entry entry="-24" weight="0.6449618"/> <entry entry="25" weight="0.4351295"/> <entry entry="-26" weight="0.56466544"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

461

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-27" weight="0.08902261"/> <entry entry="-28" weight="0.84203446"/>
<entry entry="-29" weight="0.731174"/> <entry entry="-30"
weight="0.42507264"/> <entry entry="-31" weight="0.42714897"/> <entry
entry="-32" weight="0.42678237"/> <entry entry="-33" weight="0.8918242"/>
<entry entry="-34" weight="0.5768895"/> <entry entry="-35"
weight="0.9230958"/> <entry entry="-36" weight="0.6092769"/> <entry entry="37" weight="0.7063888"/> <entry entry="-38" weight="0.8102529"/> <entry
entry="-39" weight="0.6243952"/> <entry entry="-40" weight="0.69690055"/>
<entry entry="-41" weight="0.37241107"/> <entry entry="-42"
weight="0.5621257"/> <entry entry="-43" weight="0.33346352"/> <entry entry="44" weight="0.4264422"/> <entry entry="-45" weight="0.39535654"/> <entry
entry="-46" weight="0.39473113"/> <entry entry="-47" weight="0.49243248"/>
<entry entry="-48" weight="0.9025186"/> <entry entry="-49"
weight="0.6503519"/> <entry entry="-50" weight="0.24783637"/> <entry entry="51" weight="0.305431"/> <entry entry="-52" weight="0.26538414"/> <entry
entry="-53" weight="0.59406435"/> <entry entry="-54" weight="0.12819856"/>
<entry entry="-55" weight="0.9384205"/> <entry entry="-56"
weight="0.68699276"/> <entry entry="-57" weight="0.7526452"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="35"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.6226771"/> <entry entry="-2" weight="0.769322"/>
<entry entry="-3" weight="0.3175314"/> <entry entry="-4"
weight="0.59271955"/> <entry entry="-5" weight="0.5635487"/> <entry entry="6" weight="0.64567983"/> <entry entry="-7" weight="0.8198336"/> <entry
entry="-8" weight="0.58694303"/> <entry entry="-9" weight="0.24586773"/>
<entry entry="-10" weight="0.25926352"/> <entry entry="-11"
weight="0.34906518"/> <entry entry="-12" weight="0.19623542"/> <entry
entry="-13" weight="0.32939005"/> <entry entry="-14" weight="0.5815435"/>
<entry entry="-15" weight="0.3526262"/> <entry entry="-16"
weight="0.7771092"/> <entry entry="-17" weight="0.92418325"/> <entry entry="18" weight="0.14552769"/> <entry entry="-19" weight="0.2994281"/> <entry
entry="-20" weight="0.61028063"/> <entry entry="-21" weight="0.21392712"/>
<entry entry="-22" weight="0.4930079"/> <entry entry="-23"
weight="0.35368103"/> <entry entry="-24" weight="0.49647394"/> <entry
entry="-25" weight="0.34200943"/> <entry entry="-26" weight="0.46055532"/>
<entry entry="-27" weight="0.43414858"/> <entry entry="-28"
weight="0.806582"/> <entry entry="-29" weight="0.6434057"/> <entry entry="30" weight="0.45341298"/> <entry entry="-31" weight="0.41201124"/> <entry
entry="-32" weight="0.4056309"/> <entry entry="-33" weight="0.60268235"/>
<entry entry="-34" weight="0.66690695"/> <entry entry="-35"
weight="0.91879576"/> <entry entry="-36" weight="0.5561767"/> <entry entry="37" weight="0.5609104"/> <entry entry="-38" weight="0.7470572"/> <entry
entry="-39" weight="0.7271975"/> <entry entry="-40" weight="0.43882418"/>
<entry entry="-41" weight="0.4125568"/> <entry entry="-42"
weight="0.78502214"/> <entry entry="-43" weight="0.62093663"/> <entry
entry="-44" weight="0.6683423"/> <entry entry="-45" weight="0.3822497"/>
<entry entry="-46" weight="0.27857408"/> <entry entry="-47"
weight="0.66059625"/> <entry entry="-48" weight="0.98050314"/> <entry
entry="-49" weight="0.6188675"/> <entry entry="-50" weight="0.462206"/>
<entry entry="-51" weight="0.39165008"/> <entry entry="-52"
weight="0.21240072"/> <entry entry="-53" weight="0.33941177"/> <entry
entry="-54" weight="0.25946498"/> <entry entry="-55" weight="0.6926752"/>
<entry entry="-56" weight="0.5651705"/> <entry entry="-57"
weight="0.5199944"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

462

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="4"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="36"
neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.5051719"/> <entry entry="-2"
weight="0.73273194"/> <entry entry="-3" weight="0.3445073"/> <entry entry="4" weight="0.6510578"/> <entry entry="-5" weight="0.34966147"/> <entry
entry="-6" weight="0.47263262"/> <entry entry="-7" weight="0.893939"/> <entry
entry="-8" weight="0.38211754"/> <entry entry="-9" weight="0.31925917"/>
<entry entry="-10" weight="0.44375235"/> <entry entry="-11"
weight="0.19209422"/> <entry entry="-12" weight="0.52886003"/> <entry
entry="-13" weight="0.4439469"/> <entry entry="-14" weight="0.37262356"/>
<entry entry="-15" weight="0.46308017"/> <entry entry="-16"
weight="0.44266048"/> <entry entry="-17" weight="0.93657064"/> <entry
entry="-18" weight="0.37902308"/> <entry entry="-19" weight="0.35845482"/>
<entry entry="-20" weight="0.51336247"/> <entry entry="-21"
weight="0.57379794"/> <entry entry="-22" weight="0.5882125"/> <entry entry="23" weight="0.21230847"/> <entry entry="-24" weight="0.58669645"/> <entry
entry="-25" weight="0.5891893"/> <entry entry="-26" weight="0.5452958"/>
<entry entry="-27" weight="0.35904804"/> <entry entry="-28"
weight="0.84887135"/> <entry entry="-29" weight="0.7703278"/> <entry entry="30" weight="0.37507287"/> <entry entry="-31" weight="0.39346486"/> <entry
entry="-32" weight="0.50311"/> <entry entry="-33" weight="0.8007201"/> <entry
entry="-34" weight="0.8236731"/> <entry entry="-35" weight="0.48847967"/>
<entry entry="-36" weight="0.43534452"/> <entry entry="-37"
weight="0.767222"/> <entry entry="-38" weight="0.6986876"/> <entry entry="39" weight="0.68984246"/> <entry entry="-40" weight="0.28408548"/> <entry
entry="-41" weight="0.63956255"/> <entry entry="-42" weight="0.90940994"/>
<entry entry="-43" weight="0.65629923"/> <entry entry="-44"
weight="0.78691864"/> <entry entry="-45" weight="0.40754557"/> <entry
entry="-46" weight="0.14302126"/> <entry entry="-47" weight="0.5020496"/>
<entry entry="-48" weight="0.6594658"/> <entry entry="-49"
weight="0.3482146"/> <entry entry="-50" weight="0.26798132"/> <entry entry="51" weight="0.5032027"/> <entry entry="-52" weight="0.3718285"/> <entry
entry="-53" weight="0.30563593"/> <entry entry="-54" weight="0.5407718"/>
<entry entry="-55" weight="0.8287838"/> <entry entry="-56"
weight="0.4948436"/> <entry entry="-57" weight="0.44277543"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction" id="37"
neuronClass="null">
<entries>
<entry entry="-1" weight="0.41154906"/> <entry entry="-2"
weight="0.5442487"/> <entry entry="-3" weight="0.52465844"/> <entry entry="4" weight="0.6388369"/> <entry entry="-5" weight="0.21931674"/> <entry
entry="-6" weight="0.2828248"/> <entry entry="-7" weight="0.9007026"/> <entry
entry="-8" weight="0.4082709"/> <entry entry="-9" weight="0.60778165"/>
<entry entry="-10" weight="0.49653298"/> <entry entry="-11"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

463

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.2018622"/> <entry entry="-12" weight="0.9097403"/> <entry entry="13" weight="0.47492835"/> <entry entry="-14" weight="0.3900826"/> <entry
entry="-15" weight="0.34520423"/> <entry entry="-16" weight="0.10092909"/>
<entry entry="-17" weight="0.6219027"/> <entry entry="-18"
weight="0.41342413"/> <entry entry="-19" weight="0.4866255"/> <entry entry="20" weight="0.49227464"/> <entry entry="-21" weight="0.70709515"/> <entry
entry="-22" weight="0.70985633"/> <entry entry="-23" weight="0.30719888"/>
<entry entry="-24" weight="0.6855194"/> <entry entry="-25"
weight="0.7281815"/> <entry entry="-26" weight="0.59644103"/> <entry entry="27" weight="0.22388315"/> <entry entry="-28" weight="0.79391855"/> <entry
entry="-29" weight="0.74222624"/> <entry entry="-30" weight="0.31875637"/>
<entry entry="-31" weight="0.5507308"/> <entry entry="-32"
weight="0.74601376"/> <entry entry="-33" weight="0.782318"/> <entry entry="34" weight="0.9744477"/> <entry entry="-35" weight="0.2494914"/> <entry
entry="-36" weight="0.55538565"/> <entry entry="-37" weight="0.8044559"/>
<entry entry="-38" weight="0.5571419"/> <entry entry="-39"
weight="0.5430303"/> <entry entry="-40" weight="0.48100716"/> <entry entry="41" weight="0.7517346"/> <entry entry="-42" weight="0.71933514"/> <entry
entry="-43" weight="0.47350878"/> <entry entry="-44" weight="0.6743231"/>
<entry entry="-45" weight="0.54960144"/> <entry entry="-46"
weight="0.30789137"/> <entry entry="-47" weight="0.2042294"/> <entry entry="48" weight="0.4865533"/> <entry entry="-49" weight="0.36429322"/> <entry
entry="-50" weight="0.16693154"/> <entry entry="-51" weight="0.42018193"/>
<entry entry="-52" weight="0.5165991"/> <entry entry="-53"
weight="0.5816766"/> <entry entry="-54" weight="0.5300634"/> <entry entry="55" weight="0.9360256"/> <entry entry="-56" weight="0.33276638"/> <entry
entry="-57" weight="0.46635738"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="38" neuronClass="null">
<entries>
<entry entry="-1" weight="0.28966445"/> <entry entry="-2"
weight="0.5530942"/> <entry entry="-3" weight="0.5094442"/> <entry entry="-4"
weight="0.51532316"/> <entry entry="-5" weight="0.2006435"/> <entry entry="6" weight="0.405358"/> <entry entry="-7" weight="0.87476593"/> <entry
entry="-8" weight="0.4277806"/> <entry entry="-9" weight="0.4896566"/> <entry
entry="-10" weight="0.4317306"/> <entry entry="-11" weight="0.19499946"/>
<entry entry="-12" weight="0.8578581"/> <entry entry="-13"
weight="0.51834124"/> <entry entry="-14" weight="0.48541704"/> <entry
entry="-15" weight="0.3263374"/> <entry entry="-16" weight="0.14560561"/>
<entry entry="-17" weight="0.5912787"/> <entry entry="-18"
weight="0.46227562"/> <entry entry="-19" weight="0.38840872"/> <entry
entry="-20" weight="0.5179972"/> <entry entry="-21" weight="0.6608622"/>
<entry entry="-22" weight="0.6907402"/> <entry entry="-23"
weight="0.3206717"/> <entry entry="-24" weight="0.64643353"/> <entry entry="25" weight="0.78084266"/> <entry entry="-26" weight="0.5962004"/> <entry
entry="-27" weight="0.24059296"/> <entry entry="-28" weight="0.8169786"/>
<entry entry="-29" weight="0.7042095"/> <entry entry="-30"
weight="0.3614744"/> <entry entry="-31" weight="0.58666295"/> <entry entry="32" weight="0.68928695"/> <entry entry="-33" weight="0.8055154"/> <entry
entry="-34" weight="0.89637774"/> <entry entry="-35" weight="0.35157937"/>
<entry entry="-36" weight="0.55197054"/> <entry entry="-37"
weight="0.7076509"/> <entry entry="-38" weight="0.58896613"/> <entry entry="39" weight="0.6236091"/> <entry entry="-40" weight="0.51415265"/> <entry
entry="-41" weight="0.7222489"/> <entry entry="-42" weight="0.68011093"/>
<entry entry="-43" weight="0.39835867"/> <entry entry="-44"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

464

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.72867143"/> <entry entry="-45" weight="0.47800124"/> <entry
entry="-46" weight="0.2114915"/> <entry entry="-47" weight="0.20520505"/>
<entry entry="-48" weight="0.5960392"/> <entry entry="-49"
weight="0.34151354"/> <entry entry="-50" weight="0.18947625"/> <entry
entry="-51" weight="0.44011205"/> <entry entry="-52" weight="0.58823955"/>
<entry entry="-53" weight="0.6242529"/> <entry entry="-54"
weight="0.50001395"/> <entry entry="-55" weight="0.9382123"/> <entry entry="56" weight="0.3518415"/> <entry entry="-57" weight="0.46744984"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="39" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.4029321"/> <entry entry="-2" weight="0.6892429"/>
<entry entry="-3" weight="0.357571"/> <entry entry="-4" weight="0.638586"/>
<entry entry="-5" weight="0.6015097"/> <entry entry="-6"
weight="0.43217203"/> <entry entry="-7" weight="0.8620798"/> <entry entry="8" weight="0.5515534"/> <entry entry="-9" weight="0.3435554"/> <entry
entry="-10" weight="0.15540247"/> <entry entry="-11" weight="0.33596414"/>
<entry entry="-12" weight="0.45850152"/> <entry entry="-13"
weight="0.25832742"/> <entry entry="-14" weight="0.7386346"/> <entry entry="15" weight="0.05860064"/> <entry entry="-16" weight="0.5539477"/> <entry
entry="-17" weight="0.588501"/> <entry entry="-18" weight="0.19488458"/>
<entry entry="-19" weight="0.2467924"/> <entry entry="-20"
weight="0.5005346"/> <entry entry="-21" weight="0.38884073"/> <entry entry="22" weight="0.681135"/> <entry entry="-23" weight="0.2970165"/> <entry
entry="-24" weight="0.49573824"/> <entry entry="-25" weight="0.37306258"/>
<entry entry="-26" weight="0.61350316"/> <entry entry="-27"
weight="0.1119991"/> <entry entry="-28" weight="0.825759"/> <entry entry="29" weight="0.71925354"/> <entry entry="-30" weight="0.36827388"/> <entry
entry="-31" weight="0.44472352"/> <entry entry="-32" weight="0.40681598"/>
<entry entry="-33" weight="0.7860757"/> <entry entry="-34"
weight="0.6163522"/> <entry entry="-35" weight="0.77358246"/> <entry entry="36" weight="0.5723055"/> <entry entry="-37" weight="0.5522317"/> <entry
entry="-38" weight="0.734137"/> <entry entry="-39" weight="0.61935997"/>
<entry entry="-40" weight="0.7904732"/> <entry entry="-41"
weight="0.29760545"/> <entry entry="-42" weight="0.66533023"/> <entry
entry="-43" weight="0.38032687"/> <entry entry="-44" weight="0.59056896"/>
<entry entry="-45" weight="0.33338207"/> <entry entry="-46"
weight="0.344482"/> <entry entry="-47" weight="0.34843618"/> <entry entry="48" weight="0.88076097"/> <entry entry="-49" weight="0.7462249"/> <entry
entry="-50" weight="0.33780125"/> <entry entry="-51" weight="0.16231516"/>
<entry entry="-52" weight="0.3389485"/> <entry entry="-53"
weight="0.639755"/> <entry entry="-54" weight="0.103424706"/> <entry entry="55" weight="0.94055855"/> <entry entry="-56" weight="0.6304933"/> <entry
entry="-57" weight="0.6007773"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="40" neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.40877306"/> <entry entry="-2"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

465

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.6886667"/> <entry entry="-3" weight="0.36097282"/> <entry entry="4" weight="0.6287234"/> <entry entry="-5" weight="0.6059488"/> <entry
entry="-6" weight="0.44118583"/> <entry entry="-7" weight="0.8696511"/>
<entry entry="-8" weight="0.55887586"/> <entry entry="-9"
weight="0.3384382"/> <entry entry="-10" weight="0.1583643"/> <entry entry="11" weight="0.33793297"/> <entry entry="-12" weight="0.454022"/> <entry
entry="-13" weight="0.2546571"/> <entry entry="-14" weight="0.7338038"/>
<entry entry="-15" weight="0.070402846"/> <entry entry="-16"
weight="0.5575661"/> <entry entry="-17" weight="0.5902662"/> <entry entry="18" weight="0.19560127"/> <entry entry="-19" weight="0.23778015"/> <entry
entry="-20" weight="0.50502145"/> <entry entry="-21" weight="0.3766383"/>
<entry entry="-22" weight="0.6706749"/> <entry entry="-23"
weight="0.31079367"/> <entry entry="-24" weight="0.50834763"/> <entry
entry="-25" weight="0.38251618"/> <entry entry="-26" weight="0.6033898"/>
<entry entry="-27" weight="0.11584527"/> <entry entry="-28"
weight="0.83300686"/> <entry entry="-29" weight="0.7131045"/> <entry entry="30" weight="0.37670875"/> <entry entry="-31" weight="0.45041487"/> <entry
entry="-32" weight="0.41338554"/> <entry entry="-33" weight="0.78361714"/>
<entry entry="-34" weight="0.6132528"/> <entry entry="-35"
weight="0.7839715"/> <entry entry="-36" weight="0.5723536"/> <entry entry="37" weight="0.5568043"/> <entry entry="-38" weight="0.73238397"/> <entry
entry="-39" weight="0.6229792"/> <entry entry="-40" weight="0.78018934"/>
<entry entry="-41" weight="0.3044488"/> <entry entry="-42"
weight="0.66419876"/> <entry entry="-43" weight="0.37153018"/> <entry
entry="-44" weight="0.58758134"/> <entry entry="-45" weight="0.33190554"/>
<entry entry="-46" weight="0.35338578"/> <entry entry="-47"
weight="0.34822208"/> <entry entry="-48" weight="0.8913719"/> <entry entry="49" weight="0.7521174"/> <entry entry="-50" weight="0.3375739"/> <entry
entry="-51" weight="0.17079638"/> <entry entry="-52" weight="0.33733234"/>
<entry entry="-53" weight="0.6372009"/> <entry entry="-54"
weight="0.10600536"/> <entry entry="-55" weight="0.937383"/> <entry entry="56" weight="0.6235602"/> <entry entry="-57" weight="0.5997557"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="41" neuronClass="null">
<entries>
<entry entry="-1" weight="0.5255994"/> <entry entry="-2" weight="0.6974773"/>
<entry entry="-3" weight="0.4111729"/> <entry entry="-4" weight="0.5729753"/>
<entry entry="-5" weight="0.72114515"/> <entry entry="-6"
weight="0.7136898"/> <entry entry="-7" weight="0.68581796"/> <entry entry="8" weight="0.58767635"/> <entry entry="-9" weight="0.12370596"/> <entry
entry="-10" weight="0.17003079"/> <entry entry="-11" weight="0.34128666"/>
<entry entry="-12" weight="0.20131765"/> <entry entry="-13"
weight="0.37972352"/> <entry entry="-14" weight="0.6953396"/> <entry entry="15" weight="0.2139277"/> <entry entry="-16" weight="0.8350423"/> <entry
entry="-17" weight="0.74667996"/> <entry entry="-18" weight="0.30751455"/>
<entry entry="-19" weight="0.14476362"/> <entry entry="-20"
weight="0.48906544"/> <entry entry="-21" weight="0.32153094"/> <entry
entry="-22" weight="0.4354459"/> <entry entry="-23" weight="0.44947892"/>
<entry entry="-24" weight="0.50154924"/> <entry entry="-25"
weight="0.4714693"/> <entry entry="-26" weight="0.45759177"/> <entry entry="27" weight="0.34041733"/> <entry entry="-28" weight="0.7711767"/> <entry
entry="-29" weight="0.62476903"/> <entry entry="-30" weight="0.3702611"/>
<entry entry="-31" weight="0.50869685"/> <entry entry="-32"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

466

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


weight="0.25869328"/> <entry entry="-33" weight="0.65742147"/> <entry
entry="-34" weight="0.38953573"/> <entry entry="-35" weight="0.81668663"/>
<entry entry="-36" weight="0.38799638"/> <entry entry="-37"
weight="0.38539082"/> <entry entry="-38" weight="0.7421551"/> <entry entry="39" weight="0.778838"/> <entry entry="-40" weight="0.55465376"/> <entry
entry="-41" weight="0.31639338"/> <entry entry="-42" weight="0.77459526"/>
<entry entry="-43" weight="0.48490646"/> <entry entry="-44"
weight="0.83395034"/> <entry entry="-45" weight="0.13998006"/> <entry
entry="-46" weight="0.2139687"/> <entry entry="-47" weight="0.44356006"/>
<entry entry="-48" weight="0.930434"/> <entry entry="-49"
weight="0.7133509"/> <entry entry="-50" weight="0.41104624"/> <entry entry="51" weight="0.47450587"/> <entry entry="-52" weight="0.45632672"/> <entry
entry="-53" weight="0.5330336"/> <entry entry="-54" weight="0.2569347"/>
<entry entry="-55" weight="0.82319033"/> <entry entry="-56"
weight="0.7461829"/> <entry entry="-57" weight="0.53999996"/>
</entries>
<examplesInClasses/>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="42" neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.41558588"/> <entry entry="-2"
weight="0.6343569"/> <entry entry="-3" weight="0.32397225"/> <entry entry="4" weight="0.7292081"/> <entry entry="-5" weight="0.3484071"/> <entry
entry="-6" weight="0.32136986"/> <entry entry="-7" weight="0.8355115"/>
<entry entry="-8" weight="0.3182866"/> <entry entry="-9"
weight="0.59593433"/> <entry entry="-10" weight="0.52024376"/> <entry
entry="-11" weight="0.18249524"/> <entry entry="-12" weight="0.80300486"/>
<entry entry="-13" weight="0.5243186"/> <entry entry="-14"
weight="0.26913083"/> <entry entry="-15" weight="0.46948445"/> <entry
entry="-16" weight="0.16322732"/> <entry entry="-17" weight="0.81158507"/>
<entry entry="-18" weight="0.38546324"/> <entry entry="-19" weight="0.4091"/>
<entry entry="-20" weight="0.4433497"/> <entry entry="-21"
weight="0.7356043"/> <entry entry="-22" weight="0.62865746"/> <entry entry="23" weight="0.41538924"/> <entry entry="-24" weight="0.5786637"/> <entry
entry="-25" weight="0.5523783"/> <entry entry="-26" weight="0.6102914"/>
<entry entry="-27" weight="0.2928409"/> <entry entry="-28"
weight="0.73679185"/> <entry entry="-29" weight="0.6914959"/> <entry entry="30" weight="0.15360473"/> <entry entry="-31" weight="0.5395323"/> <entry
entry="-32" weight="0.6443835"/> <entry entry="-33" weight="0.6490706"/>
<entry entry="-34" weight="0.9758582"/> <entry entry="-35"
weight="0.045082193"/> <entry entry="-36" weight="0.47085938"/> <entry
entry="-37" weight="0.6645075"/> <entry entry="-38" weight="0.47859162"/>
<entry entry="-39" weight="0.58985674"/> <entry entry="-40"
weight="0.32832664"/> <entry entry="-41" weight="0.76390797"/> <entry
entry="-42" weight="0.95101684"/> <entry entry="-43" weight="0.6944449"/>
<entry entry="-44" weight="0.85909903"/> <entry entry="-45"
weight="0.49074847"/> <entry entry="-46" weight="0.19564109"/> <entry
entry="-47" weight="0.22332504"/> <entry entry="-48" weight="0.44340837"/>
<entry entry="-49" weight="0.38384762"/> <entry entry="-50"
weight="0.32788497"/> <entry entry="-51" weight="0.4892669"/> <entry entry="52" weight="0.5067467"/> <entry entry="-53" weight="0.4957213"/> <entry
entry="-54" weight="0.56702745"/> <entry entry="-55" weight="0.8365951"/>
<entry entry="-56" weight="0.47100526"/> <entry entry="-57"
weight="0.2572744"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="1"/> <examplesClassCount class="0.0"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

467

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="43" neuronClass="0.0">
<entries>
<entry entry="-1" weight="0.34301138"/> <entry entry="-2"
weight="0.54405487"/> <entry entry="-3" weight="0.5230446"/> <entry
entry="-4" weight="0.54724324"/> <entry entry="-5" weight="0.24152188"/>
<entry entry="-6" weight="0.35345367"/> <entry entry="-7"
weight="0.8810695"/> <entry entry="-8" weight="0.3973383"/> <entry entry="9" weight="0.5275016"/> <entry entry="-10" weight="0.45858842"/> <entry
entry="-11" weight="0.20558059"/> <entry entry="-12" weight="0.8659147"/>
<entry entry="-13" weight="0.5163107"/> <entry entry="-14"
weight="0.43728969"/> <entry entry="-15" weight="0.35350138"/> <entry
entry="-16" weight="0.116749555"/> <entry entry="-17" weight="0.5957086"/>
<entry entry="-18" weight="0.47128493"/> <entry entry="-19"
weight="0.3691346"/> <entry entry="-20" weight="0.4874617"/> <entry
entry="-21" weight="0.7095426"/> <entry entry="-22" weight="0.6778865"/>
<entry entry="-23" weight="0.35387388"/> <entry entry="-24"
weight="0.65704167"/> <entry entry="-25" weight="0.8027575"/> <entry
entry="-26" weight="0.6259255"/> <entry entry="-27" weight="0.21064693"/>
<entry entry="-28" weight="0.80870515"/> <entry entry="-29"
weight="0.7436787"/> <entry entry="-30" weight="0.3243318"/> <entry
entry="-31" weight="0.5559448"/> <entry entry="-32" weight="0.68928885"/>
<entry entry="-33" weight="0.8130546"/> <entry entry="-34"
weight="0.8851049"/> <entry entry="-35" weight="0.30753362"/> <entry
entry="-36" weight="0.5162866"/> <entry entry="-37" weight="0.71495616"/>
<entry entry="-38" weight="0.55384725"/> <entry entry="-39"
weight="0.59382033"/> <entry entry="-40" weight="0.50927126"/> <entry
entry="-41" weight="0.74617994"/> <entry entry="-42" weight="0.692585"/>
<entry entry="-43" weight="0.43000436"/> <entry entry="-44"
weight="0.7243985"/> <entry entry="-45" weight="0.449433"/> <entry entry="46" weight="0.22950271"/> <entry entry="-47" weight="0.15790059"/> <entry
entry="-48" weight="0.5500142"/> <entry entry="-49" weight="0.38500577"/>
<entry entry="-50" weight="0.20092928"/> <entry entry="-51"
weight="0.43069473"/> <entry entry="-52" weight="0.58240813"/> <entry
entry="-53" weight="0.6612136"/> <entry entry="-54" weight="0.48583996"/>
<entry entry="-55" weight="0.9500002"/> <entry entry="-56"
weight="0.3920443"/> <entry entry="-57" weight="0.45205396"/>
</entries>
<examplesInClasses>
<examplesClassCount class="0.0" count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="44" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.38946038"/> <entry entry="-2"
weight="0.6715472"/> <entry entry="-3" weight="0.36345193"/> <entry entry="4" weight="0.6558391"/> <entry entry="-5" weight="0.36764544"/> <entry
entry="-6" weight="0.37736243"/> <entry entry="-7" weight="0.9231527"/>
<entry entry="-8" weight="0.32092488"/> <entry entry="-9"
weight="0.34438437"/> <entry entry="-10" weight="0.34806085"/> <entry
entry="-11" weight="0.19120021"/> <entry entry="-12" weight="0.68313044"/>
<entry entry="-13" weight="0.43142086"/> <entry entry="-14"
weight="0.42225608"/> <entry entry="-15" weight="0.302018"/> <entry entry="-

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

468

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


16" weight="0.33101797"/> <entry entry="-17" weight="0.77265465"/> <entry
entry="-18" weight="0.3764537"/> <entry entry="-19" weight="0.26485255"/>
<entry entry="-20" weight="0.43651816"/> <entry entry="-21"
weight="0.6279143"/> <entry entry="-22" weight="0.6682754"/> <entry entry="23" weight="0.19080055"/> <entry entry="-24" weight="0.56089234"/> <entry
entry="-25" weight="0.63463247"/> <entry entry="-26" weight="0.62662333"/>
<entry entry="-27" weight="0.19753923"/> <entry entry="-28"
weight="0.8884669"/> <entry entry="-29" weight="0.8480844"/> <entry entry="30" weight="0.34787717"/> <entry entry="-31" weight="0.3880155"/> <entry
entry="-32" weight="0.5174606"/> <entry entry="-33" weight="0.8667385"/>
<entry entry="-34" weight="0.7702405"/> <entry entry="-35"
weight="0.46233702"/> <entry entry="-36" weight="0.4735215"/> <entry entry="37" weight="0.72837865"/> <entry entry="-38" weight="0.70044065"/> <entry
entry="-39" weight="0.63561064"/> <entry entry="-40" weight="0.45576495"/>
<entry entry="-41" weight="0.58415407"/> <entry entry="-42"
weight="0.81565285"/> <entry entry="-43" weight="0.5110678"/> <entry entry="44" weight="0.7691705"/> <entry entry="-45" weight="0.31094006"/> <entry
entry="-46" weight="0.21425723"/> <entry entry="-47" weight="0.3209833"/>
<entry entry="-48" weight="0.6573215"/> <entry entry="-49"
weight="0.4590911"/> <entry entry="-50" weight="0.19846968"/> <entry entry="51" weight="0.35637373"/> <entry entry="-52" weight="0.46152866"/> <entry
entry="-53" weight="0.53066504"/> <entry entry="-54" weight="0.4473855"/>
<entry entry="-55" weight="0.9626266"/> <entry entry="-56"
weight="0.51531744"/> <entry entry="-57" weight="0.49782953"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="45" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.43721467"/> <entry entry="-2"
weight="0.67242014"/> <entry entry="-3" weight="0.39935666"/> <entry entry="4" weight="0.64406466"/> <entry entry="-5" weight="0.6108569"/> <entry
entry="-6" weight="0.42539835"/> <entry entry="-7" weight="0.87295055"/>
<entry entry="-8" weight="0.5420718"/> <entry entry="-9"
weight="0.34176004"/> <entry entry="-10" weight="0.14880207"/> <entry
entry="-11" weight="0.3265804"/> <entry entry="-12" weight="0.46871638"/>
<entry entry="-13" weight="0.26468176"/> <entry entry="-14"
weight="0.7031592"/> <entry entry="-15" weight="0.06959276"/> <entry entry="16" weight="0.56162155"/> <entry entry="-17" weight="0.619864"/> <entry
entry="-18" weight="0.19224696"/> <entry entry="-19" weight="0.20957673"/>
<entry entry="-20" weight="0.5017303"/> <entry entry="-21"
weight="0.37234312"/> <entry entry="-22" weight="0.6619732"/> <entry entry="23" weight="0.32852593"/> <entry entry="-24" weight="0.5011715"/> <entry
entry="-25" weight="0.3996432"/> <entry entry="-26" weight="0.592081"/>
<entry entry="-27" weight="0.1124104"/> <entry entry="-28"
weight="0.8221793"/> <entry entry="-29" weight="0.7330737"/> <entry entry="30" weight="0.3573472"/> <entry entry="-31" weight="0.42652702"/> <entry
entry="-32" weight="0.4280763"/> <entry entry="-33" weight="0.7825725"/>
<entry entry="-34" weight="0.6011021"/> <entry entry="-35"
weight="0.77868795"/> <entry entry="-36" weight="0.55167377"/> <entry
entry="-37" weight="0.5365429"/> <entry entry="-38" weight="0.7253597"/>
<entry entry="-39" weight="0.6223666"/> <entry entry="-40"
weight="0.7587089"/> <entry entry="-41" weight="0.31603193"/> <entry entry="42" weight="0.6774991"/> <entry entry="-43" weight="0.398548"/> <entry

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

469

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


entry="-44" weight="0.6160074"/> <entry entry="-45" weight="0.29137927"/>
<entry entry="-46" weight="0.35870138"/> <entry entry="-47"
weight="0.3188495"/> <entry entry="-48" weight="0.88599503"/> <entry entry="49" weight="0.763651"/> <entry entry="-50" weight="0.3162631"/> <entry
entry="-51" weight="0.16343157"/> <entry entry="-52" weight="0.33494693"/>
<entry entry="-53" weight="0.66912985"/> <entry entry="-54"
weight="0.09110618"/> <entry entry="-55" weight="0.94880986"/> <entry
entry="-56" weight="0.62705594"/> <entry entry="-57" weight="0.60559225"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="3"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"
id="46" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.4210028"/> <entry entry="-2"
weight="0.73683965"/> <entry entry="-3" weight="0.24668698"/> <entry entry="4" weight="0.66215664"/> <entry entry="-5" weight="0.7511178"/> <entry
entry="-6" weight="0.63942254"/> <entry entry="-7" weight="0.8113778"/>
<entry entry="-8" weight="0.5637071"/> <entry entry="-9" weight="0.3141629"/>
<entry entry="-10" weight="0.101924084"/> <entry entry="-11"
weight="0.3366951"/> <entry entry="-12" weight="0.36075348"/> <entry entry="13" weight="0.3070796"/> <entry entry="-14" weight="0.60199016"/> <entry
entry="-15" weight="0.1283476"/> <entry entry="-16" weight="0.6610238"/>
<entry entry="-17" weight="0.76642007"/> <entry entry="-18"
weight="0.18453214"/> <entry entry="-19" weight="0.08692372"/> <entry
entry="-20" weight="0.50455374"/> <entry entry="-21" weight="0.24567202"/>
<entry entry="-22" weight="0.5252993"/> <entry entry="-23"
weight="0.42813212"/> <entry entry="-24" weight="0.35379422"/> <entry
entry="-25" weight="0.28283352"/> <entry entry="-26" weight="0.53858"/>
<entry entry="-27" weight="0.20420098"/> <entry entry="-28"
weight="0.8627158"/> <entry entry="-29" weight="0.6932837"/> <entry entry="30" weight="0.2748738"/> <entry entry="-31" weight="0.4635614"/> <entry
entry="-32" weight="0.3135466"/> <entry entry="-33" weight="0.63366854"/>
<entry entry="-34" weight="0.5264165"/> <entry entry="-35"
weight="0.6500539"/> <entry entry="-36" weight="0.44398803"/> <entry entry="37" weight="0.33687037"/> <entry entry="-38" weight="0.6844778"/> <entry
entry="-39" weight="0.73130137"/> <entry entry="-40" weight="0.67838866"/>
<entry entry="-41" weight="0.2690524"/> <entry entry="-42"
weight="0.8647926"/> <entry entry="-43" weight="0.47574338"/> <entry entry="44" weight="0.8459545"/> <entry entry="-45" weight="0.24237463"/> <entry
entry="-46" weight="0.26038098"/> <entry entry="-47" weight="0.3717643"/>
<entry entry="-48" weight="0.9582332"/> <entry entry="-49"
weight="0.7464392"/> <entry entry="-50" weight="0.45778215"/> <entry entry="51" weight="0.284795"/> <entry entry="-52" weight="0.43219995"/> <entry
entry="-53" weight="0.6125516"/> <entry entry="-54" weight="0.1540944"/>
<entry entry="-55" weight="0.8938903"/> <entry entry="-56"
weight="0.76619434"/> <entry entry="-57" weight="0.42958945"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/> <examplesClassCount class="0.0"
count="1"/>
</examplesInClasses>
</neuron>
<neuron class="com.jcortex.kohonen.KohonenNeuron"
distanceFunction="com.jcortex.distanceFunctions.EuclideanDistanceFunction"

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

470

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


id="47" neuronClass="1.0">
<entries>
<entry entry="-1" weight="0.52408934"/> <entry entry="-2"
weight="0.6971202"/> <entry entry="-3" weight="0.4098035"/> <entry entry="-4"
weight="0.5725161"/> <entry entry="-5" weight="0.7152734"/> <entry entry="-6"
weight="0.7092463"/> <entry entry="-7" weight="0.68527174"/> <entry entry="8" weight="0.58476853"/> <entry entry="-9" weight="0.117359385"/> <entry
entry="-10" weight="0.1739245"/> <entry entry="-11" weight="0.33544305"/>
<entry entry="-12" weight="0.2001091"/> <entry entry="-13"
weight="0.3741799"/> <entry entry="-14" weight="0.697037"/> <entry entry="15" weight="0.2164286"/> <entry entry="-16" weight="0.8415456"/> <entry
entry="-17" weight="0.7466216"/> <entry entry="-18" weight="0.30453232"/>
<entry entry="-19" weight="0.14367566"/> <entry entry="-20"
weight="0.4870588"/> <entry entry="-21" weight="0.3225785"/> <entry entry="22" weight="0.4378786"/> <entry entry="-23" weight="0.45607194"/> <entry
entry="-24" weight="0.5093627"/> <entry entry="-25" weight="0.4701772"/>
<entry entry="-26" weight="0.45666432"/> <entry entry="-27"
weight="0.34322512"/> <entry entry="-28" weight="0.7695832"/> <entry entry="29" weight="0.6216408"/> <entry entry="-30" weight="0.37506688"/> <entry
entry="-31" weight="0.5070194"/> <entry entry="-32" weight="0.2618038"/>
<entry entry="-33" weight="0.65508974"/> <entry entry="-34"
weight="0.38900152"/> <entry entry="-35" weight="0.82006353"/> <entry
entry="-36" weight="0.3859446"/> <entry entry="-37" weight="0.38652593"/>
<entry entry="-38" weight="0.7467995"/> <entry entry="-39"
weight="0.7794996"/> <entry entry="-40" weight="0.5540877"/> <entry entry="41" weight="0.31743288"/> <entry entry="-42" weight="0.7722806"/> <entry
entry="-43" weight="0.48622003"/> <entry entry="-44" weight="0.83085114"/>
<entry entry="-45" weight="0.14015049"/> <entry entry="-46"
weight="0.22134873"/> <entry entry="-47" weight="0.44380814"/> <entry
entry="-48" weight="0.9283865"/> <entry entry="-49" weight="0.71271205"/>
<entry entry="-50" weight="0.4052436"/> <entry entry="-51"
weight="0.46858916"/> <entry entry="-52" weight="0.45324844"/> <entry
entry="-53" weight="0.5307816"/> <entry entry="-54" weight="0.2643035"/>
<entry entry="-55" weight="0.8209216"/> <entry entry="-56"
weight="0.74950635"/> <entry entry="-57" weight="0.5443636"/>
</entries>
<examplesInClasses>
<examplesClassCount class="1.0" count="2"/> <examplesClassCount class="0.0"
count="2"/>
</examplesInClasses>
</neuron>
<teacher analysisWindow="10" avgDistanceAccepted="0.05"
class="com.jcortex.kohonen.DefaultKohonenTeacher" constantVariation="1.0E-4"
learningRate="0.4" maxIterations="500" neighbourhoodRadius="1"/>
</neuralNetwork>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

471

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Modelo de Red Perceptrn


Configuracin de la Red y del Maestro:
Red Perceptn
simple con dos
entradas, Linear
Basis Function como
funcin de red y una
funcin umbral.

Esquema de la red entrenada:

Causas de parada del entrenamiento:


Razones de parada de los analizadores aglutinados:
{
....Error de Entrenamiento (Cuadrtico Medio) no ha encontrado razones hasta ahora
para detener el entrenamiento.
....Detenido porque Error de Validacin (Cuadrtico Medio) no decreca suficientemente
bien.
a[o] = 0.19980265; a[m] = 0.19980265; a[n] = 0.19980265
....Variacin de Pesos (Media Abs.) no ha encontrado razones hasta ahora para detener
el entrenamiento.
}

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

472

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Resultados de los estadsticos:

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

473

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

El entrenamiento se detuvo a causa de la tendencia constante del error de validacin.


Esta parada tiene lugar en la iteracin 10, ya que en los parmetros del maestro por
defecto, se ha indicado que el tamao de la ventana de estudio es de 10. (Para ms
informacin
ver
5.6.4.
Modelo
Perceptrn
>
d.
Maestro
DefaultPerceptronTeacher)
Archivo de ejemplos:
aFuncion2Variables.txt (ver)
Nodo de configuracin XML generado:
<neuralNetwork class="com.jcortex.feedForward.PerceptronNeuralNetwork"
inputTranslator="com.jcortex.translators.TransparentInputTranslator" neuronCount="1"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
sensorCount="2">
<neuron activationFunction="com.jcortex.activationFunctions.StepFunction"
activationParamsCount="1" class="com.jcortex.feedForward.FeedForwardNeuron"
id="0" networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="0.5"/>
</parameters>
<entries>
<entry id="-1" weight="-28.797607"/>
<entry id="-2" weight="20.38462"/>
</entries>
</neuron>
<firstNeurons size="1">
<neuronRef id="0"/>
</firstNeurons>
<endNeurons size="1">
<neuronRef id="0"/>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

474

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


</endNeurons>
<teacher acceptableError="0.05" analysisWindow="10"
class="com.jcortex.feedForward.DefaultPerceptronTeacher"
constantVariation="1.0E-4" learningRate="0.5" maxIterations="500"
validationPercent="0.2"/>
</neuralNetwork>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

475

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Modelo de Redes Perceptrn Multicapa


Configuracin de la Red y del Maestro:
Red Perceptrn
Multicapa
formada por dos
capas de 2 y 1
neuronas. Todas
las capas usan la
Linear Basis
Function como
funcin de red, y
una sigmoidal
como funcin de
activacin.

En la configuracin del maestro hubo que bajar el error aceptable a una cifra muy baja
ya que el entrenamiento terminaba enseguida por haber alcanzado este umbral.
Esquema de la red entrenada:

Causas de parada del entrenamiento:


Razones de parada de los analizadores aglutinados:
{
....Error de Entrenamiento (Cuadrtico Medio) no ha encontrado razones hasta ahora
para detener el entrenamiento.

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

476

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


....Detenido porque Error de Validacin (Cuadrtico Medio) no decreca suficientemente
bien.
a[o] = 0.5487105; a[m] = 0.5487105; a[n] = 0.6852519
....Variacin de Pesos (Media Abs.) no ha encontrado razones hasta ahora para detener
el entrenamiento.
}

Resultados de los estadsticos:

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

477

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Est claro porqu la causa de parada del entrenamiento propuesto como ejemplo de un
Perceptrn Multicapa es el sobreaprendizaje. Se puede apreciar como la grfica del
error de validacin comienza a crecer desde el primer momento, lo que indica que la
red no est siendo capaz de generalizar correctamente el conocimiento aprendido.

Archivo de ejemplos:
aFuncion2Variables.txt (ver)
Nodo de configuracin XML generado:
<neuralNetwork class="com.jcortex.backPropagation.MultilayerPerceptronNeuralNetwork"
inputTranslator="com.jcortex.translators.TransparentInputTranslator" neuronCount="3"
outputTranslator="com.jcortex.translators.TransparentOutputTranslator"
sensorCount="2">
<layers count="2">
<layer ix="0" size="2"/>
<layer ix="1" size="1"/>
</layers>
<neuron activationFunction="com.jcortex.activationFunctions.SigmoidalFunction"
activationParamsCount="1"
class="com.jcortex.backPropagation.BackPropagationNeuron" id="0"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="1.0"/>
</parameters>
<entries>
<entry id="-1" weight="-3.11482"/>
<entry id="-2" weight="2.8287375"/>
</entries>
</neuron>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

478

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


<neuron activationFunction="com.jcortex.activationFunctions.SigmoidalFunction"
activationParamsCount="1"
class="com.jcortex.backPropagation.BackPropagationNeuron" id="1"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="1.0"/>
</parameters>
<entries>
<entry id="-1" weight="7.708614"/>
<entry id="-2" weight="-7.584787"/>
</entries>
</neuron>
<neuron activationFunction="com.jcortex.activationFunctions.SigmoidalFunction"
activationParamsCount="1"
class="com.jcortex.backPropagation.BackPropagationNeuron" id="2"
networkFunction="com.jcortex.networkFunctions.LinearBasisFunction">
<parameters count="1">
<parameter ix="0" value="1.0"/>
</parameters>
<entries>
<entry id="1" weight="-8.249389"/>
<entry id="0" weight="7.265858"/>
</entries>
</neuron>
<firstNeurons size="2">
<neuronRef id="0"/>
<neuronRef id="1"/>
</firstNeurons>
<endNeurons size="1">
<neuronRef id="2"/>
</endNeurons>
<teacher acceptableError="5.0E-4" analysisWindow="10"
class="com.jcortex.backPropagation.DefaultMultilayerPerceptronTeacher"
constantVariation="1.0E-4" learningRate="0.3" maxIterations="500"
validationPercent="0.3"/>
</neuralNetwork>

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

479

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/

Archivo de ejemplos aFuncion2variables.txt


# Funcion de 2 variables para las pruebas con JCortex
@structure

float[]

@input X
@input Y

float
float

@output F(X,Y) float


@data
0.0556,
0.1312,
0.4812,
0.0823,
0.6290,
0.4420,
0.1844,
0.9158,
0.8084,
0.5660,
0.1441,
0.6787,
0.0545,
0.8848,
0.6918,
0.7764,
0.1382,
0.7322,
0.1312,
0.7525,
0.4966,
0.2214,
0.3665,
0.6788,
0.0815,
0.0416,
0.8055,
0.7239,
0.3891,
0.7579,
0.7604,
0.0858,
0.6515,
0.7204,
0.1126,
0.9194,
0.6770,
0.0579,
0.3928,
0.0133,
0.7970,
0.3492,

0.6032,
0.8413,
0.2673,
0.7760,
0.4325,
0.2461,
0.3030,
0.0093,
0.2719,
0.7860,
0.9740,
0.9945,
0.0329,
0.3245,
0.0628,
0.9562,
0.2049,
0.1341,
0.9937,
0.7424,
0.4112,
0.7231,
0.2401,
0.6585,
0.9494,
0.7732,
0.7280,
0.3666,
0.8400,
0.3917,
0.2743,
0.7793,
0.2166,
0.4703,
0.2167,
0.9149,
0.4153,
0.2401,
0.3494,
0.8844,
0.1808,
0.9959,

0.9981
0.9827
-0.1283
0.9935
-0.2687
-0.1086
0.9990
-0.0085
-0.2180
0.9692
0.9715
0.9095
-0.0018
-0.2832
-0.0434
0.9613
0.9998
-0.0980
0.9745
-0.5300
-0.2028
0.9754
-0.0879
-0.4323
0.9900
0.9981
-0.5534
-0.2623
0.9391
-0.2925
-0.2071
0.9929
-0.1407
-0.3323
0.9997
-0.7454
-0.2775
0.9998
-0.1368
0.9997
-0.1436
0.8997

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

480

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.1874,
0.8461,
0.6856,
0.1973,
0.6394,
0.1956,
0.6954,
0.0443,
0.1326,
0.2344,
0.2651,
0.3510,
0.3796,
0.5894,
0.8827,
0.3007,
0.1004,
0.5354,
0.0604,
0.2770,
0.1163,
0.9658,
0.0814,
0.1377,
0.9377,
0.5980,
0.4171,
0.8560,
0.9288,
0.1668,
0.8096,
0.4424,
0.3050,
0.8490,
0.7959,
0.7523,
0.4710,
0.5425,
0.1478,
0.4828,
0.4227,
0.3427,
0.6875,
0.3497,
0.6308,
0.0004,
0.5609,
0.7706,
0.3954,
0.7799,
0.6537,
0.7913,
0.4198,
0.6419,
0.0048,
0.6143,
0.7403,
0.0968,
0.4294,

0.9973,
0.5198,
0.5313,
0.1039,
0.5529,
0.3643,
0.2704,
0.0024,
0.7584,
0.6890,
0.0094,
0.7793,
0.9979,
0.9639,
0.0494,
0.4775,
0.1076,
0.0200,
0.4976,
0.7571,
0.1294,
0.9735,
0.4143,
0.7924,
0.4761,
0.4874,
0.6727,
0.5217,
0.2875,
0.2349,
0.2657,
0.1498,
0.2733,
0.1634,
0.5407,
0.2273,
0.2964,
0.9673,
0.2398,
0.2633,
0.1645,
0.8381,
0.3346,
0.8742,
0.8953,
0.9514,
0.5914,
0.0913,
0.4133,
0.5613,
0.4070,
0.9761,
0.6781,
0.5294,
0.5872,
0.8110,
0.5255,
0.2656,
0.9436,

0.9543
-0.4257
-0.3562
-0.0205
-0.3462
0.9978
-0.1869
-0.0001
0.9863
0.9774
-0.0025
0.9551
0.8918
0.9042
-0.0436
0.9944
1.0000
-0.0107
0.9986
0.9648
1.0000
0.9999
0.9985
0.9838
-0.4318
-0.2874
0.9774
-0.4319
-0.2639
0.9997
-0.2135
-0.0662
-0.0832
-0.1383
-0.4172
-0.1701
-0.1392
0.8956
0.9996
-0.1268
-0.0695
0.9429
-0.2280
0.9335
0.9448
1.0000
0.9994
-0.0703
0.9999
-0.4239
-0.2630
0.9575
0.9766
-0.3333
1.0000
0.9710
-0.3793
0.9995
0.9041

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

481

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.7000,
0.7033,
0.5180,
0.3717,
0.4887,
0.3037,
0.9000,
0.4388,
0.9542,
0.2405,
0.1151,
0.6243,
0.7817,
0.8805,
0.0003,
0.8407,
0.6118,
0.0443,
0.9256,
0.2726,
0.2549,
0.5510,
0.8587,
0.1738,
0.5505,
0.8637,
0.5417,
0.8489,
0.9753,
0.5276,
0.8818,
0.5574,
0.4229,
0.7090,
0.0658,
0.0039,
0.0254,
0.8833,
0.9418,
0.8390,
0.5057,
0.1643,
0.8661,
0.7649,
0.9689,
0.0070,
0.1463,
0.9634,
0.5888,
0.3306,
0.0627,
0.0312,
0.9529,
0.7348,
0.2863,
0.7409,
0.5178,
0.2790,
0.4560,

0.0593,
0.5987,
0.9972,
0.6725,
0.2400,
0.8008,
0.6060,
0.5082,
0.5847,
0.9432,
0.5779,
0.2717,
0.6603,
0.5242,
0.1637,
0.4078,
0.8584,
0.6927,
0.0995,
0.3837,
0.0201,
0.2357,
0.0809,
0.9200,
0.0097,
0.4785,
0.0463,
0.1500,
0.1471,
0.2155,
0.5606,
0.4395,
0.2379,
0.4170,
0.8552,
0.6630,
0.5877,
0.3409,
0.1933,
0.3001,
0.9581,
0.5524,
0.0308,
0.1667,
0.9232,
0.0346,
0.1137,
0.4475,
0.7149,
0.7007,
0.8029,
0.7655,
0.8115,
0.1228,
0.9005,
0.8102,
0.1806,
0.0844,
0.8643,

-0.0415
-0.4087
0.8793
0.9751
-0.1170
0.9548
-0.5188
0.9981
-0.5294
0.9434
0.9943
-0.1688
-0.4935
-0.4453
1.0000
-0.3362
0.9548
0.9984
-0.0919
0.9982
-0.0051
-0.1295
-0.0694
0.9665
-0.0053
-0.4016
-0.0251
-0.1270
-0.1430
-0.1135
-0.4745
-0.2425
-0.1004
-0.2914
0.9946
1.0000
0.9996
-0.2966
-0.1811
-0.2492
0.8971
0.9919
-0.0266
-0.1272
-0.7799
1.0000
-0.0166
-0.4178
0.9890
0.9702
0.9957
0.9990
-0.6985
-0.0901
0.9388
0.9947
-0.0934
-0.0236
0.9315

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

482

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.4904,
0.8287,
0.9494,
0.5043,
0.9508,
0.1269,
0.4842,
0.7497,
0.7206,
0.1875,
0.3071,
0.4039,
0.8824,
0.2292,
0.4755,
0.8135,
0.8245,
0.9833,
0.6669,
0.5167,
0.3119,
0.8552,
0.9638,
0.8805,
0.9559,
0.1191,
0.2860,
0.0884,
0.7959,
0.9748,
0.7702,
0.2484,
0.9281,
0.2083,
0.2533,
0.5040,
0.5853,
0.5312,
0.3455,
0.2147,
0.5617,
0.4839,
0.5651,
0.4518,
0.7056,
0.4205,
0.2811,
0.6671,
0.6964,
0.3680,
0.5307,
0.7107,
0.0996,
0.8925,
0.4097,
0.2494,
0.0874,
0.7759,
0.5895,

0.3447,
0.1643,
0.5279,
0.8998,
0.0031,
0.9239,
0.3199,
0.1393,
0.1384,
0.4479,
0.7003,
0.0035,
0.2765,
0.6471,
0.4238,
0.9955,
0.3395,
0.5154,
0.3941,
0.5771,
0.8529,
0.1764,
0.4613,
0.1992,
0.5760,
0.6006,
0.4690,
0.8132,
0.9856,
0.3779,
0.6879,
0.4003,
0.5146,
0.4360,
0.4625,
0.1183,
0.9693,
0.0840,
0.4159,
0.5647,
0.6123,
0.3700,
0.2278,
0.1282,
0.6790,
0.1085,
0.9973,
0.6814,
0.5768,
0.2278,
0.8303,
0.4301,
0.5350,
0.9396,
0.4044,
0.9986,
0.2986,
0.0415,
0.1507,

-0.1683
-0.1357
-0.4805
0.9215
-0.0029
0.9796
-0.1543
-0.1042
-0.0995
0.9952
0.9710
-0.0014
-0.2416
0.9817
-0.2001
0.9565
-0.2763
-0.4854
-0.2598
0.9981
0.9436
-0.1503
-0.4301
-0.1745
-0.5233
0.9934
0.9945
0.9918
0.9548
-0.3601
-0.5054
0.9972
-0.4596
0.9955
0.9944
-0.0596
0.9007
-0.0446
0.9988
0.9887
0.9984
-0.1781
-0.1284
-0.0579
-0.4610
-0.0456
0.9200
0.9998
-0.3910
-0.0837
0.9499
-0.3010
0.9962
0.9965
-0.1649
0.9310
0.9993
-0.0322
-0.0887

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

483

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.3771,
0.5694,
0.2341,
0.0776,
0.1908,
0.6570,
0.0529,
0.3610,
0.4251,
0.8197,
0.3809,
0.9702,
0.6123,
0.1551,
0.4317,
0.9544,
0.0811,
0.4869,
0.1511,
0.9882,
0.5846,
0.8344,
0.9321,
0.1534,
0.3801,
0.3024,
0.2583,
0.2440,
0.0148,
0.4455,
0.7432,
0.9348,
0.8942,
0.0570,
0.6241,
0.6550,
0.9271,
0.3649,
0.2453,
0.7562,
0.9981,
0.2569,
0.2764,
0.5287,
0.1183,
0.2201,
0.6206,
0.1067,
0.2818,
0.2772,
0.0822,
0.5442,
0.6835,
0.0237,
0.0780,
0.2960,
0.5547,
0.1442,
0.3150,

0.4414,
0.0959,
0.9099,
0.2014,
0.5587,
0.2698,
0.0677,
0.1092,
0.8033,
0.9882,
0.6728,
0.6768,
0.3980,
0.8551,
0.1257,
0.9610,
0.0421,
0.2637,
0.7393,
0.1149,
0.0284,
0.1651,
0.8362,
0.4106,
0.2193,
0.2149,
0.9966,
0.9277,
0.2726,
0.4042,
0.2021,
0.5243,
0.1198,
0.3561,
0.6081,
0.3511,
0.5289,
0.3541,
0.8148,
0.3912,
0.3881,
0.7305,
0.4271,
0.9445,
0.7165,
0.9599,
0.3011,
0.7139,
0.1607,
0.5079,
0.4601,
0.0676,
0.4822,
0.8979,
0.8016,
0.4586,
0.1699,
0.7485,
0.2045,

0.9988
-0.0546
0.9504
0.9998
0.9902
-0.1763
1.0000
-0.0394
0.9487
0.9621
0.9754
-0.6105
-0.2413
0.9765
-0.0542
0.9999
-0.0034
-0.1280
0.9843
-0.1133
-0.0166
-0.1373
-0.7029
0.9969
-0.0833
-0.0649
0.9281
0.9448
1.0000
-0.1791
-0.1496
-0.4707
-0.1069
0.9994
-0.3705
-0.2279
-0.4710
-0.1289
0.9612
-0.2915
-0.3778
0.9705
0.9965
0.9049
0.9900
0.9475
-0.1858
0.9916
-0.0453
0.9918
0.9981
-0.0368
-0.3237
0.9991
0.9936
0.9954
-0.0941
0.9849
-0.0644

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

484

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.3145,
0.5817,
0.5684,
0.1317,
0.9653,
0.6643,
0.9853,
0.8087,
0.7695,
0.4184,
0.5137,
0.2775,
0.8133,
0.8062,
0.0115,
0.5815,
0.5698,
0.8035,
0.0337,
0.7666,
0.7017,
0.1253,
0.2310,
0.7299,
0.5312,
0.9808,
0.9574,
0.0522,
0.7055,
0.8256,
0.0827,
0.5229,
0.3546,
0.1544,
0.7993,
0.9257,
0.8904,
0.1682,
0.1793,
0.9728,
0.7913,
0.5167,
0.7006,
0.9296,
0.4063,
0.8972,
0.4100,
0.3123,
0.0629,
0.6267,
0.8751,
0.0593,
0.1109,
0.6450,
0.1820,
0.3267,
0.9231,
0.3638,
0.8449,

0.1688,
0.4152,
0.6947,
0.7447,
0.1972,
0.6100,
0.9887,
0.7570,
0.0718,
0.1568,
0.3124,
0.3388,
0.3458,
0.7107,
0.4468,
0.7176,
0.8438,
0.4672,
0.7589,
0.9624,
0.8403,
0.6083,
0.9267,
0.9522,
0.0428,
0.7096,
0.6089,
0.3548,
0.6503,
0.9021,
0.5112,
0.4013,
0.4069,
0.3661,
0.7245,
0.3866,
0.9572,
0.8392,
0.0449,
0.4181,
0.8093,
0.8163,
0.0174,
0.9526,
0.5666,
0.0719,
0.2059,
0.9752,
0.2787,
0.0368,
0.5168,
0.7437,
0.9796,
0.5118,
0.9513,
0.0961,
0.0872,
0.6686,
0.4469,

-0.0531
-0.2392
0.9897
0.9870
-0.1892
-0.3942
1.0000
-0.5747
-0.0552
-0.0655
-0.1598
0.9994
-0.2775
-0.5422
0.9999
0.9875
0.9516
-0.3666
0.9988
0.9553
0.9812
0.9927
0.9488
0.9478
-0.0228
-0.6412
-0.5505
0.9995
-0.4429
0.9920
0.9975
-0.2083
0.9993
0.9979
-0.5473
-0.3503
0.9929
0.9746
-0.0081
-0.3956
0.9996
0.9525
-0.0122
0.9991
0.9915
-0.0645
-0.0843
0.9155
0.9996
-0.0231
-0.4369
0.9967
0.9815
-0.3241
0.9611
-0.0314
-0.0804
0.9755
-0.3686

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

485

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.1612,
0.4929,
0.8525,
0.5564,
0.7229,
0.6709,
0.0115,
0.4005,
0.1485,
0.6381,
0.0654,
0.0667,
0.8449,
0.1593,
0.5892,
0.6121,
0.1267,
0.8267,
0.4503,
0.7626,
0.0396,
0.5120,
0.5613,
0.7533,
0.8430,
0.6585,
0.1321,
0.1267,
0.9141,
0.1477,
0.9654,
0.5920,
0.5078,
0.0323,
0.0042,
0.1457,
0.2573,
0.1451,
0.9206,
0.0472,
0.4841,
0.5249,
0.5311,
0.3223,
0.7896,
0.0382,
0.2181,
0.3108,
0.9407,
0.2789,
0.4211,
0.3746,
0.0785,
0.2300,
0.0509,
0.6159,
0.1619,
0.7006,
0.6846,

0.1420,
0.6617,
0.0323,
0.0015,
0.1006,
0.7014,
0.5859,
0.2804,
0.8994,
0.2578,
0.2050,
0.7846,
0.7882,
0.9014,
0.7503,
0.8469,
0.7189,
0.5780,
0.0381,
0.7777,
0.5805,
0.5605,
0.3785,
0.8924,
0.0146,
0.3608,
0.0084,
0.3200,
0.7937,
0.1079,
0.6627,
0.4384,
0.6418,
0.6970,
0.7667,
0.3634,
0.2241,
0.0394,
0.4999,
0.1158,
0.9172,
0.1111,
0.0362,
0.8602,
0.0173,
0.4355,
0.4669,
0.2083,
0.6189,
0.4971,
0.7569,
0.8883,
0.9926,
0.4083,
0.7613,
0.4162,
0.5476,
0.7401,
0.4848,

-0.0229
0.9862
-0.0275
-0.0008
-0.0726
0.9992
0.9999
-0.1121
0.9752
-0.1638
0.9998
0.9954
-0.6178
0.9722
0.9820
0.9590
0.9888
-0.4599
-0.0171
0.9997
0.9991
0.9988
-0.2109
0.9781
-0.0123
-0.2353
-0.0011
0.9988
-0.6635
-0.0159
-0.5970
-0.2567
0.9908
0.9991
1.0000
0.9980
-0.0576
-0.0057
-0.4441
1.0000
0.9133
-0.0583
-0.0192
0.9405
-0.0136
0.9995
0.9941
-0.0647
-0.5498
0.9926
0.9603
0.9268
0.9897
0.9966
0.9974
-0.2536
0.9922
0.9985
-0.3258

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

486

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.1690,
0.9128,
0.3085,
0.9131,
0.3805,
0.2862,
0.9896,
0.9495,
0.3488,
0.8826,
0.4592,
0.7560,
0.0424,
0.4995,
0.1947,
0.2894,
0.4885,
0.8378,
0.0852,
0.3592,
0.2767,
0.2210,
0.8255,
0.9362,
0.4020,
0.5367,
0.1419,
0.6746,
0.1263,
0.3397,
0.5783,
0.5576,
0.3958,
0.9253,
0.5615,
0.6986,
0.5739,
0.5600,
0.8708,
0.9179,
0.3557,
0.3180,
0.9360,
0.1199,
0.8188,
0.5273,
0.6784,
0.1162,
0.4714,
0.6419,
0.9296,
0.9106,
0.7530,
0.4705,
0.6485,
0.5287,
0.4633,
0.0317,
0.1361,

0.4219,
0.0715,
0.7872,
0.9717,
0.9529,
0.9166,
0.5366,
0.8393,
0.5895,
0.3901,
0.0911,
0.7371,
0.5831,
0.8011,
0.4691,
0.2817,
0.5368,
0.6843,
0.3808,
0.2094,
0.0445,
0.2269,
0.2074,
0.5019,
0.5314,
0.1634,
0.8364,
0.8607,
0.2294,
0.6004,
0.7669,
0.8670,
0.9454,
0.6549,
0.8197,
0.0573,
0.1292,
0.5411,
0.4910,
0.1688,
0.2673,
0.5524,
0.3649,
0.8581,
0.0551,
0.3756,
0.4197,
0.5877,
0.8160,
0.0036,
0.7752,
0.4306,
0.4107,
0.8678,
0.5377,
0.0283,
0.2231,
0.9376,
0.4664,

0.9963
-0.0653
0.9567
0.9943
0.9066
0.9356
-0.5064
-0.7152
0.9859
-0.3376
-0.0418
-0.5288
0.9990
0.9549
0.9943
-0.0814
0.9989
-0.5424
0.9987
-0.0752
-0.0123
1.0000
-0.1703
-0.4528
0.9946
-0.0876
0.9806
0.9686
0.9997
0.9844
0.9763
0.9411
0.9068
-0.5696
0.9582
-0.0400
-0.0741
-0.2984
-0.4147
-0.1543
-0.0949
0.9889
-0.3349
0.9844
-0.0451
-0.1968
-0.2809
0.9940
0.9477
-0.0023
-0.6599
-0.3822
-0.3043
0.9309
-0.3417
-0.0150
-0.1032
0.9984
0.9960

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

487

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.7138,
0.6412,
0.5610,
0.3629,
0.6469,
0.8696,
0.2483,
0.1316,
0.3551,
0.4599,
0.0968,
0.4318,
0.2634,
0.6717,
0.4499,
0.7962,
0.1176,
0.7068,
0.2724,
0.4480,
0.6095,
0.2024,
0.5881,
0.7085,
0.5133,
0.3844,
0.8918,
0.0811,
0.9782,
0.4573,
0.2206,
0.6191,
0.7719,
0.9473,
0.6152,
0.9520,
0.2688,
0.1365,
0.6847,
0.7017,
0.7688,
0.3576,
0.0457,
0.1681,
0.9959,
0.9787,
0.6167,
0.9754,
0.9524,
0.5074,
0.8136,
0.1969,
0.8090,
0.5923,
0.8696,
0.0667,
0.0702,
0.6576,
0.3236,

0.1236,
0.9435,
0.2701,
0.7459,
0.2159,
0.8951,
0.0752,
0.1516,
0.3905,
0.4161,
0.4484,
0.2700,
0.8289,
0.2829,
0.9840,
0.9204,
0.4153,
0.3697,
0.7747,
0.4132,
0.6265,
0.2833,
0.1283,
0.1821,
0.0791,
0.3655,
0.8229,
0.6752,
0.0466,
0.0155,
0.1548,
0.4847,
0.1503,
0.2001,
0.5826,
0.0909,
0.6959,
0.3485,
0.8999,
0.5455,
0.5226,
0.8553,
0.5393,
0.7499,
0.4692,
0.0511,
0.6664,
0.6973,
0.9674,
0.9559,
0.2814,
0.7953,
0.2408,
0.3454,
0.4656,
0.6173,
0.7753,
0.5439,
0.1286,

-0.0881
0.9258
-0.1509
0.9616
-0.1392
0.9990
-0.0187
1.0000
0.9997
-0.1902
0.9977
-0.1163
0.9560
-0.1889
0.8867
0.9805
0.9975
-0.2583
0.9628
-0.1840
0.9998
0.9995
-0.0754
-0.1287
-0.0406
-0.1400
-0.6697
0.9954
-0.0456
-0.0071
-0.0341
-0.2956
-0.1158
-0.1884
-0.3508
-0.0864
0.9737
0.9983
0.9569
-0.3735
-0.3910
0.9373
0.9990
0.9809
-0.4504
-0.0500
0.9981
-0.6290
0.9996
0.8982
-0.2270
0.9724
-0.1936
-0.2031
-0.3939
0.9973
0.9951
-0.3500
-0.0416

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

488

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.6021,
0.4013,
0.9640,
0.4845,
0.7102,
0.0489,
0.9200,
0.9862,
0.2934,
0.5691,
0.6307,
0.1741,
0.0040,
0.9573,
0.7412,
0.8641,
0.1558,
0.6669,
0.7484,
0.6254,
0.1705,
0.8779,
0.5101,
0.4680,
0.5282,
0.5035,
0.5519,
0.2359,
0.6189,
0.1848,
0.8424,
0.0040,
0.7968,
0.3360,
0.2026,
0.8880,
0.0401,
0.8720,
0.1585,
0.5963,
0.3667,
0.0795,
0.1252,
0.5747,
0.1077,
0.1397,
0.9883,
0.3371,
0.6652,
0.3120,
0.9743,
0.7704,
0.0486,
0.4305,
0.4741,
0.4463,
0.7586,
0.4761,
0.7433,

0.7112,
0.8142,
0.9122,
0.1815,
0.4623,
0.6492,
0.4007,
0.1496,
0.6222,
0.7439,
0.6275,
0.9049,
0.2218,
0.5508,
0.3075,
0.1143,
0.7160,
0.6425,
0.9972,
0.8136,
0.8178,
0.1144,
0.9651,
0.6402,
0.9497,
0.6747,
0.3282,
0.1595,
0.3856,
0.8893,
0.1372,
0.9764,
0.9434,
0.0059,
0.2964,
0.3710,
0.6490,
0.6201,
0.8393,
0.2564,
0.5627,
0.7619,
0.6148,
0.9424,
0.1729,
0.7264,
0.4693,
0.7244,
0.8898,
0.2074,
0.8500,
0.0675,
0.6785,
0.9221,
0.5163,
0.6473,
0.3273,
0.7491,
0.2100,

0.9914
0.9456
-0.7704
-0.0878
-0.3224
0.9983
-0.3604
-0.1470
0.9814
0.9803
-0.3855
0.9678
1.0000
-0.5032
-0.2259
-0.0986
0.9848
-0.4154
0.9315
0.9724
0.9757
-0.1003
0.8942
0.9870
0.9025
0.9852
-0.1802
-0.0376
-0.2364
0.9663
-0.1153
1.0000
0.9728
-0.0020
0.9993
-0.3235
0.9988
-0.5147
0.9768
-0.1523
0.9897
0.9941
0.9925
0.9120
0.9999
0.9866
-0.4474
0.9661
0.9557
-0.0647
-0.7366
-0.0519
0.9981
0.9117
0.9992
0.9839
-0.2458
0.9664
-0.1554

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

489

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.4064,
0.5348,
0.3929,
0.4207,
0.4944,
0.0841,
0.9658,
0.3075,
0.4276,
0.9684,
0.3007,
0.5039,
0.6586,
0.9197,
0.0647,
0.3496,
0.0017,
0.6279,
0.6578,
0.1344,
0.6727,
0.2470,
0.9627,
0.0664,
0.5438,
0.9074,
0.2507,
0.0171,
0.3732,
0.7345,
0.7321,
0.4511,
0.5573,
0.8488,
0.1956,
0.2006,
0.6545,
0.1098,
0.1171,
0.7794,
0.3988,
0.8681,
0.0671,
0.8848,
0.5382,
0.9543,
0.7462,
0.6759,
0.4777,
0.4749,
0.9414,
0.2366,
0.5348,
0.3967,
0.1329,
0.5801,
0.2293,
0.3760,
0.7931,

0.6239,
0.2979,
0.6204,
0.0319,
0.4081,
0.8749,
0.0313,
0.1366,
0.1660,
0.0110,
0.9556,
0.9358,
0.3179,
0.5955,
0.5961,
0.6152,
0.2926,
0.2990,
0.5215,
0.7235,
0.1789,
0.8333,
0.8900,
0.9907,
0.3954,
0.4577,
0.2271,
0.7192,
0.2395,
0.7742,
0.2582,
0.3103,
0.9314,
0.8038,
0.9963,
0.9781,
0.5809,
0.6059,
0.7290,
0.6765,
0.1495,
0.3635,
0.1594,
0.6607,
0.2318,
0.1731,
0.9046,
0.4343,
0.0774,
0.7106,
0.3756,
0.1129,
0.3822,
0.0572,
0.5089,
0.8993,
0.0612,
0.8831,
0.6939,

0.9844
-0.1587
0.9841
-0.0134
-0.2004
0.9912
-0.0303
-0.0420
-0.0709
-0.0107
0.9235
0.9068
-0.2078
-0.5207
0.9976
0.9828
1.0000
-0.1866
-0.3363
0.9875
-0.1200
0.9584
-0.7558
0.9925
-0.2133
-0.4035
-0.0569
0.9997
-0.0893
0.9983
-0.1879
-0.1395
0.9143
-0.6306
0.9513
0.9518
-0.3711
0.9941
0.9898
-0.5032
-0.0596
-0.3103
0.9999
-0.5518
-0.1244
-0.1644
0.9722
-0.2893
-0.0370
0.9750
-0.3463
-0.0267
-0.2029
-0.0227
0.9950
0.9322
-0.0140
0.9282
-0.5230

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

490

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.0933,
0.4377,
0.8780,
0.5792,
0.6731,
0.6586,
0.9095,
0.6548,
0.3261,
0.3596,
0.0582,
0.5863,
0.3648,
0.9059,
0.4810,
0.5304,
0.4900,
0.4622,
0.8227,
0.3827,
0.9069,
0.7108,
0.1285,
0.8795,
0.0519,
0.2969,
0.9220,
0.9795,
0.1283,
0.0464,
0.6549,
0.7651,
0.4406,
0.4498,
0.9505,
0.5737,
0.4269,
0.8970,
0.2185,
0.1517,
0.4560,
0.0404,
0.1674,
0.2922,
0.8217,
0.6691,
0.3139,
0.2542,
0.7797,
0.9765,
0.2078,
0.4223,
0.9967,
0.5410,
0.1117,
0.3212,
0.1598,
0.6218,
0.6338,

0.7950,
0.1977,
0.0744,
0.5794,
0.2577,
0.8612,
0.7115,
0.4955,
0.2259,
0.8655,
0.5628,
0.2135,
0.6511,
0.2493,
0.0923,
0.3281,
0.6793,
0.2666,
0.3826,
0.0905,
0.2774,
0.6827,
0.6748,
0.6071,
0.3688,
0.9425,
0.3066,
0.4813,
0.0766,
0.2808,
0.6839,
0.9072,
0.0142,
0.9760,
0.9555,
0.6800,
0.6679,
0.4300,
0.4344,
0.3303,
0.5418,
0.0900,
0.3195,
0.6586,
0.5164,
0.6582,
0.1978,
0.5654,
0.7107,
0.8259,
0.1042,
0.8558,
0.4112,
0.4071,
0.0343,
0.9761,
0.9453,
0.4527,
0.1021,

0.9914
-0.0864
-0.0653
1.0000
-0.1726
0.9646
-0.6029
-0.3188
-0.0736
0.9345
0.9983
-0.1248
0.9783
-0.2239
-0.0444
-0.1732
0.9828
-0.1229
-0.3096
-0.0346
-0.2489
-0.4665
0.9902
-0.5089
0.9995
0.9274
-0.2790
-0.4542
-0.0098
0.9998
0.9993
0.9764
-0.0062
0.8900
1.0000
0.9926
0.9789
-0.3762
0.9956
0.9985
0.9969
1.0000
0.9987
0.9772
-0.4117
-0.4263
-0.0620
0.9875
-0.5262
-0.7219
-0.0217
0.9337
-0.3985
-0.2184
-0.0038
0.9128
0.9687
-0.2778
-0.0647

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

491

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.1916,
0.8970,
0.8505,
0.2622,
0.7841,
0.7667,
0.1005,
0.5374,
0.3827,
0.0690,
0.2643,
0.5386,
0.0679,
0.3989,
0.4280,
0.5929,
0.0801,
0.0676,
0.7952,
0.3103,
0.3207,
0.5933,
0.4919,
0.3098,
0.4161,
0.4425,
0.4391,
0.9508,
0.0786,
0.2858,
0.2410,
0.9398,
0.2200,
0.3011,
0.2198,
0.0366,
0.0504,
0.1235,
0.8296,
0.8239,
0.1033,
0.3692,
0.9232,
0.7145,
0.2420,
0.1666,
0.0383,
0.2945,
0.8302,
0.3557,
0.9930,
0.7880,
0.8221,
0.2736,
0.7156,
0.0531,
0.8877,
0.9359,
0.9109,

0.4829,
0.6730,
0.3475,
0.5651,
0.7176,
0.4265,
0.2197,
0.3384,
0.6301,
0.7003,
0.9179,
0.9356,
0.7923,
0.6772,
0.0413,
0.6087,
0.0136,
0.6984,
0.2367,
0.2637,
0.1949,
0.3031,
0.4883,
0.2780,
0.8960,
0.3369,
0.3717,
0.7256,
0.8348,
0.8180,
0.7392,
0.5289,
0.3712,
0.0296,
0.8893,
0.3617,
0.8054,
0.9968,
0.9187,
0.0843,
0.0709,
0.3835,
0.5665,
0.0158,
0.5735,
0.7604,
0.0678,
0.3174,
0.6841,
0.1366,
0.5239,
0.3587,
0.2437,
0.7608,
0.1923,
0.0870,
0.4211,
0.0980,
0.5995,

0.9938
-0.5677
-0.2912
0.9874
-0.5334
-0.3212
0.9997
-0.1809
0.9821
0.9962
0.9409
0.9099
0.9952
0.9755
-0.0177
0.9998
-0.0011
0.9964
-0.1871
-0.0817
-0.0625
-0.1788
-0.2379
-0.0860
0.9213
-0.1485
-0.1625
-0.6365
0.9929
0.9541
0.9713
-0.4768
0.9978
-0.0089
0.9570
0.9997
0.9971
0.9768
0.9891
-0.0694
-0.0073
0.9999
-0.4995
-0.0113
0.9872
0.9805
1.0000
0.9999
-0.5379
-0.0486
-0.4971
-0.2789
-0.1990
0.9647
-0.1372
1.0000
-0.3651
-0.0916
-0.5193

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

492

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.7026,
0.0920,
0.0052,
0.6549,
0.4051,
0.5833,
0.3927,
0.0470,
0.3099,
0.3459,
0.2954,
0.9946,
0.9112,
0.2716,
0.4729,
0.3164,
0.6998,
0.2705,
0.8059,
0.5067,
0.0349,
0.2224,
0.1350,
0.9509,
0.5028,
0.4437,
0.3699,
0.2329,
0.8970,
0.9092,
0.1559,
0.4847,
0.5116,
0.0406,
0.1183,
0.3702,
0.7902,
0.4163,
0.0160,
0.4584,
0.5339,
0.3559,
0.6183,
0.7533,
0.6401,
0.0345,
0.3037,
0.9809,
0.1155,
0.5567,
0.9249,
0.3600,
0.9563,
0.4287,
0.5394,
0.2990,
0.5797,
0.4268,
0.7535,

0.0825,
0.4662,
0.6592,
0.0717,
0.2696,
0.3192,
0.6814,
0.0577,
0.2861,
0.0230,
0.9698,
0.5190,
0.9351,
0.2171,
0.0448,
0.1305,
0.0201,
0.8176,
0.0529,
0.5011,
0.7108,
0.5143,
0.6958,
0.6283,
0.5584,
0.9179,
0.0760,
0.9047,
0.8903,
0.0238,
0.5364,
0.3586,
0.8716,
0.8111,
0.4441,
0.5283,
0.8713,
0.6700,
0.7379,
0.4615,
0.9155,
0.5704,
0.7444,
0.2199,
0.0302,
0.6048,
0.1540,
0.2647,
0.1383,
0.8185,
0.3122,
0.6643,
0.8646,
0.3481,
0.2491,
0.3736,
0.1266,
0.1700,
0.9995,

-0.0580
0.9976
1.0000
-0.0469
-0.1090
-0.1851
0.9744
1.0000
-0.0885
-0.0080
0.9217
-0.4936
0.9991
-0.0589
-0.0212
-0.0413
-0.0141
0.9565
-0.0426
-0.2512
0.9989
0.9916
0.9886
-0.5625
0.9984
0.9128
-0.0281
0.9514
-0.7164
-0.0216
0.9930
-0.1730
0.9329
0.9980
0.9970
0.9932
0.9918
0.9778
0.9997
1.0000
0.9181
0.9884
0.9879
-0.1649
-0.0194
0.9992
-0.0467
-0.2567
1.0000
0.9578
-0.2848
0.9761
-0.7357
-0.1487
-0.1340
0.9990
-0.0733
-0.0725
0.9321

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

493

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.9519,
0.5169,
0.2833,
0.4862,
0.0874,
0.2813,
0.6169,
0.4922,
0.0651,
0.7438,
0.0179,
0.8235,
0.2928,
0.7907,
0.6660,
0.0177,
0.7563,
0.4223,
0.0749,
0.3753,
0.5473,
0.6362,
0.2678,
0.7592,
0.8469,
0.8160,
0.7047,
0.4858,
0.9847,
0.7190,
0.0270,
0.1514,
0.8211,
0.5186,
0.7033,
0.0530,
0.0496,
0.4303,
0.7340,
0.7098,
0.5575,
0.6937,
0.6076,
0.2909,
0.3387,
0.3215,
0.7447,
0.6646,
0.6225,
0.9227,
0.9888,
0.8476,
0.3609,
0.5282,
0.1681,
0.5727,
0.7598,
0.7885,
0.2540,

0.9726,
0.3519,
0.8995,
0.0199,
0.1145,
0.9773,
0.3535,
0.3556,
0.1286,
0.4208,
0.9920,
0.5223,
0.0613,
0.4007,
0.4514,
0.5216,
0.3072,
0.5556,
0.1216,
0.1427,
0.4802,
0.9272,
0.4418,
0.4937,
0.0166,
0.0530,
0.0358,
0.3658,
0.2229,
0.6980,
0.2758,
0.1884,
0.1786,
0.4542,
0.4275,
0.3481,
0.0782,
0.0033,
0.5268,
0.9882,
0.7932,
0.9867,
0.7549,
0.2986,
0.3642,
0.1627,
0.5120,
0.4307,
0.8603,
0.5676,
0.4979,
0.3165,
0.7826,
0.0106,
0.8100,
0.2852,
0.5346,
0.4002,
0.2099,

0.9992
-0.1809
0.9397
-0.0097
1.0000
0.9243
-0.2163
-0.1741
1.0000
-0.3079
0.9994
-0.4169
-0.0179
-0.3116
-0.2962
0.9998
-0.2303
0.9937
1.0000
-0.0535
-0.2598
0.9322
0.9957
-0.3661
-0.0141
-0.0432
-0.0252
-0.1768
-0.2177
-0.4811
0.9999
0.9999
-0.1462
-0.2334
-0.2962
0.9995
1.0000
-0.0014
-0.3771
0.9229
0.9657
0.9185
0.9840
1.0000
0.9999
-0.0523
-0.3721
-0.2824
0.9565
-0.5001
-0.4727
-0.2651
0.9540
-0.0056
0.9768
-0.1626
-0.3951
-0.3103
-0.0533

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

494

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.5304,
0.0506,
0.5210,
0.8044,
0.2288,
0.3685,
0.6508,
0.8532,
0.8103,
0.5931,
0.7378,
0.1797,
0.9820,
0.6625,
0.4127,
0.0993,
0.9807,
0.1656,
0.3651,
0.1269,
0.8801,
0.6876,
0.7738,
0.2109,
0.3691,
0.9957,
0.8463,
0.9487,
0.3303,
0.1955,
0.5798,
0.2975,
0.6629,
0.1604,
0.8322,
0.7402,
0.3561,
0.6058,
0.2693,
0.5123,
0.2033,
0.5035,
0.1888,
0.6441,
0.8200,
0.8072,
0.9093,
0.9114,
0.9387,
0.1675,
0.6192,
0.2982,
0.5941,
0.1339,
0.4931,
0.1459,
0.2087,
0.9620,
0.5485,

0.6626,
0.1486,
0.8235,
0.9847,
0.4395,
0.2989,
0.5061,
0.6931,
0.0294,
0.7858,
0.3858,
0.7218,
0.4198,
0.3823,
0.7427,
0.5167,
0.9343,
0.0310,
0.1367,
0.3636,
0.0250,
0.3427,
0.3692,
0.1642,
0.7088,
0.5965,
0.9435,
0.4234,
0.4983,
0.8910,
0.4349,
0.6084,
0.5739,
0.8520,
0.7308,
0.2830,
0.7831,
0.2720,
0.5831,
0.0742,
0.2327,
0.4243,
0.4544,
0.9464,
0.4427,
0.0529,
0.2840,
0.1574,
0.4531,
0.9882,
0.6300,
0.7683,
0.2379,
0.4069,
0.3247,
0.3205,
0.3126,
0.1511,
0.1913,

0.9902
1.0000
0.9507
0.9582
0.9954
-0.1099
-0.3234
-0.5575
-0.0238
0.9740
-0.2808
0.9811
-0.4006
-0.2506
0.9631
0.9966
-0.7934
-0.0051
-0.0499
0.9982
-0.0220
-0.2335
-0.2818
-0.0346
0.9687
-0.5597
0.9865
-0.3910
0.9938
0.9633
-0.2495
0.9829
-0.3713
0.9755
-0.5714
-0.2080
0.9541
-0.1640
0.9857
-0.0380
0.9999
-0.2120
0.9950
0.9251
-0.3551
-0.0427
-0.2554
-0.1429
-0.4126
0.9624
0.9999
0.9610
-0.1408
0.9973
-0.1594
0.9987
0.9991
-0.1448
-0.1048

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

495

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.8975,
0.8505,
0.0526,
0.1084,
0.1502,
0.2670,
0.8225,
0.2870,
0.0321,
0.6565,
0.5753,
0.4973,
0.7428,
0.2304,
0.4199,
0.9172,
0.7643,
0.0158,
0.4530,
0.1290,
0.0081,
0.0775,
0.2453,
0.5941,
0.8728,
0.4401,
0.7329,
0.9256,
0.9399,
0.4568,
0.6483,
0.9048,
0.6198,
0.5871,
0.6419,
0.3703,
0.7761,
0.2592,
0.9506,
0.7186,
0.0386,
0.2803,
0.7964,
0.7739,
0.4528,
0.7642,
0.4642,
0.4984,
0.3138,
0.6258,
0.8486,
0.5625,
0.3371,
0.2043,
0.3867,
0.4733,
0.4981,
0.6200,
0.0650,

0.0960,
0.6785,
0.3033,
0.1022,
0.6903,
0.7808,
0.0682,
0.6275,
0.1772,
0.4605,
0.7579,
0.0890,
0.0252,
0.9390,
0.5175,
0.4852,
0.3189,
0.3333,
0.1202,
0.1479,
0.5232,
0.0890,
0.9615,
0.9147,
0.4794,
0.8242,
0.6805,
0.2487,
0.0745,
0.4766,
0.6734,
0.2948,
0.2823,
0.2694,
0.4548,
0.6124,
0.9584,
0.9433,
0.6797,
0.4990,
0.2222,
0.7201,
0.9146,
0.8046,
0.7788,
0.6605,
0.1779,
0.6656,
0.4595,
0.1671,
0.4320,
0.5037,
0.7310,
0.6358,
0.6343,
0.5725,
0.1382,
0.6277,
0.1639,

-0.0861
-0.5456
0.9997
-0.0111
0.9869
0.9626
-0.0560
0.9810
1.0000
-0.2978
0.9780
-0.0442
-0.0187
0.9472
0.9966
-0.4305
-0.2413
0.9999
-0.0544
1.0000
1.0000
1.0000
0.9389
0.9283
-0.4063
0.9434
-0.4783
-0.2281
-0.0699
0.9998
0.9995
-0.2635
-0.1741
-0.1575
-0.2878
0.9840
0.9602
0.9378
-0.6021
-0.3510
0.9999
0.9698
0.9823
0.9989
0.9567
-0.4836
-0.0825
0.9861
0.9958
-0.1044
-0.3585
-0.2796
0.9649
0.9845
0.9817
0.9956
-0.0688
1.0000
0.9999

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

496

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.7234,
0.7481,
0.2169,
0.6759,
0.9965,
0.7576,
0.1973,
0.9203,
0.7023,
0.3538,
0.9740,
0.5465,
0.7876,
0.6176,

0.3125,
0.0800,
0.4042,
0.5200,
0.3079,
0.4382,
0.0435,
0.7052,
0.4427,
0.0248,
0.9488,
0.7157,
0.3340,
0.2059,

-0.2241
-0.0598
0.9967
-0.3443
-0.3020
-0.3259
-0.0086
-0.6044
-0.3059
-0.0088
-0.7981
0.9829
-0.2600
-0.1268

Archivo de ejemplos aNumbers.txt


# An example for a Hopfield Network for JCortex
# The structure can be:
#
-> "float[]" for a float array,
#
-> "Object[]" for an Object array.
@structure float[]
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input

N11
N12
N13
N14
N15
N16
N17
N18
N19
N11
N11
N12
N13
N14
N15
N16
N17
N18
N19
N21
N21
N22
N23
N24

float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float

@output NUM

float

@data
-1,-1,1,-1,-1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

497

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,-1,1,-1,-1,1,1,1,1,2
-1,1,1,-1,1,-1,-1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,1,-1,1,1,-1,3
-1,-1,1,-1,-1,1,1,-1,1,-1,1,-1,1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,4
1,1,1,1,1,-1,-1,-1,1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,5
-1,1,1,-1,1,-1,-1,-1,1,1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,6
1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,7
-1,1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,8
-1,1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,-1,-1,1,-1,9
-1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,-1

Archivo de ejemplos aPromoters.txt


# Conjunto de ejemplos para JCortex
# Nombre Original: Promotor Gene Sequences
# http://www.ics.uci.edu/~mlearn/databases/molecular-biology/promoter-gene-sequences/
@structure

float[]

@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input

float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float

G1
G2
G3
G4
G5
G6
G7
G8
G9
G10
G11
G12
G13
G14
G15
G16
G17
G18
G19
G20
G21
G22
G23
G24
G25
G26
G27
G28
G29
G30
G31
G32
G33

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

498

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input
@input

G34
G35
G36
G37
G38
G39
G40
G41
G42
G43
G44
G45
G46
G47
G48
G49
G50
G51
G52
G53
G54
G55
G56
G57

float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float
float

@output promoter

@data
1.00,
1.00,
1.00,
0.66,
1.00,
1.00,
1.00,
0.66,
0.33,
0.00,
0.66,
0.66,
1.00,
0.66,
0.66,
0.00,
1.00,
0.66,
0.00,
0.33,
1.00,
1.00,
0.00,
0.66,
0.66,
0.00,
1.00,
0.33,
0.00,
1.00,

0.00,
1.00,
0.00,
0.33,
1
0.66,
1.00,
0.66,
1.00,
1
1.00,
1.00,
1.00,
0.33,
1
0.00,
0.33,
0.66,
0.00,
1
0.33,
1.00,
0.00,
0.33,
1
0.66,
0.66,
0.66,
0.66,
1

float

0.33,
0.66,
0.00,
0.66,

1.00,
0.33,
0.66,
0.33,

0.00,
0.66,
1.00,
0.66,

0.66,
1.00,
0.00,
0.66,

0.33,
1.00,
1.00,
0.66,

0.00,
0.33,
0.66,
0.33,

0.00,
0.66,
1.00,
1.00,

1.00,
0.66,
0.00,
1.00,

0.00,
1.00,
1.00,
0.66,

0.33,
0.66,
0.00,
1.00,

0.66,
0.66,
0.00,
0.33,

0.33,
1.00,
1.00,
0.66,

0.33,
0.66,
1.00,
0.00,

1.00,
1.00,
0.66,
0.00,

0.00,
0.33,
1.00,
0.33,

1.00,
0.00,
0.33,
0.66,

0.33,
0.33,
0.66,
0.33,

0.33,
0.66,
1.00,
0.00,

1.00,
0.33,
1.00,
1.00,

0.66,
1.00,
0.00,
0.33,

0.00,
0.66,
0.33,
0.66,

0.33,
0.00,
0.00,
0.33,

0.00,
1.00,
0.00,
0.33,

0.66,
1.00,
1.00,
0.00,

0.00,
0.66,
1.00,
1.00,

0.33,
0.33,
1.00,
0.00,

1.00,
0.00,
1.00,
0.00,

0.00,
1.00,
1.00,
0.33,

0.66,
1.00,
0.66,
0.33,

0.00,
0.00,
1.00,
0.00,

0.66,
0.66,
1.00,
0.33,

0.00,
0.33,
0.00,
0.33,

0.00,
1.00,
1.00,
0.33,

0.33,
1.00,
0.33,
0.66,

1.00,
0.00,
0.00,
0.66,

0.00,
1.00,
1.00,
0.33,

1.00,
0.66,
0.00,
1.00,

1.00,
0.00,
0.66,
0.00,

0.66,
0.00,
1.00,
0.33,

1.00,
0.66,
0.00,
1.00,

0.66,
1.00,
0.66,
0.00,

0.00,
0.66,
0.00,
0.00,

1.00,
1.00,
1.00,
0.33,

0.66,
0.66,
0.66,
0.00,

1.00,
1.00,
1.00,
0.00,

0.66,
1.00,
1.00,
0.00,

1.00,
0.66,
0.00,
0.33,

0.00,
0.33,
0.66,
1.00,

0.66,
0.66,
0.00,
0.66,

0.00,
0.00,
0.00,
0.33,

1.00,
0.33,
0.33,
0.33,

0.00,
0.66,
0.33,
1.00,

0.00,
0.00,
0.00,
0.33,

1.00,
0.00,
0.33,
0.33,

1.00,
0.00,
1.00,
0.66,

0.00,
0.00,
0.00,
1.00,

0.00,
0.66,
0.66,
0.66,

0.33,
0.33,
0.00,
0.66,

1.00,
1.00,
0.00,
1.00,

0.00,
0.66,
1.00,
0.00,

0.66,
0.66,
1.00,
0.00,

0.66,
0.00,
0.00,
0.66,

0.66,
0.00,
1.00,
1.00,

0.33,
0.00,
0.00,
0.33,

0.00,
0.66,
0.00,
0.33,

0.00,
0.00,
0.00,
0.66,

0.66,
0.66,
0.66,
1.00,

0.66,
0.66,
0.00,
1.00,

0.00,
1.00,
0.00,
1.00,

0.66,
1.00,
0.00,
0.00,

0.66,
0.66,
0.33,
0.66,

0.00,
0.33,
1.00,
0.66,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

499

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.33,
1.00,
1.00,
0.33,
1.00,
1.00,
1.00,
0.66,
1.00,
0.00,
0.33,
0.66,
0.66,
0.66,
1.00,
1.00,
1.00,
1.00,
0.66,
0.00,
0.66,
1.00,
0.66,
0.66,
0.66,
0.33,
1.00,
0.66,
0.00,
0.33,
0.66,
1.00,
0.66,
0.66,
0.00,
0.33,
1.00,
0.66,
0.66,
0.00,
1.00,
1.00,
1.00,
0.66,
0.00,
0.00,
1.00,
0.66,
0.66,
0.33,
0.00,
1.00,
0.33,
0.66,
0.00,
0.00,
1.00,
0.66,
0.00,

0.00,
1.00,
0.66,
0.00,
1
1.00,
1.00,
0.33,
0.66,
1
0.66,
0.33,
1.00,
0.33,
1
1.00,
1.00,
0.00,
0.33,
1
0.33,
1.00,
0.66,
0.33,
1
0.33,
1.00,
0.66,
0.33,
1
0.00,
1.00,
0.66,
0.33,
1
1.00,
1.00,
0.00,
0.33,
1
1.00,
1.00,
0.00,
0.33,
1
0.00,
1.00,
0.66,
0.33,
1
1.00,
1.00,
0.66,
0.33,
1
0.00,
0.00,
0.00,
0.66,

0.66,
1.00,
0.00,
0.66,

0.66,
0.00,
1.00,
0.33,

0.66,
0.00,
0.66,
0.33,

0.66,
0.66,
0.00,
0.33,

0.66,
0.33,
0.33,
0.00,

1.00,
0.33,
0.66,
1.00,

0.66,
0.00,
0.33,
0.33,

0.66,
1.00,
0.00,
0.00,

0.00,
0.33,
1.00,
1.00,

0.66,
1.00,
0.00,
0.66,

0.66,
0.33,
0.66,
0.00,

0.00,
0.33,
1.00,
0.00,

1.00,
0.66,
0.00,
0.33,

0.33,
0.00,
1.00,
1.00,

1.00,
1.00,
0.00,
1.00,

0.00,
0.00,
0.33,
0.33,

0.33,
0.33,
0.00,
0.00,

0.00,
1.00,
0.66,
0.00,

0.00,
0.66,
1.00,
0.33,

0.00,
1.00,
0.00,
0.00,

0.00,
0.00,
1.00,
0.66,

0.33,
1.00,
0.00,
0.00,

0.00,
0.66,
0.00,
0.00,

0.33,
0.00,
1.00,
0.33,

0.00,
0.66,
1.00,
0.00,

0.33,
0.00,
0.33,
0.00,

1.00,
0.33,
1.00,
1.00,

1.00,
0.00,
0.66,
0.66,

0.00,
0.66,
1.00,
0.00,

0.00,
0.66,
0.66,
0.00,

1.00,
0.00,
1.00,
0.00,

0.00,
0.33,
0.00,
1.00,

1.00,
0.66,
0.00,
0.66,

0.00,
1.00,
0.00,
0.66,

0.33,
0.33,
1.00,
1.00,

1.00,
0.33,
0.33,
1.00,

1.00,
0.66,
0.00,
0.66,

1.00,
1.00,
0.33,
0.33,

0.00,
0.33,
1.00,
0.33,

0.00,
0.00,
0.33,
0.00,

0.00,
0.66,
0.33,
0.33,

1.00,
0.66,
0.33,
0.33,

1.00,
0.33,
1.00,
0.00,

1.00,
0.33,
0.00,
0.33,

0.33,
0.66,
1.00,
1.00,

0.33,
0.66,
0.00,
0.66,

1.00,
0.00,
0.00,
0.00,

0.33,
0.00,
1.00,
0.33,

0.00,
0.66,
0.00,
0.00,

0.00,
0.00,
0.00,
0.33,

0.00,
0.33,
0.66,
0.00,

0.00,
1.00,
0.66,
0.33,

0.00,
0.33,
0.33,
0.33,

1.00,
1.00,
0.66,
0.33,

0.00,
0.66,
1.00,
0.33,

0.00,
1.00,
0.00,
0.66,

0.00,
0.00,
1.00,
0.33,

1.00,
0.66,
1.00,
0.66,

0.66,
0.33,
0.00,
0.33,

0.33,
0.66,
1.00,
0.33,

1.00,
0.66,
0.00,
0.66,

0.66,
0.00,
0.00,
0.33,

0.00,
0.33,
0.00,
0.33,

0.00,
1.00,
0.66,
0.00,

0.00,
0.33,
0.33,
0.33,

1.00,
1.00,
0.66,
0.33,

1.00,
0.66,
1.00,
1.00,

0.33,
0.00,
0.00,
0.33,

0.00,
0.00,
0.00,
0.66,

0.66,
0.00,
1.00,
0.33,

0.66,
0.66,
0.00,
0.66,

0.66,
0.00,
1.00,
0.00,

1.00,
0.66,
0.66,
0.66,

0.33,
1.00,
0.00,
0.33,

0.00,
0.66,
1.00,
0.33,

0.00,
0.33,
0.33,
1.00,

0.00,
0.00,
0.33,
0.33,

0.00,
0.00,
0.33,
0.33,

0.00,
0.00,
1.00,
0.66,

0.00,
0.00,
0.00,
1.00,

0.00,
0.00,
1.00,
1.00,

1.00,
0.00,
0.00,
0.66,

0.00,
1.00,
0.00,
0.00,

0.33,
1.00,
1.00,
0.66,

0.66,
0.66,
0.00,
0.66,

0.33,
0.33,
0.33,
0.33,

0.00,
0.66,
1.00,
0.33,

0.00,
0.66,
0.33,
1.00,

1.00,
0.33,
0.33,
0.33,

1.00,
0.33,
0.33,
0.33,

1.00,
1.00,
1.00,
0.00,

1.00,
0.66,
0.00,
1.00,

1.00,
0.33,
1.00,
0.33,

0.33,
0.66,
0.00,
0.66,

1.00,
0.66,
0.00,
0.00,

0.00,
0.00,
1.00,
0.33,

1.00,
0.66,
0.00,
0.66,

0.00,
1.00,
0.33,
0.33,

1.00,
0.33,
1.00,
0.33,

0.00,
0.00,
0.33,
0.00,

1.00,
0.66,
0.33,
0.33,

1.00,
0.66,
0.33,
0.33,

1.00,
0.33,
1.00,
0.00,

1.00,
0.33,
0.00,
0.33,

1.00,
0.66,
1.00,
1.00,

0.33,
0.66,
0.00,
0.66,

0.66,
0.00,
0.00,
0.00,

0.33,
0.00,
1.00,
0.33,

0.66,
0.66,
0.00,
0.00,

0.33,
0.00,
0.00,
0.33,

0.00,
0.33,
0.66,
0.00,

0.00,
1.00,
0.66,
0.33,

0.00,
0.33,
0.33,
0.33,

0.66,
1.00,
0.66,
0.66,

0.00,
0.66,
1.00,
0.33,

0.00,
1.00,
0.00,
0.33,

0.00,
0.00,
1.00,
0.66,

1.00,
0.66,
1.00,
0.33,

0.66,
0.33,
0.00,
0.66,

0.33,
0.66,
1.00,
0.33,

0.66,
0.66,
0.00,
0.66,

0.33,
1.00,
0.33,
0.33,

0.00,
0.33,
1.00,
0.33,

1.00,
1.00,
0.33,
1.00,

1.00,
1.00,
0.33,
0.33,

1.00,
0.33,
0.33,
0.33,

1.00,
0.33,
1.00,
0.00,

1.00,
1.00,
0.00,
1.00,

0.33,
0.66,
1.00,
0.33,

0.33,
0.00,
0.00,
0.66,

0.66,
0.66,
0.00,
0.00,

0.33,
0.33,
1.00,
0.33,

0.00,
0.66,
0.66,
0.33,

0.33,
0.00,
1.00,
0.33,

0.00,
0.33,
0.66,
1.00,

0.00,
0.00,
1.00,
0.33,

1.00,
0.00,
0.00,
0.66,

1.00,
0.00,
0.00,
1.00,

1.00,
0.00,
1.00,
0.66,

0.33,
0.00,
0.00,
1.00,

0.00,
0.33,
0.00,
0.33,

0.66,
1.00,
1.00,
1.00,

0.00,
0.33,
0.66,
1.00,

0.00,
1.00,
1.00,
0.66,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

500

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.33,
1.00,
1.00,
1.00,
0.66,
0.66,
0.66,
1.00,
0.66,
1.00,
1.00,
0.66,
0.66,
0.66,
1.00,
0.66,
0.00,
1.00,
1.00,
1.00,
0.00,
1.00,
1.00,
1.00,
1.00,
0.00,
0.00,
0.66,
0.33,
1.00,
0.33,
0.00,
1.00,
1.00,
0.00,
0.66,
1.00,
1.00,
0.66,
1.00,
0.33,
0.33,
1.00,
0.33,
1.00,
1.00,
1.00,
1.00,
1.00,
1.00,
0.66,
0.00,
1.00,
0.33,
1.00,
0.66,
1.00,
1.00,
1.00,

1
0.33,
1.00,
0.33,
0.33,
1
0.33,
0.66,
1.00,
1.00,
1
0.00,
0.33,
0.33,
0.00,
1
0.00,
1.00,
1.00,
0.00,
1
0.33,
1.00,
0.33,
0.00,
1
0.33,
1.00,
0.66,
0.00,
1
0.00,
1.00,
0.00,
0.00,
1
1.00,
1.00,
0.00,
1.00,
1
0.00,
0.33,
0.66,
0.66,
1
0.33,
1.00,
0.00,
1.00,
1
0.33,
1.00,
0.00,
1.00,
1
0.66,
1.00,
1.00,

1.00,
1.00,
0.00,
0.66,

0.33,
0.00,
1.00,
0.33,

0.00,
0.33,
1.00,
0.33,

0.00,
0.00,
1.00,
0.33,

0.33,
0.66,
0.66,
0.33,

0.66,
0.33,
0.00,
0.66,

1.00,
0.66,
1.00,
0.33,

0.00,
0.66,
0.00,
1.00,

0.00,
0.33,
1.00,
1.00,

0.33,
0.66,
0.66,
0.33,

0.00,
0.33,
0.00,
0.33,

0.33,
0.66,
1.00,
0.33,

0.00,
0.66,
0.66,
1.00,

0.00,
0.00,
0.00,
1.00,

0.00,
0.33,
1.00,
0.66,

1.00,
1.00,
1.00,
1.00,

0.00,
1.00,
0.00,
1.00,

0.00,
1.00,
1.00,
0.00,

1.00,
1.00,
0.00,
0.33,

0.33,
0.33,
0.66,
0.66,

0.00,
1.00,
0.00,
0.33,

0.00,
0.66,
0.33,
0.66,

1.00,
0.33,
0.00,
1.00,

0.66,
0.33,
0.33,
1.00,

0.33,
0.66,
0.66,
0.66,

0.00,
0.33,
0.66,
0.33,

0.33,
0.00,
1.00,
0.66,

0.33,
0.00,
0.00,
0.33,

0.00,
0.00,
1.00,
0.33,

1.00,
0.00,
0.66,
0.33,

0.33,
0.33,
0.66,
0.66,

0.66,
0.33,
0.33,
0.66,

0.00,
1.00,
0.00,
0.00,

0.00,
1.00,
1.00,
0.00,

1.00,
1.00,
0.66,
0.66,

0.66,
0.33,
0.00,
0.00,

0.00,
0.66,
1.00,
1.00,

0.00,
0.33,
0.33,
0.00,

0.00,
0.00,
1.00,
0.00,

0.33,
1.00,
0.66,
0.33,

0.66,
1.00,
0.66,
0.33,

1.00,
0.00,
0.33,
0.00,

0.33,
0.66,
0.33,
1.00,

0.00,
0.00,
0.66,
1.00,

1.00,
0.00,
0.00,
0.00,

0.33,
0.00,
0.33,
0.00,

0.66,
0.66,
0.33,
1.00,

0.33,
0.66,
1.00,
1.00,

1.00,
0.66,
0.66,
0.66,

0.66,
0.00,
0.00,
1.00,

0.00,
0.33,
0.00,
0.00,

0.00,
0.00,
0.33,
0.33,

0.00,
0.00,
1.00,
0.66,

1.00,
1.00,
0.00,
0.33,

0.66,
1.00,
0.66,
0.00,

0.00,
0.00,
1.00,
0.00,

0.66,
0.00,
1.00,
0.66,

0.33,
1.00,
0.00,
1.00,

1.00,
0.33,
0.00,
1.00,

0.66,
0.00,
0.33,
0.33,

0.33,
0.66,
1.00,
0.00,

0.66,
0.00,
1.00,
0.00,

0.66,
0.33,
1.00,
0.66,

0.00,
0.00,
0.66,
0.66,

0.00,
1.00,
1.00,
0.33,

0.66,
1.00,
1.00,
0.66,

0.00,
1.00,
0.00,
0.00,

0.00,
1.00,
0.33,
0.33,

0.00,
0.00,
0.00,
0.66,

0.00,
0.00,
0.00,
0.33,

0.33,
0.33,
0.66,
0.33,

0.33,
0.00,
0.66,
0.66,

0.00,
0.66,
0.00,
1.00,

1.00,
0.00,
0.00,
0.00,

1.00,
0.33,
1.00,
1.00,

0.00,
1.00,
0.00,
0.00,

0.00,
1.00,
0.33,
0.66,

0.00,
0.00,
1.00,
0.66,

0.00,
0.66,
1.00,
0.33,

1.00,
0.66,
1.00,
0.00,

1.00,
1.00,
0.00,
1.00,

1.00,
0.33,
0.00,
0.00,

1.00,
0.00,
0.33,
0.66,

0.00,
0.33,
0.33,
0.33,

0.66,
0.66,
0.00,
0.00,

1.00,
1.00,
0.00,
0.33,

0.33,
0.00,
0.00,
0.00,

0.00,
0.00,
0.66,
0.00,

1.00,
0.00,
0.00,
0.66,

0.00,
0.33,
1.00,
1.00,

0.00,
0.33,
1.00,
0.33,

1.00,
0.00,
1.00,
1.00,

0.33,
0.00,
0.00,
0.00,

0.66,
0.00,
0.66,
0.33,

0.00,
1.00,
0.66,
0.00,

0.33,
1.00,
1.00,
0.33,

1.00,
0.66,
0.33,
0.66,

0.33,
0.00,
1.00,
0.33,

0.33,
0.33,
1.00,
0.66,

1.00,
0.66,
1.00,
0.00,

0.33,
0.00,
0.00,
0.33,

0.66,
0.33,
0.33,
0.00,

0.33,
0.66,
0.66,
0.00,

0.00,
0.66,
1.00,
1.00,

0.33,
1.00,
0.00,
1.00,

0.33,
1.00,
1.00,
1.00,

0.00,
1.00,
0.00,
1.00,

0.66,
0.00,
0.66,
1.00,

0.33,
0.66,
0.33,
0.00,

0.00,
0.66,
0.66,
0.33,

0.66,
0.33,
0.00,
0.00,

1.00,
0.00,
0.33,
1.00,

0.00,
1.00,
0.66,
0.00,

1.00,
0.00,
0.00,
0.33,

0.00,
0.00,
0.66,
0.33,

0.00,
1.00,
1.00,
1.00,

1.00,
1.00,
0.00,
0.66,

1.00,
0.00,
0.00,
0.33,

1.00,
0.00,
0.00,
0.33,

0.66,
0.66,
0.00,
0.33,

0.00,
0.33,
1.00,
0.00,

0.66,
0.33,
0.66,
0.66,

1.00,
1.00,
1.00,
0.00,

1.00,
0.66,
0.66,
0.00,

0.00,
1.00,
1.00,
0.00,

1.00,
0.66,
0.00,
0.00,

0.33,
0.66,
1.00,
0.33,

0.33,
0.00,
1.00,
0.00,

0.00,
1.00,
0.00,
0.33,

0.33,
0.00,
0.66,
0.66,

1.00,
0.00,
0.00,
0.00,

0.00,
0.33,
0.66,
0.66,

1.00, 0.66, 0.33, 0.00, 0.66, 1.00, 1.00, 1.00, 0.00, 1.00, 0.66, 0.66,
0.33, 0.33, 0.00, 0.00, 0.00, 0.00, 1.00, 0.33, 0.66, 0.33, 0.33, 1.00,
1.00, 0.66, 0.33, 1.00, 0.66, 1.00, 0.00, 1.00, 0.00, 1.00, 0.00, 0.33,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

501

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


1.00,
1.00,
0.33,
1.00,
0.00,
1.00,
0.66,
0.00,
1.00,
0.00,
1.00,
1.00,
0.00,
0.66,
0.33,
1.00,
0.66,
1.00,
1.00,
0.33,
1.00,
1.00,
0.00,
1.00,
0.00,
1.00,
1.00,
0.33,
1.00,
0.33,
1.00,
0.33,
1.00,
1.00,
0.66,
1.00,
0.00,
0.33,
1.00,
0.00,
1.00,
1.00,
1.00,
1.00,
1.00,
1.00,
1.00,
1.00,
1.00,
0.66,
1.00,
0.00,
0.66,
1.00,
1.00,
0.00,
1.00,
0.00,
1.00,

0.33,
1
1.00,
1.00,
0.33,
0.33,
1
1.00,
1.00,
0.00,
1.00,
1
1.00,
1.00,
0.00,
0.66,
1
0.00,
1.00,
0.66,
0.00,
1
1.00,
1.00,
1.00,
0.66,
1
0.33,
1.00,
1.00,
0.66,
1
0.33,
1.00,
0.33,
1.00,
1
0.33,
0.00,
0.00,
0.66,
1
1.00,
1.00,
0.66,
0.00,
1
0.66,
1.00,
0.00,
0.33,
1
0.00,
0.00,
0.00,
1.00,
1
0.00,
1.00,

0.00, 0.33, 0.00, 0.66, 0.33, 0.00, 1.00, 0.00, 0.00, 0.33, 1.00, 0.66,
0.66,
0.66,
0.33,
0.33,

1.00,
0.00,
0.33,
0.33,

1.00,
0.66,
0.33,
0.00,

0.66,
1.00,
1.00,
0.66,

1.00,
1.00,
0.33,
0.33,

1.00,
0.66,
0.00,
1.00,

0.33,
1.00,
1.00,
1.00,

0.00,
0.66,
1.00,
0.00,

0.66,
1.00,
0.33,
1.00,

1.00,
0.00,
1.00,
0.00,

1.00,
1.00,
0.66,
0.33,

1.00,
0.00,
0.00,
0.66,

1.00,
1.00,
0.00,
0.00,

0.00,
0.33,
0.00,
0.66,

0.33,
1.00,
0.00,
1.00,

0.00,
0.66,
0.00,
0.33,

0.00,
0.00,
0.66,
0.66,

0.00,
0.00,
0.00,
0.33,

0.00,
0.33,
0.66,
0.66,

0.00,
1.00,
1.00,
1.00,

0.66,
0.66,
0.00,
0.00,

1.00,
0.00,
0.00,
0.66,

0.66,
0.00,
0.00,
0.66,

0.33,
0.33,
0.66,
0.66,

0.66,
0.66,
0.00,
0.33,

0.33,
0.00,
0.00,
0.66,

0.66,
0.33,
0.33,
0.33,

0.33,
0.00,
0.33,
0.66,

0.00,
0.00,
0.33,
0.33,

0.00,
0.66,
1.00,
0.33,

0.33,
0.66,
0.33,
0.66,

0.66,
0.66,
1.00,
0.00,

0.33,
0.33,
0.00,
0.00,

0.66,
0.66,
1.00,
0.66,

0.66,
0.33,
0.00,
0.33,

0.66,
0.66,
0.33,
1.00,

0.00,
0.66,
0.33,
0.33,

0.00,
1.00,
1.00,
0.66,

0.00,
0.33,
1.00,
0.33,

0.00,
0.00,
0.00,
0.33,

0.00,
0.66,
1.00,
0.66,

0.33,
0.33,
0.00,
1.00,

1.00,
0.33,
0.00,
1.00,

0.00,
1.00,
0.66,
0.00,

0.00,
0.66,
0.00,
1.00,

0.33,
1.00,
1.00,
0.00,

0.00,
0.33,
0.33,
0.33,

0.66,
0.33,
0.00,
0.66,

0.66,
0.66,
0.66,
0.33,

0.33,
0.33,
1.00,
0.66,

0.00,
0.00,
0.33,
0.33,

0.00,
1.00,
1.00,
0.66,

1.00,
0.66,
0.33,
0.33,

1.00,
0.00,
0.33,
1.00,

1.00,
0.00,
0.00,
0.00,

1.00,
0.33,
1.00,
0.33,

1.00,
1.00,
0.00,
1.00,

1.00,
0.33,
0.66,
1.00,

0.00,
0.66,
0.00,
0.66,

0.66,
0.33,
0.00,
0.00,

1.00,
0.66,
0.33,
0.33,

1.00,
0.00,
1.00,
0.66,

0.66,
0.33,
0.00,
0.33,

0.00,
0.66,
1.00,
0.33,

0.00,
0.33,
0.00,
0.33,

0.00,
1.00,
0.33,
0.33,

0.00,
0.66,
0.66,
0.66,

0.00,
0.33,
0.33,
0.33,

0.66,
0.00,
0.00,
0.00,

0.00,
0.00,
1.00,
0.00,

0.66,
0.66,
0.00,
0.33,

0.66,
0.66,
0.00,
0.66,

0.66,
0.66,
0.00,
0.33,

1.00,
0.00,
1.00,
0.66,

1.00,
0.33,
0.33,
0.66,

0.66,
0.00,
0.66,
0.33,

1.00,
0.33,
0.33,
0.66,

0.00,
0.33,
0.33,
1.00,

1.00,
1.00,
0.33,
0.33,

0.00,
1.00,
1.00,
0.33,

1.00,
1.00,
0.00,
1.00,

1.00,
1.00,
0.00,
0.33,

1.00,
0.33,
0.00,
0.00,

0.33,
0.66,
0.00,
1.00,

0.66,
0.33,
0.66,
0.33,

1.00,
0.33,
0.33,
0.33,

1.00,
0.33,
0.66,
0.66,

1.00,
0.00,
0.66,
0.33,

0.00,
1.00,
1.00,
0.66,

1.00,
0.00,
0.66,
0.33,

1.00,
1.00,
1.00,
0.33,

1.00,
0.33,
1.00,
0.33,

1.00,
0.33,
0.00,
1.00,

1.00,
1.00,
1.00,
0.33,

1.00,
1.00,
0.00,
0.66,

0.33,
0.66,
0.00,
0.00,

0.33,
0.66,
0.00,
0.66,

0.66,
0.33,
0.66,
0.33,

0.33,
0.00,
0.33,
0.33,

0.00,
0.00,
1.00,
0.00,

1.00,
0.00,
0.66,
0.66,

0.00,
0.66,
0.66,
0.33,

1.00,
1.00,
0.33,
0.33,

1.00,
1.00,
1.00,
0.00,

1.00,
0.66,
0.00,
0.00,

1.00,
0.66,
0.66,
1.00,

1.00,
0.66,
0.00,
0.33,

0.33,
1.00,
1.00,
1.00,

1.00,
1.00,
1.00,
1.00,

0.00,
0.00,
1.00,
1.00,

0.00,
0.33,
1.00,
0.00,

0.00,
0.66,
1.00,
0.33,

0.33,
1.00,
0.66,
0.33,

1.00,
0.66,
1.00,
0.33,

0.00,
0.66,
0.33,
0.33,

0.00,
0.66,
1.00,
0.33,

1.00,
0.33,
0.00,
0.00,

0.66,
0.66,
0.33,
0.33,

0.33,
0.66,
0.00,
0.66,

0.33,
1.00,
0.00,
1.00,

1.00,
1.00,
0.00,
0.33,

0.33,
0.00,
0.00,
0.33,

0.66,
0.33,
1.00,
0.33,

0.33,
1.00,
1.00,
0.00,

0.00,
1.00,
0.00,
0.66,

0.33,
0.00,
0.00,
0.33,

0.66,
1.00,
0.33,
0.33,

0.00,
1.00,
0.33,
0.00,

1.00,
1.00,
0.33,
1.00,

0.33,
0.66,
0.00,
1.00,

1.00,
0.00,
0.33,
0.33,

0.66,
0.66,
0.66,
1.00,

0.33, 0.66, 0.33, 0.00, 1.00, 0.00, 0.33, 0.66, 0.66, 1.00, 0.00, 1.00,
1.00, 0.00, 0.33, 0.33, 1.00, 1.00, 0.33, 0.33, 0.33, 0.00, 0.66, 1.00,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

502

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.33,
1.00,
0.33,
1.00,
0.33,
0.33,
0.66,
0.66,
0.66,
0.66,
1.00,
0.33,
1.00,
0.33,
1.00,
0.33,
0.00,
1.00,
0.33,
0.00,
0.66,
0.33,
1.00,
0.00,
1.00,
0.66,
1.00,
1.00,
0.33,
1.00,
1.00,
0.00,
1.00,
0.66,
1.00,
0.00,
1.00,
1.00,
1.00,
1.00,
1.00,
1.00,
0.66,
0.33,
1.00,
0.00,
0.33,
1.00,
1.00,
0.33,
1.00,
0.66,
0.66,
1.00,
0.66,
1.00,
0.00,
1.00,
0.00,

0.00,
1.00,
1
1.00,
1.00,
0.66,
1.00,
1
0.33,
1.00,
0.00,
1.00,
1
0.00,
0.33,
0.66,
1.00,
1
0.00,
1.00,
0.33,
1.00,
1
1.00,
1.00,
0.00,
1.00,
1
0.00,
1.00,
0.66,
1.00,
1
0.66,
1.00,
0.00,
0.33,
1
0.00,
1.00,
1.00,
1.00,
1
0.33,
1.00,
0.00,
1.00,
1
0.66,
1.00,
0.00,
1.00,
1
0.33,
1.00,
1.00,
1.00,
1
1.00,

0.00, 0.66, 0.00, 0.00, 0.00, 0.00, 0.33, 1.00, 1.00, 0.00, 1.00, 0.33,
0.00, 1.00, 1.00, 0.33, 0.33, 0.33, 0.00, 0.33, 1.00, 1.00, 1.00, 1.00,
0.00,
0.66,
0.33,
1.00,

0.66,
0.00,
0.00,
1.00,

0.33,
0.33,
0.00,
0.33,

0.66,
0.66,
0.33,
1.00,

0.66,
0.33,
1.00,
0.33,

0.00,
1.00,
0.33,
0.33,

1.00,
1.00,
1.00,
0.00,

0.33,
1.00,
0.33,
1.00,

0.33,
1.00,
1.00,
0.00,

1.00,
1.00,
0.00,
0.33,

0.00,
0.00,
0.33,
0.33,

0.33,
1.00,
1.00,
0.33,

0.33,
0.66,
0.00,
1.00,

1.00,
1.00,
1.00,
0.66,

1.00,
1.00,
1.00,
1.00,

0.33,
1.00,
0.33,
0.00,

1.00,
1.00,
0.66,
0.00,

0.33,
1.00,
0.66,
0.00,

0.33,
1.00,
1.00,
0.33,

0.00,
0.66,
0.66,
0.33,

0.00,
1.00,
1.00,
1.00,

0.00,
1.00,
0.00,
0.00,

0.00,
0.66,
0.66,
0.00,

0.33,
1.00,
0.00,
0.00,

0.66,
0.66,
1.00,
1.00,

0.00,
0.00,
0.33,
0.33,

0.00,
0.00,
1.00,
1.00,

0.00,
0.33,
1.00,
0.00,

0.33,
0.00,
0.66,
0.00,

0.66,
1.00,
1.00,
0.33,

1.00,
0.33,
0.66,
0.00,

1.00,
0.66,
1.00,
1.00,

1.00,
0.00,
1.00,
0.00,

1.00,
1.00,
0.00,
0.33,

0.00,
0.33,
0.66,
0.66,

1.00,
1.00,
0.00,
0.66,

0.33,
0.66,
0.00,
0.00,

1.00,
1.00,
1.00,
1.00,

0.00,
0.33,
0.33,
0.66,

0.00,
0.00,
1.00,
0.66,

1.00,
0.33,
1.00,
1.00,

1.00,
0.00,
1.00,
1.00,

1.00,
0.33,
0.66,
0.00,

0.00,
1.00,
1.00,
1.00,

1.00,
1.00,
1.00,
1.00,

1.00,
1.00,
0.00,
1.00,

0.33,
1.00,
1.00,
0.33,

0.33,
0.33,
0.66,
0.00,

0.00,
0.66,
0.00,
0.00,

1.00,
0.33,
0.00,
0.00,

0.00,
1.00,
0.66,
0.00,

0.00,
1.00,
1.00,
0.00,

0.00,
1.00,
0.66,
0.66,

0.00,
0.33,
0.66,
0.00,

0.00,
1.00,
1.00,
0.33,

0.00,
0.00,
1.00,
0.00,

0.66,
0.00,
1.00,
1.00,

1.00,
0.33,
0.00,
0.33,

1.00,
0.66,
0.66,
0.00,

0.33,
1.00,
0.66,
0.66,

0.00,
0.66,
0.00,
0.00,

0.66,
0.33,
1.00,
0.66,

0.66,
0.33,
1.00,
1.00,

1.00,
1.00,
0.00,
0.33,

0.00,
1.00,
0.00,
0.66,

0.66,
0.66,
1.00,
0.33,

0.00,
1.00,
0.66,
0.00,

0.00,
0.33,
0.66,
1.00,

1.00,
0.66,
0.33,
0.33,

0.66,
0.66,
0.00,
0.66,

0.33,
0.33,
0.33,
0.66,

1.00,
0.33,
0.66,
0.00,

0.33,
0.66,
0.00,
1.00,

0.33,
1.00,
0.33,
1.00,

0.00,
0.00,
0.33,
1.00,

0.00,
0.33,
1.00,
0.00,

0.00,
1.00,
0.00,
0.66,

0.00,
0.00,
1.00,
0.66,

0.00,
1.00,
0.66,
0.33,

0.00,
1.00,
0.66,
0.00,

1.00,
1.00,
1.00,
1.00,

0.00,
0.00,
0.00,
1.00,

1.00,
0.33,
0.00,
0.33,

0.33,
0.00,
0.33,
0.33,

0.66,
1.00,
0.33,
0.66,

0.66,
0.00,
0.33,
1.00,

0.33,
0.33,
0.66,
0.66,

0.00,
0.00,
0.66,
1.00,

0.33,
0.33,
0.33,
0.66,

0.33,
1.00,
1.00,
0.66,

0.33,
1.00,
0.33,
0.00,

0.33,
1.00,
0.66,
0.00,

0.00,
0.00,
1.00,
1.00,

0.66,
1.00,
0.00,
1.00,

0.66,
0.66,
1.00,
0.66,

0.33,
0.33,
0.66,
1.00,

0.00,
0.33,
0.33,
1.00,

1.00,
1.00,
1.00,
0.66,

0.33,
0.33,
1.00,
1.00,

0.00,
0.00,
1.00,
0.00,

0.00,
0.00,
0.66,
0.00,

0.00,
0.33,
1.00,
0.33,

0.00,
0.00,
0.66,
0.66,

0.00,
1.00,
1.00,
0.33,

0.00,
0.00,
0.00,
1.00,

0.00,
0.00,
0.00,
0.00,

1.00,
0.00,
1.00,
0.33,

0.00,
0.00,
0.00,
0.00,

0.66,
0.66,
1.00,
0.00,

0.66,
0.00,
0.66,
0.33,

0.66,
1.00,
0.00,
1.00,

0.00,
0.33,
1.00,
0.33,

0.33,
0.33,
0.00,
1.00,

0.66,
0.66,
1.00,
1.00,

1.00,
0.33,
0.66,
1.00,

0.33,
0.00,
0.33,
0.00,

0.66,
0.33,
1.00,
0.66,

1.00,
0.66,
0.00,
0.33,

1.00,
1.00,
1.00,
0.66,

0.00,
1.00,
0.33,
0.00,

0.00,
0.66,
1.00,
1.00,

0.66,
0.00,
1.00,
1.00,

0.00,
1.00,
0.00,
0.66,

0.00,
0.66,
1.00,
1.00,

0.00,
0.00,
0.33,
1.00,

1.00,
0.00,
0.33,
0.66,

0.00,
0.33,
0.00,
0.66,

1.00,
1.00,
0.66,
0.33,

1.00,
0.66,
1.00,
0.00,

0.00,
1.00,
0.00,
1.00,

1.00,
1.00,
1.00,
0.00,

0.66,
1.00,
0.00,
0.00,

0.00, 1.00, 0.66, 0.00, 0.00, 0.33, 0.66, 1.00, 1.00, 0.66, 0.00, 0.66,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

503

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.00,
0.00,
0.00,
0.00,
0.33,
0.00,
0.33,
0.00,
0.33,
0.33,
0.33,
1.00,
0.66,
0.66,
1.00,
0.33,
1.00,
1.00,
1.00,
0.33,
0.33,
0.66,
0.33,
0.66,
0.66,
0.00,
1.00,
0.33,
1.00,
1.00,
0.00,
0.00,
1.00,
0.00,
0.66,
1.00,
1.00,
1.00,
0.00,
0.33,
0.66,
0.00,
0.33,
0.33,
0.33,
0.33,
0.33,
1.00,
0.66,
0.33,
0.00,
0.66,
1.00,
0.66,
0.00,
1.00,
0.33,
1.00,
1.00,

0.33,
1.00,
0.33,
0
0.66,
0.66,
1.00,
0.00,
0
0.00,
0.66,
1.00,
0.00,
0
1.00,
0.00,
0.66,
0.33,
0
0.66,
0.33,
0.33,
1.00,
0
0.33,
0.00,
0.00,
1.00,
0
0.66,
0.33,
1.00,
0.66,
0
0.00,
0.00,
0.33,
1.00,
0
0.66,
0.33,
0.66,
0.33,
0
0.66,
1.00,
0.33,
1.00,
0
1.00,
1.00,
0.00,
0.66,
0
1.00,
1.00,
0.00,
0.66,
0

1.00, 0.66, 0.33, 0.33, 0.66, 0.33, 1.00, 0.66, 0.00, 0.66, 1.00, 1.00,
0.33, 0.00, 0.66, 0.33, 1.00, 0.66, 1.00, 0.66, 0.00, 0.00, 0.33, 0.66,
0.00, 1.00, 1.00, 0.33, 1.00, 0.66, 0.66, 0.33, 0.66, 1.00, 0.33, 1.00,
0.00,
0.00,
0.66,
0.33,

0.00,
0.33,
0.66,
0.00,

0.33,
0.33,
1.00,
1.00,

0.66,
0.66,
0.00,
1.00,

0.00,
0.33,
1.00,
0.00,

0.66,
1.00,
1.00,
1.00,

1.00,
1.00,
0.00,
1.00,

0.33,
1.00,
0.33,
0.33,

0.00,
0.66,
1.00,
0.66,

0.00,
0.00,
0.66,
1.00,

1.00,
0.33,
1.00,
0.33,

0.33,
1.00,
0.66,
1.00,

0.00,
0.66,
1.00,
0.66,

1.00,
0.66,
1.00,
0.66,

0.66,
1.00,
1.00,
0.00,

0.66,
0.33,
1.00,
0.00,

0.33,
1.00,
0.66,
0.33,

0.33,
1.00,
0.33,
1.00,

1.00,
0.66,
1.00,
0.00,

0.33,
0.00,
0.66,
1.00,

1.00,
0.66,
0.00,
0.00,

0.00,
0.66,
0.00,
1.00,

0.00,
0.66,
0.00,
0.66,

0.00,
0.66,
0.66,
0.33,

0.66,
0.66,
1.00,
0.33,

0.00,
0.33,
0.00,
0.66,

0.33,
0.00,
0.00,
0.66,

0.33,
1.00,
0.66,
1.00,

1.00,
1.00,
0.33,
1.00,

0.00,
1.00,
1.00,
0.66,

0.33,
1.00,
0.00,
0.00,

1.00,
0.66,
0.00,
0.33,

0.00,
0.66,
0.33,
1.00,

0.33,
0.33,
0.33,
0.33,

0.66,
0.66,
0.00,
0.00,

0.33,
0.66,
1.00,
0.00,

1.00,
1.00,
1.00,
0.00,

0.33,
0.33,
0.66,
0.00,

1.00,
0.33,
0.66,
0.33,

0.00,
0.66,
0.00,
0.66,

1.00,
0.66,
0.00,
0.33,

0.33,
1.00,
0.66,
0.00,

0.66,
0.00,
0.66,
0.66,

0.66,
1.00,
1.00,
0.00,

1.00,
0.33,
0.66,
1.00,

0.66,
0.00,
0.00,
0.66,

0.00,
0.00,
0.33,
0.33,

0.00,
0.33,
0.66,
0.00,

0.33,
0.33,
1.00,
0.66,

0.00,
1.00,
0.33,
0.00,

0.00,
1.00,
0.00,
0.33,

1.00,
0.66,
0.66,
0.00,

0.33,
0.00,
0.33,
1.00,

0.00,
0.00,
0.33,
0.33,

0.00,
0.66,
0.00,
0.33,

1.00,
0.66,
0.00,
1.00,

0.33,
0.66,
0.33,
1.00,

0.00,
1.00,
0.00,
0.33,

0.00,
0.66,
0.66,
0.66,

0.66,
0.66,
0.33,
1.00,

0.66,
0.00,
0.00,
0.00,

0.00,
1.00,
0.00,
1.00,

1.00,
1.00,
0.33,
0.66,

0.66,
0.66,
0.66,
1.00,

0.66,
0.00,
0.33,
1.00,

0.00,
0.66,
1.00,
1.00,

0.33,
0.66,
0.00,
0.00,

0.66,
0.00,
0.33,
0.33,

1.00,
0.00,
1.00,
1.00,

1.00,
0.66,
0.00,
0.33,

0.33,
0.66,
0.33,
0.33,

0.00,
0.33,
0.33,
0.00,

0.66,
1.00,
0.00,
0.66,

0.66,
0.66,
0.00,
0.00,

1.00,
0.00,
1.00,
0.33,

0.66,
0.33,
0.33,
1.00,

0.66,
0.33,
0.00,
0.33,

0.33,
0.66,
0.66,
1.00,

1.00,
0.00,
0.00,
0.66,

0.00,
0.00,
0.33,
0.66,

1.00,
0.33,
0.33,
1.00,

0.66,
0.66,
0.66,
0.00,

1.00,
0.00,
0.33,
1.00,

0.66,
0.66,
1.00,
1.00,

1.00,
1.00,
1.00,
0.00,

0.00,
1.00,
0.00,
0.66,

0.66,
1.00,
0.33,
0.00,

0.33,
0.33,
0.66,
0.66,

0.66,
1.00,
0.33,
0.66,

0.33,
1.00,
0.00,
0.00,

0.00,
0.00,
0.33,
0.33,

1.00,
0.33,
0.33,
0.66,

0.33,
1.00,
0.00,
0.00,

0.00,
0.66,
0.66,
0.33,

0.66,
1.00,
0.33,
0.66,

1.00,
0.66,
0.66,
0.00,

0.00,
0.33,
1.00,
0.66,

0.33,
0.66,
0.33,
0.00,

0.33,
1.00,
1.00,
0.66,

0.66,
0.33,
0.00,
0.66,

0.00,
0.33,
0.00,
0.66,

0.00,
1.00,
0.00,
0.66,

0.66,
0.33,
0.33,
1.00,

0.33,
0.00,
0.66,
1.00,

0.66,
0.00,
0.66,
1.00,

0.00,
1.00,
0.66,
1.00,

0.66,
0.66,
1.00,
1.00,

0.33,
0.66,
0.33,
1.00,

0.00,
0.00,
1.00,
0.66,

0.33,
1.00,
0.66,
1.00,

0.66,
0.66,
0.33,
0.33,

0.66,
0.33,
0.66,
1.00,

1.00,
1.00,
1.00,
0.00,

0.66,
0.66,
1.00,
0.33,

0.66,
0.66,
0.33,
1.00,

0.66,
0.00,
0.00,
0.66,

1.00,
1.00,
0.33,
0.00,

0.00,
0.66,
1.00,
0.33,

0.33,
0.66,
1.00,
1.00,

0.00,
0.00,
0.33,
0.33,

0.00,
0.66,
0.66,
1.00,

0.66,
0.00,
0.33,
0.00,

1.00,
0.33,
0.00,
0.00,

0.33,
0.33,
1.00,
0.66,

1.00,
1.00,
1.00,
0.33,

0.33,
0.00,
1.00,
1.00,

0.00,
0.33,
1.00,
0.00,

0.66,
1.00,
0.66,
0.00,

0.00,
0.00,
0.66,
0.33,

0.66,
0.33,
0.33,
0.33,

1.00,
0.66,
0.66,
0.00,

0.33,
0.33,
0.66,
1.00,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

504

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.00,
0.00,
0.66,
0.33,
0.66,
1.00,
0.00,
0.33,
0.33,
1.00,
1.00,
1.00,
0.33,
0.66,
0.00,
0.00,
0.00,
0.66,
0.33,
0.66,
0.00,
0.00,
0.66,
1.00,
0.33,
0.66,
0.66,
0.33,
1.00,
1.00,
1.00,
0.00,
0.66,
1.00,
1.00,
1.00,
0.00,
0.33,
1.00,
0.33,
1.00,
0.00,
1.00,
1.00,
0.00,
0.33,
1.00,
1.00,
0.33,
0.33,
1.00,
1.00,
1.00,
0.00,
0.00,
0.33,
0.33,
0.66,
0.66,

0.00,
0.33,
0.00,
0.66,
0
1.00,
1.00,
1.00,
1.00,
0
0.00,
1.00,
0.00,
0.00,
0
0.00,
0.33,
0.66,
0.00,
0
0.00,
0.00,
0.00,
0.33,
0
0.00,
0.33,
0.33,
0.33,
0
1.00,
0.66,
0.33,
1.00,
0
0.00,
0.33,
0.33,
1.00,
0
0.66,
0.33,
0.00,
0.66,
0
0.00,
0.66,
1.00,
1.00,
0
1.00,
0.00,
0.66,
0.33,
0
0.00,
0.00,
0.33,
1.00,

0.33,
0.66,
0.66,
0.66,

1.00,
0.66,
0.33,
1.00,

0.33,
0.33,
0.33,
0.00,

0.00,
0.66,
1.00,
0.33,

0.00,
0.00,
1.00,
0.00,

0.66,
0.66,
0.66,
0.33,

0.66,
0.00,
1.00,
0.00,

0.33,
0.33,
0.33,
0.66,

1.00,
1.00,
0.33,
0.33,

0.66,
1.00,
1.00,
0.00,

0.00,
0.66,
1.00,
0.66,

1.00,
0.33,
0.66,
0.33,

0.00,
1.00,
0.00,
0.66,

0.33,
0.33,
0.33,
0.00,

1.00,
0.66,
0.66,
0.66,

0.66,
1.00,
0.00,
1.00,

1.00,
0.33,
1.00,
0.66,

0.66,
1.00,
0.66,
0.33,

0.00,
0.33,
0.00,
1.00,

0.00,
0.33,
0.66,
1.00,

0.33,
0.66,
0.00,
0.33,

0.00,
0.33,
1.00,
0.33,

1.00,
0.66,
0.66,
0.66,

1.00,
0.00,
0.33,
1.00,

1.00,
0.00,
0.00,
0.33,

1.00,
0.00,
1.00,
0.66,

0.33,
0.33,
0.33,
1.00,

1.00,
0.33,
1.00,
1.00,

0.33,
0.66,
0.33,
0.33,

0.00,
0.00,
0.66,
0.00,

0.00,
0.33,
1.00,
0.00,

0.33,
0.00,
0.66,
0.33,

0.00,
0.66,
0.66,
0.00,

0.00,
0.00,
0.00,
1.00,

0.66,
1.00,
1.00,
1.00,

0.00,
1.00,
0.66,
0.66,

0.33,
0.33,
1.00,
1.00,

0.66,
0.66,
0.00,
1.00,

0.00,
0.33,
1.00,
0.00,

0.66,
1.00,
1.00,
1.00,

1.00,
1.00,
0.00,
1.00,

0.33,
1.00,
0.33,
0.33,

0.00,
0.66,
1.00,
0.66,

0.00,
0.00,
0.66,
1.00,

1.00,
0.33,
1.00,
0.33,

0.33,
1.00,
0.66,
1.00,

0.00,
0.33,
0.00,
0.33,

0.66,
1.00,
0.00,
0.33,

0.66,
0.66,
0.33,
0.66,

1.00,
0.66,
0.33,
1.00,

0.66,
1.00,
0.66,
0.33,

0.33,
0.33,
0.00,
0.33,

1.00,
0.00,
0.00,
1.00,

1.00,
0.33,
0.66,
0.33,

0.00,
0.66,
0.33,
0.00,

0.66,
0.66,
0.66,
0.00,

0.33,
0.00,
0.00,
1.00,

1.00,
1.00,
0.66,
0.66,

1.00,
0.00,
0.33,
0.66,

0.33,
0.33,
0.33,
0.33,

0.00,
0.33,
1.00,
0.00,

0.66,
0.00,
1.00,
0.66,

0.00,
0.33,
0.00,
0.33,

0.33,
0.33,
0.66,
0.33,

0.33,
0.66,
0.00,
1.00,

0.00,
0.00,
0.66,
0.33,

0.33,
0.66,
0.00,
0.66,

0.66,
1.00,
0.66,
0.00,

0.33,
0.00,
0.33,
0.33,

0.33,
0.66,
0.00,
0.00,

1.00,
0.00,
1.00,
0.00,

0.33,
0.33,
0.66,
0.33,

0.00,
0.33,
0.00,
0.66,

0.66,
0.33,
1.00,
1.00,

0.00,
1.00,
0.00,
0.00,

0.66,
0.33,
0.00,
0.66,

0.00,
0.66,
0.00,
0.00,

0.66,
0.00,
1.00,
0.33,

0.33,
0.33,
0.66,
0.66,

0.00,
0.00,
0.33,
1.00,

1.00,
0.00,
1.00,
0.66,

0.66,
0.33,
1.00,
0.33,

1.00,
1.00,
1.00,
0.33,

0.33,
1.00,
0.33,
0.33,

1.00,
1.00,
1.00,
0.00,

1.00,
0.00,
0.66,
0.33,

0.33,
0.33,
0.00,
1.00,

0.66,
0.66,
0.66,
0.66,

1.00,
0.00,
1.00,
0.66,

0.33,
1.00,
0.66,
0.00,

1.00,
0.66,
0.33,
1.00,

0.33,
0.00,
1.00,
1.00,

0.33,
0.66,
1.00,
0.66,

0.66,
0.00,
0.33,
1.00,

0.33,
1.00,
0.33,
0.33,

0.66,
0.66,
0.66,
0.00,

0.33,
1.00,
0.33,
0.00,

1.00,
0.00,
0.66,
0.66,

0.66,
1.00,
0.00,
0.00,

0.00,
0.00,
1.00,
0.33,

0.00,
1.00,
0.00,
1.00,

0.00,
0.66,
1.00,
0.66,

0.66,
0.33,
0.66,
0.33,

0.66,
0.66,
0.00,
0.33,

0.00,
0.33,
0.00,
0.66,

0.66,
1.00,
0.33,
0.33,

0.66,
0.33,
0.66,
1.00,

0.00,
0.00,
1.00,
0.66,

1.00,
0.00,
0.66,
1.00,

0.66,
1.00,
0.33,
0.66,

0.00,
0.00,
0.66,
0.33,

0.00,
0.33,
0.00,
0.66,

0.33,
0.66,
0.66,
0.66,

1.00,
0.66,
0.33,
1.00,

0.33,
0.33,
0.33,
0.00,

0.00,
0.66,
1.00,
0.33,

0.00,
0.00,
1.00,
0.00,

0.66,
0.66,
0.66,
0.33,

0.66,
0.00,
1.00,
0.00,

0.33,
0.33,
0.33,
0.66,

0.33,
0.33,
0.00,
1.00,

0.66,
0.66,
0.66,
0.66,

1.00,
0.00,
1.00,
0.66,

0.33,
1.00,
0.66,
0.00,

1.00,
0.66,
0.33,
1.00,

0.33,
0.00,
1.00,
1.00,

0.33,
0.66,
1.00,
0.66,

0.66,
0.00,
0.33,
1.00,

0.33,
1.00,
0.33,
0.33,

0.66,
0.66,
0.66,
0.00,

0.00,
0.33,
1.00,
0.33,

0.33,
0.33,
1.00,
0.33,

1.00,
0.00,
1.00,
0.66,

0.66,
0.33,
1.00,
0.33,

1.00,
1.00,
1.00,
0.33,

0.33,
1.00,
0.33,
0.33,

0.00,
0.66,
1.00,
1.00,

0.66,
0.33,
1.00,
0.00,

0.33,
0.00,
0.66,
0.33,

0.33,
1.00,
1.00,
0.66,

1.00,
0.00,
0.00,
0.33,

0.33,
0.00,
0.66,
0.66,

0.66,
0.00,
0.00,
0.33,

0.00,
1.00,
0.33,
1.00,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

505

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


1.00,
0.00,
0.00,
0.66,
0.33,
0.66,
1.00,
0.00,
1.00,
0.66,
0.00,
1.00,
1.00,
0.00,
0.33,
0.66,
0.33,
0.00,
0.66,
0.66,
0.00,
0.66,
0.33,
0.33,
1.00,
1.00,
0.00,
0.33,
0.00,
0.00,
0.00,
1.00,
0.66,
0.00,
0.00,
0.66,
1.00,
0.66,
0.00,
0.33,
0.33,
1.00,
0.00,
0.66,
0.00,
1.00,
1.00,
0.33,
1.00,
1.00,
0.66,
0.33,
1.00,
0.00,
1.00,
0.66,
1.00,
0.66,
0.66,

0
0.66,
0.00,
0.66,
0.00,
0
0.33,
0.33,
0.33,
1.00,
0
0.66,
0.33,
0.33,
0.33,
0
1.00,
0.33,
0.00,
1.00,
0
0.33,
0.33,
0.33,
0.33,
0
1.00,
1.00,
1.00,
0.66,
0
0.66,
0.00,
0.00,
0.33,
0
0.33,
1.00,
0.00,
1.00,
0
0.00,
0.66,
0.33,
0.33,
0
0.00,
0.00,
0.66,
0.33,
0
0.00,
1.00,
0.66,
0.66,
0
1.00,
0.33,
1.00,

0.66,
0.66,
0.00,
0.66,

0.00,
0.66,
0.66,
0.33,

0.66,
1.00,
0.00,
0.66,

0.66,
1.00,
0.66,
0.33,

0.00,
0.66,
0.00,
0.00,

0.00,
0.66,
1.00,
0.33,

0.33,
0.00,
0.66,
0.33,

1.00,
0.00,
0.33,
1.00,

0.00,
0.33,
0.33,
0.66,

0.33,
0.00,
0.00,
0.33,

0.66,
1.00,
0.66,
0.00,

0.33,
0.33,
0.33,
0.33,

1.00,
0.33,
1.00,
1.00,

0.33,
0.66,
0.33,
0.33,

0.00,
0.00,
0.66,
0.00,

0.00,
0.33,
1.00,
0.00,

0.33,
0.00,
0.66,
0.33,

0.00,
0.66,
0.66,
0.00,

0.00,
0.00,
0.00,
1.00,

0.66,
1.00,
1.00,
1.00,

0.00,
1.00,
0.66,
0.66,

1.00,
0.33,
0.66,
0.00,

1.00,
0.00,
0.00,
0.66,

0.00,
0.00,
0.33,
0.66,

0.00,
0.00,
0.66,
1.00,

0.00,
0.00,
0.00,
0.33,

0.66,
0.66,
0.33,
0.66,

1.00,
0.66,
0.33,
1.00,

0.66,
1.00,
0.66,
0.33,

0.33,
0.33,
0.00,
0.33,

1.00,
0.00,
0.00,
1.00,

1.00,
0.33,
0.66,
0.33,

0.00,
0.66,
0.33,
0.00,

0.66,
0.66,
0.66,
0.00,

0.33,
0.00,
0.00,
1.00,

1.00,
1.00,
0.66,
0.66,

0.00,
0.66,
0.66,
1.00,

1.00,
0.00,
0.00,
0.00,

0.00,
1.00,
0.33,
1.00,

1.00,
0.00,
1.00,
0.33,

0.66,
1.00,
0.66,
0.00,

0.33,
0.66,
0.33,
0.66,

0.66,
0.00,
0.33,
0.33,

0.33,
0.00,
0.66,
1.00,

1.00,
0.33,
0.33,
0.66,

0.33,
0.66,
1.00,
1.00,

0.00,
1.00,
0.66,
0.66,

1.00,
1.00,
0.00,
0.00,

0.66,
0.00,
1.00,
0.66,

0.66,
0.33,
0.33,
0.00,

0.33,
0.66,
0.00,
1.00,

0.00,
0.33,
0.66,
0.66,

0.66,
0.66,
0.66,
1.00,

0.33,
0.66,
0.00,
0.33,

0.00,
1.00,
1.00,
1.00,

0.33,
0.66,
1.00,
1.00,

0.66,
0.00,
0.33,
0.33,

1.00,
0.66,
0.00,
0.33,

1.00,
0.00,
1.00,
0.66,

1.00,
0.66,
0.66,
0.66,

0.33,
1.00,
0.33,
0.66,

0.33,
0.33,
1.00,
1.00,

0.33,
0.33,
0.00,
0.66,

1.00,
0.66,
0.33,
0.66,

0.00,
0.66,
0.66,
0.33,

0.00,
1.00,
1.00,
1.00,

1.00,
0.33,
1.00,
0.00,

0.66,
0.00,
0.00,
1.00,

1.00,
0.00,
0.00,
0.66,

0.33,
1.00,
0.33,
1.00,

1.00,
0.33,
0.33,
0.66,

0.00,
0.33,
0.66,
1.00,

0.66,
0.00,
0.33,
0.66,

0.33,
0.33,
0.66,
0.33,

0.66,
0.33,
0.33,
1.00,

1.00,
1.00,
1.00,
0.00,

0.33,
0.33,
0.66,
0.00,

1.00,
0.33,
0.66,
0.33,

0.00,
0.66,
0.00,
0.66,

1.00,
0.66,
0.00,
0.33,

0.33,
1.00,
0.66,
0.00,

0.66,
0.00,
0.66,
0.66,

0.66,
1.00,
1.00,
0.00,

1.00,
0.33,
0.66,
1.00,

1.00,
1.00,
0.66,
0.00,

0.33,
0.33,
0.66,
0.33,

0.66,
0.00,
0.33,
0.33,

1.00,
0.00,
0.00,
1.00,

0.66,
0.33,
1.00,
0.66,

0.66,
0.00,
0.00,
0.00,

0.00,
1.00,
0.00,
1.00,

1.00,
1.00,
0.33,
0.66,

0.66,
0.66,
0.66,
1.00,

0.66,
0.00,
0.33,
1.00,

0.00,
0.66,
1.00,
1.00,

0.33,
0.66,
0.00,
0.00,

1.00,
0.33,
1.00,
1.00,

1.00,
0.00,
0.66,
1.00,

0.66,
1.00,
0.00,
0.66,

0.66,
0.66,
1.00,
0.33,

0.33,
0.00,
0.00,
0.66,

1.00,
0.00,
0.33,
0.00,

1.00,
0.33,
0.66,
0.66,

0.66,
1.00,
0.66,
0.33,

0.33,
0.33,
0.33,
0.33,

1.00,
0.00,
0.66,
1.00,

0.33,
0.00,
0.00,
1.00,

0.00,
0.66,
0.66,
0.66,

0.66,
0.00,
0.00,
1.00,

0.00,
0.66,
0.66,
0.66,

0.66,
0.00,
0.66,
0.33,

0.66,
0.00,
0.33,
0.00,

0.66,
0.66,
1.00,
1.00,

1.00,
0.00,
0.00,
0.66,

0.66,
0.66,
0.66,
0.66,

1.00,
0.66,
0.00,
0.00,

0.00,
0.00,
0.33,
0.66,

0.33,
0.00,
0.66,
1.00,

1.00,
0.66,
1.00,
0.00,

0.33,
0.00,
0.33,
1.00,

0.66,
0.33,
0.33,
1.00,

0.33,
0.33,
0.33,
0.33,

0.66,
0.00,
1.00,
0.66,

0.66,
0.33,
0.33,
0.00,

0.33,
0.66,
0.00,
1.00,

0.00,
0.33,
0.66,
0.66,

0.66,
0.66,
0.66,
1.00,

0.33,
0.66,
0.00,
0.33,

0.00,
1.00,
1.00,
1.00,

0.33,
0.66,
1.00,
1.00,

0.66,
0.00,
0.33,
0.33,

1.00,
0.66,
0.00,
0.33,

0.00, 0.33, 0.66, 1.00, 1.00, 0.66, 0.66, 0.33, 0.66, 0.00, 0.33, 0.33,
1.00, 0.00, 0.66, 0.66, 0.00, 0.33, 1.00, 1.00, 1.00, 0.33, 1.00, 1.00,
1.00, 0.66, 0.00, 1.00, 1.00, 1.00, 1.00, 0.33, 0.33, 0.00, 1.00, 0.66,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

506

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


0.33,
0.00,
0.00,
0.66,
0.66,
0.00,
0.00,
0.66,
1.00,
1.00,
0.66,
0.00,
0.00,
0.00,
1.00,
1.00,
0.00,
0.00,
0.66,
0.00,
0.00,
0.00,
1.00,
0.66,
0.00,
1.00,
0.00,
1.00,
1.00,
1.00,
0.66,
0.33,
0.00,
0.33,
0.00,
0.66,
0.66,
0.33,
0.00,
0.33,
0.00,
0.66,
0.33,
1.00,
0.66,
0.00,
1.00,
1.00,
1.00,
1.00,
0.00,
1.00,
0.00,
0.00,
0.66,
0.33,
0.00,
0.66,
0.33,

0.66,
0
0.33,
0.33,
0.33,
0.66,
0
0.66,
0.66,
0.00,
1.00,
0
0.00,
0.33,
0.33,
0.33,
0
0.66,
0.66,
0.33,
0.00,
0
0.66,
0.33,
0.00,
0.66,
0
0.66,
0.00,
0.33,
0.00,
0
0.66,
1.00,
0.66,
1.00,
0
0.33,
0.66,
0.33,
1.00,
0
0.66,
0.66,
0.33,
0.00,
0
0.00,
0.33,
1.00,
0.33,
0
0.66,
0.00,
0.00,
1.00,
0
0.00,
1.00,

0.66, 1.00, 0.66, 1.00, 1.00, 1.00, 1.00, 0.66, 0.33, 0.66, 0.33, 0.00,
0.66,
0.00,
0.66,
0.00,

0.33,
0.66,
1.00,
1.00,

1.00,
0.33,
0.00,
1.00,

0.00,
0.66,
1.00,
0.00,

0.00,
0.00,
1.00,
0.00,

0.33,
0.00,
0.33,
0.33,

0.66,
0.33,
1.00,
0.33,

0.33,
0.66,
0.33,
0.66,

0.00,
0.33,
0.00,
0.00,

0.66,
1.00,
0.00,
0.33,

0.00,
0.33,
0.33,
0.00,

1.00,
0.66,
0.00,
0.66,

1.00,
1.00,
0.33,
0.00,

0.66,
1.00,
0.00,
0.00,

1.00,
0.00,
0.33,
0.00,

1.00,
0.00,
0.33,
0.33,

1.00,
1.00,
1.00,
0.66,

1.00,
0.33,
0.33,
1.00,

0.66,
0.66,
0.00,
0.33,

0.33,
0.33,
0.66,
1.00,

0.66,
1.00,
0.66,
1.00,

0.33,
1.00,
0.33,
0.33,

0.00,
1.00,
0.00,
0.66,

0.00,
0.66,
1.00,
1.00,

0.33,
1.00,
0.66,
0.33,

0.33,
0.33,
0.00,
1.00,

0.00,
0.00,
1.00,
0.00,

1.00,
0.00,
0.66,
0.33,

1.00,
1.00,
0.33,
0.00,

0.33,
0.66,
0.00,
1.00,

0.33,
0.00,
0.66,
0.66,

0.66,
0.66,
0.33,
0.00,

0.66,
0.33,
0.66,
0.00,

1.00,
0.00,
1.00,
1.00,

1.00,
1.00,
0.00,
0.00,

0.66,
0.33,
0.33,
0.66,

0.00,
0.00,
1.00,
1.00,

0.33,
0.66,
0.00,
0.00,

0.66,
1.00,
0.33,
1.00,

1.00,
0.00,
0.66,
0.66,

0.33,
1.00,
0.66,
0.33,

1.00,
0.66,
1.00,
1.00,

0.33,
0.00,
0.66,
0.66,

1.00,
0.66,
0.66,
0.66,

0.66,
0.00,
0.66,
0.00,

0.33,
1.00,
1.00,
1.00,

0.00,
0.66,
0.00,
0.66,

1.00,
0.66,
0.33,
0.66,

1.00,
0.66,
1.00,
1.00,

1.00,
0.66,
0.66,
0.00,

0.66,
1.00,
1.00,
0.33,

0.00,
0.66,
1.00,
0.00,

1.00,
1.00,
0.00,
0.33,

1.00,
1.00,
0.00,
0.33,

1.00,
1.00,
1.00,
1.00,

1.00,
1.00,
0.33,
0.33,

0.33,
0.66,
0.66,
0.00,

0.33,
0.33,
0.33,
0.66,

0.00,
0.66,
1.00,
0.66,

1.00,
0.33,
1.00,
0.33,

0.33,
0.66,
0.00,
1.00,

0.00,
0.33,
0.66,
0.00,

0.33,
0.33,
0.66,
0.66,

0.66,
1.00,
1.00,
1.00,

0.66,
0.33,
0.66,
0.33,

0.66,
0.00,
0.33,
1.00,

1.00,
0.66,
0.66,
0.33,

1.00,
0.33,
0.00,
0.00,

0.66,
0.66,
0.66,
0.66,

0.33,
1.00,
1.00,
0.00,

0.66,
0.00,
1.00,
0.66,

0.00,
1.00,
0.33,
1.00,

0.66,
1.00,
1.00,
0.66,

0.33,
0.33,
0.66,
0.00,

0.00,
0.66,
0.33,
0.66,

1.00,
1.00,
1.00,
1.00,

0.66,
0.00,
1.00,
0.00,

1.00,
0.66,
1.00,
0.33,

0.00,
0.33,
0.33,
0.66,

0.00,
0.66,
1.00,
0.33,

0.00,
0.33,
1.00,
0.00,

0.33,
0.00,
0.00,
0.33,

0.66,
1.00,
0.33,
0.33,

1.00,
0.33,
1.00,
0.00,

0.66,
0.00,
1.00,
0.00,

0.00,
0.66,
0.33,
0.00,

0.66,
0.00,
0.66,
0.00,

1.00,
0.66,
0.00,
1.00,

0.00,
0.33,
0.33,
0.66,

0.66,
0.00,
0.00,
0.33,

0.00,
1.00,
0.00,
1.00,

0.33,
0.66,
0.33,
1.00,

0.33,
1.00,
1.00,
1.00,

0.33,
0.33,
1.00,
0.33,

1.00,
0.00,
0.66,
1.00,

1.00,
0.66,
0.33,
1.00,

0.33,
1.00,
0.66,
1.00,

1.00,
1.00,
0.66,
0.66,

0.00,
0.66,
1.00,
1.00,

0.66,
0.00,
0.66,
1.00,

0.66,
1.00,
1.00,
0.00,

0.00,
1.00,
1.00,
0.00,

0.33,
1.00,
1.00,
1.00,

1.00,
1.00,
1.00,
0.33,

1.00,
0.33,
0.66,
0.66,

1.00,
0.33,
0.33,
0.33,

0.33,
0.00,
0.66,
1.00,

1.00,
1.00,
0.33,
1.00,

1.00,
0.00,
0.66,
1.00,

0.66,
0.00,
0.00,
0.66,

0.00,
1.00,
0.33,
1.00,

0.33,
0.33,
1.00,
0.66,

0.33,
0.00,
0.33,
0.00,

0.66,
0.66,
1.00,
0.00,

0.00,
0.00,
0.66,
0.33,

0.00,
0.33,
0.66,
0.00,

0.33,
0.33,
1.00,
1.00,

0.66,
0.66,
0.00,
1.00,

0.00,
0.33,
1.00,
0.00,

0.66,
1.00,
1.00,
1.00,

0.00,
0.66,
0.66,
0.66,

0.66,
0.00,
0.66,
0.33,

0.66,
0.00,
0.33,
0.00,

0.66,
0.66,
1.00,
1.00,

1.00,
0.00,
0.00,
0.66,

0.66,
0.66,
0.66,
0.66,

1.00,
0.66,
0.00,
0.00,

0.00,
0.00,
0.33,
0.66,

0.33,
0.00,
0.66,
1.00,

1.00,
0.66,
1.00,
0.00,

0.33,
0.00,
0.33,
1.00,

0.33,
1.00,
1.00,
0.66,

0.66, 0.00, 0.66, 0.33, 0.00, 1.00, 0.66, 1.00, 0.33, 0.00, 0.66, 0.33,
0.33, 0.66, 0.00, 0.33, 0.00, 0.00, 0.33, 1.00, 1.00, 0.66, 0.33, 0.00,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

507

Anexo de Ejemplos Framework JCortex http://www.jcortex.com/


1.00,
1.00,
0.66,
0.33,
0.00,
0.66,
0.00,
1.00,
0.66,
0.00,
1.00,
0.66,
0.66,
0.33,
0.66,
1.00,
0.66,
0.33,
0.33,
0.33,
1.00,
0.66,
0.33,
1.00,
0.00,
0.66,
0.00,
1.00,

0.00,
0.00,
0
0.33,
0.00,
0.66,
0.00,
0
1.00,
1.00,
0.33,
0.66,
0
0.66,
0.00,
0.33,
1.00,
0
1.00,
0.33,
1.00,
0.33,
0
0.00,
0.00,
0.66,
0.00,
0

0.00, 0.00, 1.00, 0.66, 0.33, 1.00, 1.00, 1.00, 0.33, 1.00, 1.00, 0.66,
0.66, 0.00, 0.33, 0.66, 1.00, 0.66, 0.33, 0.33, 0.33, 1.00, 0.00, 0.33,
1.00,
0.00,
0.66,
0.66,

0.33,
0.33,
1.00,
0.66,

0.00,
0.66,
1.00,
0.00,

0.00,
0.66,
1.00,
0.66,

1.00,
0.66,
1.00,
0.66,

0.66,
1.00,
1.00,
0.00,

0.66,
0.33,
1.00,
0.00,

0.33,
1.00,
0.66,
0.33,

0.33,
1.00,
0.33,
1.00,

1.00,
0.66,
1.00,
0.00,

0.33,
0.00,
0.66,
1.00,

1.00,
0.66,
0.00,
0.00,

0.00,
1.00,
0.00,
0.00,

1.00,
0.00,
0.00,
0.33,

1.00,
0.00,
1.00,
0.66,

0.33,
0.33,
0.33,
1.00,

1.00,
0.33,
1.00,
1.00,

0.33,
0.66,
0.33,
0.33,

0.00,
0.00,
0.66,
0.00,

0.00,
0.33,
1.00,
0.00,

0.33,
0.00,
0.66,
0.33,

0.00,
0.66,
0.66,
0.00,

0.00,
0.00,
0.00,
1.00,

0.66,
1.00,
1.00,
1.00,

0.33,
1.00,
0.33,
0.33,

0.66,
0.66,
0.66,
0.00,

0.00,
0.33,
1.00,
0.33,

0.33,
0.33,
1.00,
0.33,

1.00,
1.00,
0.00,
0.00,

0.00,
0.66,
0.33,
0.00,

0.33,
0.00,
1.00,
0.66,

0.66,
0.66,
0.66,
0.66,

0.00,
1.00,
0.66,
0.33,

1.00,
0.66,
0.00,
1.00,

0.66,
0.33,
1.00,
1.00,

0.00,
1.00,
1.00,
0.33,

0.33,
1.00,
0.66,
1.00,

0.66,
0.33,
0.00,
0.66,

1.00,
1.00,
0.66,
0.00,

0.33,
0.00,
0.66,
0.00,

0.33,
0.00,
0.66,
0.00,

1.00,
0.00,
0.66,
0.66,

0.33,
0.33,
1.00,
0.66,

0.00,
0.66,
1.00,
0.00,

0.00,
0.66,
1.00,
0.66,

1.00,
0.66,
1.00,
0.66,

0.66,
1.00,
1.00,
0.00,

0.66,
0.33,
1.00,
0.00,

0.00,
0.66,
0.33,
1.00,

0.33,
0.66,
0.00,
0.33,

0.00,
0.00,
0.33,
0.00,

1.00,
0.66,
1.00,
0.00,

1.00,
0.66,
0.33,
1.00,

0.00,
0.33,
0.00,
0.33,

0.00,
1.00,
1.00,
0.00,

1.00,
0.33,
1.00,
0.00,

0.00,
1.00,
0.00,
0.66,

0.00,
0.00,
0.66,
0.00,

0.00,
0.00,
0.33,
0.00,

1.00,
1.00,
0.33,
0.33,

Framework para Redes Neuronales en Java Miguel Lara Encabo Junio 2006

508

You might also like