pythiaespañol

47
Pythia – The Neural Network Designer © 2000 by Runtime Software - 5/26/22 - 6:09 PM 1 of 47 pages Pythia – The Neural Network designer Introduction Pythia is a program for the development and design of Neural Networks. Neural Networks are used to detect hidden relations in a set of patterns, e.g. stock market data or weather data. Pythia es un programa para el desarrollo y diseño de redes neuronales. Redes neuronales se utilizan para detectar relaciones ocultas en un conjunto de patrones, por ejemplo, mercado de valores de datos o de datos meteorológicos. Pythia features Backpropagation Networks. The network parameters (“Weights”) are initially set to random value. During the “Training phase” the actual output of the network is compared with the desired output and the error propagated back toward the input of the network. Pythia características backpropagation Redes. Los parámetros de red ("Pesos") inicialmente establecido en valor aleatorio. Durante la "fase de formación" la producción efectiva de la red se compara con la salida deseada y el error de propagación hacia la entrada de la red. A Neural Network has two phases, commonly referred to as the “Training phase” and the “Reproduction phase”. During the training phase sample data containing both – inputs and desired outputs – are processed to optimize the network’s output, meaning to minimize the deviation Una red neuronal tiene dos fases, comúnmente conocida como la "fase de formación" y la "fase de la reproducción". Durante la fase de entrenamiento que contiene tanto datos de ejemplo - las entradas y salidas deseada - se procesan para optimizar la salida de la red, es decir, para reducir al mínimo la desviación (OUTPUT DATA – OUTPUT NET ) 2 OUTPUT DATA is the output value in the training data, OUTPUT NET is the output value provided by reproducing the input data with the network.

Upload: casandra-farfan-seclen

Post on 25-Oct-2015

71 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 1 of 35 pages

Pythia – The Neural Network designer

Introduction

Pythia is a program for the development and design of Neural Networks. Neural Networks are used to detect hidden relations in a set of patterns, e.g. stock market data or weather data.Pythia es un programa para el desarrollo y diseño de redes neuronales. Redes neuronales se utilizan para detectar relaciones ocultas en un conjunto de patrones, por ejemplo, mercado de valores de datos o de datos meteorológicos.Pythia features Backpropagation Networks. The network parameters (“Weights”) are initially set to random value. During the “Training phase” the actual output of the network is compared with the desired output and the error propagated back toward the input of the network.Pythia características backpropagation Redes. Los parámetros de red ("Pesos") inicialmente establecido en valor aleatorio. Durante la "fase de formación" la producción efectiva de la red se compara con la salida deseada y el error de propagación hacia la entrada de la red.A Neural Network has two phases, commonly referred to as the “Training phase” and the “Reproduction phase”. During the training phase sample data containing both – inputs and desired outputs – are processed to optimize the network’s output, meaning to minimize the deviation

Una red neuronal tiene dos fases, comúnmente conocida como la "fase de formación" y la "fase de la reproducción". Durante la fase de entrenamiento que contiene tanto datos de ejemplo - las entradas y salidas deseada - se procesan para optimizar la salida de la red, es decir, para reducir al mínimo la desviación

(OUTPUTDATA – OUTPUTNET)2

OUTPUTDATA is the output value in the training data, OUTPUTNET is the output value provided by reproducing the input data with the network.

OUTPUTDATA es el valor de salida de datos en la formación, OUTPUTNET es el valor de salida por la reproducción de los datos de entrada con la red.

During the “reproduction phase” the network’s parameters are not changed anymore and the network is used for the reproduction of input data in order to “predict” suitable output data.Durante la "fase de la reproducción" de la red no se cambian los parámetros y la red ya se utiliza para la reproducción de datos de entrada con el fin de "predecir" una salida adecuada de datos.

Page 2: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 2 of 35 pages

Picture 1 – A typical Backpropagation network

Picture 1 shows a typical Backpropagation Network. It has 2 inputs and 1 output. It contains two layers (levels) of neurons, level 1 with 2 neurons and level 2 with 1 neuron.

Figura 1 muestra una típica red backpropagation. Dispone de 2 entradas y 1 salida. Contiene dos capas (niveles) de las neuronas, de nivel 1 con 2 neuronas y el nivel 2 en contra y 1 neurona.

In Backpropagation Networks each neuron has one output and as many inputs as neurons in the previous level.En Redes backpropagation cada neurona tiene una salida y el mayor número de entradas como las neuronas en el nivel anterior.

Each network input is connected to every neuron in the first level. Each neuron output is connected to every neuron in the next level. Cada red está conectada a la entrada de cada neurona en el primer nivel. Cada neurona está conectada a la salida de cada neurona en el siguiente nivel.

The Network’s output is the output of the last level’s neurons.La Red de la salida es la salida del último nivel de las neuronas.

Page 3: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 3 of 35 pages

Each neurons output is calculated asCada uno de las neuronas de salida se calcula como

On = F(ΣIk * Wkn) k

O ist the neuron’s output, n is the number of the neuron,Ik are the neurons inputs, k is the number of inputs,Wkn are the neurons weights.F is the Fermi function 1/(1+Exp(-4*(x-0.5)))

Picture 2 – Sample calculation of a NetworkThe activity of N1 is calculated as

A = (1*0.249733)+(0*-0.233776) = 0.249733The output of N1 is calculated as

O = Fermi(A)= 1/(1+Exp(-4*(0.249733-0.5))) = 0.268731The outputs of N1 and N2 are the inputs for the calculation of N3

The network is processed from the left to the right. Picture 2 shows a sample how the output of a Neural Network is calculated from the input.La red es la transformación de la izquierda a la derecha. Figura 2 muestra un ejemplo de cómo la salida de una red neuronal se calcula a partir de la entrada.

Page 4: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 4 of 35 pages

Pythia allows you to import data from different file formats or from spreadsheet programs like Microsoft Excel. You can design and train Neural Networks. Both, data and networks can easily be stored on disk.Pythia le permite importar datos de diferentes formatos de archivo o de programas de hoja de cálculo como Microsoft Excel. Usted puede diseñar y entrenar redes neuronales. Tanto, los datos y las redes pueden ser fácilmente almacenado en el disco. A special feature of Pythia is the Evolutionary Optimizer that automatically generates suitable networks for a given training data set. It uses evolutionary algorithms for the selection and generation of neural networks.Una característica especial de Pythia es el Optimizador evolutivo que genera automáticamente las redes adecuadas para un determinado conjunto de datos de formación. Utiliza algoritmos evolutivos para la selección y la generación de redes neuronales.

In order to get familiar with Pythia we recommend to work through the two examples we discuss below. Con el fin de familiarizarse con Pythia recomendamos trabajar a través de los dos ejemplos se discuten a continuación.

Page 5: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 5 of 35 pages

Ejemplo 1 – Problema XOR Un ejemplo clásico para aprender redes neuronales es el problema XOR. La red se supone que debe aprender el patrón:

Input1 Input2 OutputPattern 1 0 0 0Pattern 2 0 1 1Pattern 3 1 0 1Pattern 4 1 1 0

Tabla 1: Tabla Lógica XOR

La red que necesitamos diseñar tiene 2 entradas y 1 salida.

Figura 1: Tabla de Patrones XOR

En primer lugar tenemos que obtener los patrones de formación (0,0,1), (0,1,1), (1, 0, 1) y (1,1,0) en Pythia. La forma más fácil es usar un programa de hoja de cálculo como Excel.

Introduzca el patrón como se muestra en la Figura 1. Seleccionar columnas A hasta C y filas de 1 a 4 con el ratón. Presione CTRL-INS, o presionar el botón derecho y luego seleccione Copiar en el

menú desplegable.

Page 6: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 6 of 35 pages

Los datos se encuentran en el portapapeles de Windows. El siguiente paso es llamar Pythia. Pythia inicialmente se verá como se muestra en la Figura 5.

Figura 2: Menú del Pythia

Seleccione EDIT→PASTE CELLS o simplemente presione SHIFT-INSERT.

Figura 3: Ventana de Dialogo de Copia

Page 7: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 7 of 35 pages

Usted recibirá un cuadro de diálogo como se muestra en la Figura 3. Deje el campo delimitador (TAB) y los campos por registro (3). Pegar a los nuevos criterios que es correcta, porque queremos crear un nuevo

patrón establecido. Observe que los productos no está establecido en 1 por defecto. Si la red se

supone que tiene algo más que una salida, aquí se debe especificar. Finalmente pulse el botón OK.

Figura 4 muestra Pythia después de pegar el modelo de datos establecido.

Figura 4: Los criterios que los datos se han pegado en una tabla nueva

¿Ves las columnas I1, I2 y O1. Las columnas O1 (NET) y (SQ DV) están vacíos porque se llenan más tarde por la red neuronal ahora vamos a diseñar. Es una buena idea guardar los criterios que con el nombre de "XOR.PAT" ahora.

Page 8: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 8 of 35 pages

Figura 5: Creación de una Red Neuronal

Para crear una nueva red neuronal hacer los siguientes pasos: Seleccionar → NET→CREATE NET Introduzca el número de entradas de su red tendrá (2) Introduzca el número de neuronas en el nivel 1. Seleccionamos 2. Introduzca el número de neuronas en el nivel 2. Dado que este es el último nivel

se define, es igual al nivel de salida. Por lo tanto, seleccione 1. Finalmente pulse el botón OK.

Page 9: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 9 of 35 pages

Figura 6: Red Neuronal Creada

Ahora trate de reproducir el modelo establecido con la nueva red.

Figura 7: Mostrar Patrones

