The BriCA Platform is a collection of software modules to develop brain-inspired cognitive architecture with BriCA to be run on OpenAI Gym.

The BriCA Platform contains the following modules:

  • BriCA1: the BriCA core to describe and run brain-inspired cognitive architectures (in Python).
  • brica_gym: a Python program to create OpenAI Gym agents
    (containing classes for adapting to Gym execution cycles)
  • BriCAL: interpreter that generates code from BriCA Language description
  • bif_excel2brical: utility to generate BriCA Language files from spreadsheet (Excel) files

Cognitive architecture development with the BriCA Platform could proceed in the following order:

  1. Describe modules, ports, and connections in a spreadsheet (Excel file)
    (See bif_excel2brical and the examples below for the format.)
  2. Convert the spreadsheet into the JSON format with bif_excel2brical
  3. Implement a Gym environment, BriCA components, and the main program (see the examples below).
  4. Test & debug

Code for cognitive architecture with the BriCA language interpreter and OpenAI Gym generally contains the following:

  • Importing necessary libraries (including brica1, brica1.brica_gym, brica1,brical, gym, numpy, json)
  • Reading and checking a BriCA language file (JSON)
    (At this stage, BriCA modules are generated and linked to an internal expression of the language nb.)
  • Reading other config. files (if any)
  • Instantiating a Gym environment (env)
  • Initializing BriCA components
  • Creating ports(nb.make_ports()
  • agent_builder = brical.AgentBuilder()
  • agent = agent_builder.create_gym_agent(nb, the top module, env)
  • scheduler = brica1.VirtualTimeSyncScheduler(agent)
  • Executing scheduler.step() while looping
    (Note that tokens are circulated to synchronize with Gym env. cycles.)
  • Closing

See examples below for details.

BriCA Test

Minimal Cognitive Architecture

Cortex-Basal Ganglia Loop

Working Memory with Attention Mechanism

(Gym agent)

  • Main program
    Note: In architectures with internal connections, components with internal output should be reset when an environment episode ends so that information from the last episode is not carried over.

The explanation for these three implementations is found here

  • brica_platform.txt
  • Last modified: 2022/05/10 14:27
  • by n.arakawa