NEAL Home Page
Middlesex Logo

Code and Short Tutorial for Planner neuro-cognitive component

Introduction

Code

  1. Download the Planner neuro-cognitive component tarball from January 2020.
  2. Grab the tarball, unzip, and untar it.
  3. The cognitive map class uses Timer class and the neural Finite State Automata class.
    If you are interested in doing a specific tutorial about the FSA, click here.
  4. The folder has tests that run with both Nest and SpiNNaker.
  5. Before running examples, verify the correct functioning of the cognitive map following the instructions in the Tutorial section.

Tutorial

Get the cognitive map running

  1. The system runs with Ubuntu 14.04 and Ubuntu 16.04.
  2. The python classes used are:
    1. stateMachineClass.py: the system is parsing a regular language, which can be defined by a stateMachine. So, this class is used; it's well tested and should work robustly for sentences.
    2. nealCoverClass.py: neal is the Neuromophic Embodied Agents that Learn project. The idea is that we write agents by combining modules (like this associative memory or the parser). Then we change one parameter (the simulator), and the system works on different platforms. Unfortunately some pyNN functions differ from simulator to simulator. These are included in nealCoverClass to reduce the amount of branching (e.g.if simulator == nest) in the modules.
    3. timerClass.py: this makes several different types of timers and provides mechanisms for the timers to effect other states and be turned on by other states, spike sources and neurons.
    4. planBaseClass.py: that is a plan class for making planning net with neurons.
      The essential features are goals, facts and modules, that are implemented as binary cell assemblies (CA)
      The planBaseClass.py is used by the following test-related classes:
      1. simpPlanClass.py: it is a simple planner class with four primitive goal-module-action triples
        (e.g., goalTurnRight, moduleTurnRight, actionTurnRight).
      2. compoundClass.py: it is a plan class with the four above mentioned primitive with also two compounds with a timer.
      3. modAndFactClass.py: it is a plan class that uses a fact to turn toward an object once the goal is defined
      4. idObjPlanClass.py: it is a plan class that does four conditional operations, which are i) identify an object, ii) if not possible and there's an object in front, it moves toward that object, iii) else, if there is an object on the left or right, it turns toward it, iv) else, move forward. It stops with objectIDed.
  3. The test files are:
    1. runNestTests.sh: automated script for the overall testing nest.
    2. runSpinn8Tests.sh: automated script for the overall testing spinnaker
      1. In particular, there are the following stand-alone tests, where XXX refers to Nest or spiNNaker:
      2. testXXXSimp.py: it uses the simpPlanClass.py (that loads the planBaseClass.py)
        and tests four goals (turnRight, turnLeft, stepForward, stepBackward)
      3. testXXXCompound.py: it uses the compoundPlanClass.py (that loads both planeBaseClass.py and timerClass.py)
        and tests the joined goals (forward and left, forward and right).
      4. testXXXModAndFact: it uses the modAndFactClass.py (loading only the placeBaseClass.py)
        and tests related goals and facts (goal turn toward object given the fact that the object is on the left).
      5. testXXXIDObj.py: it used the iDOBjPlanClass.py (that loads both placeBaseClass.py and timerClass.py)
        and tests conditional sequences (moving forward or left or right until reach an id object)

How run a test: example with testNestSimp.py

  1. Run the test as follow: python testNestSimp.py
  2. Convert the Pkl File in textual file and put it into the autoResults directory
  3. python printPklFile.py results/planAction.pkl > autoResults/nestSimpAction.sp
    python printPklFile.py results/planGoal.pkl > autoResults/nestSimpGoal.sp
    python printPklFile.py results/planModule.pkl > autoResults/nestSimpModule.sp
    python printPklFile.py results/planFact.pkl > autoResults/nestSimpFact.sp
    python printPklFile.py results/planReset.pkl > autoResults/nestSimpReset.sp

  4. Display numerically a specific result: e.g., the nestSimpAction.sp
  5. more autoResults/nestSimpAction.sp


  6. Use Pandas and matplotlib libraries to open the text file and plot it