===== BriCA Platform ===== The BriCA Platform is a collection of software modules to develop brain-inspired cognitive architecture with [[BriCA]] to be run on [[https://gym.openai.com|OpenAI Gym]]. ==== Modules ==== The BriCA Platform contains the following modules: * [[https://github.com/wbap/BriCA1|BriCA1]]: the BriCA core to describe and run brain-inspired cognitive architectures (in Python). * [[https://github.com/wbap/BriCA1/blob/master/brica1/brica_gym.py|brica_gym]]: a Python program to create [[https://gym.openai.com|OpenAI Gym]] agents\\ (containing classes for adapting to Gym execution cycles) * [[https://github.com/wbap/BriCAL|BriCAL]]: interpreter that generates code from [[BriCA Language]] description * [[https://github.com/wbap/BriCAL/tree/master/bif_excel2brical|bif_excel2brical]]: utility to generate BriCA Language files from spreadsheet (Excel) files ==== Use Case ==== Cognitive architecture development with the BriCA Platform could proceed in the following order: - Describe modules, ports, and connections in a spreadsheet (Excel file)\\ (See [[https://github.com/wbap/BriCAL/tree/master/bif_excel2brical|bif_excel2brical]] and the examples below for the format.) - Convert the spreadsheet into the JSON format with bif_excel2brical - Implement a Gym environment, BriCA components, and the main program (see the examples below).\\ The skeletal code for the main program can be generated with [[https://github.com/wbap/BriCAL/tree/master/brical2py|brical2py]]. - Test & debug ==== Main Program Overview ==== 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. ==== Examples ==== === BriCA Test === (Not a Gym agent) * [[https://ggle.io/4wXy|Spreadsheet]] * [[https://github.com/wbap/BriCAL/blob/master/bif_excel2brical/usecase/n001.brical.json|BriCAL in JSON]] * [[https://github.com/wbap/BriCAL/blob/master/bif_excel2brical/usecase/n001.py|Main program]] === Minimal Cognitive Architecture === (Gym agent) * [[https://ggle.io/4wZG|Spreadsheet]] * [[https://github.com/rondelion/minimalCA/blob/main/minimal_CA.brical.json|BriCAL in JSON]] * [[https://github.com/rondelion/minimalCA/blob/main/minimal_CA_1_BL.py|Main program]] === Cortex-Basal Ganglia Loop === (Gym agent) * [[https://ggle.io/4wZK|Spreadsheet]] * [[https://github.com/rondelion/MinimalCtxBGA/blob/main/CBT1CA.brical.json|BriCAL in JSON]] * [[https://github.com/rondelion/MinimalCtxBGA/blob/main/CBT1cCA_1_BL.py|Main program]] === Working Memory with Attention Mechanism === (Gym agent) * [[https://ggle.io/4wZO|Spreadsheet]] * [[https://github.com/rondelion/MinimalWMAgent/blob/main/MinWMAgent1.brical.json|BriCAL in JSON]] * [[https://github.com/rondelion/MinimalWMAgent/blob/main/MinWMAgent1_1_BL.py|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 [[http://rondelionai.blogspot.com/2022/03/attempts-to-implement-biologically.html|here]]