Alrighty! Here’s the NengoOCL-compatible implementation of the masked-BCM rule. NengoOCL has a slightly different implementation than Nengo. In Nengo, custom learning rules can be “registered” with the Nengo builder (that builds the Nengo simulator object), but for NengoOCL, you need to create a subclass of the NengoOCL simulator with calls to your custom learning rule inside it.
Here are the files you will need to run the masked-BCM rule in NengoOCL:
- This file contains the custom openCL kernel, and the custom NengoOCL simulator that you will need to use: bcm_mask_ocl.py (5.4 KB)
- This file contains some example test code (basically identical to the previous test code, but modified to run in NengoOCL): test_bcm_mask_ocl.py (6.1 KB)
You will also require the originalbcm_mask.py
file since the Nengo model needs to be defined with the masked-BCM learning rule to work.