Stanford-BIS / pystorm

PyStorm python module used to interface with Brainstorm. Brainstorm can be programmed and controlled using this module.
MIT License
10 stars 0 forks source link

Diffusor cuts fail wth 7 (or more) pools of 512 neurons #105

Open tcstewar opened 6 years ago

tcstewar commented 6 years ago

If I try this model, it fails during the mapping step:

n_neurons = 512

model = nengo.Network()
with model:
    for i in range(7):
        ens = nengo.Ensemble(n_neurons=n_neurons, dimensions=1)    

sim = nengo_brainstorm.Simulator(model)

Here is the error:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-6-b64adecd4d46> in <module>()
     10         #model.config[ens].keep = np.ones(ens.n_neurons, int)*0
     11 
---> 12 sim = nengo_brainstorm.Simulator(model)

~/git/nengo_brainstorm/nengo_brainstorm/simulator.py in __init__(self, model, dt, upstream_resolution, input_transmission_update_time, precompute_inputs, intercept_lower_bound, do_mapping)
    131         self.ens_to_pool = {}
    132         self.mapped_xy = {}
--> 133         self.perform_initial_mapping()
    134 
    135         self.cache = cache.Cache(self)

~/git/nengo_brainstorm/nengo_brainstorm/simulator.py in perform_initial_mapping(self)
    969             self.ens_to_pool[ens] = pool
    970             pool_to_ens[pool] = ens
--> 971         self.hal.map(net)
    972         for ens in self.converted.ensembles:
    973             self.mapped_xy[ens] = self.ens_to_pool[ens].mapped_xy

~/git/pystorm/pystorm/hal/hal.py in map(self, network, remap, verbose)
    396         # implement core objects, calling driver
    397         logger.info("HAL: programming mapping results to hardware")
--> 398         self.implement_core()
    399 
    400     def dump_core(self):

~/git/pystorm/pystorm/hal/hal.py in implement_core(self)
    454             # cut top edge
    455             for x_idx in range(x_min, x_max):
--> 456                 self.driver.OpenDiffusorCutXY(CORE_ID, x_idx, y_max-1, DIFFUSOR_NORTH_LEFT)
    457                 self.driver.OpenDiffusorCutXY(CORE_ID, x_idx, y_max-1, DIFFUSOR_NORTH_RIGHT)
    458             # cut left edge

IndexError: array::at: __n (which is 304) >= _Nm (which is 256)

Note that it work fine if there are only 6 pools.

aneckar commented 6 years ago

OK. Probably a literal corner case I missed. Will take a look shortly

On Fri, Aug 10, 2018 at 10:25 PM tcstewar notifications@github.com wrote:

If I try this model, it fails during the mapping step:

n_neurons = 512

model = nengo.Network()with model: for i in range(7): ens = nengo.Ensemble(n_neurons=n_neurons, dimensions=1)

sim = nengo_brainstorm.Simulator(model)

Here is the error:


IndexError Traceback (most recent call last)

in () 10 #model.config[ens].keep = np.ones(ens.n_neurons, int)*0 11 ---> 12 sim = nengo_brainstorm.Simulator(model) ~/git/nengo_brainstorm/nengo_brainstorm/simulator.py in __init__(self, model, dt, upstream_resolution, input_transmission_update_time, precompute_inputs, intercept_lower_bound, do_mapping) 131 self.ens_to_pool = {} 132 self.mapped_xy = {} --> 133 self.perform_initial_mapping() 134 135 self.cache = cache.Cache(self) ~/git/nengo_brainstorm/nengo_brainstorm/simulator.py in perform_initial_mapping(self) 969 self.ens_to_pool[ens] = pool 970 pool_to_ens[pool] = ens --> 971 self.hal.map(net) 972 for ens in self.converted.ensembles: 973 self.mapped_xy[ens] = self.ens_to_pool[ens].mapped_xy ~/git/pystorm/pystorm/hal/hal.py in map(self, network, remap, verbose) 396 # implement core objects, calling driver 397 logger.info("HAL: programming mapping results to hardware") --> 398 self.implement_core() 399 400 def dump_core(self): ~/git/pystorm/pystorm/hal/hal.py in implement_core(self) 454 # cut top edge 455 for x_idx in range(x_min, x_max): --> 456 self.driver.OpenDiffusorCutXY(CORE_ID, x_idx, y_max-1, DIFFUSOR_NORTH_LEFT) 457 self.driver.OpenDiffusorCutXY(CORE_ID, x_idx, y_max-1, DIFFUSOR_NORTH_RIGHT) 458 # cut left edge IndexError: array::at: __n (which is 304) >= _Nm (which is 256) Note that it work fine if there are only 6 pools. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .