Вы находитесь на странице: 1из 24

APLICACIN PARA SNTOMAS Y DIAGNSTICOS DE AUTOMVILES En la carpeta redes neuronales que nos paso el ingeniero buscamos la carpeta aplicaciones

Y abrimos el documento de texto MOTOR

Duplicamos las filas

Guardamos nuestro documento de texto en la carpeta que se desea crear

Terminado este proceso empezamos a trabajar con el neuro Shell Creamos un nuevo problema

Buscamos el documento de texto en la carpeta que creamos

Abrimos el primer recuadro (de la bicicleta azul)

Importamos el archivo

Escogemos el primer ASCII Files

Realizamos algunas modificaciones

Seleccionamos el men file

Seleccionamos nuestro documento de texto y aceptar

Luego en el men IMPORT

Y nos sale el siguiente mensaje

Volvemos a la siguiente ventana y escogemos

Y nos sale la siguiente tabla

Cerramos la ventana y

En el men settings escogemos la sgte opcion

Del cual nos sale la tabla correspondiente

De ah vamos a definir las entradas y salidas Primero las entradas

Segn el pdf mostrado las entradas son: hasta SIN GASOLINA des pues hacemos click en los cuadros y nos damos cuenta de que los espacios vacos se llenan con I

Lo mismo se hace con las salidas y en ah los espacios vacos se llenan con A

Cerramos la ventana y nos vamos al siguiente

Cerramos la ventana y nos vamos a .

Hacemos click en el botn enmarcado y nos sale el 9

Cerramos todas las ventanas hasta llegar a

NOS VAMOS AL VISUAL BASIC Y CREAMOS EL WINDOWS FORM

HACEMOS DOBLE CLICK EN EL BUTTON Y COPIAMOS EL CODIGO QUE ESTA EN EL PDF Y LUEGO HACEMOS UNOS AJUSTES DEBIDO A QUE EL VB QUE SE GNERA EN NUESTRA CARPETA ES LA VERSION VISUAL BASIC 6.

EN VEZ DE e ponemos t PORQUE LA VARIABLE e YA ES VARIABLE PERTENECIENTE AL PROGRAMA. EN EL CODIGO POR EJEMPLO APARECE TEXT1.TEXT ESO LO CAMBIAMOS POR TEXTBOX1.TEXT Y LO MISMO HACEMOS CON LOS DEMAS.

EN VEZ DE Call Fire_DIAGNOST(e, s) PONEMOS Call Fire_MOTOR(t, s)


Dim t(7) As Double Dim s(6) As Double t(1) t(2) t(3) t(4) t(5) t(6) t(7) = = = = = = = Val(TextBox1.Text) Val(TextBox2.Text) Val(TextBox3.Text) Val(TextBox4.Text) Val(TextBox5.Text) Val(TextBox6.Text) Val(TextBox7.Text)

Call Fire_MOTOR(t, s) If (s(1) > 0.9 And s(1) <= 1) Then TextBox8.Text = "mal" End If If (s(1) >= 0 And s(1) < 0.1) Then TextBox8.Text = "bien" End If If (s(2) > 0.9 And s(2) <= 1) Then TextBox9.Text = "mal" End If If (s(2) >= 0 And s(2) < 0.1) Then TextBox9.Text = "bien" End If If (s(3) > 0.9 And s(3) <= 1) Then TextBox10.Text = "mal" End If If (s(3) >= 0 And s(3) < 0.1) Then TextBox10.Text = "bien" End If If (s(4) > 0.9 And s(4) <= 1) Then TextBox11.Text = "mal" End If If (s(4) >= 0 And s(4) < 0.1) Then TextBox11.Text = "bien" End If If (s(5) > 0.9 And s(5) <= 1) Then TextBox12.Text = "mal" End If If (s(5) >= 0 And s(5) < 0.1) Then TextBox12.Text = "bien" End If If (s(6) > 0.9 And s(6) <= 1) Then TextBox13.Text = "mal" End If If (s(6) >= 0 And s(6) < 0.1) Then TextBox13.Text = "bien" End If End Sub

Terminando esto despus del END SUB ponemos el siguiente cdigo que esta en el archivo MOTOR.VB carpeta que se creo al inicio NOS VAMOS A LA CARPETA QUE CREAMOS AL INICIO

Dentro de la carpeta automticamente se creo un archivo de visual basic el cual abrimos con bloc de notas

Se abre con block de notas para poder corregir

Por ejemplo En vez de feature2(1) otros valores

= 1 / (1 + Exp(-netsum))

feature2(1) = 1 / (1 + Math.Exp(-netsum))

ponemos y eso hacemos con todos los

' Insert this code into your VB program to fire the D:\MOTOR\MOTOR network ' This code is designed to be simple and fast for porting to any machine. ' Therefore all code and weights are inline without looping or data storage ' which might be harder to port between compilers. Sub Fire_MOTOR(ByVal inarray() As Double , ByVal outarray() as double) Dim netsum As Double Static feature2(9) As Double

' ' ' ' ' ' ' ' ' ' ' ' '

inarray(1) is No_hace_Nada inarray(2) is Hace_Clics inarray(3) is Molinillo inarray(4) is Gira inarray(5) is Sin_chispa inarray(6) is Cable_caliente inarray(7) is Sin_gasolina outarray(1) is Bateria outarray(2) is Bobina outarray(3) is Motor_de_arranque outarray(4) is Cables outarray(5) is Distribuidor outarray(6) is Bomba_de_gasolina

If (inarray(1) < 0) Then inarray(1) = 0 If (inarray(1) > 1) Then inarray(1) = 1 inarray(1) = inarray(1) If (inarray(2) < 0) Then inarray(2) = 0 If (inarray(2) > 1) Then inarray(2) = 1 inarray(2) = inarray(2) If (inarray(3) < 0) Then inarray(3) = 0 If (inarray(3) > 1) Then inarray(3) = 1 inarray(3) = inarray(3) If (inarray(4) < 0) Then inarray(4) = 0 If (inarray(4) > 1) Then inarray(4) = 1 inarray(4) = inarray(4) If (inarray(5) < 0) Then inarray(5) = 0 If (inarray(5) > 1) Then inarray(5) = 1 inarray(5) = inarray(5) If (inarray(6) < 0) Then inarray(6) = 0 If (inarray(6) > 1) Then inarray(6) = 1 inarray(6) = inarray(6) If (inarray(7) < 0) Then inarray(7) = 0 If (inarray(7) > 1) Then inarray(7) = 1 inarray(7) = inarray(7) netsum = -0.293207 netsum = netsum + inarray(1) * 1.123512 netsum = netsum + inarray(2) * -0.2577713 netsum = netsum + inarray(3) * 1.011096 netsum = netsum + inarray(4) * -0.4667826 netsum = netsum + inarray(5) * -0.01599128 netsum = netsum + inarray(6) * -1.324942 netsum = netsum + inarray(7) * -0.3291185 feature2(1) = 1 / (1 + Math.Exp(-netsum)) netsum netsum netsum netsum netsum = = = = = -0.3532057 netsum + inarray(1) netsum + inarray(2) netsum + inarray(3) netsum + inarray(4)

* * * *

-0.5842241 -1.775854 0.5336415 0.8069229

netsum = netsum netsum = netsum netsum = netsum feature2(2) = 1

+ + + /

inarray(5) * 0.01626305 inarray(6) * -0.7772855 inarray(7) * 0.8546853 (1 + Math.Exp(-netsum))