Seleccione NET → REPRO PATTERN SET, o pulse el icono que se indica en la figura 7

Como puede ver en la Figura 7 los resultados son pobres tranquila. La columna O1 (NET) debe ser similar a O1. La columna de la derecha más SQ DV le informa sobre el cuadrado de la desviación y se define como

SQ DVi = (O1i – O1(NET)i)2

i is the pattern number

Example: (0-0.071094)2 = 0.005054

Es la meta de la fase de entrenamiento para reducir al mínimo estos valores. Si nos fijamos en los resultados en la columna O1, verá que la salida es 0 ó 1. En consecuencia una O1 (NET) de un valor de <0,5 será suficiente para 0 y un valor de más de 0,5 será suficiente para 1. Esto significa que la desviación para cada patrón se reproduce debe ser <0,5, es decir, la plaza de esta desviación debe ser <0,25.

Page 10: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 10 of 35 pages

Figura 8: Set up a learn plan

Vamos a configurar un plan de aprender. • Seleccionar → NET→LEARN PATTERN SET

Figura 11 muestra la ventana de diálogo para la creación del plan de aprender. • Por favor, deje los valores por defecto, con la excepción de * desviación. Este punto de verificación e introduzca el valor 0,25. • Presione el botón OK.

Si cada desviación es inferior a 0,25 de la red es lo suficientemente entrenado. Esto probablemente no es el caso de que la primera vez que intentarlo. La razón es que no todos los valores a partir de la neurona causa del peso de esta red para obtener el patrón establecido.

Por favor introduzca nuevos pesos al azar antes de intentar la formación de nuevo. Usted puede hacer esto ya sea marcando la casilla Establecer pesos al azar o por selección de la correspondiente punto del menú de la barra de menú principal (NET→SET RANDOM WEIGHTS).

Hacer la formación de nuevo. Repita hasta que la desviación sea inferior a 0,25.

Después de alcanzar este objetivo la red es lo suficientemente capacitado, a fin de predecir el resultado correcto de las posibles entradas (0,0), (0,1), (1,0) y (1,1).

Puede guardar la red en el disco ahora.

Page 11: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 11 of 35 pages

Cabe mencionar que los criterios que XOR.PAT sería adquirida por una gran red neuronal en el primer juicio. Sin embargo, hay varias razones para preferir una red lo más pequeño posible. Una de las razones es el rendimiento de la red. Un reducido se calcula uno más rápido. La segunda, aún más importante razón, es la capacidad de las redes de la abstracción. Una gran red podría ser capaz de aprender las pautas de formación, pero puede fallar en algo diferente de datos durante la fase de reproducción.

Example 2 – Stock Market PredictionEjemplo 2 - Predicción del Mercado de Valores

It must be stated clearly: No Neural Network can ever predict a market crash or any point gain or loss due to actual economical or political events you don’t know in advance. But a Neural Network might be able discover relations between stock market data that are not obvious.Una buena aplicación para la red neuronal es la predicción del mercado de valores. Mantenemos nuestro siguiente ejemplo muy simple y se limita a mostrar la forma de preparar el mercado de valores para la entrada de datos en una red neuronal. Resultados deben estar siempre sujeto a la interpretación y siempre es el riesgo para los inversores apostar dinero real en ella. Debe señalarse claramente: Una red neuronal no puede predecir la caída de un mercado o cualquier punto de ganancia o la pérdida real debido a los acontecimientos políticos o económicos que no saben de antemano. Sin embargo, una red neuronal podría descubrir las relaciones entre los datos del mercado de valores que no son evidentes.

Nuestro ejemplo examinará el Dow Jones Industrial Índice en 1999.

Date Open High Low Close Volume1/4/99 9184.01 9350.33 9122.47 9184.27 8831/5/99 9184.78 9338.74 9182.98 9311.19 7791/6/99 9315.42 9562.22 9315.42 9544.97 9861/7/99 9542.14 9542.14 9426.02 9537.76 8571/8/99 9538.28 9647.96 9525.41 9643.32 9401/11/99 9643.32 9643.32 9532.61 9619.89 816

::Picture 12 – DJI open, high, low, close and volume in 1999

La figura 12 muestra algunos datos DJI para 1999.

Nuestra idea es que puede haber una relación entre el día de hoy abiertos, altos, bajos, estrechos y el volumen y la mañana del cierre.

Utilizando los valores directamente como entrada a nuestra red no es aconsejable porque

Page 12: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 12 of 35 pages

nuestro interés no es más que el porcentaje de descenso y ganar. Por lo tanto, obtener nuestros datos de entrada de los datos originales de la siguiente manera:

ΔOpen(t) = % change day t-1 → day t = (Open(t)-Open(t-1))/Open(t-1)*100ΔHigh(t) = % rel. to Open = (High(t)-Open(t))/Open(t)*100ΔLow(t) = % rel. to Open = (Low(t)-Open(t))/Open(t)*100ΔClose(t) = % change day t-1 → day t = (Close(t)-Close(t-1))/Close(t-1)*100ΔVolume(t) = % change day t-1 → day t = (Volume(t)-Volume(t-1))/Volume(t-1)*100

