Skip to content

Pytorch firing parity#5

Open
williamnourse wants to merge 8 commits into
eonsystemspbc:mainfrom
williamnourse:pytorch-firing-parity
Open

Pytorch firing parity#5
williamnourse wants to merge 8 commits into
eonsystemspbc:mainfrom
williamnourse:pytorch-firing-parity

Conversation

@williamnourse

Copy link
Copy Markdown

Discovered sources of firing rate discrepancy in PyTorch backend when compared to Brian2. Discrepancies were as follows:

  1. Poisson inputs were being treated as incoming spikes, and filtered through the synaptic time constant. Fixed so that poisson inputs are directly injected into the membrane.
  2. Poisson inputs were incorrectly triggering a refractory period in their stimulated neurons. Refactored the refractory period mechanism to be neuron-specific, allowing exclusion of stimulated neurons.

New firing rate statistics compared to ground truth are as follows, based on t_run = 10.0 and n_run = 1:
Ground truth: Brian2 (CPU)

  Brian2 (CPU): 168,903 spikes, 437 active neurons

  PyTorch (CUDA) (Original Version):
    Spikes:          95,052  (ratio: 0.5628)
    Active:             380   (Jaccard: 0.8442, shared: 374, gt_only: 63, backend_only: 6)
    Rate corr:   0.961903
    Median diff: 47.45%
    Verdict:     CLOSE

  PyTorch (CUDA) (Poisson inputs ->  membrane):
    Spikes:         174,681  (ratio: 1.0342)
    Active:             437   (Jaccard: 0.9729, shared: 431, gt_only: 6, backend_only: 6)
    Rate corr:   0.999439
    Median diff: 5.06%
    Verdict:     MATCH

  PyTorch (CUDA) (Poisson inputs -> membrane, Poisson inputs X refrafctory period):
    Spikes:         172,730  (ratio: 1.0227)
    Active:             435   (Jaccard: 0.9684, shared: 429, gt_only: 8, backend_only: 6)
    Rate corr:   0.99947
    Median diff: 3.62%
    Verdict:     MATCH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants