hnn-core icon indicating copy to clipboard operation
hnn-core copied to clipboard

Event random seed smaller than 0

Open chenghuzi opened this issue 2 years ago • 4 comments

Not sure if my understanding is correct. But if one loads drives from the parameter file default.json, since we have

    "prng_seedcore_input_prox": 2,
    "prng_seedcore_input_dist": 2,
    "prng_seedcore_extpois": 2,
    "prng_seedcore_extgauss": 2,
    "prng_seedcore_evprox_1": 2,
    "prng_seedcore_evdist_1": 2,
    "prng_seedcore_evprox_2": 2,
    "prng_seedcore_evdist_2": 0,

and in params.py we have

https://github.com/jonescompneurolab/hnn-core/blob/bab819687e40c866c7c1130e1aad3ab86124d3fe/hnn_core/params.py#L223

If we run Network(params, add_drives_from_params=True) and before https://github.com/jonescompneurolab/hnn-core/blob/bab819687e40c866c7c1130e1aad3ab86124d3fe/hnn_core/drives.py#L135

we insert

print(specs['type'], drive_name, specs['event_seed'])

the output will be image

it seems that the corresponding resulting event_seed could be -16 and thus cause errors in running simulation as the seed is smaller than 0

chenghuzi avatar Jul 02 '22 05:07 chenghuzi

uffff ... @rythorpe I need your help here :-)

jasmainak avatar Jul 04 '22 14:07 jasmainak

These values are set this way to maintain consistency with our previous "ground truth" default current dipole simulation. After these values get summed with the trial index and cell's GID (specifically for cell-specific, non-synchronous drives), the seed value that gets passed to the random number generator should be positive.

rythorpe avatar Jul 07 '22 04:07 rythorpe

but now the seeds are determined by the cell's GID minus the GID of the first cell of that cell type. Is this still relevant in that case?

jasmainak avatar Jul 07 '22 06:07 jasmainak

Oh yes, I had forgotten about that. We updated the event_seed values in add_erp_drives_to_jones_model(); however, I'm guessing that we forgot to update them in default.json and _extract_drive_specs_from_hnn_params().

rythorpe avatar Jul 07 '22 18:07 rythorpe