La salida se define como

ΔClose(t+1) = % change day t → day t+1 = (Close(t+1)-Close(t))/Close(t)*100

Las fórmulas se pueden introducir fácilmente en una tabla de hoja de cálculo y se verá como se muestra en la imagen 13:

Ahora puede seleccionar y copiar el derecho 6 columnas y las pega en Pythia. También puede simplemente cargar el archivo de ejemplo que viene con DOW99I.PAT Pythia. Nuestro enfoque será el de formar a una red con los datos de la 1 ª mitad del año 1999. Con la red de formación a continuación vamos a examinar la salida para la reproducción de la 2 ª mitad de 1999.

Nuestra red neuronal espera de entrada y salida de cualquier valor para estar entre 0 y 1. Por lo tanto, el patrón de juegos debe ser normalizado antes de ser transformados por la red.

La normalización se calcula:

N(i) = (i - low) / (high - low)i is the input (or output value)

Date Open High Low Close Volume ΔOpen ΔHigh ΔLow ΔClose ΔVolume ΔClose+1

12/31/98 9274.12 9287.77 9181.43 9181.43 755 -0.50274 0.147184 -0.99945 -1.005 27.10438 0.030932

1/4/99 9184.01 9350.33 9122.47 9184.27 883 -0.97163 1.810974 -0.67008 0.030932 16.95364 1.381928

1/5/99 9184.78 9338.74 9182.98 9311.19 779 0.008384 1.676251 -0.0196 1.381928 -11.778 2.510742

1/6/99 9315.42 9562.22 9315.42 9544.97 986 1.422353 2.649371 0 2.510742 26.57253 -0.07554

1/7/99 9542.14 9542.14 9426.02 9537.76 857 2.433814 0 -1.21692 -0.07554 -13.0832 1.106759

1/8/99 9538.28 9647.96 9525.41 9643.32 940 -0.04045 1.149893 -0.13493 1.106759 9.684947 -0.24297

1/11/99 9643.32 9643.32 9532.61 9619.89 816 1.101247 0 -1.14805 -0.24297 -13.1915 -1.50948

1/12/99 9618.86 9620.15 9451.77 9474.68 794 -0.25365 0.013411 -1.73711 -1.50948 -2.69608 -1.32057

1/13/99 9471.34 9471.34 9213.1 9349.56 935 -1.53365 0 -2.72654 -1.32057 17.75819 -2.44536

1/14/99 9349.56 9359.08 9087.72 9120.93 798 -1.28577 0.101823 -2.80056 -2.44536 -14.6524 2.407868

1/15/99 9127.16 9342.61 9127.16 9340.55 921 -2.37872 2.360537 0 2.407868 15.41353 0.157057

Picture 13 – DJI data modified for input into a Neural Network

Page 13: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 13 of 35 pages

low is the minimum possible valuehigh is the maximum possible value

Esto normalmente se hace automáticamente, pero debemos tomar el tiempo para examinar los parámetros de normalización ahora.

Seleccione PATTERN→OPTIONS. Para nuestro ejemplo actual que vea las opciones como se muestra en el Cuadro 14.

INPUT1 por ejemplo, cuenta con valores posibles entre -2,378722 y 2,846741.

Supongamos que usted tiene que normalizar el valor I1 = 0.5. Que calcular:

N(0.5) = (0.5 – (-2.378722)) / (2.846741- (–2.378722)) = 0.55090276

Picture 14 – Options for pattern sets

Once you create a new pattern set Pythia calculates the lowest and the highest value for each column.

You can change these values in the option menu if you like.

If you train a network with a certain pattern set you must choose the same normalization parameters for a pattern set you are going to reproduce with this network.

Page 14: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 14 of 35 pages

The display format parameters only specifies how the number are displayed in the table.

Una vez que haya creado un nuevo modelo establecido Pythia calcula el más bajo y el más alto valor para cada columna.

Puede cambiar estos valores en el menú de opciones si lo desea.

Si un tren de la red con un determinado patrón de conjunto que debe elegir los mismos parámetros de la normalización para establecer un patrón que se va a reproducir con esta red.

El formato de visualización de parámetros sólo especifica la forma en que el número se muestran en la tabla.

Now let’s design an appropriate network. Create a new network with the values (5,5,7,1). This network has the required 5

inputs and 1 output. Select NET → LEARN PATTERN SET. Leave the default values except the repetition count, which we set to 3000.

Press the Ok button

Ahora el diseño de una red adecuada. • Crear una nueva red con los valores (5,5,7,1). Esta red tiene el 5 entradas y 1 salida. • Seleccionar → NET APRENDER PLAN CONJUNTO. • Deje los valores predeterminados, salvo la repetición contar, que nos fijamos para 3000.

