Red HTM con la version 1.5 de Nupic
Este es el código con los cambios comentados:
"""
## @file
Esta clase genera la Red para las bolsas de aire
"""
from nupic.network import *
from nupic.network.simpledatainterface import WideDataInterface #Cambio en la version 1.5
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=WideDataInterface('Datos/__Categorias__.txt', 'Datos/Datos_Entrenamiento%d.txt', numDataFiles = 8)#Cambio SimpleDataInterface por WideDataInterface en la version 1.5
net.createNetwork(Datos)
net.train(Datos)
if __name__ == '__main__':
print "Creando la red de AirBag"
CreaRed()
Comentarios