netsum = 0.6327147 netsum = netsum + inarray(1) * 1.47782 netsum = netsum + inarray(2) * 2.621465 netsum = netsum + inarray(3) * -2.641397 netsum = netsum + inarray(4) * -1.292558 netsum = netsum + inarray(5) * -2.16276 netsum = netsum + inarray(6) * 1.634122 netsum = netsum + inarray(7) * 1.716884 feature2(3) = 1 / (1 + Math.Exp(-netsum)) netsum = -0.5931598 netsum = netsum + inarray(1) * 2.524671 netsum = netsum + inarray(2) * -1.428208 netsum = netsum + inarray(3) * -2.199162 netsum = netsum + inarray(4) * -1.246239 netsum = netsum + inarray(5) * 0.4745786 netsum = netsum + inarray(6) * -0.5988813 netsum = netsum + inarray(7) * 1.431845 feature2(4) = 1 / (1 + Math.Exp(-netsum)) netsum = -0.5900567 netsum = netsum + inarray(1) * -1.718907 netsum = netsum + inarray(2) * 0.4318832 netsum = netsum + inarray(3) * -0.606814 netsum = netsum + inarray(4) * -1.138939 netsum = netsum + inarray(5) * 0.8617999 netsum = netsum + inarray(6) * 2.823951 netsum = netsum + inarray(7) * -1.298288 feature2(5) = 1 / (1 + Math.Exp(-netsum)) netsum = -0.1563343 netsum = netsum + inarray(1) * -0.3112293 netsum = netsum + inarray(2) * -1.601652 netsum = netsum + inarray(3) * 0.5160032 netsum = netsum + inarray(4) * 2.036605 netsum = netsum + inarray(5) * 1.912554 netsum = netsum + inarray(6) * -2.244209 netsum = netsum + inarray(7) * -0.824273 feature2(6) = 1 / (1 + Math.Exp(-netsum)) netsum = 0.4270693 netsum = netsum + inarray(1) * -1.344498 netsum = netsum + inarray(2) * -3.011172 netsum = netsum + inarray(3) * 1.311803 netsum = netsum + inarray(4) * 0.05518052 netsum = netsum + inarray(5) * 0.393869 netsum = netsum + inarray(6) * 1.170268 netsum = netsum + inarray(7) * 1.788381 feature2(7) = 1 / (1 + Math.Exp(-netsum)) netsum = -0.08816916 netsum = netsum + inarray(1) * 0.1227391 netsum = netsum + inarray(2) * -2.560767

netsum = netsum netsum = netsum netsum = netsum netsum = netsum netsum = netsum feature2(8) = 1

+ + + + + /

inarray(3) * -2.08326 inarray(4) * 2.029924 inarray(5) * 1.020645 inarray(6) * -0.9546381 inarray(7) * 2.028047 (1 + Math.Exp(-netsum))

netsum = -0.2024657 netsum = netsum + inarray(1) * 1.412539 netsum = netsum + inarray(2) * 0.08129002 netsum = netsum + inarray(3) * -2.204125 netsum = netsum + inarray(4) * -0.720578 netsum = netsum + inarray(5) * 2.777082 netsum = netsum + inarray(6) * 0.3666981 netsum = netsum + inarray(7) * -1.541361 feature2(9) = 1 / (1 + Math.Exp(-netsum)) netsum = 0.9543391 netsum = netsum + feature2(1) * 1.184753 netsum = netsum + feature2(2) * -0.9695778 netsum = netsum + feature2(3) * 1.652344 netsum = netsum + feature2(4) * 0.6994206 netsum = netsum + feature2(5) * -1.673703 netsum = netsum + feature2(6) * 0.3046654 netsum = netsum + feature2(7) * -3.933132 netsum = netsum + feature2(8) * -1.584016 netsum = netsum + feature2(9) * 0.7379652 outarray(1) = 1 / (1 + Math.Exp(-netsum)) netsum = 0.4711114 netsum = netsum + feature2(1) * -1.676155 netsum = netsum + feature2(2) * -0.8036944 netsum = netsum + feature2(3) * 1.874733 netsum = netsum + feature2(4) * -2.285707 netsum = netsum + feature2(5) * 2.641574 netsum = netsum + feature2(6) * -1.123412 netsum = netsum + feature2(7) * -1.257585 netsum = netsum + feature2(8) * -0.6804103 netsum = netsum + feature2(9) * -0.06687725 outarray(2) = 1 / (1 + Math.Exp(-netsum)) netsum = 2.526351 netsum = netsum + netsum = netsum + netsum = netsum + netsum = netsum + netsum = netsum + netsum = netsum + netsum = netsum + netsum = netsum + netsum = netsum + outarray(3) = 1 / netsum netsum netsum netsum netsum = = = = =