• Presione el botón OK

The training pattern set will now be processed 3000 times. Finally the trained network automatically reproduces the inputs of the pattern set.

The results can be examined in Picture 15. Have a look at the columns O1 and NET(O1). As you remember, NET(O1) is the output generated by the Neural Network, O1 is the output we would like to get. The values describe the percentage drop or gain between two day’s close values.

Our network at least has learned some of the patterns. Especially if our network makes a significant statement (let’s say it predicts a gain or drop of 0.6% or more) it is usually right with the direction the DJI moves.

El modelo de formación establecido será procesada 3000 veces. Por último, la red de formación reproduce automáticamente los insumos del modelo establecido.

Page 15: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 15 of 35 pages

Los resultados se pueden examinar en el Cuadro 15. Echa un vistazo a las columnas O1 y NET (O1). Como recordarán, NET (O1) es la salida generada por la red neuronal, O1 es la salida que nos gustaría conseguir. Los valores que describen el porcentaje de disminución o aumento de entre dos días de cierre de los valores.

Nuestra red ha aprendido, al menos, algunos de los patrones. Especialmente si nuestra red de manera significativa declaración (digamos que predice un aumento o descenso del

0,6% o más) por lo general es la derecha con la dirección se mueve el DJI.

Now let’s test the same network with the 2nd half year data. The network has not been trained with these. So they are completely unknown to the network.

Picture 15 – The network after the training

Page 16: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 16 of 35 pages

Please load dow99ii.pat into Pythia. Note that the normalization options are the same for dow99i.pat and dow99ii.pat.

Reproduce this pattern set.

You see that this time the outcome is very poor.

Ahora vamos a probar la misma red con el 2 º semestre de datos. La red no se ha entrenado con estos. Por lo que son totalmente desconocidos para la red.

• Por favor, carga dow99ii.pat en Pythia. Tenga en cuenta que la normalización de las opciones son las mismas para dow99i.pat y dow99ii.pat.

• reproducir este patrón establecido.

Usted ve que esta vez el resultado es muy pobre.

Next step would be to modify the model, usually by adding input parameters like interest rates, overseas market indices, currency ratio etc.

Picture 16 – Reproducing the 2nd half 1999 data generates poor results

Page 17: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 17 of 35 pages

El siguiente paso sería la de modificar el modelo, por lo general mediante la adición de parámetros de entrada como los tipos de interés, índices de los mercados de ultramar, etc ratio de moneda

Page 18: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 18 of 35 pages

Evolutionary Optimizer

Picture 17 – The Evolutionary Optimizer

The Evolutionary Optimizer is a tool for generating Neural Networks. The only thing you must provide is the training pattern set. Let’s see how the Evolutionary Optimizer generates a network for the XOR sample:El Optimizador evolutiva es una herramienta para la generación de Redes Neuronales. Lo único que usted debe proporcionar es el patrón de formación establecidos. Vamos a ver cómo el Evolutiva Optimizador genera una red para la XOR muestra:

Load the pattern set XOR.PAT into Pythia. Select NET→ EVOLUTIONARY OPTIMIZER

• Cargar el modelo establecido en XOR.PAT Pythia. • Seleccione NET EVOLUTIONARY Optimizador →

You will see a dialog window as shown in Picture 17.

Uncheck the Ø deviation² field Change the *deviation² field to 0.25 Change the # neurons field to 3 Press the Ok button

Page 19: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 19 of 35 pages

The Evolutionary Optimization will start processing now. It will stop if the Goals to achieve are true, meaning

Verá una ventana de diálogo como se muestra en la Figura 17.

• Desmarca la desviación ² Ø campo • Cambie el campo ² * desviación a 0,25 • Cambie el campo a las neuronas # 3 • Presione el botón OK

Optimización evolutiva de la transformación se iniciará ahora. Se detendrá si los objetivos a alcanzar son verdaderas, es decir,

*deviation² < 0.25 and # neurons <= 3

However, if will perform max. 1000 evolution steps.

You can find further explanations of the options in the reference part of this manual.

 Sin embargo, si se realizan máx. 1000 evolución pasos.

Puede encontrar más explicaciones de las opciones en la parte de referencia de este manual.

Page 20: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 20 of 35 pages

After a couple of generations the optimizer finally found a suitable network in line 11. This network has 3 neurons and the max. deviation for any pattern is 0.078666.Click the checkbox on the left of this line and press the Ok button. You now have a network that is sufficiently trained for the XOR problem.Después de un par de generaciones el optimizador encontrado una red adecuada en la línea 11. Esta red tiene 3 neuronas y el máx. cualquier desviación de patrón es 0,078666. Haga clic en la casilla a la izquierda de esta línea y pulse el botón OK. Ahora tiene una red que tiene la suficiente formación para el problema XOR.

