Red HTM para bolsas de aire

Siguiendo el tema de la tesis cree una red para determinar que bolsa de aire se debería de abrir dependiendo que sensor se active (ver figura 1)

Figura 1. Esquema de la red

La red más o menos se vería así:


De las 3 bolsas de aire (2 frontales que por simplicidad se abren al mismo tiempo y una por cada lado) definí 7 categorías:

Son 3 bolsas de aire (P Prendida, A Apagada)
____________Delanteras
| __________Lateral Izquierdo
| | ________Lateral Derecho
| | |
X X X Categoría
A A A -> 0
P A A -> 1
A P A -> 2
A A P -> 3
P P A -> 4
P A P -> 5
A P P -> 6
P P P -> 7


"""
## @file
Esta clase genera la Red para las bolsas de aire
"""

"""
#*********************************************************
# la red seria algo así:
# X <-> Nivel 3 (Top Level)
# / | \
# / /\ \
# / / \ \
# / / \ \
# X X X X <-> Nivel 2
# /\ /\ /\ /\
# XX XX XX XX <-> Nivel 1
#**********************************************************
"""

from nupic.network import *

def CreaRed():
net=SimpleHTM(
levelParams=[
{ # Level 0 El Sensor de entrada!!
},
{ # Level 1
'levelSize': 8, 'bottomUpOut': 8,
'spatialPoolerAlgorithm': 'gaussian',
'sigma': 0.4, 'maxDistance': 0.05,
'symmetricTime': True, 'transitionMemory': 1,
'topNeighbors': 2, 'maxGroupSize': 1024,
'temporalPoolerAlgorithm': 'sumProp'
},
{ # Level 2
'levelSize': 4, 'bottomUpOut': 4,
'spatialPoolerAlgorithm': 'product',
'symmetricTime': True, 'transitionMemory': 1,
'topNeighbors': 2, 'maxGroupSize': 1024,
'temporalPoolerAlgorithm': 'sumProp'
},
{ # Level 3
'levelSize': 1,
'spatialPoolerAlgorithm': 'product',
'mapperAlgorithm': 'sumProp'
},
],
)
Datos=SimpleDataInterface('Datos/__Categorias__.txt',
'Datos/Datos_Entrenamiento%d.txt'
, numDataFiles = 8)
net.createNetwork(Datos)
net.train(Datos)

if __name__ == '__main__':
print "Creando la red de AirBag"
CreaRed()

Comentarios

Entradas populares