feature2(1) * 0.5916092 feature2(2) * -0.2920179 feature2(3) * -0.04875144 feature2(4) * -1.788733 feature2(5) * 1.97296 feature2(6) * -1.215545 feature2(7) * 0.402508 feature2(8) * -4.011669 feature2(9) * -1.599512 (1 + Math.Exp(-netsum))

0.3673018 netsum + feature2(1) netsum + feature2(2) netsum + feature2(3) netsum + feature2(4)

* * * *

0.3736119 0.6002874 -3.239529 -1.761386

netsum = netsum netsum = netsum netsum = netsum netsum = netsum netsum = netsum outarray(4) = 1

+ + + + + /

feature2(5) * -0.01810038 feature2(6) * 2.641771 feature2(7) * 0.1567359 feature2(8) * 0.2404097 feature2(9) * 0.3261118 (1 + Math.Exp(-netsum))

netsum = 0.2975652 netsum = netsum + feature2(1) * 0.52074 netsum = netsum + feature2(2) * 0.7474925 netsum = netsum + feature2(3) * -3.257371 netsum = netsum + feature2(4) * -1.895759 netsum = netsum + feature2(5) * -0.007014206 netsum = netsum + feature2(6) * 2.472588 netsum = netsum + feature2(7) * 0.1317068 netsum = netsum + feature2(8) * 0.3420114 netsum = netsum + feature2(9) * 0.428334 outarray(5) = 1 / (1 + Math.Exp(-netsum)) netsum = 0.5789193 netsum = netsum + feature2(1) * 0.1790952 netsum = netsum + feature2(2) * 1.38872 netsum = netsum + feature2(3) * -0.06913969 netsum = netsum + feature2(4) * -1.217883 netsum = netsum + feature2(5) * -2.381548 netsum = netsum + feature2(6) * 0.5519463 netsum = netsum + feature2(7) * 1.491087 netsum = netsum + feature2(8) * 1.188822 netsum = netsum + feature2(9) * -4.146392 outarray(6) = 1 / (1 + Math.Exp(-netsum))

outarray(1) = (outarray(1) - 0.1) / 0.8 If (outarray(1) < 0) Then outarray(1) = 0 If (outarray(1) > 1) Then outarray(1) = 1 outarray(2) = (outarray(2) - 0.1) / 0.8 If (outarray(2) < 0) Then outarray(2) = 0 If (outarray(2) > 1) Then outarray(2) = 1 outarray(3) = (outarray(3) - 0.1) / 0.8 If (outarray(3) < 0) Then outarray(3) = 0 If (outarray(3) > 1) Then outarray(3) = 1 outarray(4) = (outarray(4) - 0.1) / 0.8 If (outarray(4) < 0) Then outarray(4) = 0 If (outarray(4) > 1) Then outarray(4) = 1 outarray(5) = (outarray(5) - 0.1) / 0.8 If (outarray(5) < 0) Then outarray(5) = 0 If (outarray(5) > 1) Then outarray(5) = 1 outarray(6) = (outarray(6) - 0.1) / 0.8 If (outarray(6) < 0) Then outarray(6) = 0 If (outarray(6) > 1) Then outarray(6) = 1

End Sub

End Class

Una vez hecho esto ejecutamos:

Para poner los valores de las entradas debemos fijarnos la tabla que nos brindan en el ejemplo

Ponemos la segunda fila y corroboramos si esta bien

Al corroborar nos damos cuenta de que el resultado es el correcto.

Y LISTO ESPERO LES SIRVA EN ALGO AMIGOS

Вам также может понравиться