Picture 18 – The Evolutionary Optimizer generated a network

Page 21: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 21 of 35 pages

ReferenceReferencias

The reference part of this manual will describe in detail the menu items and the settings in the various dialog boxes.La referencia de este manual se describen en detalle los elementos del menú y los ajustes en los diversos cuadros de diálogo.

The Main Window

Pythia’s main windows contains three areas:

The pattern set area on the left side The network area on the right side A log window on the bottom

The pattern and the network area can contain any number of pattern sets or networks. Any operation a user selects will process the currently selected pattern set or network.

The log windows displays the last transactions.

LA VENTANA PRINCIPAL

Pythia principales ventanas contiene tres áreas:

• El patrón establecido en la zona izquierda • El área de red en el lado derecho • Una ventana de registro en la parte inferior

El patrón y el área de red puede contener cualquier número de conjuntos de patrones o redes. Cualquier operación de un usuario selecciona el proceso que actualmente seleccionado patrón establecido o de la red.

El registro muestra ventanas de la última transacción.

FILE → EXIT

This terminates Pythia.

PATTERN → READ PATTERN SET

This menu item reads a previously saved pattern set into pythia. Pattern set files have the extension “.PAT”

Page 22: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 22 of 35 pages

PATTERN → IMPORT PATTERN SET

This menu item imports a data file as a pattern set into pythia. The data file’s format is assumed to be ASCII.

After choosing a file name a dialog box as shown in Picture 19 will pop up. A preview window displays the first lines of the file.

You can further specify a field delimiter, the number of fields per record and the number of outputs.

Pythia tries to determine the field delimiter and the field per record value automatically. Usually you won’t have to change these.

The number of outputs field default to 1. You must change this if your data contain more than one output.

Finally press the Ok button. Your new pattern set will be display on the left side of Pythia’s main windows.

Note: During import some values will set automatically. These settings are the Normalization parameters and the Display format.

Normalization:

The High of each input or output is set to the maximum value of the referred column.The Low of each input or output is set to the minimum value of the referred column.

Display format:

The display for each column is set to (9,6), meaning the values will be displayed by a 9 character string with 6 characters after the decimal point.

PATTERN → SAVE PATTERN SET

This menu item allows you to save the currently selected pattern set. Any special settings like Normalization and Display format parameters are stored along with the pattern set.

Picture 19 – Import pattern file dialog

Page 23: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 23 of 35 pages

PATTERN → CLOSE PATTERN SET

This menu item closes the currently selected pattern set. The user will be prompted to save this pattern set if it was modified.

Page 24: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 24 of 35 pages

PATTERN → OPTIONS

This menu item allows you to change certain settings for the pattern set.

Normalization:

A Neural Network expects any input and output value to be between 0 and 1. Therefore the pattern sets must be normalized before being processed by the network.

The normalization is calculated:

N(i) = (i - low) / (high - low)i is the input (or output value)low is the minimum possible valuehigh is the maximum possible value

The dialog box shown in Picture 20 allows you change the normalization parameters.

The initial parameters are calculated when the pattern set was first created, either by importing or by pasting. They are set to the lowest and highest value found in a column.

The low..high range should span any possible value. However, if your data set contain any “runaways” you should either exclude these from you data or ignore them by manually adjusting the normalization parameters.

You can change values in the option window by simply entering the new value into the cell.

Alternatively, you can make use of the following operations:

Push this button to specify a new low value for all columns.Push this button to specify a new high value for all columns.Restore the default values (new calculation as if the pattern set was just created).Discard changes.

Note: If you train a network with a certain pattern set you must choose the same normalization parameters for another pattern set you are going to reproduce with this network.

The display format parameters only specifies how the number are displayed in the table.

Picture 20 – Options for pattern sets

Page 25: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 25 of 35 pages

Display format:

The display format parameters specify how the numbers are displayed in the table.

By default the display for each column is set to (9,6), meaning the values will be displayed by a 9 character string with 6 characters after the decimal point.

Use the following operations to change the look of the numbers:

Push this button to specify a new width for all columns.Push this button to specify a new decimal value for all columns.Restore the default values (9,6).Discard changes.

PATTERN → TOGGLE VIEW

Select this command to toggle between the original and the normalized form of the pattern set.

You recognize the currently select view on the tab of the pattern set. The notation N(xxx.pat) means normalized, xxx.pat indicates native (original).

Page 26: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 26 of 35 pages

NET → CREATE NET

This menu item is used to create a new Neural Network.

Enter the new network’s desired topology into the dialog box display in Picture 21.

Begin with the number of inputs the new network is supposed to have.

Continue with the levels (usually 2 or 3 levels).

Keep in mind that the last described level is the output level, meaning the number of neurons in the last level must match the number of neurons in the output level.

Pressing the Sample button automatically creates a sample topology that is able to process the currently selected pattern set (if there is one).

Finally press the Ok button. The new created Neural Net is now displayed in the network area of Pythia’s main window.

Picture 22 shows how this will look like.

Picture 21 – Create a new Neural Network

Page 27: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 27 of 35 pages

NET → READ NET

This menu item reads a previously saved network into pythia. Network files have the extension “.NN”

NET → CLOSE NET

This menu item closes the currently selected network. The user will be prompted to save this network if it was modified.

NET → SAVE NET

This menu item allows you to save the currently selected network. The network topology and weights are stored to a file with the extension “.NN”.

Picture 22 – A new created Neural Network

Page 28: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 28 of 35 pages

NET → EVOLUTIONARY OPTIMIZER

The Evolutionary Optimizer is a tool for generating Neural Networks. The only thing you must provide is the training pattern set. Selecting this menu item pops up a dialog box as displayed in Picture 23.

How the Evolutionary Optimizer works

(the following brief description assumes parameters to be set as shown in Picture 23)

The Evolutionary Optimizer initially creates a generation containing 50 randomly created networks.

Each network within this generation will be trained shortly and its fitness determined according to the parameters in Goals to achieve.

Then a new generation of networks will be created from the old one according to the following procedure:

Two “parent” networks will be chosen out of the old generation. The selection algorithm will choose networks with a high fitness by a higher probability.

Two “children” networks will be created from the two “parent” networks. With the probability of 0.2 the two “children” networks will be crossed over. This

means they will swap level with each other.Example:

Child 1: (2,2,1) → (2,2 │1) Child 2: (2,6,6,1) → (2,6 │6,1)

Compose the 1st part of child 1 with the 2nd part of child 2 to (2,2,6,1)Compose the 1st part of child 2 with the 2nd part of child 1 to (2,6,1)The “children” have been crossed over to (2,2,6,1) and (2,6,1).

The “children” now will be mutated with a probability of 0.04. Mutation means insertion or deletion of a level, insertion or deletion of a neuron into a level or change of weights.

The two “parent” network will now be checked if they belong to the 10 “fittest” of the old generation. If they do they will be mutated and rolled over into the new generation.

The selection continues until the new generation has 50 members too. After completion the new generation will be evaluated.

The Evolutionary Optimizer is considered ready as soon as it found a network with a fitness of 100.

Otherwise it continues for 1000 generations, what might take hours or days to compute. You always can stop the process if you do not see any progress.

Page 29: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 29 of 35 pages

Options

There are lots of options you can fine-tune the optimizer’s work with.

1 st ancestor Neural Net:

Specify a template network the first generation is created from or allow to generate a new random one with create new.

Pattern set to learn:

Specify the pattern set you want to generate a network for. This pattern set must be loaded previously.

Check the option Mix pattern randomly if you want to overcome a given but unwanted sort order in the pattern set. Note that a pattern set’s sort order influences the training phase of the network.

Goals to achieve:

Here you can specify what the network should be optimized for. There are three goals possible:

Optimize for medium deviation (Ø deviation²) Optimize for max. deviation within the pattern set (*deviation²) Optimize for size (# neurons)

Tag or untag the checkboxes on the left side to determine if the certain goal shall play a role at all.

If a goal is tagged specify the value you want to push the network below.

Specify the contribution a goal will make to the overall fitness.

The example in Picture 23 does not care about the medium deviation, but wants the max. deviation to be below 0.25 and the network size below or equal 3. Both checked goals will contribute 50% to the overall fitness of an evolutionary created network (1:1 = 50:50). If you would want the network size to have an importance of only 20% you

Picture 23 – The Evolutionary Optimizer

Page 30: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 30 of 35 pages

would have to enter the value 4 and 1 into the contribution fields for max. deviation and size.

Evolutionary algorithms settings:

Different options influence the optimization process

Population size: number of networks created per generation.

Evolution steps: max. number of generations before stop.

Mutation rate: probability for a network to be modified during rollover to a new generation.

Cross over rate: probability for a child network to be crossed over with another child network

# fittest/Generation: number of networks that are rolled over to a new generation as they are. Any other networks of one generation are discarded. However, discarded network still might become parent network.

Modify fittest: if checked, the rolled over networks are modified with the given mutation rate.

Pressing the Ok button starts the evolutionary process. You can watch the progress in the progress window shown in Picture 24

During optimization you always can stop the process by pressing the Stop button.

The colored circle right of the checkbox show you the quality of a network. Red means no goal achieved at all, yellow means some goals achieved and green means all goals achieved. If there is any green network the optimization terminates.

The column Topology describes the levels of the network. The column Neurons describes the number of neurons the network owns. The column Ø dev² shows the network’s medium square deviation on pattern set

reproduction. The column *dev² shows the network’s max square deviation on pattern set

reproduction. The column Fitness describes the network’s “fitness” with a number between 0

and 100.

Page 31: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 31 of 35 pages

When the optimization stops (by either finding a network with a “fitness” of 100 or stopping manually) you can choose one or more network to be move into the network area of Pythia’s main window.

The moved networks are ready for use.

NET → REPRO PATTERN SET

This menu item causes the currently selected network to reproduce the currently selected pattern set. The net output columns and the deviation column will be refreshed.

Note: You can only choose this command if the currently selected network is compatible to the currently selected pattern set. Compatibility means same number of inputs and same number of outputs.

Picture 24 – The Evolutionary Optimizer generated a network

Page 32: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 32 of 35 pages

NET → LEARN PATTERN SET

Choosing this menu item pops up a dialog box (Picture 25) that allows you to specify a learn plan for the training of the currently selected network with the currently selected pattern set.

Options

Neuronal Network to train:

Specify the network you want to train. This network must be compatible with the pattern set and must have been loaded into the network area of the main window.

Pattern set to learn:

Specify the pattern set you want to train the network with. This pattern set must be loaded previously.

Check the option Mix pattern randomly if you want to overcome a given but unwanted sort order in the pattern set. Note that a pattern set’s sort order influences the training of the network.

Set weights randomly:

Check this box to set the network’s weights to initial random values. This might be necessary because sometimes the given weight values do not lead to a suitable network even if this is possible.

Train until:

Declare the cancel criteria of the learn plan here. You can connect the criteria with each other by the AND or the OR operator.

The criteria for exiting the learn plan are:

Repetition Medium deviation (Ø deviation²) Max. deviation within the pattern set (*deviation²) Time passed

Picture 25 – Set up a learn plan

Page 33: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 33 of 35 pages

Tag or untag the checkboxes on the left side to determine if the certain criterion shall play a role at all.

In the example in Picture 25 the learn plan will stop as soon as either the repetition count reaches 1000 or the max deviation is below 0.25 or 300 seconds have passed.

Learn rate:

The learn rate specifies how fast an error is propagated backwards. A large value accelerates the learning, but might cause the network to overshoot the mark. Choose a value between 0.1 and 0.5.

Tag Automatically adjust if you want Pythia to adjust the learn rate during the training automatically. (Note: this feature is not implemented yet).

Finally:

Tag Reproduce pattern set if you want to get the pattern set reproduced after the training. This is equivalent with the command NET → REPRO PATTERN SET.

Check show results in native form to get the pattern set shown in their original form instead of the normalized form. This is equivalent with the command PATTERN → TOGGLE VIEW.

NET → REPRODUCE SINGLE

This menu item causes the currently selected network to reproduce a single pattern.

Manually enter the inputs, delimited by a , .

The number of data you need to enter equals the number of inputs of the network.

Furthermore, you need to check if the data entered will be interpreted normalized or original.

Picture 26 – Reproduce a single pattern

Page 34: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 34 of 35 pages

The result of this operation will be displayed in Pythia’s log window on the bottom of the main window.

NET → LEARN SINGLE

This menu item causes the currently selected network to perform one learn step for a single pattern.

Manually enter the inputs and outputs, delimited by a , .

The number of data you need to enter equals the number of inputs plus the number of outputs of the network.

Furthermore, you need to check if the data entered will be interpreted normalized or original.

The result of this operation will be displayed in Pythia’s log window on the bottom of the main window.

NET → SET RANDOM WEIGHTS

Choose this menu item to reset a network’s weights to random values. This might be necessary because sometimes the given weight values do not lead to a suitable network even if this is possible.

You need to enter the low..high range for the new random weights. These are usually between –1 and 1.

Picture 27 – Result of the single pattern reproduction

Picture 28 – Perform one learn step for a single pattern

Picture 29 – Result of a single learn step

Picture 30 – Set new random weights

Page 35: PythiaEspañol

Pythia – The Neural Network Designer © 2000 by Runtime Software - 4/17/23 - 7:28 PM 35 of 35 pages

NET → SET LEARN RATE

Choose this menu item to change a network’s learn rate.

The learn rate specifies how fast an error is propagated backwards. A large value accelerates the learning, but might cause the network to overshoot the mark. Choose a value between 0.1 and 0.5.

EDIT → COPY CELLS

This command copies a pattern set’s selected cells into the windows clipboard. From there you can paste the data into other applications, e.g. text editors or MS Excel.

EDIT → PASTE CELLS

This command pastes cells from the Windows clipboard into Pythia.

You will get a dialog box as shown in Picture 31.

Field delimiter:

This specifies the delimiter between single fields.

Fields per record:

Specifies the number of fields in each record.

Paste to new Pattern Set:

Select this options if you intend to paste the clipboard into a whole new pattern set. You must specify the number of inputs too.

Paste to selected Pattern Set:

Select this option if you want to paste the clipboard into an existing pattern set. You can either paste at the current position or append.

Finally press the Ok button.

Picture 31 – Paste dialog